/*! For license information please see adkit.js.LICENSE.txt */ (()=>{var t={61:(t,e,n)=>{var r=n(698).default;function o(){"use strict";t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",d=s.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function g(t,e,n,r){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(r||[]);return i(a,"_invoke",{value:T(t,n,s)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=g;var p={};function h(){}function v(){}function m(){}var b={};l(b,c,(function(){return this}));var w=Object.getPrototypeOf,y=w&&w(w(k([])));y&&y!==n&&a.call(y,c)&&(b=y);var S=m.prototype=h.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function n(o,i,s,c){var u=f(t[o],t,i);if("throw"!==u.type){var d=u.arg,l=d.value;return l&&"object"==r(l)&&a.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):e.resolve(l).then((function(t){d.value=t,s(d)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(a,a):a()}})}function T(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return{value:void 0,done:!0}}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=I(i,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=f(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function I(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,I(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},698:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:(t,e,n)=>{var r=n(61)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var a=e[r]={exports:{}};return t[r](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";function t(t,e,n,r,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,o)}function e(e){return function(){var n=this,r=arguments;return new Promise((function(o,a){var i=e.apply(n,r);function s(e){t(i,o,a,s,c,"next",e)}function c(e){t(i,o,a,s,c,"throw",e)}s(void 0)}))}}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function o(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===r(e)?e:String(e)}function a(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);ne&&(clearInterval(a),r(new Error("Timeout:rejected")))}),200)})).catch((function(t){return{error:t}}))},L=function(){var t=new URLSearchParams(window.location.search).get("adcallkw");return t?[t]:void 0},N=function(){return new RegExp("ignorePublicState=true","i").test(window.location.search)},_=function(t){return new Promise((function(e,n){setTimeout(n,t,new Error("timeout"))}))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t||!document.getElementById(t))return!1;var n=document.getElementById(t).parentElement;if(n&&/adWrapper/i.test(n.className)){var r=new RegExp("\\sad(?=\\s|$)","g"),o=R(Array.from(n.children)).filter((function(t){return"SMALL"===t.tagName}));return o.length&&o.forEach((function(t){/advertisement/i.test(t.innerText)&&(t.style.display=e?"block":"none")})),e?r.test(n.className)||(n.className+=" ad"):n.className.replace(r,""),!0}return!1},G=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return new Promise((function(n){var r=setInterval((function(){t()&&(clearInterval(r),n())}),e)}))},F=function(t){var e=!1;return t.forEach((function(t){t.includes(300)&&t.includes(600)&&(e=!0)})),e},U=function(t,e){var n=e.filter((function(e){return t.filter((function(t){return t.adSlotId===e&&F(t.adSize)}))}))[0],r=document.getElementById(n).getBoundingClientRect(),o=r.bottom,a=r.left,i=r.right,s=r.top,c=window,u=c.innerHeight,d=c.innerWidth;return(s>0&&s0&&o0&&a0&&i0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";s(this,t),f(this,"debug",(function(t,e){if("true"===C("adkitDebug")){var n="".concat(Date.now()-S,"ms");console.log("ADKIT: ".concat(t," - ").concat(n," - ").concat(e))}})),f(this,"error",(function(t,e){if("true"===C("adkitDebug")){var n="".concat(Date.now()-S,"ms");console.error("ADKIT: ".concat(t," - ").concat(n," - ").concat(e))}})),e.length&&n.length&&this.debug(e,n)}));var V=function(){function t(e){s(this,t),f(this,"isLoaded",!1),f(this,"global",void 0),f(this,"fnInit",void 0),f(this,"src",void 0),f(this,"id",void 0);var n=e.fnInit,r=e.global,o=e.id,a=void 0===o?"":o,i=e.src;this.fnInit=n,this.global=r,this.id=a,this.isLoaded=!1,this.src=i}var n;return i(t,[{key:"loadScript",value:function(){var t=this;return new Promise((function(e,n){t.fnInit();var r=document.location.protocol,o=document.createElement("script");o.id=t.id,o.type="text/javascript",o.async=!0,o.src="".concat(r,"//").concat(t.src);var a=document.getElementsByTagName("script")[0]||document.body.firstChild;a||n(new Error("".concat(t.src," failed to find a valid location."))),a.parentNode.insertBefore(o,a),o.addEventListener("load",(function(){t.isLoaded=!0,e(o)})),o.addEventListener("error",(function(){n(new Error("".concat(t.src," failed to load.")))}))}))}},{key:"load",value:(n=e(m().mark((function e(){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isLoaded){e.next=9;break}return e.prev=1,e.next=4,this.loadScript();case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),t.logger.error("Error","".concat(this.global," loader error: ").concat(e.t0));case 9:return e.abrupt("return",window[this.global]);case 10:case"end":return e.stop()}}),e,this,[[1,6]])}))),function(){return n.apply(this,arguments)})}]),t}();f(V,"logger",new H);const K=V;var W=encodeURIComponent("\nquery AdTypesByAdIds($input: AdTypesByAdIdsInput!) {\n adTypesByAdIds(input: $input) {\n error {\n message\n }\n lines {\n key\n type\n }\n }\n}\n".replace(/\s+/g," ")),Y=function(){var t=e(m().mark((function t(e){var n,r,o,a,i;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=A.NINE_STAGING===(C("adkitGamId").length?C("adkitGamId"):b.aid)?b.adservingApi.devEndpoint:b.adservingApi.prodEndpoint,r={input:{ids:e}},o=encodeURIComponent(JSON.stringify(r)),a=new URL("https://".concat(n,"?query=").concat(W,"&variables=").concat(o)).toString(),t.next=7,fetch(a,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then((function(t){if(t.status>400)throw new Error("".concat(t.status," ").concat(t.statusText));return t.json()})).then((function(t){var e=t.data.adTypesByAdIds,n=(e=void 0===e?{}:e).lines;return void 0===n?[]:n})).catch((function(t){return console.log("ADKIT: Get line item id failed",t),[]}));case 7:return i=t.sent,t.abrupt("return",i);case 11:return t.prev=11,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return",[]);case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}(),Z=function(){var t=e(m().mark((function t(e){var n,r,o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],e.forEach((function(t){t.lineItemId&&F(t.adSize)&&n.push(t.lineItemId.toString())})),t.next=4,Y(n);case 4:return r=t.sent,o=[],r.forEach((function(t){e.filter((function(e){return F(e.adSize)&&e.lineItemId===parseInt(t.key,10)})).forEach((function(e){o.push({lineItemId:e.lineItemId,lineItemType:t.type,adSlotId:e.adSlotId})}))})),t.abrupt("return",o);case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function J(t){for(var e=1;e=1450?"true":"false",hasFocus:Boolean(!document.hidden).toString()})),{},{brms:n.isMeasurable.toString(),brvs:n.isVisible.toString(),deployEnv:n.pageInfo.deployEnv||"",swgt:s,u:n.userInfo.memberId||"",adKitVersion:n.config.version,nuid:(null===(t=n.adInfo)||void 0===t?void 0:t.keywords.nuid)||C("NUID")||"",sysEnv:n.pageInfo.sysEnv||""})})),f(this,"getSlotById",(function(t){var e=n.getAdConfig();return[].concat(R(e.adLazyloadSlots),R(e.adSlots),R(e.additionalAdSlots)).find((function(e){return t===e.adSlotId}))})),f(this,"getAdConfig",(function(){var t,e,r;return new Q({adExclusions:null!==(t=null===(e=n.adInfo)||void 0===e?void 0:e.adExclusion)&&void 0!==t?t:[],adSlots:(null===(r=n.adInfo)||void 0===r?void 0:r.ads)||[],adUnitPath:n.adUnitPath||"",adTargets:n.getAdCustomTargeting()}).getAllSlots})),this.firstLoad=!0,this.config=b,e?this.config.options=e:e=this.config.options,this.logger=new H("Data","Initialized"),this.startTime=Date.now(),this.isMeasurable=!0,this.isVisible=!0,this.definedSlotsMap=new Map,this.renderedSlots=new Map}return i(t,[{key:"setDataLayerData",value:function(t){this.dataSource=function(t){var e=t.adserving,n=t.page,r=void 0===n?{}:n,o=t.user;return{adData:e,dataSource:t||{},pageInfo:r,userInfo:void 0===o?{}:o}}(t)}},{key:"adInfo",get:function(){return this.dataSource.adData}},{key:"pageInfo",get:function(){return this.dataSource.pageInfo}},{key:"userInfo",get:function(){return this.dataSource.userInfo}},{key:"adUnitPath",get:function(){var t=(this.adInfo||{}).keywords,e=L(),n=t.hierarchy.level1||t.hierarchy.pagelevel01,r=t.hierarchy.level2||t.hierarchy.pagelevel02,o=t.hierarchy.level3||t.hierarchy.pagelevel03,a=[this.config.aid,e?"adtester":n,r,o].filter((function(t){return t}));return"/".concat(a.join("/"))}}]),t}(),nt=i((function t(e,n){s(this,t),f(this,"getScript",(function(t,e){var n,r=document.createElement("script");r.type="text/javascript",r.id="admiralScript";var o=null!==(n=t.brand.get(e))&&void 0!==n?n:t.brand.get("DEFAULT");return r.innerText='!(function(o,n,t){t=o.createElement(n),\n o=o.getElementsByTagName(n)[0],t.async=1,t.id="'.concat(t.id,'",\n t.src="https://teenytinyshirt.com/').concat(o,'",o.parentNode.insertBefore(t,o)})(document,"script"),\n (function(o,n){function t(){(t.q=t.q||[]).push(arguments)}t.v=1,o[n]=o[n]||t})(window,String.fromCharCode(97,100,109,105,114,97,108))\n ;!(function(o,t,n,c){function e(n){(function(){try{return(localStorage.getItem("v4ac1eiZr0")||"").split(",")[4]>0}\n catch(o){}return!1})()&&(n=o[t].pubads())&&n.setTargeting("admiralengaged","true")}(c=o[t]=o[t]||{}).cmd=c.cmd||[],\n typeof c.pubads===n?e():typeof c.cmd.unshift===n?c.cmd.unshift(e):c.cmd.push(e)})(window,"googletag","function");'),r}));var r=this.getScript(e,n);document.getElementsByTagName("head")[0].appendChild(r),window.admiral=window.admiral||function(){(window.q=window.admiral.q||[]).push(arguments)},window.admiral("after","measure.detected",(function(t){var e=new Date;e.setDate(e.getDate()+30),document.cookie="admiral-unblocked=".concat(t.whitelisted,"; expires=").concat(e.toUTCString(),"; path=/;")})),window.admiral("targeting","pause");var o=window.dataLayerHybrid.user.memberType.includes("subscriber")?"subscriber":window.dataLayerHybrid.user.memberType;window.admiral("targeting","set","isSubscribed",o),window.admiral("targeting","ready")})),rt=i((function t(){s(this,t),f(this,"init",(function(){var t=document.createElement("script");return t.id="btloaderblue",t.type="text/javascript",t.src="https://btloader.com/tag?o=5196279419240448&upapi=true",document.getElementsByTagName("head")[0].appendChild(t),t})),this.init()})),ot=i((function t(n){var r=this;s(this,t),f(this,"logger",void 0),f(this,"grapeShotConfig",void 0),f(this,"init",(function(){return new K({fnInit:function(){window.gs_channels=window.gs_channels||[]},global:"gs_channels",src:"".concat(r.grapeShotConfig.url).concat(window.location.href),id:r.grapeShotConfig.id}).load()})),f(this,"fireGrapeshot",function(){var t=e(m().mark((function t(e,n){var o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=!/article/i.test(e),n&&!o&&!N()){t.next=3;break}return t.abrupt("return","Custom Targeting - Grapeshot not enabled on this page");case 3:return t.prev=3,t.next=6,r.init();case 6:return window.googletag.pubads().setTargeting("gs_cat",window.gs_channels),r.logger.debug("Custom Targeting","Grapeshot targeting is set"),t.abrupt("return",{resolved:window.gs_channels});case 11:return t.prev=11,t.t0=t.catch(3),r.logger.error("Error","Custom Targeting - Grapeshot - ".concat(t.t0)),t.abrupt("return",{resolved:[]});case 15:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,n){return t.apply(this,arguments)}}()),this.logger=new H,this.grapeShotConfig=n}));function at(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,s=[],c=!0,u=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}(t,e)||M(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const it=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(this,t),f(this,"timer",void 0),f(this,"end",void 0),f(this,"tid",void 0),f(this,"clear",(function(){return e.end=new Promise((function(t){window.clearTimeout(e.tid),e.tid=null,t("Timeout:clear")})),e.end})),f(this,"set",(function(t){return new Promise((function(n){e.tid=window.setTimeout((function(){n("Timeout:".concat(t,"ms"))}),t)}))})),this.timer=n,this.tid=null,this.end=this.set(this.timer)}return i(t,[{key:"resolved",get:function(){return this.end}}]),t}();var st=i((function t(n){var r=this;s(this,t),f(this,"logger",void 0),f(this,"magniteConfig",void 0),f(this,"targeting",[]),f(this,"loadPromise",void 0),f(this,"pagetype",void 0),f(this,"init",(function(){return r.loadPromise=new K({fnInit:function(){window.pbjs=window.pbjs||{}},global:"pbjs",id:r.magniteConfig.id,src:"".concat(r.magniteConfig.url)}).load(),r.loadPromise})),f(this,"fireMagnite",function(){var t=e(m().mark((function t(e,n,o){var a;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.pagetype=o,n){t.next=3;break}return t.abrupt("return","Custom Targeting - Magnite not enabled on this page");case 3:return t.prev=3,t.next=6,r.getMagniteCustomTargeting(e);case 6:a=t.sent,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),r.logger.error("Custom Targeting","Magnite - ".concat(t.t0));case 12:return t.abrupt("return",a);case 13:case"end":return t.stop()}}),t,null,[[3,9]])})));return function(e,n,r){return t.apply(this,arguments)}}()),f(this,"getMagniteCustomTargeting",function(){var t=e(m().mark((function t(e){var n,o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.loadPromise;case 2:return n=new it(r.magniteConfig.timeout),t.next=5,Promise.race([r.makeBidRequest(e),n.resolved]);case 5:if(t.sent){t.next=8;break}return t.abrupt("return","Magnite: request Bid not found");case 8:return t.next=10,r.setTargeting(e);case 10:return o=t.sent,r.logger.debug("Custom Targeting","Magnite targeting is set"),t.abrupt("return",o);case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),f(this,"generateSlotMapData",(function(e){return e.map((function(e){return t.slotIds.push(e.adSlotId),{name:e.adUnitPath,divId:e.adSlotId,ortb2Imp:{ext:{data:{pos:e.target[0][1],foldposition:e.target[1][1],adUnitPath:e.adUnitPath}}},sizes:e.native?[{w:e.adSize[0][0],h:e.adSize[0][1]}]:e.adSize.map((function(t){return{w:t[0],h:t[1]}}))}}))})),f(this,"makeBidRequest",function(){var n=e(m().mark((function e(n){var o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.pbjs){e.next=2;break}throw new Error("makeBidRequest: window.pbjs NotExist");case 2:return o=r.generateSlotMapData(n),e.abrupt("return",new Promise((function(e,n){window.pbjs.rp.requestBids?(window.pbjs.setConfig({ortb2:{site:{ext:{data:{pagetype:r.pagetype}}}},appnexusAuctionKeywords:{pageType:r.pagetype}}),window.pbjs.que.push((function(){window.pbjs.rp.requestBids({divPatternMatching:!0,slotMap:o,callback:function(n){return e(t.initAdserver(n))},setTargeting:!1})}))):n(new Error("makeBidRequest: window.pbjs.rp.requestBids NotExist"))})));case 4:case"end":return e.stop()}}),e)})));return function(t){return n.apply(this,arguments)}}()),f(this,"setTargeting",function(){var n=e(m().mark((function e(n){var o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.bidData,e.abrupt("return",new Promise((function(t,e){o&&!Object.keys(o).length&&e(new Error("Magnite setTargeting: magnite header bidding data not available"));try{n.forEach((function(t){var e,n=[],a=o[t.adSlotId];return a&&0!==Object.keys(a).length&&Object.entries(a).forEach((function(t){var e=at(t,2),r=e[0],o=e[1];n.push([r,o.toString()])})),r.targeting.push(f({},t.adSlotId,[].concat(n))),(e=t.target).push.apply(e,n)}))}catch(t){e(new Error("Magnite setTargeting: ".concat(t)))}t({resolved:r.targeting})})));case 2:case"end":return e.stop()}}),e)})));return function(t){return n.apply(this,arguments)}}()),f(this,"refreshBids",function(){var t=e(m().mark((function t(e,n){var o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=r.generateSlotMapData(e),t.abrupt("return",new Promise((function(t,e){window.pbjs.rp.requestBids?window.pbjs.que.push((function(){window.pbjs.rp.requestBids({divPatternMatching:!0,slotMap:o,callback:function(){return t(window.pbjs.que.push((function(){window.pbjs.setTargetingForGPTAsync(n)})))}})})):e(new Error("makeBidRequest: window.pbjs.rp.requestBids NotExist"))})));case 5:t.prev=5,t.t0=t.catch(0),r.logger.error("Custom Targeting","Magnite - ".concat(t.t0));case 8:return t.abrupt("return",void 0);case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e,n){return t.apply(this,arguments)}}()),this.magniteConfig=n,this.logger=new H}));f(st,"slotIds",[]),f(st,"bidData",{}),f(st,"initAdserver",(function(t){return 0!==Object.keys(t).length&&(st.slotIds.forEach((function(t){st.bidData[t]=window.pbjs.getAdserverTargetingForAdUnitCode([t])})),!0)}));const ct=st,ut=i((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";s(this,t),f(this,"category",void 0),f(this,"action",void 0),f(this,"label",void 0),f(this,"property",void 0),f(this,"value",void 0),f(this,"creativeid",void 0),this.category=h.ADOPS_TIMING_EVENT,this.action=e,this.label=n,this.property=r,this.value=Date.now(),this.creativeid=o})),dt=i((function t(n,r){var o=this;s(this,t),f(this,"moatConfig",void 0),f(this,"logger",void 0),f(this,"moatResult",void 0),f(this,"moatData",void 0),f(this,"moatCallBackFlag",void 0),f(this,"perfEvent",void 0),f(this,"gamId",void 0),f(this,"init",(function(){return new K({fnInit:function(){window.moatPrebidApi=window.moatPrebidApi||[]},global:"moatPrebidApi",id:o.moatConfig.id,src:o.gamId===A.FAIRFAX?o.moatConfig.url:o.moatConfig.url_nine}).load()})),f(this,"setMoatTargetingData",(function(t){if(!window.moatPrebidApi||!window.moatPrebidApi.safetyDataAvailable())throw new Error("makePreBidRequest: moatPrebidApi NotExist");var e=window.moatPrebidApi.slotDataAvailable();e&&window.moatPrebidApi.setMoatTargetingForAllSlots(),o.moatData={pageLevel:window.moatPrebidApi.getMoatTargetingForPage(),slots:e?o.getMoatSlotInfo(t):void 0}})),f(this,"fireMOAT",function(){var t=e(m().mark((function t(e,n){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return","Custom Targeting - MOAT not enabled on this page");case 2:if(o.isMoatDataAvailable()){t.next=14;break}return t.prev=3,t.next=6,o.getMOATCustomTargeting(e);case 6:o.moatResult=t.sent,t.next=13;break;case 9:t.prev=9,t.t0=t.catch(3),o.moatResult=t.t0.message,o.logger.debug("Error","Custom Targeting - MOAT - ".concat(t.t0.message));case 13:return t.abrupt("return",o.moatResult);case 14:return t.next=16,o.setMoatTargetingData(e);case 16:return t.next=18,o.setTargeting(e);case 18:return o.moatResult=t.sent,o.logger.debug("Custom Targeting","MOAT targeting is set"),t.abrupt("return",o.moatResult);case 21:case"end":return t.stop()}}),t,null,[[3,9]])})));return function(e,n){return t.apply(this,arguments)}}()),f(this,"getMoatCallBack",(function(t){return o.moatCallBackFlag?Promise.reject(new Error("Timeout:rejected")):(o.moatCallBackFlag=!0,o.logger.debug("Custom Targeting","MOAT moatYieldReady callback triggered"),Promise.resolve(o.setMoatTargetingData(t)))})),f(this,"getMOATCustomTargeting",function(){var t=e(m().mark((function t(n){var r,a;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.moatCallBackFlag=!1,window.moatYieldReady=e(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",o.getMoatCallBack(n).catch((function(t){o.logger.error("Error","Custom Targeting - MOAT - ".concat(t))})));case 1:case"end":return t.stop()}}),t)}))),t.next=4,B((function(){return o.moatCallBackFlag}),o.moatConfig.timeout);case 4:if("Timeout:clear"!==(r=t.sent)){t.next=18;break}return t.prev=6,t.next=9,o.setTargeting(n);case 9:return a=t.sent,o.perfEvent=new ut(h.BRAND_SAFETY,"stop","MOAT"),o.logger.debug("Custom Targeting","MOAT targeting is set"),t.abrupt("return",a);case 15:throw t.prev=15,t.t0=t.catch(6),new Error(t.t0);case 18:return o.perfEvent=new ut(h.BRAND_SAFETY,"stop","MOAT"),o.logger.debug("Custom Targeting","MOAT targeting is not set"),t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,null,[[6,15]])})));return function(e){return t.apply(this,arguments)}}()),f(this,"isMoatDataAvailable",(function(){return window.moatPrebidApi&&"function"==typeof window.moatPrebidApi.pageDataAvailable&&window.moatPrebidApi.pageDataAvailable()})),f(this,"setViewabilityTargetingForAllSlots",(function(){return!(!window.moatPrebidApi||"function"!=typeof window.moatPrebidApi.setMoatTargetingForAllSlots||(window.moatPrebidApi.setMoatTargetingForAllSlots(),0))})),f(this,"getMoatSlotInfo",(function(t){var n={};return t.forEach(function(){var t=e(m().mark((function t(e){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n[e.adSlotId]=window.moatPrebidApi.getMoatTargetingForSlot(e.adSlotId);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),n})),f(this,"setTargeting",function(){var t=e(m().mark((function t(e){var n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.setViewabilityTargetingForAllSlots();case 2:if(o.moatData){t.next=4;break}throw new Error("setTargeting: moatData NotExist");case 4:return n=[],void 0!==o.moatData.pageLevel.m_safety&&"waiting"!==o.moatData.pageLevel.m_safety||(o.moatData.pageLevel=window.moatPrebidApi.getMoatTargetingForPage()),o.moatData.pageLevel&&(n=Object.entries(o.moatData.pageLevel).filter((function(t){return t[1]}))),n.length&&n.forEach((function(t){window.googletag.pubads().setTargeting(t[0],t[1])})),o.moatData.slots&&e.forEach((function(t){var e,n=o.moatData.slots[t.adSlotId],r=Object.entries(n).map((function(t){var e=at(t,2);return[e[0],e[1]]}));return(e=t.target).push.apply(e,R(r))})),t.abrupt("return",{resolved:n});case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),this.moatConfig=n,this.gamId=r,this.logger=new H})),lt=function(){function t(n,r){var o=this;s(this,t),f(this,"pubmaticConfig",void 0),f(this,"site",void 0),f(this,"logger",void 0),f(this,"pubmaticTimer",void 0),f(this,"pwtConfig",void 0),f(this,"data",{}),f(this,"targeting",[]),f(this,"loadPromise",void 0),f(this,"init",(function(){return o.loadPromise=new K({fnInit:function(){window.PWT=window.PWT||{}},global:"PWT",id:o.pubmaticConfig.id,src:o.latestPubMaticVersion(o.site)}).load(),o.loadPromise})),f(this,"latestPubMaticVersion",(function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=null!==(t=o.pubmaticConfig.brand[e])&&void 0!==t?t:o.pubmaticConfig.brand.DEFAULT,r="",a=window.location.href;if(a.indexOf("pwtv=")>0){var i=/pwtv=(.*?)(&|$)/g,s=i.exec(a);r=s.length>=2&&s[1].length>0?"/".concat(s[1]):""}return"".concat(o.pubmaticConfig.url+n+r,"/pwt.js")})),f(this,"firePubMatic",function(){var t=e(m().mark((function t(e,n){var r;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return","Custom Targeting - PubMatic Open Wrap not enabled on this page");case 2:return t.prev=2,t.next=5,o.getPubMaticCustomTargeting(e);case 5:r=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),o.logger.error("Custom Targeting","PubMatic - ".concat(t.t0));case 11:return t.abrupt("return",r);case 12:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,n){return t.apply(this,arguments)}}()),f(this,"getPubMaticCustomTargeting",function(){var t=e(m().mark((function t(e){var n,r;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.loadPromise;case 2:return o.pubmaticTimer=new it(o.pubmaticConfig.timeout),t.next=5,Promise.race([o.makeOpenWrapRequest(e),o.pubmaticTimer.resolved]);case 5:if("Timeout:clear"===(n=t.sent)){t.next=8;break}return t.abrupt("return",n);case 8:return t.next=10,o.setTargeting(e);case 10:if(!(r=t.sent).error){t.next=13;break}throw new Error(r.error);case 13:return o.logger.debug("Custom Targeting","PubMatic targeting is set"),t.abrupt("return",r);case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),f(this,"generatePWTConfig",(function(t){return t.length?(void 0===o.pwtConfig&&(o.pwtConfig=[]),o.pwtConfig=t.map((function(t,e){return{adUnitId:t.adUnitPath,adUnitIndex:e.toString(),code:t.adSlotId,divId:t.adSlotId,mediaTypes:{banner:{sizes:t.adSize}},sizes:t.adSize}})),o.pwtConfig):new Error("generatePWTConfig: adSlots NoExist")})),f(this,"makeOpenWrapRequest",(function(t){return new Promise((function(e,n){window.PWT&&window.PWT.requestBids||n(new Error("makeOpenWrapRequest: window.PWT NotExist"));var r=o.generatePWTConfig(t);window.PWT.requestBids(r,(function(t){t.forEach((function(t){o.data[t.code]=t.bidData})),o.pubmaticTimer.clear(),e(o.pubmaticTimer.resolved)}))}))})),f(this,"setTargeting",function(){var t=e(m().mark((function t(e){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,new Promise((function(t,n){o.data&&!Object.keys(o.data).length&&n(new Error("PubMatic setTargeting: pubMaticData NotExist"));try{e.forEach((function(t){var e,n=[];if(void 0===t.adSlotId||void 0===o.data[t.adSlotId])return!1;var r=o.data[t.adSlotId].kvp;return r&&0!==Object.keys(r).length&&Object.entries(r).forEach((function(t){var e=at(t,2),r=e[0],o=e[1];n.push([r,o.toString()])})),o.targeting.push(f({},t.adSlotId,[].concat(n))),(e=t.target).push.apply(e,n)}))}catch(t){n(new Error("PubMatic setTargeting: ".concat(t)))}t({resolved:o.targeting})}));case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",t.t0);case 9:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(e){return t.apply(this,arguments)}}()),this.pubmaticConfig=n,this.site=r,this.logger=new H}return i(t,[{key:"clearPubMaticData",value:function(){this.targeting=[],this.data={}}}]),t}();var gt=i((function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;s(this,t),f(this,"dataStore",void 0),f(this,"instance",void 0),f(this,"add",(function(t){var n;e.dataStore.push(t),null!==(n=e.instance)&&void 0!==n&&n.apiReady()&&e.apply()})),f(this,"apply",(function(){e.dataStore.forEach((function(n){try{n.apply(e.instance)}catch(e){t.log.error("Queue","Apply Error - ".concat(n.toString()," ").concat(e))}}),e),e.clear()})),f(this,"remove",(function(){return e.dataStore.shift()})),f(this,"clear",(function(){e.dataStore=[]})),f(this,"first",(function(){return e.dataStore[0]})),f(this,"last",(function(){return e.dataStore[e.dataStore.length-1]})),f(this,"size",(function(){return e.dataStore.length})),f(this,"isEmpty",(function(){return!e.dataStore.length})),this.dataStore=n,this.instance=r}));f(gt,"log",new H);const ft=gt,pt=function(){function t(e){s(this,t),f(this,"event",void 0),f(this,"schema",void 0),this.event=e?e.event:"",this.schema=e?e.schema:""}return i(t,[{key:"trackEvent",value:function(t){return!!(window.snowplow&&this.event&&this.schema)&&(window.snowplow("trackSelfDescribingEvent:ffx",{data:t,schema:this.schema}),!0)}},{key:"trackStructuredEvent",value:function(t){var e=t.action,n=t.category,r=t.label,o=t.property,a=void 0===o?"":o,i=t.value,s=void 0===i?0:i,c=[{data:{},schema:this.schema}];return!!(window.snowplow&&this.event&&this.schema)&&(window.snowplow(this.event,n,e,r,a,s,c),!0)}}]),t}();var ht=i((function t(n){var r=this;s(this,t),f(this,"logger",void 0),f(this,"amazonConfig",void 0),f(this,"loadPromise",void 0),f(this,"targeting",[]),f(this,"requestManager",{adserverRequestSent:!1,aps:!1}),f(this,"init",(function(){return r.loadPromise=new K({fnInit:function(){window.apstag=window.apstag||{}},global:"apstag",id:r.amazonConfig.id,src:"".concat(r.amazonConfig.url)}).load().then((function(){window.apstag.init({pubID:r.amazonConfig.pubId,adServer:"googletag"})})),r.loadPromise})),f(this,"generateSlotMap",(function(e){return e.reduce((function(e,n){return n.native?e:(t.slotIds.push(n.adSlotId),[].concat(R(e),[{slotID:n.adSlotId,slotName:n.adUnitPath,sizes:n.adSize.reduce((function(t,e){return D.includes(e.join("x"))?[].concat(R(t),[e]):t}),[])}]))}),[])})),f(this,"fireAmazon",function(){var t=e(m().mark((function t(e,n){var o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return","Custom Targeting - Amazon not enabled on this page");case 2:return t.prev=2,t.next=5,r.getAmazonCustomTargeting(e);case 5:o=t.sent,t.next=11;break;case 8:t.prev=8,t.t0=t.catch(2),r.logger.error("Custom Targeting","Amazon - ".concat(t.t0));case 11:return t.abrupt("return",o);case 12:case"end":return t.stop()}}),t,null,[[2,8]])})));return function(e,n){return t.apply(this,arguments)}}()),f(this,"getAmazonCustomTargeting",function(){var t=e(m().mark((function t(e){var n,o;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.loadPromise;case 2:return n=new it(r.amazonConfig.timeout),t.next=5,Promise.race([r.makeAmazonBidRequest(e),n.resolved]);case 5:if(t.sent){t.next=8;break}return t.abrupt("return","Amazon: fetchBids not found");case 8:return t.next=10,G((function(){return!0===r.requestManager.aps}));case 10:return t.next=12,r.setTargeting(e);case 12:return o=t.sent,r.logger.debug("Custom Targeting","Amazon targeting is set"),t.abrupt("return",o);case 15:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),f(this,"setBids",(function(e){return t.slotIds.forEach((function(n){t.bidData[n]=e.find((function(t){return t.slotID===n}))})),r.requestManager.aps=!0,!0})),f(this,"makeAmazonBidRequest",function(){var t=e(m().mark((function t(e){var n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(window.apstag){t.next=2;break}throw new Error("makeAmazonBidRequest: window.apstag NotExist");case 2:return n=r.generateSlotMap(e),t.abrupt("return",new Promise((function(t,e){window.apstag.fetchBids?window.apstag.fetchBids({slots:n},(function(e){return t(r.setBids(e))})):e(new Error("makeAmazonBidRequest: window.apstag.fetchBids NotExist"))})));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),f(this,"setTargeting",function(){var n=e(m().mark((function e(n){var o;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.bidData,e.abrupt("return",new Promise((function(t,e){o&&!Object.keys(o).length&&e(new Error("Amazon setTargeting: amazon header bidding data not available"));try{n.forEach((function(t){var e,n=[],a=o[t.adSlotId];return 0!==a.amzniid.length&&0!==Object.keys(a).length&&Object.entries(a).forEach((function(t){var e=at(t,2),r=e[0],o=e[1];n.push([r,o.toString()])})),r.targeting.push(f({},t.adSlotId,[].concat(n))),(e=t.target).push.apply(e,n)}))}catch(t){e(new Error("Amazon setTargeting: ".concat(t)))}t({resolved:r.targeting})})));case 2:case"end":return e.stop()}}),e)})));return function(t){return n.apply(this,arguments)}}()),f(this,"refreshbid",(function(t){if(!window.apstag)throw new Error("makeAmazonBidRequest: window.apstag NotExist");var e=r.generateSlotMap(t);return new Promise((function(t,n){window.apstag.fetchBids?window.apstag.fetchBids({slots:e},(function(){return t(window.googletag.cmd.push((function(){window.apstag.setDisplayBids()})))})):n(new Error("makeAmazonBidRequest: window.apstag.fetchBids NotExist"))}))})),this.amazonConfig=n,this.logger=new H}));f(ht,"slotIds",[]),f(ht,"bidData",{});const vt=ht;function mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:St;t.config.aid=C("adkitGamId").length?C("adkitGamId"):n.gamId,e.adserving.adSuppression||(t.setDataLayerData(e),t.getPageAds(yt(yt(yt({},t.getAdConfig()),St),n)))})),f(c(t),"updateAds",(function(e){t.destroy(),t.init(e,yt(yt({},St),{},{isUpdateAd:!0,gamId:t.config.aid}))})),f(c(t),"apiReady",(function(){return!!(window.ADKIT.gptInstallPromise&&window.googletag&&window.googletag.apiReady&&t.ready)})),t}return i(o)}(function(t){d(p,t);var n,r,o,a,u=(o=p,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=g(o);if(a){var n=g(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return l(this,t)});function p(t){var n;return s(this,p),f(c(n=u.call(this,t)),"ready",!1),f(c(n),"queue",void 0),f(c(n),"moat",void 0),f(c(n),"gs",void 0),f(c(n),"blockthrough",void 0),f(c(n),"admiral",void 0),f(c(n),"pubmatic",void 0),f(c(n),"magnite",void 0),f(c(n),"sp",void 0),f(c(n),"adSlotData",void 0),f(c(n),"amazon",void 0),f(c(n),"allSlotsRenderedFlag",!1),f(c(n),"count",0),f(c(n),"isMouseOverHalfpageAd",!1),f(c(n),"setupThirdPartyScripts",(function(){var t;n.config.options.enableMOAT&&n.setupMOAT(),n.config.options.enablePubMatic&&n.setupPubmatic(),n.config.options.enableGrapeshot&&n.setupGrapeshot(),n.config.options.enableAdmiral&&(n.admiral=new nt(n.config.admiral,null===(t=n.adInfo)||void 0===t?void 0:t.brand),n.logger.debug("Admiral","Loaded"))})),f(c(n),"isSlotSet",(function(t){return n.slots.find((function(e){return e.getSlotElementId()===t}))})),f(c(n),"setSlots",(function(t){if(!t.length)return n.logger.debug("setSlots","slotsConfig is empty"),!1;"true"===C("admiral-unblocked")?(t.forEach((function(t){var e=t.adUnitPath.split("/");t.adUnitPath="/".concat([e[1],"admiral",e.slice(2)].join("/"))})),window.googletag.pubads().setTargeting("admiral-engaged","true")):0!==window.googletag.pubads().getTargeting("admiral-engaged").length&&window.googletag.pubads().clearTargeting("admiral-engaged");try{return t.forEach((function(t){var e=window.googletag.defineSlot(t.adUnitPath,t.adSize,t.adSlotId);e?(e.setCollapseEmptyDiv(!t.lazyload,!t.lazyload),e.addService(window.googletag.pubads()),t.target.forEach((function(t){return e.setTargeting(t[0],t[1])})),n.definedSlotsMap.set(t.adSlotId,e),n.logger.debug("Request Ad","".concat(t.adSlotId))):n.isSlotSet(t.adSlotId)?n.logger.debug("Request Ad","".concat(t.adSlotId," has been set")):n.logger.error("Error","GPT setSlots Error - definedSlot ".concat(t.adSlotId," is null"))}),c(n)),!0}catch(t){return n.logger.error("Error","GPT setSlots Error - ".concat(t)),!1}})),f(c(n),"render",(function(t){try{return t.forEach((function(t){return window.googletag.display(t)})),!0}catch(t){return n.logger.error("Error","GPT Display Error - ".concat(t)),!1}})),f(c(n),"getSlotAds",(function(t){var e=n.setSlots(t);return{render:n.render(t.map((function(t){return t.adSlotId}))),setSlots:e}})),f(c(n),"getSlotAdsSequence",function(){var t=e(m().mark((function t(e){var r,o,a,i;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.adLazyloadSlots,o=e.adSlots,a=e.additionalAdSlots,n.ready=!0,o.length&&n.getSlotAds(o),n.queue=new ft(window.ADKIT.queue.dataStore,c(n)),window.ADKIT.queue=n.queue,n.queue.apply(),a.length&&n.getSlotAds(a),r.length&&(window.googletag.pubads().enableLazyLoad({fetchMarginPercent:50,renderMarginPercent:20,mobileScaling:2}),n.getSlotAds(r)),n.config.aid===A.FAIRFAX){t.next=18;break}return t.next=11,G((function(){return!0===n.allSlotsRenderedFlag}));case 11:return n.logger.debug("Request Lineitem data","Calling"),t.next=14,Z(n.adSlotData);case 14:i=t.sent,n.logger.debug("Request Lineitem data","Received"),i.forEach((function(t){n.adSlotData=n.adSlotData.map((function(e){return e.adSlotId===t.adSlotId?bt(bt({},e),{},{lineItemType:t.lineItemType}):bt({},e)}))})),n.logger.debug("Request Lineitem data","Data updated for adslots");case 18:n.slots.length===n.renderedSlots.size&&(n.perfEvent=new ut("AD_CALL_TRIGGER","stop","All"),new pt(n.config.snowplow).trackEvent({"adops.batch":[n.perfEvent],"client.deviceType":n.pageInfo.sysEnv,"page.type":n.adInfo.keywords.pageType,"page.viewID":n.pageInfo.viewID||n.pageInfo.pageViewId,"performance.pageReady":0}));case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),f(c(n),"setPubAdsServicConfiguration",(function(t){var e=window.googletag.pubads();n.logger.debug("GPT","Set PubAds Service Configuration"),t.enableAdCentering&&e.setCentering(!0),t.enableSingleRequest&&e.enableSingleRequest(),t.adExclusions.length&&(e.clearCategoryExclusions(),t.adExclusions.forEach((function(t){return e.setCategoryExclusion(t)}))),t.setTargeting.length&&(e.clearTargeting(),t.setTargeting.forEach((function(t){e.setTargeting(t[0],t[1]),"nuid"===t[0]&&e.setPublisherProvidedId(t[1])})));var r=L();r&&e.setTargeting("adcallkw",r),t.isUpdateAd||e.addEventListener("slotRenderEnded",n.slotRendered.bind(c(n)))})),f(c(n),"getPageAds",(function(t){var e={adLazyloadSlots:t.adLazyloadSlots,adSlots:t.adSlots,additionalAdSlots:t.additionalAdSlots};if(/desktop/i.test(n.pageInfo.sysEnv)&&n.config.aid!==A.FAIRFAX){var r=e.adSlots.findIndex((function(t){return void 0!==t.target[3]&&/above/i.test(t.target[1][1])&&/billboard/i.test(t.target[3][1])}));e.adSlots[0]=e.adSlots.splice(r,1,e.adSlots[0])[0]}n.adSlotData=[].concat(R(e.adSlots),R(e.adLazyloadSlots),R(e.additionalAdSlots)),t.isUpdateAd&&n.config.options.enablePubMatic&&n.pubmatic.data&&n.pubmatic.clearPubMaticData(),t.isUpdateAd||n.setupThirdPartyScripts(),window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push((function(){if(!n.adSlotData.length)return n.logger.debug("Requester - getPageAds","adSlots is invalid - length: ".concat(t.adSlots.length)),!1;if(n.logger.debug("GPT","Ad Call Start"),n.setPubAdsServicConfiguration(t),window.googletag.enableServices(),!n.config.options.enableGrapeshot&&!n.config.options.enableMOAT)return n.getSlotAdsSequence(e),!0;try{return n.getCustomTargeting(n.adSlotData).then((function(t){t.forEach((function(t,e){var r,o;void 0===t.value?n.logger.debug("Custom Targeting","".concat(I[e]," is not available")):null!==(r=t.value)&&void 0!==r&&null!==(o=r.resolved)&&void 0!==o&&o.length?n.logger.debug("Custom Targeting","".concat(I[e]," is responsed")):n.logger.debug("Custom Targeting",JSON.stringify(t.value))})),n.logger.debug("Custom Targeting","Done")}),(function(t){n.logger.error("Custom Targeting","".concat(t))})).finally((function(){n.getSlotAdsSequence(e)})),!0}catch(t){return n.logger.error("Custom Targeting","".concat(t)),n.getSlotAdsSequence(e),!1}}))})),f(c(n),"setupMOAT",(function(){n.moat=new dt(n.config.moat,n.config.aid),n.moat.init().then((function(){n.perfEvent=new ut(h.BRAND_SAFETY,"start","MOAT"),n.logger.debug("MOAT","Loaded")}),(function(){n.perfEvent=new ut(h.BRAND_SAFETY,"failed","MOAT"),n.logger.error("MOAT","Failed to load")}))})),f(c(n),"setupPubmatic",(function(){var t;n.pubmatic=new lt(n.config.pubmatic,null===(t=n.adInfo)||void 0===t?void 0:t.brand),n.pubmatic.init().then((function(){n.perfEvent=new ut(h.HEADER_BIDDER,"start","PubMatic"),n.logger.debug("PubMatic","Loaded")}),(function(){n.perfEvent=new ut(h.HEADER_BIDDER,"failed","PubMatic"),n.logger.error("PubMatic","Failed to load")}))})),f(c(n),"setupMagnite",(function(){n.magnite=new ct(n.config.magnite),n.magnite.init().then((function(){n.perfEvent=new ut(h.HEADER_BIDDER,"start","MAGNITE"),n.logger.debug("Magnite","Loaded")}),(function(){n.perfEvent=new ut(h.HEADER_BIDDER,"failed","MAGNITE"),n.logger.error("Magnite","Failed to load")}))})),f(c(n),"setupAmazon",(function(){n.amazon=new vt(n.config.amazon),n.amazon.init().then((function(){n.perfEvent=new ut(h.HEADER_BIDDER,"start","AMAZON"),n.logger.debug("AMAZON","Loaded")}),(function(){n.perfEvent=new ut(h.HEADER_BIDDER,"failed","AMAZON"),n.logger.error("AMAZON","Failed to load")}))})),f(c(n),"setupGrapeshot",(function(){var t,e,r=(null===(t=n.adInfo)||void 0===t?void 0:t.keywords.pageType)||(null===(e=n.adInfo)||void 0===e?void 0:e.keywords.template);if(!/article/i.test(r)||N())return n.logger.debug("Grapeshot","No call made"),!1;var o=document.getElementById(n.config.grapeshot.id);return o&&o.remove(),n.perfEvent=new ut(h.BRAND_SAFETY,"start","GRAPESHOT"),n.gs=new ot(n.config.grapeshot),n.gs.init().then((function(){n.perfEvent=new ut(h.BRAND_SAFETY,"stop","GRAPESHOT"),n.logger.debug("Grapeshot","Loaded")}),(function(){n.perfEvent=new ut(h.BRAND_SAFETY,"failed","GRAPESHOT"),n.logger.error("Grapeshot","Failed to load")})),!0})),f(c(n),"getSlotsById",(function(){try{var t=[];return n.slots.forEach((function(e){var r=n.definedSlotsMap.get(e.getSlotElementId());t.push(r)})),t}catch(t){return n.logger.error("Error","GPT getSlotsById Error - ".concat(t)),[]}})),f(c(n),"destroy",(function(){try{var t=Array.from(n.renderedSlots.keys()),e=window.googletag.destroySlots(t)||window.googletag.destroySlots();return n.slots&&n.slots.length?n.slots.forEach((function(t){n.definedSlotsMap.delete(t.getSlotElementId()),n.renderedSlots.delete(t.getSlotElementId())})):(n.definedSlotsMap.clear(),n.renderedSlots.clear()),e}catch(t){return n.logger.debug("Error","GPT Destroy Error - ".concat(t)),!1}})),n.logger.debug("Requester","Initialized"),n.config.options.enableMagnite&&n.setupMagnite(),n.config.options.enableAmazon&&n.setupAmazon(),n.config.options.enableBlockthrough&&(n.blockthrough=new rt,n.logger.debug("Blockthrough","loaded")),n.config.options.enableSnowplow&&(n.sp=new pt(n.config.snowplow)),n}return i(p,[{key:"slots",get:function(){try{return window.googletag.pubads().getSlots()}catch(t){return this.logger.error("Error","GPT slots Error - ".concat(t)),[]}}},{key:"slotRendered",value:function(t){var e=this,n=t.slot.getSlotElementId(),r=document.getElementById(n);!function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=document.getElementById(t);if(n){var r=n.parentElement&&n.parentElement.classList&&n.parentElement.classList.contains("adWrapper")?n.parentElement.classList:n.classList;r.value&&(r.value=r.value.replace(/(adSize-\d\w+\d)|(noAd)/gim,"")),e?n.style&&(n.style.display="block"):n.style&&(n.style.display="none"),e&&e[0]&&e[1]?r.add("adSize-".concat(e[0],"x").concat(e[1])):r.add("noAd")}}(n,t.size),this.definedSlotsMap.set(n,t);var o=!1;if(r&&r.id&&(o=/-1($|\D)/.test(r.id),/halfpage/i.test(r.id)&&(r.addEventListener("mouseover",(function(){e.isMouseOverHalfpageAd=!0})),r.addEventListener("mouseleave",(function(){e.isMouseOverHalfpageAd=!1})))),t.isEmpty?this.logger.debug("slotRendered","".concat(n," returned but nothing to render")):(this.renderedSlots.set(n,t),null!==t.slot.getResponseInformation()&&this.config.aid!==A.FAIRFAX&&this.adSlotData.forEach((function(r,o){r.adSlotId===n&&(e.adSlotData[o].lineItemId=t.slot.getResponseInformation().lineItemId)})),this.logger.debug("slotRendered","".concat(n))),!t.isEmpty&&t.size&&t.size.length&&o){var a,i,s=function(t,e,n,r){var o,a,i;return t&&970===r.size[0]?(o=!0,a=!1,i="on"):90===r.size[1]||50===r.size[1]||120===r.size[1]||t&&e&&n?(o=!1,a=!0,i="on"):300===r.size[0]||250!==r.size[1]||(e||!t)&&t||(o=!1,a=!1,i="off"),{isBillboard:o,isLeaderboard:a,state:i}}(new RegExp("smh|theage|brisbanetimes|watoday|afr").test(null===(a=this.adInfo)||void 0===a?void 0:a.brand),"homepage"===(null===(i=this.adInfo.keywords)||void 0===i?void 0:i.pageType),"mobile"===this.pageInfo.sysEnv,t);void 0!==s.isBillboard&&void 0!==s.isLeaderboard&&void 0!==s.state&&(document.dispatchEvent(new window.CustomEvent("stickyAd",{detail:bt({},s)})),this.logger.debug("slotRendered","stickyAdEvent size:".concat(t.size[0],"x").concat(t.size[1],", status:").concat(s.state,", isLeaderboard:").concat(s.isLeaderboard,", isBillboard:").concat(s.isBillboard)))}this.count++,this.count===this.slots.length&&(this.allSlotsRenderedFlag=!0),q(n)}},{key:"getCustomTargeting",value:(r=e(m().mark((function t(e){var n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.race([Promise.allSettled([this.amazon?this.amazon.fireAmazon(e,this.config.options.enableAmazon):Promise.resolve("Amazon is undefined"),this.magnite?this.magnite.fireMagnite(e,this.config.options.enableMagnite,this.dataSource.adData.keywords.template||this.dataSource.adData.keywords.pageType):Promise.resolve("Magnite is undefined"),this.pubmatic?this.pubmatic.firePubMatic(e,this.config.options.enablePubMatic):Promise.resolve("Pubmatic is undefined"),this.moat?this.moat.fireMOAT(e,this.config.options.enableMOAT):Promise.resolve("MOAT is undefined"),this.gs?this.gs.fireGrapeshot(this.adInfo.keywords.pageType||this.adInfo.keywords.template,this.config.options.enableGrapeshot):Promise.resolve("Grapeshot is undefined")]),_(2e3)]);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"refresh",value:(n=e(m().mark((function t(){var e,n,r,o,a,i,s,c,u,d=this,l=arguments;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]?l[0]:[],n=z(),0!==e.length&&n){t.next=4;break}return t.abrupt("return",!1);case 4:if(r=U(this.adSlotData,e),0!==(o=e.filter((function(t){return 0===d.adSlotData.filter((function(e){return e.adSlotId===t&&F(e.adSize)&&(/sponsorship/i.test(e.lineItemType)||d.isMouseOverHalfpageAd||!r)})).length}))).length){t.next=8;break}return t.abrupt("return",!1);case 8:if(t.prev=8,a=o.map((function(t){return d.definedSlotsMap.get(t)})),i=[],a.length>0&&a.forEach((function(t){var e=t.slot;e.setTargeting("refresh","true"),i.push(e),q(e.getSlotElementId(),!1)})),!(this.config.options.enablePubMatic&&a.length>0)){t.next=19;break}return this.pubmatic.pwtConfig=void 0,s=[],window.PWT.removeKeyValuePairsFromGPTSlots(i),i.forEach((function(t){var e=t.getSlotElementId(),n=d.definedSlotsMap.get(e),r=t.getSizes();r.forEach((function(t,e){r[e]=Object.values(t)})),s.push(bt(bt({},t),{},{adSlotId:e,adUnitPath:n.slot.getAdUnitPath(),size:r,target:[]}))})),t.next=19,this.pubmatic.firePubMatic(s,!0).catch((function(t){d.logger.error("Error ","Pubmatic Refresh Error - ".concat(t))}));case 19:if(!(this.config.options.enableMagnite&&a.length>0)){t.next=24;break}return c=[],o.forEach((function(t){c.push.apply(c,R(d.adSlotData.filter((function(e){return t===e.adSlotId}))))})),t.next=24,this.magnite.refreshBids(c,o).catch((function(t){d.logger.error("Error ","Magnite Refresh Error - ".concat(t))}));case 24:if(!(this.config.options.enableAmazon&&a.length>0)){t.next=29;break}return u=[],o.forEach((function(t){u.push.apply(u,R(d.adSlotData.filter((function(e){return t===e.adSlotId}))))})),t.next=29,this.amazon.refreshbid(u).catch((function(t){d.logger.error("Error ","Amazon Refresh Error - ".concat(t))}));case 29:return window.googletag.pubads().refresh(i),t.abrupt("return",!0);case 33:return t.prev=33,t.t0=t.catch(8),this.logger.error("Error","GPT Refresh Error - ".concat(t.t0)),t.abrupt("return",!1);case 37:case"end":return t.stop()}}),t,this,[[8,33]])}))),function(){return n.apply(this,arguments)})}]),p}(et));f(Et,"logCurrentTimestamp",Date.now()),f(Et,"log",new H),f(Et,"installGPT",e(m().mark((function t(){var e,n;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Et.log.debug("GPT","Initialized"),!document.getElementById(b.gptid)){t.next=5;break}return Et.log.debug("GPT","Loaded"),Et.prototype.status=!0,t.abrupt("return",window.googletag);case 5:return e=new K({fnInit:function(){return Et.bootstrap()},global:"googletag",id:b.gptid,src:b.gpt}),t.next=8,e.load();case 8:return n=t.sent,Et.log.debug("GPT","Loaded"),Et.prototype.status=!0,t.abrupt("return",n);case 12:case"end":return t.stop()}}),t)})))),f(Et,"bootstrap",(function(){window.googletag=window.googletag||{cmd:[]},Et.log.debug("GPT","Start to load")})),window.ADKIT={gptInstallPromise:Et.installGPT(),queue:new ft};const At=Et;window.Adkit=At})()})();