Comparing version 0.3.0 to 1.0.0
@@ -0,1 +1,9 @@ | ||
<a name="1.0.0"></a> | ||
## [1.0.0](https://github.com/nfl/react-gpt/compare/v0.3.0...v1.0.0) (2017-09-18) | ||
### Features | ||
* Export AdManager ([9ed1807](https://github.com/nfl/react-gpt/commit/9ed1807)) | ||
* Build and export es modules ([2d7a3ec](https://github.com/nfl/react-gpt/commit/2d7a3ec)) | ||
<a name="0.3.0"></a> | ||
@@ -2,0 +10,0 @@ ## [0.3.0](https://github.com/nfl/react-gpt/compare/v0.2.5...v0.3.0) (2017-09-18) |
@@ -1,2 +0,3 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactGPT=t(require("react"),require("react-dom")):e.ReactGPT=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(4);Object.defineProperty(t,"Bling",{enumerable:!0,get:function(){return r(o).default}});var a=n(1);Object.defineProperty(t,"Events",{enumerable:!0,get:function(){return r(a).default}})},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={READY:"ready",RENDER:"render",SLOT_RENDER_ENDED:"slotRenderEnded",IMPRESSION_VIEWABLE:"impressionViewable",SLOT_VISIBILITY_CHANGED:"slotVisibilityChanged"};t.default=n},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},function(e,t){e.exports=function(e,t,n,r){function o(){function o(){i=Number(new Date),n.apply(u,c)}function s(){a=void 0}var u=this,l=Number(new Date)-i,c=arguments;r&&!a&&o(),a&&clearTimeout(a),void 0===r&&l>e?o():t!==!0&&(a=setTimeout(r?s:o,void 0===r?e-l:e))}var a,i=0;return"boolean"!=typeof t&&(r=n,n=t,t=void 0),o}},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}Object.defineProperty(t,"__esModule",{value:!0});var u,l,c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d="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},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(21),g=r(p),h=n(17),y=r(h),v=n(22),_=r(v),b=n(2),m=r(b),w=n(8),S=r(w),M=n(15),P=r(M),E=n(1),O=r(E),k=n(6),x=r(k),C=n(5),R=(l=u=function(e){function t(){var e,n,r,o;a(this,t);for(var s=arguments.length,u=Array(s),l=0;l<s;l++)u[l]=arguments[l];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={scriptLoaded:!1,inViewport:!1},o=n,i(r,o)}return s(t,e),f(t,[{key:"componentDidMount",value:function(){t._adManager.addInstance(this),t._adManager.load(t._config.seedFileUrl).then(this.onScriptLoaded.bind(this)).catch(this.onScriptError.bind(this))}},{key:"componentWillReceiveProps",value:function(e){var n=t._config.propsEqual,r=this.props.sizeMapping;!e.sizeMapping&&!r||n(e.sizeMapping,r)||t._adManager.removeMQListener(this,e)}},{key:"shouldComponentUpdate",value:function(e,n){var r=n.scriptLoaded,o=n.inViewport,a=this.notInViewport(e,n),i=this.state.inViewport!==o,s=this.state.scriptLoaded!==r;if(a)return!1;if(i)return!0;var u=t._config,l=u.filterProps,c=u.propsEqual,d=l(t.refreshableProps,this.props,e),f=l(t.reRenderProps,this.props,e),p=!c(f.props,f.nextProps),g=!p&&!c(d.props,d.nextProps);if(g&&this.configureSlot(this._adSlot,e),t._adManager._syncCorrelator)g?t._adManager.refresh():(p||s)&&t._adManager.renderAll();else{if(g)return this.refresh(),!1;if(p||s)return!0}return!1}},{key:"componentDidUpdate",value:function(){this.notInViewport(this.props,this.state)||this._divId&&(t._adManager._initialRender?t._adManager.render():this.renderAd())}},{key:"componentWillUnmount",value:function(){t._adManager.removeInstance(this),this._adSlot&&(t._adManager.googletag.destroySlots([this._adSlot]),this._adSlot=null)}},{key:"onScriptLoaded",value:function e(){var e=this.props.onScriptLoaded;this.getRenderWhenViewable()&&this.foldCheck(),this.setState({scriptLoaded:!0},e)}},{key:"onScriptError",value:function(e){console.warn("Ad: Failed to load gpt for "+t._config.seedFileUrl,e)}},{key:"getRenderWhenViewable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return void 0!==e.renderWhenViewable?e.renderWhenViewable:t._config.renderWhenViewable}},{key:"foldCheck",value:function(){if(!this.state.inViewport){var e=this.getSlotSize();Array.isArray(e)&&Array.isArray(e[0])&&(e=e[0]),"fluid"===e&&(e=[0,0]);var n=t._adManager.isInViewport(_.default.findDOMNode(this),e,this.viewableThreshold);n&&this.setState({inViewport:!0})}}},{key:"defineSizeMapping",value:function(e,n){if(n){t._adManager.addMQListener(this,this.props);var r=n.reduce(function(e,t){return e.addSize(t.viewport,t.slot)},t._adManager.googletag.sizeMapping()).build();e.defineSizeMapping(r)}}},{key:"setAttributes",value:function(e,t){var n=e.getAttributeKeys();n.forEach(function(t){e.set(t,null)}),t&&Object.keys(t).forEach(function(n){e.set(n,t[n])})}},{key:"setTargeting",value:function(e,t){e.clearTargeting(),t&&Object.keys(t).forEach(function(n){e.setTargeting(n,t[n])})}},{key:"addCompanionAdService",value:function(e,n){var r=t._adManager.googletag.companionAds();n.addService(r),"object"===("undefined"==typeof e?"undefined":d(e))&&(e.hasOwnProperty("enableSyncLoading")&&r.enableSyncLoading(),e.hasOwnProperty("refreshUnfilledSlots")&&r.setRefreshUnfilledSlots(e.refreshUnfilledSlots))}},{key:"getSlotSize",value:function(){var e=this.props,t=e.slotSize,n=e.sizeMapping,r=void 0;if(t)r=t;else if(n){var o=n;r=o[0]&&o[0].slot}return r}},{key:"renderAd",value:function(){this.defineSlot(),this.display()}},{key:"notInViewport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,n=t.inViewport;return this.getRenderWhenViewable(e)&&!n}},{key:"defineSlot",value:function(){var e=this.props,n=e.adUnitPath,r=e.outOfPage,o=this._divId,a=this.getSlotSize();this._adSlot||(r?this._adSlot=t._adManager.googletag.defineOutOfPageSlot(n,o):this._adSlot=t._adManager.googletag.defineSlot(n,a||[],o)),this.configureSlot(this._adSlot)}},{key:"configureSlot",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props,r=n.sizeMapping,a=n.attributes,i=n.targeting,s=n.companionAdService,u=n.categoryExclusion,l=n.collapseEmptyDiv,c=n.safeFrameConfig,d=n.content,f=n.clickUrl,p=n.forceSafeFrame;if(this.defineSizeMapping(e,r),void 0!==l)if(Array.isArray(l)){var g;(g=e.setCollapseEmptyDiv).call.apply(g,[e].concat(o(l)))}else e.setCollapseEmptyDiv(l);if(f&&e.setClickUrl(f),u){var h=u;"string"==typeof h&&(h=[h]),e.clearCategoryExclusions(),h.forEach(function(t){e.setCategoryExclusion(t)})}this.setAttributes(e,a),this.setTargeting(e,i),c&&e.setSafeFrameConfig(c),p&&e.setForceSafeFrame(p),s&&this.addCompanionAdService(s,e),d?e.addService(t._adManager.googletag.content()):e.addService(t._adManager.googletag.pubads())}},{key:"display",value:function(){var e=this.props.content,n=this._divId,r=this._adSlot;e?t._adManager.googletag.content().setContent(r,e):(t._adManager._disableInitialLoad||t._adManager._syncCorrelator||t._adManager.updateCorrelator(),t._adManager.googletag.display(n),t._adManager._disableInitialLoad&&!t._adManager._initialRender&&this.refresh())}},{key:"clear",value:function(){var e=this._adSlot;if(e&&e.hasOwnProperty("getServices")){var n=e.getServices();if(this._divId&&n.some(function(e){return!!e.setContent}))return void(document.getElementById(this._divId).innerHTML="");t._adManager.clear([e])}}},{key:"refresh",value:function(e){var n=this._adSlot;n&&(this.clear(),t._adManager.refresh([n],e))}},{key:"render",value:function(){var e=this.state.scriptLoaded,n=this.props,r=n.id,o=n.outOfPage,a=n.style,i=this.notInViewport(this.props,this.state);if(!e||i){var s=this.getSlotSize();o||(0,m.default)(s,"Either 'slotSize' or 'sizeMapping' prop needs to be set."),Array.isArray(s)&&Array.isArray(s[0])&&(s=s[0]),"fluid"===s&&(s=["auto","auto"]);var u=s&&{width:s[0],height:s[1]};return g.default.createElement("div",{style:u})}return this.clear(),this._adSlot&&(t._adManager.googletag.destroySlots([this._adSlot]),this._adSlot=null),this._divId=r||t._adManager.generateDivId(),g.default.createElement("div",{id:this._divId,style:a})}},{key:"adSlot",get:function(){return this._adSlot}},{key:"viewableThreshold",get:function(){return this.props.viewableThreshold>=0?this.props.viewableThreshold:t._config.viewableThreshold}}],[{key:"on",value:function(e,n){t._on("on",e,n)}},{key:"once",value:function(e,n){t._on("once",e,n)}},{key:"removeListener",value:function(){var e;(e=t._adManager).removeListener.apply(e,arguments)}},{key:"removeAllListeners",value:function(){var e;(e=t._adManager).removeAllListeners.apply(e,arguments)}},{key:"_on",value:function(e,n,r){"function"==typeof r&&(n===O.default.READY&&t._adManager.isReady?r.call(t._adManager,t._adManager.googletag):t._adManager[e](n,r))}},{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t._config=c({},t._config,e)}},{key:"getGPTVersion",value:function(){return t._adManager.getGPTVersion()}},{key:"getPubadsVersion",value:function(){return t._adManager.getPubadsVersion()}},{key:"syncCorrelator",value:function(e){t._adManager.syncCorrelator(e)}},{key:"render",value:function(){t._adManager.renderAll()}},{key:"refresh",value:function(e,n){t._adManager.refresh(e,n)}},{key:"clear",value:function(e){t._adManager.clear(e)}},{key:"updateCorrelator",value:function(){t._adManager.updateCorrelator()}},{key:"testManager",set:function(e){(0,m.default)(e,"Pass in createManagerTest to mock GPT"),t._adManager=e}}]),t}(p.Component),u.propTypes={id:y.default.string,adUnitPath:y.default.string.isRequired,targeting:y.default.object,slotSize:y.default.oneOfType([y.default.array,y.default.string]),sizeMapping:y.default.arrayOf(y.default.shape({viewport:y.default.array,slot:y.default.array})),outOfPage:y.default.bool,companionAdService:y.default.oneOfType([y.default.bool,y.default.object]),content:y.default.string,clickUrl:y.default.string,categoryExclusion:y.default.oneOfType([y.default.string,y.default.array]),attributes:y.default.object,collapseEmptyDiv:y.default.oneOfType([y.default.bool,y.default.array]),forceSafeFrame:y.default.bool,safeFrameConfig:y.default.object,onSlotRenderEnded:y.default.func,onImpressionViewable:y.default.func,onSlotVisibilityChanged:y.default.func,renderWhenViewable:y.default.bool,viewableThreshold:y.default.number,onScriptLoaded:y.default.func,onMediaQueryChange:y.default.func,style:y.default.object},u.refreshableProps=["targeting","sizeMapping","clickUrl","categoryExclusion","attributes","collapseEmptyDiv","companionAdService","forceSafeFrame","safeFrameConfig"],u.reRenderProps=["adUnitPath","slotSize","outOfPage","content"],u._adManager=(0,C.createManager)(),u._config={seedFileUrl:"//www.googletagservices.com/tag/js/gpt.js",renderWhenViewable:!0,viewableThreshold:.5,filterProps:x.default,propsEqual:S.default},l);t.default=(0,P.default)(R,C.pubadsAPI.reduce(function(e,t){return e[t]=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return R._adManager.pubadsProxy({method:t,args:n})},e},{}))},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function s(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)}function u(e){return new m(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.AdManager=t.APIToCallBeforeServiceEnabled=t.pubadsAPI=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.createManager=u;var c=n(11),d=r(c),f=n(20),p=n(2),g=(r(p),n(12)),h=n(1),y=r(h),v=n(7),_=r(v),b=(t.pubadsAPI=["enableAsyncRendering","enableSingleRequest","enableSyncRendering","disableInitialLoad","collapseEmptyDivs","enableVideoAds","set","get","getAttributeKeys","setTargeting","clearTargeting","setCategoryExclusion","clearCategoryExclusions","setCentering","setCookieOptions","setLocation","setPublisherProvidedId","setTagForChildDirectedTreatment","clearTagForChildDirectedTreatment","setVideoContent","setForceSafeFrame"],t.APIToCallBeforeServiceEnabled=["enableAsyncRendering","enableSingleRequest","enableSyncRendering","disableInitialLoad","collapseEmptyDivs","setCentering"]),m=t.AdManager=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._adCnt=0,n._initialRender=!0,n._syncCorrelator=!1,n._testMode=!1,n._foldCheck=(0,f.throttle)(20,function(e){var t=n.getMountedInstances();t.forEach(function(t){t.getRenderWhenViewable()&&t.foldCheck(e)}),n.testMode&&n._getTimer()}),n._handleMediaQueryChange=function(e){if(n._syncCorrelator)return void n.refresh();var t=/min-width:\s?(\d+)px/.exec(e.media),r=t&&t[1];r&&n._mqls[r]&&n._mqls[r].listeners.forEach(function(t){t.refresh(),t.props.onMediaQueryChange&&t.props.onMediaQueryChange(e)})},n.render=(0,f.debounce)(4,function(){if(n._initialRender){var e=function e(t){n.pubadsReady?t():setTimeout(e,50,t)},t=n.getMountedInstances(),r=!1,o=void 0;t.forEach(function(e){if(!e.notInViewport()){e.defineSlot();var t=e.adSlot;if(t&&t.hasOwnProperty("getServices")){var n=t.getServices();r||(r=n.filter(function(e){return!!e.enableAsyncRendering}).length>0)}}}),r||(o=n.googletag.defineSlot("/",[]),o.addService(n.googletag.pubads())),n._processPubadsQueue(),n.googletag.enableServices(),e(function(){o&&n.googletag.destroySlots([o]),n._processPubadsQueue(),n._listen(),n._isReady=!0,n.emit(y.default.READY,n.googletag),t.forEach(function(e){e.notInViewport()||e.display()}),n.emit(y.default.RENDER,n.googletag),n._initialRender=!1})}}),n.renderAll=(0,f.debounce)(4,function(){if(!n.apiReady)return!1;var e=n.getMountedInstances();return e.forEach(function(e,t){0===t&&n.updateCorrelator(),e.forceUpdate()}),!0}),e.test&&(n.testMode=e),n}return s(t,e),l(t,[{key:"_processPubadsQueue",value:function(){var e=this;this._pubadsProxyQueue&&(Object.keys(this._pubadsProxyQueue).forEach(function(t){(e.googletag&&!e.googletag.pubadsReady&&b.indexOf(t)>-1||e.pubadsReady)&&(e._pubadsProxyQueue[t].forEach(function(t){return e.pubadsProxy(t)}),delete e._pubadsProxyQueue[t])}),Object.keys(this._pubadsProxyQueue).length||(this._pubadsProxyQueue=null))}},{key:"_callPubads",value:function(e){var t=e.method,n=e.args,r=e.resolve,a=e.reject;if("function"!=typeof this.googletag.pubads()[t])a(new Error("googletag.pubads does not support "+t+", please update pubadsAPI"));else try{var i,s=(i=this.googletag.pubads())[t].apply(i,o(n));r(s)}catch(e){a(e)}}},{key:"_toggleListener",value:function(e){var t=this;["scroll","resize"].forEach(function(n){window[e?"addEventListener":"removeEventListener"](n,t._foldCheck)})}},{key:"_getTimer",value:function(){return Date.now()}},{key:"_listen",value:function(){var e=this;this._listening||([y.default.SLOT_RENDER_ENDED,y.default.IMPRESSION_VIEWABLE,y.default.SLOT_VISIBILITY_CHANGED].forEach(function(t){["pubads","content","companionAds"].forEach(function(n){e.googletag[n]().addEventListener(t,e._onEvent.bind(e,t))})}),this._listening=!0)}},{key:"_onEvent",value:function(e,t){this.listeners(e,!0)&&this.emit(e,t);var n=this.getMountedInstances(),r=t.slot,o="on"+e.charAt(0).toUpperCase()+e.substr(1),a=n.filter(function(e){return r===e.adSlot})[0];a&&a.props[o]&&a.props[o](t)}},{key:"syncCorrelator",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._syncCorrelator=e}},{key:"generateDivId",value:function(){return"bling-"+ ++this._adCnt}},{key:"getMountedInstances",value:function(){return this.mountedInstances||(this.mountedInstances=[]),this.mountedInstances}},{key:"addInstance",value:function(e){var t=this.getMountedInstances(),n=t.indexOf(e);n===-1&&(0===t.length&&this._toggleListener(!0),this.addMQListener(e,e.props),t.push(e))}},{key:"removeInstance",value:function(e){var t=this.getMountedInstances(),n=t.indexOf(e);n>=0&&(t.splice(n,1),0===t.length&&this._toggleListener(!1),this.removeMQListener(e,e.props))}},{key:"addMQListener",value:function(e,t){var n=this,r=t.sizeMapping;r&&Array.isArray(r)&&r.forEach(function(t){var r=t.viewport&&t.viewport[0];if(void 0!==r){if(n._mqls||(n._mqls={}),!n._mqls[r]){var o=window.matchMedia("(min-width: "+r+"px)");o.addListener(n._handleMediaQueryChange),n._mqls[r]={mql:o,listeners:[]}}n._mqls[r].listeners.indexOf(e)===-1&&n._mqls[r].listeners.push(e)}})}},{key:"removeMQListener",value:function(e){var t=this;this._mqls&&Object.keys(this._mqls).forEach(function(n){var r=t._mqls[n].listeners.indexOf(e);r>-1&&t._mqls[n].listeners.splice(r,1),0===t._mqls[n].listeners.length&&(t._mqls[n].mql.removeListener(t._handleMediaQueryChange),delete t._mqls[n])})}},{key:"isInViewport",value:function(){return _.default.apply(void 0,arguments)}},{key:"refresh",value:function(e,t){return!!this.pubadsReady&&(this.googletag.pubads().refresh(e,t),!0)}},{key:"clear",value:function(e){return!!this.pubadsReady&&(this.googletag.pubads().clear(e),!0)}},{key:"getGPTVersion",value:function(){return!!this.apiReady&&this.googletag.getVersion()}},{key:"getPubadsVersion",value:function(){return!!this.pubadsReady&&this.googletag.pubads().getVersion()}},{key:"updateCorrelator",value:function(){return!!this.pubadsReady&&(this.googletag.pubads().updateCorrelator(),!0)}},{key:"load",value:function(e){var t=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,r){if(t.testMode)return void n(t.googletag);if(!g.canUseDOM)return void r(new Error("DOM not available"));if(!e)return void r(new Error("url is missing"));var o=function(){window.googletag?(t._googletag=window.googletag,t.googletag.cmd.push(function(){t._isLoaded=!0,n(t.googletag)})):r(new Error("window.googletag is not available"))};if(window.googletag&&window.googletag.apiReady)o();else{var a=document.createElement("script");a.async=!0,a.onload=o,a.onerror=function(){r(new Error("failed to load script"))},a.src=e,document.head.appendChild(a)}}))}},{key:"pubadsProxy",value:function(e){var t=this,n=e.method,r=e.args,o=void 0===r?[]:r,a=e.resolve,i=e.reject;return a?(this._callPubads({method:n,args:o,resolve:a,reject:i}),Promise.resolve()):(b.indexOf(n)>-1&&(this["_"+n]=o&&o.length&&o[0]||!0),new Promise(function(e,r){var a={method:n,args:o,resolve:e,reject:r};t.pubadsReady?t._callPubads(a):(t._pubadsProxyQueue||(t._pubadsProxyQueue={}),t._pubadsProxyQueue[n]||(t._pubadsProxyQueue[n]=[]),t._pubadsProxyQueue[n].push(a))}))}},{key:"googletag",get:function(){return this._googletag}},{key:"isLoaded",get:function(){return!!this._isLoaded}},{key:"isReady",get:function(){return!!this._isReady}},{key:"apiReady",get:function(){return this.googletag&&this.googletag.apiReady}},{key:"pubadsReady",get:function(){return this.googletag&&this.googletag.pubadsReady}},{key:"testMode",get:function(){return this._testMode},set:function(e){return}}]),t}(d.default)},function(e,t){function n(e,t,n){return e.reduce(function(e,r){return e.props[r]=t[r],e.nextProps[r]=n[r],e},{props:{},nextProps:{}})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t){function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0],n=r(t,2),o=n[0],a=n[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e||1!==e.nodeType)return!1;var s=e.getBoundingClientRect(),u={top:s.top,left:s.left,bottom:s.bottom,right:s.right},l={top:0,left:0,bottom:window.innerHeight,right:window.innerWidth},c=u.bottom>=l.top+a*i&&u.right>=l.left+o*i&&u.top<=l.bottom-a*i&&u.left<=l.right-o*i;return c}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=n},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}function a(e,t,n){var a,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(u(e))return!!u(t)&&(e=i.call(e),t=i.call(t),l(e,t,n));if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}try{var d=s(e),f=s(t)}catch(e){return!1}if(d.length!=f.length)return!1;for(d.sort(),f.sort(),a=d.length-1;a>=0;a--)if(d[a]!=f[a])return!1;for(a=d.length-1;a>=0;a--)if(c=d[a],!l(e[c],t[c],n))return!1;return typeof e==typeof t}var i=Array.prototype.slice,s=n(10),u=n(9),l=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n))}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){"use strict";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(){this._events=new r,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,s="~";Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),a.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)i.call(e,t)&&n.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e,t){var n=s?s+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var o=0,a=r.length,i=new Array(a);o<a;o++)i[o]=r[o].fn;return i},a.prototype.emit=function(e,t,n,r,o,a){var i=s?s+e:e;if(!this._events[i])return!1;var u,l,c=this._events[i],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,o),!0;case 6:return c.fn.call(c.context,t,n,r,o,a),!0}for(l=1,u=new Array(d-1);l<d;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,r);break;default:if(!u)for(f=1,u=new Array(d-1);f<d;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},a.prototype.on=function(e,t,n){var r=new o(t,n||this),a=s?s+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],r]:this._events[a].push(r):(this._events[a]=r,this._eventsCount++),this},a.prototype.once=function(e,t,n){var r=new o(t,n||this,!0),a=s?s+e:e;return this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],r]:this._events[a].push(r):(this._events[a]=r,this._eventsCount++),this},a.prototype.removeListener=function(e,t,n,o){var a=s?s+e:e;if(!this._events[a])return this;if(!t)return 0===--this._eventsCount?this._events=new r:delete this._events[a],this;var i=this._events[a];if(i.fn)i.fn!==t||o&&!i.once||n&&i.context!==n||(0===--this._eventsCount?this._events=new r:delete this._events[a]);else{for(var u=0,l=[],c=i.length;u<c;u++)(i[u].fn!==t||o&&!i[u].once||n&&i[u].context!==n)&&l.push(i[u]);l.length?this._events[a]=1===l.length?l[0]:l:0===--this._eventsCount?this._events=new r:delete this._events[a]}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=s?s+e:e,this._events[t]&&(0===--this._eventsCount?this._events=new r:delete this._events[t])):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prototype.setMaxListeners=function(){return this},a.prefixed=s,a.EventEmitter=a,e.exports=a},function(e,t,n){var r;/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactGPT=t(require("react"),require("react-dom")):e.ReactGPT=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);Object.defineProperty(t,"Bling",{enumerable:!0,get:function(){return r(o).default}});var i=n(1);Object.defineProperty(t,"Events",{enumerable:!0,get:function(){return r(i).default}});var a=n(7);Object.defineProperty(t,"createManagerTest",{enumerable:!0,get:function(){return a.createManagerTest}})},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={READY:"ready",RENDER:"render",SLOT_RENDER_ENDED:"slotRenderEnded",IMPRESSION_VIEWABLE:"impressionViewable",SLOT_VISIBILITY_CHANGED:"slotVisibilityChanged"};t.default=n},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}function u(e){return new m(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.AdManager=t.APIToCallBeforeServiceEnabled=t.pubadsAPI=void 0;var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();t.createManager=u;var l=n(14),f=r(l),d=n(23),p=n(3),g=(r(p),n(15)),h=n(1),y=r(h),v=n(9),b=r(v),_=(t.pubadsAPI=["enableAsyncRendering","enableSingleRequest","enableSyncRendering","disableInitialLoad","collapseEmptyDivs","enableVideoAds","set","get","getAttributeKeys","setTargeting","clearTargeting","setCategoryExclusion","clearCategoryExclusions","setCentering","setCookieOptions","setLocation","setPublisherProvidedId","setTagForChildDirectedTreatment","clearTagForChildDirectedTreatment","setVideoContent","setForceSafeFrame"],t.APIToCallBeforeServiceEnabled=["enableAsyncRendering","enableSingleRequest","enableSyncRendering","disableInitialLoad","collapseEmptyDivs","setCentering"]),m=t.AdManager=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._adCnt=0,n._initialRender=!0,n._syncCorrelator=!1,n._testMode=!1,n._foldCheck=(0,d.throttle)(20,function(e){var t=n.getMountedInstances();t.forEach(function(t){t.getRenderWhenViewable()&&t.foldCheck(e)}),n.testMode&&n._getTimer()}),n._handleMediaQueryChange=function(e){if(n._syncCorrelator)return void n.refresh();var t=/min-width:\s?(\d+)px/.exec(e.media),r=t&&t[1];r&&n._mqls[r]&&n._mqls[r].listeners.forEach(function(t){t.refresh(),t.props.onMediaQueryChange&&t.props.onMediaQueryChange(e)})},n.render=(0,d.debounce)(4,function(){if(n._initialRender){var e=function e(t){n.pubadsReady?t():setTimeout(e,50,t)},t=n.getMountedInstances(),r=!1,o=void 0;t.forEach(function(e){if(!e.notInViewport()){e.defineSlot();var t=e.adSlot;if(t&&t.hasOwnProperty("getServices")){var n=t.getServices();r||(r=n.filter(function(e){return!!e.enableAsyncRendering}).length>0)}}}),r||(o=n.googletag.defineSlot("/",[]),o.addService(n.googletag.pubads())),n._processPubadsQueue(),n.googletag.enableServices(),e(function(){o&&n.googletag.destroySlots([o]),n._processPubadsQueue(),n._listen(),n._isReady=!0,n.emit(y.default.READY,n.googletag),t.forEach(function(e){e.notInViewport()||e.display()}),n.emit(y.default.RENDER,n.googletag),n._initialRender=!1})}}),n.renderAll=(0,d.debounce)(4,function(){if(!n.apiReady)return!1;var e=n.getMountedInstances();return e.forEach(function(e,t){0===t&&n.updateCorrelator(),e.forceUpdate()}),!0}),e.test&&(n.testMode=e),n}return s(t,e),c(t,[{key:"_processPubadsQueue",value:function(){var e=this;this._pubadsProxyQueue&&(Object.keys(this._pubadsProxyQueue).forEach(function(t){(e.googletag&&!e.googletag.pubadsReady&&_.indexOf(t)>-1||e.pubadsReady)&&(e._pubadsProxyQueue[t].forEach(function(t){return e.pubadsProxy(t)}),delete e._pubadsProxyQueue[t])}),Object.keys(this._pubadsProxyQueue).length||(this._pubadsProxyQueue=null))}},{key:"_callPubads",value:function(e){var t=e.method,n=e.args,r=e.resolve,i=e.reject;if("function"!=typeof this.googletag.pubads()[t])i(new Error("googletag.pubads does not support "+t+", please update pubadsAPI"));else try{var a,s=(a=this.googletag.pubads())[t].apply(a,o(n));r(s)}catch(e){i(e)}}},{key:"_toggleListener",value:function(e){var t=this;["scroll","resize"].forEach(function(n){window[e?"addEventListener":"removeEventListener"](n,t._foldCheck)})}},{key:"_getTimer",value:function(){return Date.now()}},{key:"_listen",value:function(){var e=this;this._listening||([y.default.SLOT_RENDER_ENDED,y.default.IMPRESSION_VIEWABLE,y.default.SLOT_VISIBILITY_CHANGED].forEach(function(t){["pubads","content","companionAds"].forEach(function(n){e.googletag[n]().addEventListener(t,e._onEvent.bind(e,t))})}),this._listening=!0)}},{key:"_onEvent",value:function(e,t){this.listeners(e,!0)&&this.emit(e,t);var n=this.getMountedInstances(),r=t.slot,o="on"+e.charAt(0).toUpperCase()+e.substr(1),i=n.filter(function(e){return r===e.adSlot})[0];i&&i.props[o]&&i.props[o](t)}},{key:"syncCorrelator",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._syncCorrelator=e}},{key:"generateDivId",value:function(){return"bling-"+ ++this._adCnt}},{key:"getMountedInstances",value:function(){return this.mountedInstances||(this.mountedInstances=[]),this.mountedInstances}},{key:"addInstance",value:function(e){var t=this.getMountedInstances(),n=t.indexOf(e);n===-1&&(0===t.length&&this._toggleListener(!0),this.addMQListener(e,e.props),t.push(e))}},{key:"removeInstance",value:function(e){var t=this.getMountedInstances(),n=t.indexOf(e);n>=0&&(t.splice(n,1),0===t.length&&this._toggleListener(!1),this.removeMQListener(e,e.props))}},{key:"addMQListener",value:function(e,t){var n=this,r=t.sizeMapping;r&&Array.isArray(r)&&r.forEach(function(t){var r=t.viewport&&t.viewport[0];if(void 0!==r){if(n._mqls||(n._mqls={}),!n._mqls[r]){var o=window.matchMedia("(min-width: "+r+"px)");o.addListener(n._handleMediaQueryChange),n._mqls[r]={mql:o,listeners:[]}}n._mqls[r].listeners.indexOf(e)===-1&&n._mqls[r].listeners.push(e)}})}},{key:"removeMQListener",value:function(e){var t=this;this._mqls&&Object.keys(this._mqls).forEach(function(n){var r=t._mqls[n].listeners.indexOf(e);r>-1&&t._mqls[n].listeners.splice(r,1),0===t._mqls[n].listeners.length&&(t._mqls[n].mql.removeListener(t._handleMediaQueryChange),delete t._mqls[n])})}},{key:"isInViewport",value:function(){return b.default.apply(void 0,arguments)}},{key:"refresh",value:function(e,t){return!!this.pubadsReady&&(this.googletag.pubads().refresh(e,t),!0)}},{key:"clear",value:function(e){return!!this.pubadsReady&&(this.googletag.pubads().clear(e),!0)}},{key:"getGPTVersion",value:function(){return!!this.apiReady&&this.googletag.getVersion()}},{key:"getPubadsVersion",value:function(){return!!this.pubadsReady&&this.googletag.pubads().getVersion()}},{key:"updateCorrelator",value:function(){return!!this.pubadsReady&&(this.googletag.pubads().updateCorrelator(),!0)}},{key:"load",value:function(e){var t=this;return this._loadPromise||(this._loadPromise=new Promise(function(n,r){if(t.testMode)return void n(t.googletag);if(!g.canUseDOM)return void r(new Error("DOM not available"));if(!e)return void r(new Error("url is missing"));var o=function(){window.googletag?(t._googletag=window.googletag,t.googletag.cmd.push(function(){t._isLoaded=!0,n(t.googletag)})):r(new Error("window.googletag is not available"))};if(window.googletag&&window.googletag.apiReady)o();else{var i=document.createElement("script");i.async=!0,i.onload=o,i.onerror=function(){r(new Error("failed to load script"))},i.src=e,document.head.appendChild(i)}}))}},{key:"pubadsProxy",value:function(e){var t=this,n=e.method,r=e.args,o=void 0===r?[]:r,i=e.resolve,a=e.reject;return i?(this._callPubads({method:n,args:o,resolve:i,reject:a}),Promise.resolve()):(_.indexOf(n)>-1&&(this["_"+n]=o&&o.length&&o[0]||!0),new Promise(function(e,r){var i={method:n,args:o,resolve:e,reject:r};t.pubadsReady?t._callPubads(i):(t._pubadsProxyQueue||(t._pubadsProxyQueue={}),t._pubadsProxyQueue[n]||(t._pubadsProxyQueue[n]=[]),t._pubadsProxyQueue[n].push(i))}))}},{key:"googletag",get:function(){return this._googletag}},{key:"isLoaded",get:function(){return!!this._isLoaded}},{key:"isReady",get:function(){return!!this._isReady}},{key:"apiReady",get:function(){return this.googletag&&this.googletag.apiReady}},{key:"pubadsReady",get:function(){return this.googletag&&this.googletag.pubadsReady}},{key:"testMode",get:function(){return this._testMode},set:function(e){return}}]),t}(f.default)},function(e,t,n){"use strict";var r=function(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],l=0;u=new Error(t.replace(/%s/g,function(){return c[l++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},function(e,t){e.exports=function(e,t,n,r){function o(){function o(){a=Number(new Date),n.apply(u,l)}function s(){i=void 0}var u=this,c=Number(new Date)-a,l=arguments;r&&!i&&o(),i&&clearTimeout(i),void 0===r&&c>e?o():t!==!0&&(i=setTimeout(r?s:o,void 0===r?e-c:e))}var i,a=0;return"boolean"!=typeof t&&(r=n,n=t,t=void 0),o}},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}Object.defineProperty(t,"__esModule",{value:!0});var u,c,l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f="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},d=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(24),g=r(p),h=n(20),y=r(h),v=n(25),b=r(v),_=n(3),m=r(_),k=n(11),S=r(k),w=n(18),M=r(w),E=n(1),P=r(E),O=n(8),C=r(O),A=n(2),x=(c=u=function(e){function t(){var e,n,r,o;i(this,t);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=r=a(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={scriptLoaded:!1,inViewport:!1},o=n,a(r,o)}return s(t,e),d(t,[{key:"componentDidMount",value:function(){t._adManager.addInstance(this),t._adManager.load(t._config.seedFileUrl).then(this.onScriptLoaded.bind(this)).catch(this.onScriptError.bind(this))}},{key:"componentWillReceiveProps",value:function(e){var n=t._config.propsEqual,r=this.props.sizeMapping;!e.sizeMapping&&!r||n(e.sizeMapping,r)||t._adManager.removeMQListener(this,e)}},{key:"shouldComponentUpdate",value:function(e,n){var r=n.scriptLoaded,o=n.inViewport,i=this.notInViewport(e,n),a=this.state.inViewport!==o,s=this.state.scriptLoaded!==r;if(i)return!1;if(a)return!0;var u=t._config,c=u.filterProps,l=u.propsEqual,f=c(t.refreshableProps,this.props,e),d=c(t.reRenderProps,this.props,e),p=!l(d.props,d.nextProps),g=!p&&!l(f.props,f.nextProps);if(g&&this.configureSlot(this._adSlot,e),t._adManager._syncCorrelator)g?t._adManager.refresh():(p||s)&&t._adManager.renderAll();else{if(g)return this.refresh(),!1;if(p||s)return!0}return!1}},{key:"componentDidUpdate",value:function(){this.notInViewport(this.props,this.state)||this._divId&&(t._adManager._initialRender?t._adManager.render():this.renderAd())}},{key:"componentWillUnmount",value:function(){t._adManager.removeInstance(this),this._adSlot&&(t._adManager.googletag.destroySlots([this._adSlot]),this._adSlot=null)}},{key:"onScriptLoaded",value:function e(){var e=this.props.onScriptLoaded;this.getRenderWhenViewable()&&this.foldCheck(),this.setState({scriptLoaded:!0},e)}},{key:"onScriptError",value:function(e){console.warn("Ad: Failed to load gpt for "+t._config.seedFileUrl,e)}},{key:"getRenderWhenViewable",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props;return void 0!==e.renderWhenViewable?e.renderWhenViewable:t._config.renderWhenViewable}},{key:"foldCheck",value:function(){if(!this.state.inViewport){var e=this.getSlotSize();Array.isArray(e)&&Array.isArray(e[0])&&(e=e[0]),"fluid"===e&&(e=[0,0]);var n=t._adManager.isInViewport(b.default.findDOMNode(this),e,this.viewableThreshold);n&&this.setState({inViewport:!0})}}},{key:"defineSizeMapping",value:function(e,n){if(n){t._adManager.addMQListener(this,this.props);var r=n.reduce(function(e,t){return e.addSize(t.viewport,t.slot)},t._adManager.googletag.sizeMapping()).build();e.defineSizeMapping(r)}}},{key:"setAttributes",value:function(e,t){var n=e.getAttributeKeys();n.forEach(function(t){e.set(t,null)}),t&&Object.keys(t).forEach(function(n){e.set(n,t[n])})}},{key:"setTargeting",value:function(e,t){e.clearTargeting(),t&&Object.keys(t).forEach(function(n){e.setTargeting(n,t[n])})}},{key:"addCompanionAdService",value:function(e,n){var r=t._adManager.googletag.companionAds();n.addService(r),"object"===("undefined"==typeof e?"undefined":f(e))&&(e.hasOwnProperty("enableSyncLoading")&&r.enableSyncLoading(),e.hasOwnProperty("refreshUnfilledSlots")&&r.setRefreshUnfilledSlots(e.refreshUnfilledSlots))}},{key:"getSlotSize",value:function(){var e=this.props,t=e.slotSize,n=e.sizeMapping,r=void 0;if(t)r=t;else if(n){var o=n;r=o[0]&&o[0].slot}return r}},{key:"renderAd",value:function(){this.defineSlot(),this.display()}},{key:"notInViewport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,n=t.inViewport;return this.getRenderWhenViewable(e)&&!n}},{key:"defineSlot",value:function(){var e=this.props,n=e.adUnitPath,r=e.outOfPage,o=this._divId,i=this.getSlotSize();this._adSlot||(r?this._adSlot=t._adManager.googletag.defineOutOfPageSlot(n,o):this._adSlot=t._adManager.googletag.defineSlot(n,i||[],o)),this.configureSlot(this._adSlot)}},{key:"configureSlot",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props,r=n.sizeMapping,i=n.attributes,a=n.targeting,s=n.companionAdService,u=n.categoryExclusion,c=n.collapseEmptyDiv,l=n.safeFrameConfig,f=n.content,d=n.clickUrl,p=n.forceSafeFrame;if(this.defineSizeMapping(e,r),void 0!==c)if(Array.isArray(c)){var g;(g=e.setCollapseEmptyDiv).call.apply(g,[e].concat(o(c)))}else e.setCollapseEmptyDiv(c);if(d&&e.setClickUrl(d),u){var h=u;"string"==typeof h&&(h=[h]),e.clearCategoryExclusions(),h.forEach(function(t){e.setCategoryExclusion(t)})}this.setAttributes(e,i),this.setTargeting(e,a),l&&e.setSafeFrameConfig(l),p&&e.setForceSafeFrame(p),s&&this.addCompanionAdService(s,e),f?e.addService(t._adManager.googletag.content()):e.addService(t._adManager.googletag.pubads())}},{key:"display",value:function(){var e=this.props.content,n=this._divId,r=this._adSlot;e?t._adManager.googletag.content().setContent(r,e):(t._adManager._disableInitialLoad||t._adManager._syncCorrelator||t._adManager.updateCorrelator(),t._adManager.googletag.display(n),t._adManager._disableInitialLoad&&!t._adManager._initialRender&&this.refresh())}},{key:"clear",value:function(){var e=this._adSlot;if(e&&e.hasOwnProperty("getServices")){var n=e.getServices();if(this._divId&&n.some(function(e){return!!e.setContent}))return void(document.getElementById(this._divId).innerHTML="");t._adManager.clear([e])}}},{key:"refresh",value:function(e){var n=this._adSlot;n&&(this.clear(),t._adManager.refresh([n],e))}},{key:"render",value:function(){var e=this.state.scriptLoaded,n=this.props,r=n.id,o=n.outOfPage,i=n.style,a=this.notInViewport(this.props,this.state);if(!e||a){var s=this.getSlotSize();o||(0,m.default)(s,"Either 'slotSize' or 'sizeMapping' prop needs to be set."),Array.isArray(s)&&Array.isArray(s[0])&&(s=s[0]),"fluid"===s&&(s=["auto","auto"]);var u=s&&{width:s[0],height:s[1]};return g.default.createElement("div",{style:u})}return this.clear(),this._adSlot&&(t._adManager.googletag.destroySlots([this._adSlot]),this._adSlot=null),this._divId=r||t._adManager.generateDivId(),g.default.createElement("div",{id:this._divId,style:i})}},{key:"adSlot",get:function(){return this._adSlot}},{key:"viewableThreshold",get:function(){return this.props.viewableThreshold>=0?this.props.viewableThreshold:t._config.viewableThreshold}}],[{key:"on",value:function(e,n){t._on("on",e,n)}},{key:"once",value:function(e,n){t._on("once",e,n)}},{key:"removeListener",value:function(){var e;(e=t._adManager).removeListener.apply(e,arguments)}},{key:"removeAllListeners",value:function(){var e;(e=t._adManager).removeAllListeners.apply(e,arguments)}},{key:"_on",value:function(e,n,r){"function"==typeof r&&(n===P.default.READY&&t._adManager.isReady?r.call(t._adManager,t._adManager.googletag):t._adManager[e](n,r))}},{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t._config=l({},t._config,e)}},{key:"getGPTVersion",value:function(){return t._adManager.getGPTVersion()}},{key:"getPubadsVersion",value:function(){return t._adManager.getPubadsVersion()}},{key:"syncCorrelator",value:function(e){t._adManager.syncCorrelator(e)}},{key:"render",value:function(){t._adManager.renderAll()}},{key:"refresh",value:function(e,n){t._adManager.refresh(e,n)}},{key:"clear",value:function(e){t._adManager.clear(e)}},{key:"updateCorrelator",value:function(){t._adManager.updateCorrelator()}},{key:"testManager",set:function(e){(0,m.default)(e,"Pass in createManagerTest to mock GPT"),t._adManager=e}}]),t}(p.Component),u.propTypes={id:y.default.string,adUnitPath:y.default.string.isRequired,targeting:y.default.object,slotSize:y.default.oneOfType([y.default.array,y.default.string]),sizeMapping:y.default.arrayOf(y.default.shape({viewport:y.default.array,slot:y.default.array})),outOfPage:y.default.bool,companionAdService:y.default.oneOfType([y.default.bool,y.default.object]),content:y.default.string,clickUrl:y.default.string,categoryExclusion:y.default.oneOfType([y.default.string,y.default.array]),attributes:y.default.object,collapseEmptyDiv:y.default.oneOfType([y.default.bool,y.default.array]),forceSafeFrame:y.default.bool,safeFrameConfig:y.default.object,onSlotRenderEnded:y.default.func,onImpressionViewable:y.default.func,onSlotVisibilityChanged:y.default.func,renderWhenViewable:y.default.bool,viewableThreshold:y.default.number,onScriptLoaded:y.default.func,onMediaQueryChange:y.default.func,style:y.default.object},u.refreshableProps=["targeting","sizeMapping","clickUrl","categoryExclusion","attributes","collapseEmptyDiv","companionAdService","forceSafeFrame","safeFrameConfig"],u.reRenderProps=["adUnitPath","slotSize","outOfPage","content"],u._adManager=(0,A.createManager)(),u._config={seedFileUrl:"//www.googletagservices.com/tag/js/gpt.js",renderWhenViewable:!0,viewableThreshold:.5,filterProps:C.default,propsEqual:S.default},c);t.default=(0,M.default)(x,A.pubadsAPI.reduce(function(e,t){return e[t]=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return x._adManager.pubadsProxy({method:t,args:n})},e},{}))},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});t.gptVersion=110,t.gptAPI=[["getVersion","function"],["cmd","object"],["getEventLog","function"],["enableServices","function"],["setAdIframeTitle","function"],["impl","object"],["pubads","function"],["defineOutOfPageSlot","function"],["defineSlot","function"],["defineUnit","function"],["destroySlots","function"],["display","function"],["companionAds","function"],["content","function"],["debug_log","object"],["service_manager_instance","object"],["disablePublisherConsole","function"],["onPubConsoleJsLoad","function"],["openConsole","function"],["sizeMapping","function"],["evalScripts","function"],["apiReady","boolean"],["slot_manager_instance","object"],["pubadsReady","boolean"]],t.pubadsVersion=110,t.pubadsAPI=[["set","function"],["get","function"],["getAttributeKeys","function"],["display","function"],["getName","function"],["setCookieOptions","function"],["setTagForChildDirectedTreatment","function"],["clearTagForChildDirectedTreatment","function"],["setKidsFriendlyAds","function"],["setTargeting","function"],["clearTargeting","function"],["getTargeting","function"],["getTargetingKeys","function"],["setCategoryExclusion","function"],["clearCategoryExclusions","function"],["disableInitialLoad","function"],["enableSingleRequest","function"],["enableAsyncRendering","function"],["enableSyncRendering","function"],["setCentering","function"],["setPublisherProvidedId","function"],["definePassback","function"],["defineOutOfPagePassback","function"],["refresh","function"],["enableVideoAds","function"],["setVideoContent","function"],["getVideoContent","function"],["getCorrelator","function"],["setCorrelator","function"],["updateCorrelator","function"],["isAdRequestFinished","function"],["collapseEmptyDivs","function"],["clear","function"],["setLocation","function"],["getVersion","function"],["forceExperiment","function"],["markAsAmp","function"],["setSafeFrameConfig","function"],["setForceSafeFrame","function"],["enableChromeInterventionSignals","function"],["markAsGladeControl","function"],["markAsGladeOptOut","function"],["getName","function"],["getVersion","function"],["getSlots","function"],["getSlotIdMap","function"],["enable","function"],["addEventListener","function"]],t.slotAPI=[["getPassbackPageUrl","function"],["set","function"],["get","function"],["getAttributeKeys","function"],["addService","function"],["getName","function"],["getAdUnitPath","function"],["getInstance","function"],["getSlotElementId","function"],["getSlotId","function"],["getServices","function"],["getSizes","function"],["defineSizeMapping","function"],["hasWrapperDiv","function"],["setClickUrl","function"],["getClickUrl","function"],["setForceSafeFrame","function"],["setCategoryExclusion","function"],["clearCategoryExclusions","function"],["getCategoryExclusions","function"],["setTargeting","function"],["clearTargeting","function"],["getTargetingMap","function"],["getTargeting","function"],["getTargetingKeys","function"],["getOutOfPage","function"],["getAudExtId","function"],["gtfcd","function"],["setCollapseEmptyDiv","function"],["getCollapseEmptyDiv","function"],["getDivStartsCollapsed","function"],["fetchStarted","function"],["getContentUrl","function"],["fetchEnded","function"],["renderStarted","function"],["getResponseInformation","function"],["renderEnded","function"],["loaded","function"],["impressionViewable","function"],["visibilityChanged","function"],["setFirstLook","function"],["getFirstLook","function"],["getEscapedQemQueryId","function"],["setSafeFrameConfig","function"],["getCsiId","function"]]},function(e,t,n){function r(e){return(0,i.createManager)(o({},e,{test:!0,GPTMock:a.GPTMock}))}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.createManagerTest=r;var i=n(2),a=n(10)},function(e,t){function n(e,t,n){return e.reduce(function(e,r){return e.props[r]=t[r],e.nextProps[r]=n[r],e},{props:{},nextProps:{}})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t){function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0],n=r(t,2),o=n[0],i=n[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e||1!==e.nodeType)return!1;var s=e.getBoundingClientRect(),u={top:s.top,left:s.left,bottom:s.bottom,right:s.right},c={top:0,left:0,bottom:window.innerHeight,right:window.innerWidth},l=u.bottom>=c.top+i*a&&u.right>=c.left+o*a&&u.top<=c.bottom-i*a&&u.left<=c.right-o*a;return l}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=n},function(e,t,n){function r(e){return e&&e.__esModule?e:{default:e}}function o(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}function i(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)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){return e.reduce(function(e,t){var n=l(t,2),r=n[0],o=n[1];return"undefined"==typeof e[r]&&("function"===o?e[r]=function(){return arguments.length?arguments.length<=0?void 0:arguments[0]:{}}:"boolean"===o?e[r]=!0:e[r]={}),e},t||{})}function u(e){for(var t=e.getSizes(),n=t;Array.isArray(n[0]);)n=n[0];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.ContentServiceMock=t.CompanionAdsServiceMock=t.PubAdsServiceMock=t.SizeMappingBuilderMock=t.SlotMock=t.GPTMock=void 0;var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=n(6),d=n(1),p=r(d),g=function(){function e(t,n,r){a(this,e),this.adUnitPath=t,this.size=n,this.divId=r,this.services=[],this.attributes={},this.categoryExclusions=[],this._targeting={}}return c(e,[{key:"defineSizeMapping",value:function(e){return this.size=e,this}},{key:"addService",value:function(e){this.services.push(e)}},{key:"getServices",value:function(){return this.services}},{key:"set",value:function(e,t){return this.attributes[e]=t,this}},{key:"get",value:function(e){return this.attributes[e]}},{key:"getAttributeKeys",value:function(){return Object.keys(this.attributes)}},{key:"setCollapseEmptyDiv",value:function(e,t){return this.collapseEmptyDiv=e,this.collapseBeforeAdFetch=t,this}},{key:"getCollapseEmptyDiv",value:function(){return this.collapseEmptyDiv}},{key:"setClickUrl",value:function(e){return this.clickUrl=e,this}},{key:"getClickUrl",value:function(){return this.clickUrl}},{key:"setCategoryExclusion",value:function(e){return this.categoryExclusions.push(e),this}},{key:"getCategoryExclusions",value:function(){return this.categoryExclusions}},{key:"clearCategoryExclusions",value:function(){return this.categoryExclusions=[],this}},{key:"setTargeting",value:function(e,t){return this._targeting[e]=t,this}},{key:"getAdUnitPath",value:function(){return this.adUnitPath}},{key:"clearTargeting",value:function(){return this._targeting={},this}},{key:"getTargeting",value:function(e){return this._targeting&&this._targeting[e]}},{key:"getTargetingKeys",value:function(){return this._targeting&&Object.keys(this._targeting)}},{key:"getSizes",value:function(){return this.size}},{key:"getSlotElementId",value:function(){return this.divId}}]),e}();s(f.slotAPI,g.prototype);var h=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.config=t}return c(e,[{key:"addSize",value:function(e,t){return this.mapping||(this.mapping=[]),this.mapping.push([e,t]),this}},{key:"build",value:function(){return this.mapping}}]),e}(),y=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.config=t,this.listeners={},this.slots={}}return c(e,[{key:"addEventListener",value:function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"getSlots",value:function(){var e=this;return Object.keys(this.slots).map(function(t){return e.slots[t]})}}]),e}(),v=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.version=f.pubadsVersion,n}return i(t,e),c(t,[{key:"getVersion",value:function(){return this.version}},{key:"refresh",value:function(e){var t=this;e||(e=Object.keys(this.slots).map(function(e){return t.slots[e]})),setTimeout(function(){var n=p.default.SLOT_RENDER_ENDED;e.forEach(function(e){t.listeners[n]&&t.listeners[n].forEach(function(n){var r=!!t.config.emptyAd,o={isEmpty:r,creativeId:r?null:Date.now(),lineItemId:r?null:Date.now(),serviceName:"publisher_ads",size:r?null:u(e),slot:e};n(o)})})},0)}}]),t}(y);s(f.pubadsAPI,v.prototype);var b=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),c(t,[{key:"enableSyncLoading",value:function(){this._enableSyncLoading=!0}},{key:"setRefreshUnfilledSlots",value:function(e){"boolean"==typeof e&&(this._refreshUnfilledSlots=e)}}]),t}(y),_=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),c(t,[{key:"setContent",value:function(e,t){e._content=t}}]),t}(y),m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a(this,e),this.pubadsReady=!1,this.config=t,this.version=f.gptVersion,this.cmd={},this.cmd.push=function(e){e()}}return c(e,[{key:"getVersion",value:function(){return this.version}},{key:"enableServices",value:function(){var e=this;setTimeout(function(){e.pubadsReady=!0},0)}},{key:"sizeMapping",value:function(){return this.sizeMappingBuilder||(this.sizeMappingBuilder=new h(this.config)), | ||
this.sizeMappingBuilder}},{key:"pubads",value:function(){return this._pubads||(this._pubads=new v(this.config)),this._pubads}},{key:"companionAds",value:function(){return this._companionAds||(this._companionAds=new b(this.config)),this._companionAds}},{key:"content",value:function(){return this._content||(this._content=new _(this.config)),this._content}},{key:"defineSlot",value:function(e,t,n){var r=new g(e,t,n);return this.pubads().slots[n]=r,r}},{key:"defineOutOfPageSlot",value:function(e,t){var n=new g(e,[1,1],t);return this.pubads().slots[t]=n,n}},{key:"display",value:function(e){var t=this,n=this.pubads();setTimeout(function(){Object.keys(n.listeners).forEach(function(r){n.listeners[r]&&n.listeners[r].forEach(function(r){var o=n.slots[e],i=!!t.config.emptyAd,a={isEmpty:i,creativeId:i?null:Date.now(),lineItemId:i?null:Date.now(),serviceName:"publisher_ads",size:i?null:u(o),slot:o};r(a)})})},0)}}]),e}();s(f.gptAPI,m.prototype),t.GPTMock=m,t.SlotMock=g,t.SizeMappingBuilderMock=h,t.PubAdsServiceMock=v,t.CompanionAdsServiceMock=b,t.ContentServiceMock=_},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}function i(e,t,n){var i,l;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(u(e))return!!u(t)&&(e=a.call(e),t=a.call(t),c(e,t,n));if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}try{var f=s(e),d=s(t)}catch(e){return!1}if(f.length!=d.length)return!1;for(f.sort(),d.sort(),i=f.length-1;i>=0;i--)if(f[i]!=d[i])return!1;for(i=f.length-1;i>=0;i--)if(l=f[i],!c(e[l],t[l],n))return!1;return typeof e==typeof t}var a=Array.prototype.slice,s=n(13),u=n(12),c=e.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:i(e,t,n))}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){"use strict";function r(){}function o(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){this._events=new r,this._eventsCount=0}var a=Object.prototype.hasOwnProperty,s="~";Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),i.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)a.call(e,t)&&n.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},i.prototype.listeners=function(e,t){var n=s?s+e:e,r=this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o<i;o++)a[o]=r[o].fn;return a},i.prototype.emit=function(e,t,n,r,o,i){var a=s?s+e:e;if(!this._events[a])return!1;var u,c,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,o),!0;case 6:return l.fn.call(l.context,t,n,r,o,i),!0}for(c=1,u=new Array(f-1);c<f;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var d,p=l.length;for(c=0;c<p;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),f){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,n);break;case 4:l[c].fn.call(l[c].context,t,n,r);break;default:if(!u)for(d=1,u=new Array(f-1);d<f;d++)u[d-1]=arguments[d];l[c].fn.apply(l[c].context,u)}}return!0},i.prototype.on=function(e,t,n){var r=new o(t,n||this),i=s?s+e:e;return this._events[i]?this._events[i].fn?this._events[i]=[this._events[i],r]:this._events[i].push(r):(this._events[i]=r,this._eventsCount++),this},i.prototype.once=function(e,t,n){var r=new o(t,n||this,!0),i=s?s+e:e;return this._events[i]?this._events[i].fn?this._events[i]=[this._events[i],r]:this._events[i].push(r):(this._events[i]=r,this._eventsCount++),this},i.prototype.removeListener=function(e,t,n,o){var i=s?s+e:e;if(!this._events[i])return this;if(!t)return 0===--this._eventsCount?this._events=new r:delete this._events[i],this;var a=this._events[i];if(a.fn)a.fn!==t||o&&!a.once||n&&a.context!==n||(0===--this._eventsCount?this._events=new r:delete this._events[i]);else{for(var u=0,c=[],l=a.length;u<l;u++)(a[u].fn!==t||o&&!a[u].once||n&&a[u].context!==n)&&c.push(a[u]);c.length?this._events[i]=1===c.length?c[0]:c:0===--this._eventsCount?this._events=new r:delete this._events[i]}return this},i.prototype.removeAllListeners=function(e){var t;return e?(t=s?s+e:e,this._events[t]&&(0===--this._eventsCount?this._events=new r:delete this._events[t])):(this._events=new r,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=s,i.EventEmitter=i,e.exports=i},function(e,t,n){var r;/*! | ||
Copyright (c) 2015 Jed Watson. | ||
@@ -6,2 +7,2 @@ Based on code that is Copyright 2013-2015, Facebook, Inc. | ||
*/ | ||
!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),a={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};r=function(){return a}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}()},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,a,i,s,u){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,i,s,u],d=0;l=new Error(t.replace(/%s/g,function(){return c[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,a){if("string"!=typeof t){var i=Object.getOwnPropertyNames(t);o&&(i=i.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;++s)if(!(n[i[s]]||r[i[s]]||a&&a[i[s]]))try{e[i[s]]=t[i[s]]}catch(e){}}return e}},function(e,t,n){"use strict";var r=n(13),o=n(14),a=n(18);e.exports=function(){function e(e,t,n,r,i,s){s!==a&&o(!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 t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){e.exports=n(16)()},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){var r=n(3);e.exports=function(e,t,n){return void 0===n?r(e,t,!1):r(e,n,t!==!1)}},function(e,t,n){var r=n(3),o=n(19);e.exports={throttle:r,debounce:o}},function(t,n){t.exports=e},function(e,n){e.exports=t}])}); | ||
!function(){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),i={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen};r=function(){return i}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}()},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i,a,s,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,s,u],f=0;c=new Error(t.replace(/%s/g,function(){return l[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},o="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,i){if("string"!=typeof t){var a=Object.getOwnPropertyNames(t);o&&(a=a.concat(Object.getOwnPropertySymbols(t)));for(var s=0;s<a.length;++s)if(!(n[a[s]]||r[a[s]]||i&&i[a[s]]))try{e[a[s]]=t[a[s]]}catch(e){}}return e}},function(e,t,n){"use strict";var r=n(16),o=n(17),i=n(21);e.exports=function(){function e(e,t,n,r,a,s){s!==i&&o(!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 t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){e.exports=n(19)()},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){var r=n(4);e.exports=function(e,t,n){return void 0===n?r(e,t,!1):r(e,n,t!==!1)}},function(e,t,n){var r=n(4),o=n(22);e.exports={throttle:r,debounce:o}},function(t,n){t.exports=e},function(e,n){e.exports=t}])}); |
@@ -23,2 +23,11 @@ Object.defineProperty(exports, "__esModule", { | ||
var _createManagerTest = require("./utils/createManagerTest"); | ||
Object.defineProperty(exports, "createManagerTest", { | ||
enumerable: true, | ||
get: function get() { | ||
return _createManagerTest.createManagerTest; | ||
} | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "react-gpt", | ||
"version": "0.3.0", | ||
"version": "1.0.0", | ||
"description": "A react display ad component using Google Publisher Tag", | ||
"main": "lib/index.js", | ||
"jsnext:main": "es/index.js", | ||
"contributors": [ | ||
@@ -27,3 +28,9 @@ { | ||
}, | ||
"files": ["*.md", "docs", "src", "dist", "lib"], | ||
"files": [ | ||
"*.md", | ||
"docs", | ||
"src", | ||
"dist", | ||
"lib" | ||
], | ||
"dependencies": { | ||
@@ -92,3 +99,3 @@ "deep-equal": "^1.0.1", | ||
}, | ||
"peerDepencencies": { | ||
"peerDependencies": { | ||
"prop-types": "^15.5.10", | ||
@@ -102,17 +109,13 @@ "react": "^15.0.1", | ||
"build": "npm run clean && npm run compile", | ||
"build:umd": | ||
"NODE_ENV=development webpack src/index.js dist/react-gpt.js", | ||
"build:umd:min": | ||
"NODE_ENV=production webpack -p src/index.js dist/react-gpt.min.js", | ||
"build:es": "BABEL_ENV=es babel --copy-files ./src -d es", | ||
"build:umd": "NODE_ENV=development webpack src/index.js dist/react-gpt.js", | ||
"build:umd:min": "NODE_ENV=production webpack -p src/index.js dist/react-gpt.min.js", | ||
"bundlesize": "npm run build:umd:min && bundlesize", | ||
"clean": "rimraf lib coverage", | ||
"compile": "babel src --out-dir lib", | ||
"examples": | ||
"webpack-dev-server --config examples/webpack.config.js --content-base examples/apps --inline", | ||
"examples": "webpack-dev-server --config examples/webpack.config.js --content-base examples/apps --inline", | ||
"lint": "eslint --fix src test examples", | ||
"start": | ||
"npm run build && env BABEL_ENV=examples node examples/server/index.js", | ||
"start": "npm run build && env BABEL_ENV=examples node examples/server/index.js", | ||
"pretest": "npm run build", | ||
"prepublish": | ||
"npm run build && npm run build:umd && npm run build:umd:min", | ||
"prepublish": "npm run build && npm run build:es && npm run build:umd && npm run build:umd:min", | ||
"test": "npm run lint && karma start", | ||
@@ -129,5 +132,5 @@ "update-apilist": "node ./scripts/updateAPIList.js" | ||
"path": "./dist/react-gpt.min.js", | ||
"maxSize": "8.5 kB" | ||
"maxSize": "10.5 kB" | ||
} | ||
] | ||
} |
export {default as Bling} from "./Bling"; | ||
export {default as Events} from "./Events"; | ||
export {createManagerTest} from "./utils/createManagerTest"; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
336388
6837
2
10