Comparing version 4.0.1 to 5.0.0-beta.1
@@ -11,2 +11,3 @@ module.exports = { | ||
sourceType: 'module', | ||
ecmaVersion: '2018', | ||
ecmaFeatures: { | ||
@@ -45,2 +46,2 @@ jsx: true | ||
} | ||
}; | ||
}; |
@@ -1,1 +0,1 @@ | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var i=n();for(var t in i)("object"==typeof exports?exports:e)[t]=i[t]}}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=n,i.d=function(e,n,t){i.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},i.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(n,"a",n),n},i.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},i.p="",i(i.s=5)}([function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sendLog=function(e,n,i){try{if("true"===new URLSearchParams(window.location.search).get("debug")){var r=(0,t.default)("arcads.js");r({service:"ArcAds",timestamp:""+new Date,"logging from":e,description:n,slotName:i})}}catch(e){console.error(e)}};var t=function(e){return e&&e.__esModule?e:{default:e}}(i(2));i(7)},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initializeGPT=function(){window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],(0,t.appendResource)("script","//securepubads.g.doubleclick.net/tag/js/gpt.js",!0,!0),(0,o.sendLog)("initializeGPT()","Appended googletag script to the head tag of the page.",null)},n.refreshSlot=function(e){var n=e.ad,i=e.correlator,t=void 0!==i&&i,r=e.prerender,o=void 0===r?null:r,a=e.info,d=void 0===a?{}:a;new Promise(function(e){if(o)try{o(d).then(function(){e("Prerender function has completed.")})}catch(n){console.warn("ArcAds: Prerender function did not return a promise or there was an error.\n Documentation: https://github.com/washingtonpost/arcads/wiki/Utilizing-a-Prerender-Hook"),e("Prerender function did not return a promise or there was an error, ignoring.")}else e("No Prerender function was provided.")}).then(function(){!function e(){if(window.blockArcAdsLoad)return"blockArcAdsLoad";window.googletag&&googletag.pubadsReady?window.googletag.pubads().refresh([n],{changeCorrelator:t}):setTimeout(function(){e()},200)}()})},n.queueGoogletagCommand=function(e){window.googletag.cmd.push(e)},n.setTargeting=function(e,n){for(var i in n)n.hasOwnProperty(i)&&n[i]&&e.setTargeting(i,n[i])},n.dfpSettings=function(e){window.googletag.pubads().disableInitialLoad(),window.googletag.pubads().enableSingleRequest(),window.googletag.pubads().enableAsyncRendering(),this.collapseEmptyDivs&&((0,o.sendLog)("dfpSettings()","This wrapper is set to collapse any empty divs.",null),window.googletag.pubads().collapseEmptyDivs());window.googletag.enableServices(),e&&((0,o.sendLog)("dfpSettings()","This wrapper has a function to call upon the slot render ending.",null),window.googletag.pubads().addEventListener("slotRenderEnded",e))},n.determineSlotName=function(e,n){var i=(0,r.expandQueryString)("adslot");if(i&&(""!==i||null!==i))return"/"+e+"/"+i;return"/"+e+"/"+n};var t=i(8),r=i(9),o=i(0)},function(e,n){var i=Object.create(null),t=function(e,n){return e?i[e]||(i[e]=t.ext(t.new(e,n))):i};t.levels={error:1,warn:2,info:3,log:4,debug:5,trace:6},t.new=function(e,n){var i={};i[e]=function(){t.log(e,[].slice.call(arguments))};try{Object.defineProperty(i[e],"name",{get:function(){return e}})}catch(e){}return i[e]},t.log=function(e,n){var r=n.length>1&&t.levels[n[0]]?n.shift():"log";i[e][r].apply(i[e],n)},t.ext=function(e){for(var n in e.enabledFor=function(){},t.levels)e[n]=function(){};return e},e.exports=t},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.initializeBiddingServices=d,n.fetchBids=function(e){var n=this,i=e.ad,a=e.id,s=e.slotName,l=e.dimensions,u=e.wrapper,c=e.bidding,p=e.correlator,g=void 0!==p&&p,f=e.prerender,h=e.breakpoints,b={adUnit:i,adSlot:s,adDimensions:l,adId:a,bids:c},v=new Promise(function(e){if(u.prebid&&u.prebid.enabled){var r=u.prebid.timeout||700;t.queuePrebidCommand.bind(n,(0,t.fetchPrebidBids)(i,u.prebid.useSlotForAdUnit?s:a,r,b,f,function(){e("Fetched Prebid ads!")}))}else e("Prebid is not enabled on the wrapper...")}),w=new Promise(function(e){u.amazon&&u.amazon.enabled?(0,r.fetchAmazonBids)(a,s,l,h,function(){e("Fetched Amazon ads!")}):e("Amazon is not enabled on the wrapper...")});window.arcBiddingReady?Promise.all([v,w]).then(function(){(0,o.refreshSlot)({ad:i,correlator:g,prerender:f,info:b})}):setTimeout(function(){return d()},200)};var t=i(4),r=i(10),o=i(1),a=i(0);function d(e){var n=e.prebid,i=void 0!==n&&n,t=e.amazon,o=void 0!==t&&t;if(window.arcBiddingReady)(0,a.sendLog)("initializeBiddingServices()","Header bidding has been previously initialized",null);else{window.arcBiddingReady=!1;var d=new Promise(function(e){if(i&&i.enabled){if("undefined"==typeof pbjs){var n=n||{};n.que=n.que||[]}e("Prebid has been initialized")}else(0,a.sendLog)("initializeBiddingServices()","Prebid is not enabled on this wrapper.",null),e("Prebid is not enabled on the wrapper...")}),s=new Promise(function(e){o&&o.enabled&&window.apstag?o.id&&""!==o.id?(0,r.queueAmazonCommand)(function(){window.apstag.init({pubID:o.id,adServer:"googletag"}),e("Amazon scripts have been added onto the page!")}):(console.warn("ArcAds: Missing Amazon account id. \n Documentation: https://github.com/washingtonpost/arcads#amazon-tama9"),(0,a.sendLog)("initializeBiddingServices()","Amazon is not enabled on this wrapper.",null),e("Amazon is not enabled on the wrapper...")):e("Amazon is not enabled on the wrapper...")});Promise.all([d,s]).then(function(){window.arcBiddingReady=!0})}}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}return e};n.queuePrebidCommand=function(e){pbjs.que.push(e)},n.fetchPrebidBidsArray=o,n.fetchPrebidBids=function(e,n,i,t,r){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,d=t;d.bids=Array.isArray(t.bids)?t.bids:[t.bids],o(e,[n],i,d,r,a)},n.addUnit=function(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=t({code:e,bids:i},o);a.mediaTypes={banner:{sizes:n}};var d=r.sizeConfig,s=r.config;if(pbjs.addAdUnits(a),s)return void pbjs.setConfig(s);d&&pbjs.setConfig({sizeConfig:d})};var r=i(1);function o(e,n,i,t,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;pbjs.addAdUnits(t),window.blockArcAdsPrebid||pbjs.requestBids({timeout:i,adUnitCodes:n,bidsBackHandler:function(i){console.log("Bid Back Handler",i),pbjs.setTargetingForGPTAsync(n),a?a():(0,r.refreshSlot)({ad:e,info:t,prerender:o})}})}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ArcAds=void 0;var t=function(){function e(e,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(n,i,t){return i&&e(n.prototype,i),t&&e(n,t),n}}(),r=i(6),o=i(0),a=i(3),d=i(1),s=i(4),l=i(11);function u(e){if(Array.isArray(e)){for(var n=0,i=Array(e.length);n<e.length;n++)i[n]=e[n];return i}return Array.from(e)}n.ArcAds=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),this.dfpId=n.dfp.id||"",this.wrapper=n.bidding||{},this.positions=[],this.collapseEmptyDivs=n.dfp.collapseEmptyDivs,this.adsList=[],window.isMobile=r.MobileDetection,""===this.dfpId?(console.warn("ArcAds: DFP id is missing from the arcads initialization script.","\n","Documentation: https://github.com/washingtonpost/arcads#getting-started"),(0,o.sendLog)("constructor()","The DFP id missing from the arcads initialization script. ArcAds cannot proceed.",null)):((0,d.initializeGPT)(),(0,d.queueGoogletagCommand)(d.dfpSettings.bind(this,i)),(0,a.initializeBiddingServices)(this.wrapper))}return t(e,[{key:"registerAd",value:function(e){var n=e.id,i=e.slotName,t=e.dimensions,r=e.adType,a=void 0!==r&&r,l=e.targeting,c=void 0===l?{}:l,p=e.display,g=void 0===p?"all":p,f=e.bidding,h=void 0!==f&&f,b=e.iframeBidders,v=void 0===b?["openx"]:b,w=e.others,m=void 0===w?{}:w,y=[],A=!1,k=function e(n){return Array.isArray(n)?1+Math.max.apply(Math,u(n.map(function(n){return e(n)}))):0}(t);t&&void 0!==t&&1===k?y.push.apply(y,u(t)):t&&void 0!==t&&t.length>0&&2===k?y.push.apply(y,u(t)):t&&t.forEach(function(e){y.push.apply(y,u(e))});try{if(!(c&&c.hasOwnProperty("position")||!1===a)){var P=this.positions[a]+1||1;this.positions[a]=P;var z=Object.assign(c,{position:P});Object.assign(e,{targeting:z})}var S=h.prebid&&(h.prebid.enabled&&h.prebid.bids||void 0===h.prebid.enabled&&h.prebid.bids);if(isMobile.any()&&"mobile"===g||!isMobile.any()&&"desktop"===g||"all"===g){if(S&&this.wrapper.prebid&&this.wrapper.prebid.enabled&&y){pbjs&&v.length>0&&pbjs.setConfig({userSync:{iframeEnabled:!0,filterSettings:{iframe:{bidders:v,filter:"include"}}}});var L=this.wrapper.prebid.useSlotForAdUnit?(0,d.determineSlotName)(this.dfpId,i):n;s.queuePrebidCommand.bind(this,(0,s.addUnit)(L,y,h.prebid.bids,this.wrapper.prebid,m))}(A=this.displayAd.bind(this,e))&&((0,o.sendLog)("registerAd()","Queuing Google Tag command for ad",i),(0,d.queueGoogletagCommand)(A))}}catch(e){console.error("ads error",e)}}},{key:"registerAdCollection",value:function(e){var n=this;e.forEach(function(e){n.registerAd(e)})}},{key:"registerAdCollectionSingleCall",value:function(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700;(0,o.sendLog)("registerAdCollectionSingleCall()","Registering all reserved ads",null),window.blockArcAdsLoad=!0,window.blockArcAdsPrebid=!0,e.forEach(function(e){n.registerAd(e)}),window.blockArcAdsLoad=!1,window.blockArcAdsPrebid=!1,pbjs.requestBids({timeout:i,bidsBackHandler:function(e){console.log("Bid Back Handler",e),pbjs.setTargetingForGPTAsync(),window.googletag.pubads().refresh(window.adsList),window.adsList=[]}})}},{key:"displayAd",value:function(e){var n=e.id,i=e.slotName,t=e.dimensions,r=e.targeting,s=e.sizemap,u=void 0!==s&&s,c=e.bidding,p=void 0!==c&&c,g=e.prerender,f=void 0===g?null:g,h=(0,d.determineSlotName)(this.dfpId,i),b=t&&!t.length?null:t,v=t?window.googletag.defineSlot(h,b,n):window.googletag.defineOutOfPageSlot(h,n);if(u&&u.breakpoints&&t){var w=(0,l.prepareSizeMaps)(b,u.breakpoints),m=w.mapping,y=w.breakpoints,A=w.correlators;if(!v)return(0,o.sendLog)("displayAd()","No ad available to display - the div was either not defined or an ad with the same slot name already exists on the page",i),!1;v.defineSizeMapping(m),u.refresh&&((0,o.sendLog)("displayAd()","Attaching resize listener to the ad with this slot name and sizemap defined",i),(0,l.setResizeListener)({ad:v,slotName:h,breakpoints:y,id:n,mapping:m,correlators:A,bidding:p,wrapper:this.wrapper,prerender:f}))}v&&(v.addService(window.googletag.pubads()),(0,d.setTargeting)(v,r));var k=u&&u.breakpoints?u.breakpoints:[];window.adsList&&v&&adsList.push(v),t&&p&&(p.amazon&&p.amazon.enabled||p.prebid&&p.prebid.enabled)?((0,o.sendLog)("displayAd()","Fetching bids for ad with this slot name",i),(0,a.fetchBids)({ad:v,id:n,slotName:h,dimensions:b,wrapper:this.wrapper,prerender:f,bidding:p,breakpoints:k})):window.blockArcAdsPrebid||((0,o.sendLog)("displayAd()","Refreshing ad with this slot name",i),(0,d.refreshSlot)({ad:v,prerender:f,info:{adUnit:v,adSlot:h,adDimensions:b,adId:n}}))}},{key:"sendSingleCallAds",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:700;if(this.adsList&&this.adsList.length<1)return(0,o.sendLog)("sendSingleCallAds()","No ads have been reserved on the page",null),!1;window&&window.googletag&&googletag.pubadsReady?(window.googletag.pubads().disableInitialLoad(),window.googletag.pubads().enableSingleRequest(),window.googletag.pubads().enableAsyncRendering(),this.registerAdCollectionSingleCall(this.adsList,n)):setTimeout(function(){e.sendSingleCallAds()},2e3)}},{key:"reserveAd",value:function(n){e.setAdsBlockGate(),this.adsList.push(n)}},{key:"setPageLeveTargeting",value:function(e,n){googletag.pubads().setTargeting(e,n)}}],[{key:"setAdsBlockGate",value:function(){var n=e.getWindow();void 0!==n&&(n.blockArcAdsLoad=!0)}},{key:"releaseAdsBlockGate",value:function(){var n=e.getWindow();void 0!==n&&(n.blockArcAdsLoad=!1)}},{key:"getWindow",value:function(){return window}}]),e}()},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=function(){function e(e,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}return function(n,i,t){return i&&e(n.prototype,i),t&&e(n,t),n}}();var r=n.MobileDetection=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}return t(e,null,[{key:"Android",value:function(){return!!navigator.userAgent.match(/Android/i)}},{key:"AndroidOld",value:function(){return!!navigator.userAgent.match(/Android 2.3.3/i)}},{key:"AndroidTablet",value:function(){return!(!navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/Mobile/i))}},{key:"Kindle",value:function(){return!!navigator.userAgent.match(/Kindle/i)}},{key:"KindleFire",value:function(){return!!navigator.userAgent.match(/KFOT/i)}},{key:"Silk",value:function(){return!!navigator.userAgent.match(/Silk/i)}},{key:"BlackBerry",value:function(){return!!navigator.userAgent.match(/BlackBerry/i)}},{key:"iOS",value:function(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)}},{key:"iPhone",value:function(){return!!navigator.userAgent.match(/iPhone|iPod/i)}},{key:"iPad",value:function(){return!!navigator.userAgent.match(/iPad/i)}},{key:"Windows",value:function(){return!!navigator.userAgent.match(/IEMobile/i)}},{key:"FirefoxOS",value:function(){return!!navigator.userAgent.match(/Mozilla/i)&&!!navigator.userAgent.match(/Mobile/i)}},{key:"Retina",value:function(){return window.retina||window.devicePixelRatio>1}},{key:"any",value:function(){return this.Android()||this.Kindle()||this.KindleFire()||this.Silk()||this.BlackBerry()||this.iOS()||this.Windows()||this.FirefoxOS()}}]),e}();n.default=r},function(e,n,i){var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(i(2));t.default.ext=function(e){var n="undefined"!=typeof console&&console;for(var i in t.default.levels)e[i]=n&&(n[i]||n.log)||function(){};return e.enabledFor=function(){return!0},e}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.appendResource=function(e,n,i,t,r){var o=document.createElement(e);if("script"!==e)return;o.src=n,o.async=i||!1,o.defer=i||t||!1;(document.head||document.documentElement).appendChild(o),r&&r()}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.expandQueryString=function(e){var n=window.location.href,i=e.replace(/[[\]]/g,"\\$&"),t=new RegExp("[?&]"+i+"(=([^&#]*)|&|#|$)").exec(n);if(!t)return null;if(!t[2])return"";return decodeURIComponent(t[2].replace(/\+/g," "))}},function(e,n,i){"use strict";function t(e){window.apstag&&e()}Object.defineProperty(n,"__esModule",{value:!0}),n.fetchAmazonBids=function(e,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=i;if(r&&void 0!==window.innerWidth&&void 0!==i[0][0][0]){for(var d=window.innerWidth,s=-1,l=r.length,u=0;u<l;u++)if(d>=r[u][0]){s=u;break}a=i[s]}t(function(){var i={slotName:n,slotID:e,sizes:a};window.apstag.fetchBids({slots:[i]},function(){window.apstag.setDisplayBids(),o&&o()})})},n.queueAmazonCommand=t},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.resizeListeners=n.sizemapListeners=void 0,n.prepareSizeMaps=function(e,n){var i=[],t=[],r=[],o=n.length?n:null;o&&e&&o.forEach(function(n,o){i.push([n,e[o]]),-1===t.indexOf(n[0])&&(t.push(n[0]),r.push(!1))});return t.sort(function(e,n){return e-n}),{mapping:i,breakpoints:t,correlators:r}},n.parseSizeMappings=l,n.runResizeEvents=u,n.setResizeListener=function(e){var n=e.id,i=e.correlators;s[n]=(0,t.debounce)(u(e),250),window.addEventListener("resize",s[n]),d[n]={listener:s[n],correlators:i}};var t=i(12),r=i(3),o=i(1),a=i(0),d=n.sizemapListeners={},s=n.resizeListeners={};function l(e){try{var n=[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight],i=e.filter(function(e){return e[0][0]<=n[0]&&e[0][1]<=n[1]}),t=i.length>0?i[0][1]:[];return t.length>0&&t[0].constructor!==Array&&(t=[t]),t}catch(n){return(0,a.sendLog)("parseSizeMappings()","invalid size mapping",null),e[e.length-1][1]}}function u(e){var n=void 0,i=!1;if(e.breakpoints){var t=window.innerWidth;n=e.breakpoints.filter(function(e){return e<t}).pop()||e.breakpoints[0]}return function(){for(var t=e.ad,a=e.breakpoints,s=e.id,u=e.bidding,c=e.mapping,p=e.slotName,g=e.wrapper,f=e.prerender,h=window.innerWidth,b=void 0,v=void 0,w=0;w<a.length;w++){if(b=a[w],v=a[w+1],n!==b&&(h>b&&(h<v||!v)||h===b&&!i)){n=b,i=!0;var m=l(c),y={adUnit:t,adSlot:p,adDimensions:m,adId:s};u.prebid&&u.prebid.enabled||u.amazon&&u.amazon.enabled?(0,r.fetchBids)({ad:t,id:s,slotName:p,dimensions:m,bidding:u,wrapper:g,prerender:f,correlator:d[s].correlators[w],breakpoints:a}):(0,o.refreshSlot)({ad:t,correlator:d[s].correlators[w],prerender:f,info:y})}d[s].correlators[w]=!0}}}},function(e,n,i){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.debounce=function(e,n){var i=void 0;return function(){for(var t=this,r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(i),i=setTimeout(function(){i=null,e.apply(t,o)},n)}}}])}); | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var i=n();for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}("undefined"!=typeof self?self:this,(function(){return(()=>{var e={"./node_modules/anylogger-console/anylogger-console.cjs.js":(e,n,i)=>{function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(i("./node_modules/anylogger/anylogger.cjs.js"));t.default.ext=function(e){var n="undefined"!=typeof console&&console;for(var i in t.default.levels)e[i]=n&&(n[i]||n.log)||function(){};return e.enabledFor=function(){return!0},e}},"./node_modules/anylogger/anylogger.cjs.js":e=>{var n=Object.create(null),i=function(e,r){return e?n[e]||(n[e]=i.ext(i.new(e,r))):n};i.levels={error:1,warn:2,info:3,log:4,debug:5,trace:6},i.new=function(e,n){var r={};r[e]=function(){i.log(e,[].slice.call(arguments))};try{Object.defineProperty(r[e],"name",{get:function(){return e}})}catch(e){}return r[e]},i.log=function(e,r){var t=r.length>1&&i.levels[r[0]]?r.shift():"log";n[e][t].apply(n[e],r)},i.ext=function(e){for(var n in e.enabledFor=function(){},i.levels)e[n]=function(){};return e},e.exports=i},"./src/services/amazon.js":(e,n,i)=>{"use strict";function r(e,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=i;if(r&&void 0!==window.innerWidth&&void 0!==i[0][0][0]){for(var s=window.innerWidth,d=-1,l=r.length,c=0;c<l;c++)if(s>=r[c][0]){d=c;break}a=i[d]}t((function(){var i={slotName:n,slotID:e,sizes:a};window.apstag.fetchBids({slots:[i]},(function(){window.apstag.setDisplayBids(),o&&o()}))}))}function t(e){window.apstag&&e()}i.r(n),i.d(n,{fetchAmazonBids:()=>r,queueAmazonCommand:()=>t})},"./src/services/gpt.js":(e,n,i)=>{"use strict";i.r(n),i.d(n,{initializeGPT:()=>a,refreshSlot:()=>s,queueGoogletagCommand:()=>d,setTargeting:()=>l,dfpSettings:()=>c,determineSlotName:()=>u});var r=i("./src/util/resources.js"),t=i("./src/util/query.js"),o=i("./src/util/log.js");function a(){window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[],(0,r.appendResource)("script","//securepubads.g.doubleclick.net/tag/js/gpt.js",!0,!0),(0,o.sendLog)("initializeGPT()","Appended googletag script to the head tag of the page.",null)}function s(e){var n=e.ad,i=e.correlator,r=void 0!==i&&i,t=e.prerender,o=void 0===t?null:t,a=e.info,s=void 0===a?{}:a;function d(){if(window.blockArcAdsLoad)return"blockArcAdsLoad";window.googletag&&googletag.pubadsReady?window.googletag.pubads().refresh([n],{changeCorrelator:r}):setTimeout((function(){d()}),200)}new Promise((function(e){if(o)try{o(s).then((function(){e("Prerender function has completed.")}))}catch(n){console.warn("ArcAds: Prerender function did not return a promise or there was an error.\n Documentation: https://github.com/washingtonpost/arcads/wiki/Utilizing-a-Prerender-Hook"),e("Prerender function did not return a promise or there was an error, ignoring.")}else e("No Prerender function was provided.")})).then((function(){d()}))}function d(e){window.googletag.cmd.push(e)}function l(e,n){for(var i in n)n.hasOwnProperty(i)&&n[i]&&e.setTargeting(i,n[i])}function c(e){window.googletag.pubads().disableInitialLoad(),window.googletag.pubads().enableSingleRequest(),window.googletag.pubads().enableAsyncRendering(),this.collapseEmptyDivs&&((0,o.sendLog)("dfpSettings()","This wrapper is set to collapse any empty divs.",null),window.googletag.pubads().collapseEmptyDivs()),window.googletag.enableServices(),e&&((0,o.sendLog)("dfpSettings()","This wrapper has a function to call upon the slot render ending.",null),window.googletag.pubads().addEventListener("slotRenderEnded",e))}function u(e,n){var i=(0,t.expandQueryString)("adslot");return!i||""===i&&null===i?"/".concat(e,"/").concat(n):"/".concat(e,"/").concat(i)}},"./src/services/headerbidding.js":(e,n,i)=>{"use strict";i.r(n),i.d(n,{initializeBiddingServices:()=>s,fetchBids:()=>d});var r=i("./src/services/prebid.js"),t=i("./src/services/amazon.js"),o=i("./src/services/gpt.js"),a=i("./src/util/log.js");function s(e){var n=e.prebid,i=void 0!==n&&n,r=e.amazon,o=void 0!==r&&r;if(window.arcBiddingReady)(0,a.sendLog)("initializeBiddingServices()","Header bidding has been previously initialized",null);else{window.arcBiddingReady=!1;var s=new Promise((function(e){if(i&&i.enabled){if("undefined"==typeof pbjs){var n=n||{};n.que=n.que||[]}e("Prebid has been initialized")}else(0,a.sendLog)("initializeBiddingServices()","Prebid is not enabled on this wrapper.",null),e("Prebid is not enabled on the wrapper...")})),d=new Promise((function(e){o&&o.enabled&&window.apstag?o.id&&""!==o.id?(0,t.queueAmazonCommand)((function(){window.apstag.init({pubID:o.id,adServer:"googletag"}),e("Amazon scripts have been added onto the page!")})):(console.warn("ArcAds: Missing Amazon account id. \n Documentation: https://github.com/washingtonpost/arcads#amazon-tama9"),(0,a.sendLog)("initializeBiddingServices()","Amazon is not enabled on this wrapper.",null),e("Amazon is not enabled on the wrapper...")):e("Amazon is not enabled on the wrapper...")}));Promise.all([s,d]).then((function(){window.arcBiddingReady=!0}))}}function d(e){var n=this,i=e.ad,a=e.id,d=e.slotName,l=e.dimensions,c=e.wrapper,u=e.bidding,g=e.correlator,p=void 0!==g&&g,f=e.prerender,b=e.breakpoints,h={adUnit:i,adSlot:d,adDimensions:l,adId:a,bids:u},v=new Promise((function(e){if(c.prebid&&c.prebid.enabled){var t=c.prebid.timeout||700;r.queuePrebidCommand.bind(n,(0,r.fetchPrebidBids)(i,c.prebid.useSlotForAdUnit?d:a,t,h,f,(function(){e("Fetched Prebid ads!")})))}else e("Prebid is not enabled on the wrapper...")})),m=new Promise((function(e){c.amazon&&c.amazon.enabled?(0,t.fetchAmazonBids)(a,d,l,b,(function(){e("Fetched Amazon ads!")})):e("Amazon is not enabled on the wrapper...")}));window.arcBiddingReady?Promise.all([v,m]).then((function(){(0,o.refreshSlot)({ad:i,correlator:p,prerender:f,info:h})})):setTimeout((function(){return s()}),200)}},"./src/services/prebid.js":(e,n,i)=>{"use strict";i.r(n),i.d(n,{queuePrebidCommand:()=>s,fetchPrebidBidsArray:()=>d,fetchPrebidBids:()=>l,addUnit:()=>c});var r=i("./src/services/gpt.js");function t(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,r)}return i}function o(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(n){a(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}function a(e,n,i){return n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,e}function s(e){pbjs.que.push(e)}function d(e,n,i,t,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;pbjs.addAdUnits(t),window.blockArcAdsPrebid||pbjs.requestBids({timeout:i,adUnitCodes:n,bidsBackHandler:function(i){console.log("Bid Back Handler",i),pbjs.setTargetingForGPTAsync(n),a?a():(0,r.refreshSlot)({ad:e,info:t,prerender:o})}})}function l(e,n,i,r,t){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=r;a.bids=Array.isArray(r.bids)?r.bids:[r.bids],d(e,[n],i,a,t,o)}function c(e,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},t=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=o({code:e,bids:i},t);a.mediaTypes={banner:{sizes:n}};var s=r.sizeConfig,d=r.config;pbjs.addAdUnits(a),d?pbjs.setConfig(d):s&&pbjs.setConfig({sizeConfig:s})}},"./src/services/sizemapping.js":(e,n,i)=>{"use strict";i.r(n),i.d(n,{sizemapListeners:()=>s,resizeListeners:()=>d,prepareSizeMaps:()=>l,parseSizeMappings:()=>c,runResizeEvents:()=>u,setResizeListener:()=>g});var r=i("./src/util/debounce.js"),t=i("./src/services/headerbidding.js"),o=i("./src/services/gpt.js"),a=i("./src/util/log.js"),s={},d={};function l(e,n){var i=[],r=[],t=[],o=n.length?n:null;return o&&e&&o.forEach((function(n,o){i.push([n,e[o]]),-1===r.indexOf(n[0])&&(r.push(n[0]),t.push(!1))})),r.sort((function(e,n){return e-n})),{mapping:i,breakpoints:r,correlators:t}}function c(e){try{var n=[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight],i=e.filter((function(e){return e[0][0]<=n[0]&&e[0][1]<=n[1]})),r=i.length>0?i[0][1]:[];return r.length>0&&r[0].constructor!==Array&&(r=[r]),r}catch(n){return(0,a.sendLog)("parseSizeMappings()","invalid size mapping",null),e[e.length-1][1]}}function u(e){var n,i=!1;if(e.breakpoints){var r=window.innerWidth;n=e.breakpoints.filter((function(e){return e<r})).pop()||e.breakpoints[0]}return function(){for(var r,a,d=e.ad,l=e.breakpoints,u=e.id,g=e.bidding,p=e.mapping,f=e.slotName,b=e.wrapper,h=e.prerender,v=window.innerWidth,m=0;m<l.length;m++){if(r=l[m],a=l[m+1],n!==r&&(v>r&&(v<a||!a)||v===r&&!i)){n=r,i=!0;var w=c(p),y={adUnit:d,adSlot:f,adDimensions:w,adId:u};g.prebid&&g.prebid.enabled||g.amazon&&g.amazon.enabled?(0,t.fetchBids)({ad:d,id:u,slotName:f,dimensions:w,bidding:g,wrapper:b,prerender:h,correlator:s[u].correlators[m],breakpoints:l}):(0,o.refreshSlot)({ad:d,correlator:s[u].correlators[m],prerender:h,info:y})}s[u].correlators[m]=!0}}}function g(e){var n=e.id,i=e.correlators;d[n]=(0,r.debounce)(u(e),250),window.addEventListener("resize",d[n]),s[n]={listener:d[n],correlators:i}}},"./src/util/debounce.js":(e,n,i)=>{"use strict";function r(e,n){var i;return function(){for(var r=this,t=arguments.length,o=new Array(t),a=0;a<t;a++)o[a]=arguments[a];clearTimeout(i),i=setTimeout((function(){i=null,e.apply(r,o)}),n)}}i.r(n),i.d(n,{debounce:()=>r})},"./src/util/log.js":(e,n,i)=>{"use strict";i.r(n),i.d(n,{sendLog:()=>o});var r=i("./node_modules/anylogger/anylogger.cjs.js"),t=i.n(r);i("./node_modules/anylogger-console/anylogger-console.cjs.js");function o(e,n,i){try{if("true"===new URLSearchParams(window.location.search).get("debug"))t()("arcads.js")({service:"ArcAds",timestamp:"".concat(new Date),"logging from":e,description:n,slotName:i})}catch(e){console.error(e)}}},"./src/util/mobile.js":(e,n,i)=>{"use strict";function r(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}i.r(n),i.d(n,{MobileDetection:()=>t,default:()=>o});var t=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,i,t;return n=e,t=[{key:"Android",value:function(){return!!navigator.userAgent.match(/Android/i)}},{key:"AndroidOld",value:function(){return!!navigator.userAgent.match(/Android 2.3.3/i)}},{key:"AndroidTablet",value:function(){return!(!navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/Mobile/i))}},{key:"Kindle",value:function(){return!!navigator.userAgent.match(/Kindle/i)}},{key:"KindleFire",value:function(){return!!navigator.userAgent.match(/KFOT/i)}},{key:"Silk",value:function(){return!!navigator.userAgent.match(/Silk/i)}},{key:"BlackBerry",value:function(){return!!navigator.userAgent.match(/BlackBerry/i)}},{key:"iOS",value:function(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)}},{key:"iPhone",value:function(){return!!navigator.userAgent.match(/iPhone|iPod/i)}},{key:"iPad",value:function(){return!!navigator.userAgent.match(/iPad/i)}},{key:"Windows",value:function(){return!!navigator.userAgent.match(/IEMobile/i)}},{key:"FirefoxOS",value:function(){return!!navigator.userAgent.match(/Mozilla/i)&&!!navigator.userAgent.match(/Mobile/i)}},{key:"Retina",value:function(){return window.retina||window.devicePixelRatio>1}},{key:"any",value:function(){return this.Android()||this.Kindle()||this.KindleFire()||this.Silk()||this.BlackBerry()||this.iOS()||this.Windows()||this.FirefoxOS()}}],(i=null)&&r(n.prototype,i),t&&r(n,t),e}();const o=t},"./src/util/query.js":(e,n,i)=>{"use strict";function r(e){var n=window.location.href,i=e.replace(/[[\]]/g,"\\$&"),r=new RegExp("[?&]".concat(i,"(=([^&#]*)|&|#|$)")).exec(n);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null}i.r(n),i.d(n,{expandQueryString:()=>r})},"./src/util/resources.js":(e,n,i)=>{"use strict";function r(e,n,i,r,t){var o=document.createElement(e);"script"===e&&(o.src=n,o.async=i||!1,o.defer=i||r||!1,(document.head||document.documentElement).appendChild(o),t&&t())}i.r(n),i.d(n,{appendResource:()=>r})}},n={};function i(r){var t=n[r];if(void 0!==t)return t.exports;var o=n[r]={exports:{}};return e[r](o,o.exports,i),o.exports}i.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return i.d(n,{a:n}),n},i.d=(e,n)=>{for(var r in n)i.o(n,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},i.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";i.r(r),i.d(r,{ArcAds:()=>p});var e=i("./src/util/mobile.js"),n=i("./src/util/log.js"),t=i("./src/services/headerbidding.js"),o=i("./src/services/gpt.js"),a=i("./src/services/prebid.js"),s=i("./src/services/sizemapping.js");function d(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function l(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return u(e,n);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return u(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var i=0,r=new Array(n);i<n;i++)r[i]=e[i];return r}function g(e){return Array.isArray(e)?1+Math.max.apply(Math,c(e.map((function(e){return g(e)})))):0}var p=function(){function i(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;d(this,i),this.dfpId=r.dfp.id||"",this.wrapper=r.bidding||{},this.positions=[],this.collapseEmptyDivs=r.dfp.collapseEmptyDivs,this.adsList=[],window.isMobile=e.MobileDetection,""===this.dfpId?(console.warn("ArcAds: DFP id is missing from the arcads initialization script.","\n","Documentation: https://github.com/washingtonpost/arcads#getting-started"),(0,n.sendLog)("constructor()","The DFP id missing from the arcads initialization script. ArcAds cannot proceed.",null)):((0,o.initializeGPT)(),(0,o.queueGoogletagCommand)(o.dfpSettings.bind(this,a)),(0,t.initializeBiddingServices)(this.wrapper))}var r,u,p;return r=i,p=[{key:"setAdsBlockGate",value:function(){var e=i.getWindow();void 0!==e&&(e.blockArcAdsLoad=!0)}},{key:"releaseAdsBlockGate",value:function(){var e=i.getWindow();void 0!==e&&(e.blockArcAdsLoad=!1)}},{key:"getWindow",value:function(){return window}}],(u=[{key:"registerAd",value:function(e){var i=e.id,r=e.slotName,t=e.dimensions,s=e.adType,d=void 0!==s&&s,l=e.targeting,u=void 0===l?{}:l,p=e.display,f=void 0===p?"all":p,b=e.bidding,h=void 0!==b&&b,v=e.iframeBidders,m=void 0===v?["openx"]:v,w=e.others,y=void 0===w?{}:w,A=[],j=!1,k=g(t);t&&void 0!==t&&1===k||t&&void 0!==t&&t.length>0&&2===k?A.push.apply(A,c(t)):t&&t.forEach((function(e){A.push.apply(A,c(e))}));try{if(!(u&&u.hasOwnProperty("position")||!1===d)){var P=this.positions[d]+1||1;this.positions[d]=P;var S=Object.assign(u,{position:P});Object.assign(e,{targeting:S})}var z=h.prebid&&(h.prebid.enabled&&h.prebid.bids||void 0===h.prebid.enabled&&h.prebid.bids);if(isMobile.any()&&"mobile"===f||!isMobile.any()&&"desktop"===f||"all"===f){if(z&&this.wrapper.prebid&&this.wrapper.prebid.enabled&&A){pbjs&&m.length>0&&pbjs.setConfig({userSync:{iframeEnabled:!0,filterSettings:{iframe:{bidders:m,filter:"include"}}}});var O=this.wrapper.prebid.useSlotForAdUnit?(0,o.determineSlotName)(this.dfpId,r):i;a.queuePrebidCommand.bind(this,(0,a.addUnit)(O,A,h.prebid.bids,this.wrapper.prebid,y))}(j=this.displayAd.bind(this,e))&&((0,n.sendLog)("registerAd()","Queuing Google Tag command for ad",r),(0,o.queueGoogletagCommand)(j))}}catch(e){console.error("ads error",e)}}},{key:"registerAdCollection",value:function(e){var n=this;e.forEach((function(e){n.registerAd(e)}))}},{key:"registerAdCollectionSingleCall",value:function(e){var i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:700;(0,n.sendLog)("registerAdCollectionSingleCall()","Registering all reserved ads",null),window.blockArcAdsLoad=!0,window.blockArcAdsPrebid=!0,e.forEach((function(e){i.registerAd(e)})),window.blockArcAdsLoad=!1,window.blockArcAdsPrebid=!1,pbjs.requestBids({timeout:r,bidsBackHandler:function(e){console.log("Bid Back Handler",e),pbjs.setTargetingForGPTAsync(),window.googletag.pubads().refresh(window.adsList),window.adsList=[]}})}},{key:"displayAd",value:function(e){var i=e.id,r=e.slotName,a=e.dimensions,d=e.targeting,l=e.sizemap,c=void 0!==l&&l,u=e.bidding,g=void 0!==u&&u,p=e.prerender,f=void 0===p?null:p,b=(0,o.determineSlotName)(this.dfpId,r),h=a&&!a.length?null:a,v=a?window.googletag.defineSlot(b,h,i):window.googletag.defineOutOfPageSlot(b,i);if(c&&c.breakpoints&&a){var m=(0,s.prepareSizeMaps)(h,c.breakpoints),w=m.mapping,y=m.breakpoints,A=m.correlators;if(!v)return(0,n.sendLog)("displayAd()","No ad available to display - the div was either not defined or an ad with the same slot name already exists on the page",r),!1;v.defineSizeMapping(w),c.refresh&&((0,n.sendLog)("displayAd()","Attaching resize listener to the ad with this slot name and sizemap defined",r),(0,s.setResizeListener)({ad:v,slotName:b,breakpoints:y,id:i,mapping:w,correlators:A,bidding:g,wrapper:this.wrapper,prerender:f}))}v&&(v.addService(window.googletag.pubads()),(0,o.setTargeting)(v,d));var j=c&&c.breakpoints?c.breakpoints:[];window.adsList&&v&&adsList.push(v),a&&g&&(g.amazon&&g.amazon.enabled||g.prebid&&g.prebid.enabled)?((0,n.sendLog)("displayAd()","Fetching bids for ad with this slot name",r),(0,t.fetchBids)({ad:v,id:i,slotName:b,dimensions:h,wrapper:this.wrapper,prerender:f,bidding:g,breakpoints:j})):window.blockArcAdsPrebid||((0,n.sendLog)("displayAd()","Refreshing ad with this slot name",r),(0,o.refreshSlot)({ad:v,prerender:f,info:{adUnit:v,adSlot:b,adDimensions:h,adId:i}}))}},{key:"sendSingleCallAds",value:function(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:700;if(this.adsList&&this.adsList.length<1)return(0,n.sendLog)("sendSingleCallAds()","No ads have been reserved on the page",null),!1;window&&window.googletag&&googletag.pubadsReady?(window.googletag.pubads().disableInitialLoad(),window.googletag.pubads().enableSingleRequest(),window.googletag.pubads().enableAsyncRendering(),this.registerAdCollectionSingleCall(this.adsList,i)):setTimeout((function(){e.sendSingleCallAds()}),2e3)}},{key:"reserveAd",value:function(e){i.setAdsBlockGate(),this.adsList.push(e)}},{key:"setPageLeveTargeting",value:function(e,n){googletag.pubads().setTargeting(e,n)}}])&&l(r.prototype,u),p&&l(r,p),i}()})(),r})()})); |
const babelOptions = { | ||
presets: ['env', 'stage-2'], | ||
plugins: ['transform-decorators-legacy', 'babel-plugin-root-import'], | ||
presets: ['@babel/preset-env'], | ||
plugins: ['babel-plugin-root-import'], | ||
}; | ||
module.exports = require('babel-jest').createTransformer(babelOptions) | ||
module.exports = require('babel-jest').default.createTransformer(babelOptions); |
{ | ||
"name": "arcads", | ||
"version": "4.0.1", | ||
"version": "5.0.0-beta.1", | ||
"description": "ArcAds is a GPT wrapper created by Arc Publishing with publishers in mind.", | ||
@@ -8,4 +8,4 @@ "main": "dist/arcads.js", | ||
"test": "jest --config jest.config.js --no-cache --coverage", | ||
"build": "rm -rf dist && webpack --env.production", | ||
"dev": "rm -rf dist && webpack --env.development --watch", | ||
"build": "rm -rf dist && webpack --env production --mode development", | ||
"dev": "rm -rf dist && webpack --env development --mode development --watch", | ||
"docs": "rm -rf docs && ./node_modules/.bin/esdoc && open docs/index.html", | ||
@@ -35,28 +35,25 @@ "debug": "node debugging.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.0.0-beta.37", | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"@babel/core": "^7.15.0", | ||
"@babel/preset-env": "^7.15.0", | ||
"babel-loader": "^8.2.2", | ||
"babel-plugin-root-import": "^5.1.0", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"eslint": "^4.15.0", | ||
"esdoc": "^1.1.0", | ||
"esdoc-standard-plugin": "^1.0.0", | ||
"eslint": "^7.32.0", | ||
"eslint-config-airbnb": "^16.1.0", | ||
"eslint-config-standard": "^11.0.0-beta.0", | ||
"eslint-config-standard": "^16.0.3", | ||
"eslint-import-resolver-webpack": "^0.8.4", | ||
"eslint-loader": "^1.9.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"jest": "^22.0.4", | ||
"uglifyjs-webpack-plugin": "^1.1.6", | ||
"webpack": "^3.10.0", | ||
"webpack-cli": "^3.0.8" | ||
"eslint-webpack-plugin": "^3.0.1", | ||
"jest": "^27.1.0", | ||
"terser-webpack-plugin": "^5.1.4", | ||
"webpack": "^5.51.1", | ||
"webpack-cli": "^4.8.0" | ||
}, | ||
"dependencies": { | ||
"anylogger": "^1.0.10", | ||
"anylogger": "^1.0.11", | ||
"anylogger-console": "^1.0.0", | ||
"esdoc": "^1.0.4", | ||
"esdoc-standard-plugin": "^1.0.0", | ||
"promise-polyfill": "^8.0.0" | ||
"promise-polyfill": "^8.2.0" | ||
}, | ||
"homepage": "https://github.com/washingtonpost/arcads#readme" | ||
} |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { | ||
@@ -42,2 +46,2 @@ fetchAmazonBids, | ||
}); | ||
}); | ||
}); |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { ArcAds } from '../index'; | ||
@@ -2,0 +6,0 @@ import * as gptService from '../services/gpt.js'; |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { ArcAds } from '../index'; | ||
@@ -231,2 +235,2 @@ import * as gptService from '../services/gpt.js'; | ||
}); | ||
}); |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { ArcAds } from '../index'; | ||
@@ -2,0 +6,0 @@ import * as gpt from '../services/gpt'; |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { | ||
@@ -118,2 +122,2 @@ initializeBiddingServices | ||
}); | ||
}); | ||
}); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
@@ -2,0 +5,0 @@ import {MobileDetection} from '../util/mobile.js'; |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { | ||
@@ -84,2 +88,2 @@ queuePrebidCommand, | ||
}); | ||
}); | ||
}); |
@@ -0,4 +1,7 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { expandQueryString } from '../util/query.js'; | ||
describe('expandQueryString', () => { | ||
@@ -34,2 +37,2 @@ | ||
}); | ||
}); | ||
}); |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { ArcAds } from '../index'; | ||
@@ -6,3 +10,2 @@ import * as gptService from '../services/gpt.js'; | ||
describe('registerAds dimensions branches', () => { | ||
@@ -352,2 +355,2 @@ | ||
}); | ||
}); |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import {appendResource} from '../util/resources.js'; | ||
@@ -2,0 +6,0 @@ |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { | ||
@@ -87,2 +91,2 @@ prepareSizeMaps, | ||
}); | ||
}); | ||
}); |
@@ -0,1 +1,5 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import anylogger from 'anylogger'; | ||
@@ -2,0 +6,0 @@ import 'anylogger-console'; |
@@ -1,11 +0,32 @@ | ||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | ||
const ESLintPlugin = require('eslint-webpack-plugin'); | ||
const TerserPlugin = require('terser-webpack-plugin'); | ||
const path = require('path'); | ||
const generatePlugins = function (env) { | ||
const plugins = []; | ||
const generateOptimizations = (env) => { | ||
let optimizations = { | ||
minimize: false | ||
}; | ||
if (env.production) { | ||
plugins.push(new UglifyJsPlugin({ | ||
sourceMap: true, | ||
})); | ||
optimizations.minimize = true; | ||
optimizations.minimizer = [ | ||
new TerserPlugin({ | ||
terserOptions: { | ||
format: { | ||
comments: false, | ||
}, | ||
}, | ||
extractComments: false, | ||
}), | ||
] | ||
} | ||
return optimizations; | ||
}; | ||
const generatePlugins = (env) => { | ||
let plugins = []; | ||
if (env.production) { | ||
plugins.push(new ESLintPlugin()) | ||
} | ||
return plugins; | ||
@@ -20,2 +41,3 @@ }; | ||
libraryTarget: 'umd', | ||
globalObject: 'typeof self !== \'undefined\' ? self : this', | ||
}, | ||
@@ -27,16 +49,8 @@ devtool: env.development ? 'inline-source-map' : false, | ||
{ | ||
loader: 'eslint-loader', | ||
enforce: 'pre', | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
options: { configFile: '.eslintrc.js' }, | ||
}, | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
use: { | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['env'], | ||
plugins: ['transform-decorators-legacy', 'transform-object-rest-spread'], | ||
presets: ['@babel/preset-env'], | ||
}, | ||
@@ -47,3 +61,4 @@ }, | ||
}, | ||
optimization: generateOptimizations(env), | ||
plugins: generatePlugins(env), | ||
}); | ||
}); |
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
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
142638
3
16
2731
1
- Removedesdoc@^1.0.4
- Removedesdoc-standard-plugin@^1.0.0
- Removed@types/node@22.9.0(transitive)
- Removedabab@1.0.4(transitive)
- Removedacorn@2.7.0(transitive)
- Removedacorn-globals@1.0.9(transitive)
- Removedajv@6.12.6(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbabel-code-frame@6.26.0(transitive)
- Removedbabel-generator@6.11.46.26.1(transitive)
- Removedbabel-messages@6.23.0(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbabel-traverse@6.26.0(transitive)
- Removedbabel-types@6.26.0(transitive)
- Removedbabylon@6.18.0(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedboolbase@1.0.0(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcheerio@0.20.00.22.01.0.0-rc.2(transitive)
- Removedcolor-logger@0.0.30.0.6(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedcore-util-is@1.0.21.0.3(transitive)
- Removedcss-select@1.2.0(transitive)
- Removedcss-what@2.1.3(transitive)
- Removedcssom@0.3.8(transitive)
- Removedcssstyle@0.2.37(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddeep-is@0.1.4(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddetect-indent@3.0.14.0.0(transitive)
- Removeddom-serializer@0.1.1(transitive)
- Removeddomelementtype@1.3.1(transitive)
- Removeddomhandler@2.3.02.4.2(transitive)
- Removeddomutils@1.5.1(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedentities@1.0.01.1.2(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedescodegen@1.14.3(transitive)
- Removedesdoc@1.1.0(transitive)
- Removedesdoc-accessor-plugin@1.0.0(transitive)
- Removedesdoc-brand-plugin@1.0.1(transitive)
- Removedesdoc-coverage-plugin@1.1.0(transitive)
- Removedesdoc-external-ecmascript-plugin@1.0.0(transitive)
- Removedesdoc-integrate-manual-plugin@1.0.0(transitive)
- Removedesdoc-integrate-test-plugin@1.0.0(transitive)
- Removedesdoc-lint-plugin@1.0.2(transitive)
- Removedesdoc-publish-html-plugin@1.1.2(transitive)
- Removedesdoc-standard-plugin@1.0.0(transitive)
- Removedesdoc-type-inference-plugin@1.0.2(transitive)
- Removedesdoc-undocumented-identifier-plugin@1.0.0(transitive)
- Removedesdoc-unexported-identifier-plugin@1.0.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@4.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfast-levenshtein@2.0.6(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedfs-extra@1.0.05.0.0(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedglobals@9.18.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhtmlparser2@3.10.13.8.3(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedice-cap@0.0.4(transitive)
- Removedinherits@2.0.4(transitive)
- Removedinvariant@2.2.4(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisarray@0.0.1(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjs-tokens@3.0.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjsdom@7.2.2(transitive)
- Removedjsesc@1.3.0(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsonfile@2.4.04.0.0(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedklaw@1.3.1(transitive)
- Removedlevn@0.3.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.assignin@4.2.0(transitive)
- Removedlodash.bind@4.2.1(transitive)
- Removedlodash.defaults@4.2.0(transitive)
- Removedlodash.filter@4.6.0(transitive)
- Removedlodash.flatten@4.4.0(transitive)
- Removedlodash.foreach@4.5.0(transitive)
- Removedlodash.map@4.6.0(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedlodash.pick@4.4.0(transitive)
- Removedlodash.reduce@4.6.0(transitive)
- Removedlodash.reject@4.6.0(transitive)
- Removedlodash.some@4.6.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedmarked@0.3.19(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimist@1.2.0(transitive)
- Removedms@2.0.0(transitive)
- Removednth-check@1.0.2(transitive)
- Removednwmatcher@1.4.4(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedoptionator@0.8.3(transitive)
- Removedparse5@1.5.13.0.3(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedprelude-ls@1.1.2(transitive)
- Removedpsl@1.10.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedreadable-stream@1.1.143.6.2(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedrepeating@1.1.32.0.1(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsax@1.4.1(transitive)
- Removedsource-map@0.5.70.6.1(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedstring_decoder@0.10.311.3.0(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedsymbol-tree@3.2.4(transitive)
- Removedtaffydb@2.7.22.7.3(transitive)
- Removedto-fast-properties@1.0.3(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedtrim-right@1.0.1(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removedtype-check@0.3.2(transitive)
- Removedundici-types@6.19.8(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)
- Removedwebidl-conversions@2.0.1(transitive)
- Removedwhatwg-url-compat@0.6.5(transitive)
- Removedword-wrap@1.2.5(transitive)
- Removedxml-name-validator@2.0.1(transitive)
Updatedanylogger@^1.0.11
Updatedpromise-polyfill@^8.2.0