(()=>{"use strict";var e={936:(e,t)=>{t.__esModule=!0,t.requester=t.Method=t.Requester=void 0;var n,r=function(){function e(){this.isFetchApiSupported=!!window.fetch}return e.prototype.send=function(e,t,r){var i=this;return new Promise((function(o,s){var a=i.isFetchApiSupported?function(){return i.sendFetch(e,t,r,o,s)}:function(){return i.sendAjax(e,t,r,o,s)};switch(e){case n.BEACON:return i.sendBeacon(t,o,s,r);case n.GET:case n.POST:return a();default:return i.sendJsonp(t,o,s)}}))},e.prototype.sendAjax=function(e,t,n,r,i){var o=this,s=new XMLHttpRequest;s.addEventListener("error",(function(){return o.handleAjaxError(s,e,n,r,i)})),s.open(e,t,!0),s.onreadystatechange=function(){return o.handleAjaxResponse(s,r)},s.setRequestHeader("Content-type","application/json"),s.send(n)},e.prototype.handleAjaxError=function(e,t,n,r,i){0!==e.status?i({name:"AjaxError",message:"Ajax error failed, method: ".concat(t," With data: ").concat(n)}):r("client-cancelled requests")},e.prototype.handleAjaxResponse=function(e,t){4===e.readyState&&t(e.responseText)},e.prototype.sendFetch=function(e,t,n,r,i){var o=this,s={method:e,headers:{"Content-Type":"application/json"},cache:"no-cache"};s.body=n,fetch(t.href,s).then((function(e){return e.text()})).then((function(e){return r(o.parseText(e))})).catch((function(e){return i(e)}))},e.prototype.sendBeacon=function(e,t,n,r){var i=navigator.sendBeacon(e,function(){if(r){var e=new FormData;return Object.keys(r).forEach((function(t){return e.append(t,r[t])})),e}}());i?t(i):n({name:"BeaconError",message:"Beacon error failed, With data: ".concat(r)})},e.prototype.sendJsonp=function(e,t,n){var r=document.getElementsByTagName("head");r&&r.length||n({name:"JSONPError",message:"JSONP error failed"});var i=document.createElement("script");i.src=e.href,r[0].appendChild(i),t(!0)},e.prototype.parseText=function(e){try{return JSON.parse(e)}catch(t){return e}},e}();t.Requester=r,function(e){e.GET="GET",e.POST="POST",e.JSONP="JSONP",e.BEACON="BEACON"}(n=t.Method||(t.Method={})),t.requester=new r},41:(e,t,n)=>{t.__esModule=!0,t.viewability=t.Viewability=void 0;var r=n(936),i=function(){function e(e,t){this.urls=e,this.container=t,this.isIntersectionObserver()&&this.urls.length&&this.observe()}return e.prototype.observe=function(){var e=this;this.intersectionObserver=new IntersectionObserver((function(t,n){return e.handleIntersect(t,n)}),{threshold:.5}),this.intersectionObserver.observe(this.container)},e.prototype.isIntersectionObserver=function(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype},e.prototype.handleIntersect=function(e,t){var n=this;e.forEach((function(e){if(e.intersectionRatio>=.5){var t=n.getViewabilityObserver();setTimeout((function(){return t.observe(n.container)}),1e3)}}))},e.prototype.getViewabilityObserver=function(){var e=this;return new IntersectionObserver((function(t,n){return e.handleViewabilityObserver(t,n)}),{threshold:0})},e.prototype.handleViewabilityObserver=function(e,t){var n=this;e&&e.forEach((function(e){var r;e.intersectionRatio>=.5&&(n.reportOnViewability(),t.unobserve(n.container),null===(r=n.intersectionObserver)||void 0===r||r.unobserve(n.container))}))},e.prototype.reportOnViewability=function(){this.urls.forEach((function(e){var t=new URL(e);return r.requester.send(r.Method.GET,t).then((function(e){})).catch((function(e){}))}))},e}();t.Viewability=i;t.viewability=function(e,t){return new i(e,t)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}var r,i,o,s;r=n(41),i="data-pixel-urls",o="data-wrapper-id",s="[".concat("data-viewability-pixel",'="ob"]'),function(){function e(){var e=this.getScriptAttribute(),t=e.containerId,n=e.pixelUrls;this.containerId=t,this.pixelUrls=this.getPixelUrls(n)}return e.getInstance=function(){return new e},e.prototype.init=function(){if(this.containerId){var e=document.querySelector("#".concat(this.containerId));e&&(0,r.viewability)(this.pixelUrls,e)}},e.prototype.getPixelUrls=function(e){return e?e.split(","):[]},e.prototype.getScriptElement=function(e){return void 0===e&&(e=s),document.querySelector(e)},e.prototype.getScriptAttribute=function(){var e=this.getScriptElement();return{containerId:null==e?void 0:e.getAttribute(o),pixelUrls:null==e?void 0:e.getAttribute(i)}},e}().getInstance().init()})();