!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"TapadSdk",(function(){return f}));var r=Object({name:"P&G",pixelUrl:"https://pandg.tapad.com/tag"});function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.iframeUrl=t,this.windowRef=n}var t,n,r;return t=e,(n=[{key:"sync",value:function(e){return this.appendIframe(e)}},{key:"appendIframe",value:function(e){var t=window.document.body||window.document.getElementsByTagName("head")[0],n=window.document.createElement("iframe");return n.height="0",n.width="0",n.frameborder=0,n.src="".concat(this.iframeUrl,"?").concat(this.constructQueryString(e)),n.style.display="none",new Promise((function(e,r){n.onload=function(){return e()},n.onerror=function(e){return r(e)},t.insertBefore(n,t.lastChild)}))}},{key:"constructQueryString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).filter((function(t){return null!=e[t]})).map((function(t){var n=e[t];return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent("object"===o(n)?JSON.stringify(n):n))})).join("&")}}])&&i(t.prototype,n),r&&i(t,r),e}();function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=t,this.config=u({},r,n),this.windowRef=o,this.pixelIframeApi=new a(this.config.pixelUrl,this.windowRef)}var t,n,o;return t=e,(n=[{key:"sync",value:function(e){return this.pixelIframeApi.sync(this.buildQueryParams(e)).then((function(){return{status:"success"}}),(function(e){return{status:"failure",error:e}}))}},{key:"buildQueryParams",value:function(e){return{gdpr:this.metadata.gdpr,us_privacy:this.metadata.ccpa,gdpr_consent:this.metadata.gdpr_consent,referrer_url:this.windowRef.document.referrer,page_url:this.windowRef.document.location.href,owner:this.config.name,bp_id:this.metadata.sid||this.metadata.bpid||this.metadata.bp_id,data:e}}}])&&c(t.prototype,n),o&&c(t,o),e}();f.init=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=new f(e,t,n);return r},window.Tapad=f}]);