var TTDConversionEvents;(()=>{"use strict";var e={d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{argsToSdkFunction:()=>ie});var n={merchantId:null,advertiserId:null,enableDebug:!1,enableCookieSyncing:!0,rootUrl:"https://insight.adsrvr.org",dataProcessingOption:null,pixelVersion:"3.0.0"},i={tcfV2ConsentVersion:2,consentRequestHasTimedOut:!1,waitForConsentTimeout:null,consentCheckExists:!1,isGdprApplicable:!1,gdprConsentString:null},r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n0)return;null==e||e.resolveWith(document,[i])}},bindReady:function(){if(!e){if(e=i._Deferred(),"complete"===document.readyState)return setTimeout((function(){return i.ready()}),1);if(document.addEventListener)document.addEventListener("DOMContentLoaded",t,!1),window.addEventListener("load",(function(){return i.ready()}),!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",t),window.attachEvent("onload",i.ready);var n=!1;try{n=null==window.frameElement}catch(e){console.log(e)}document.documentElement.doScroll&&n&&r()}}},_Deferred:function(){var e,t=[],n=!1,r=!1,o={done:function(){for(var n=[],a=0;a0){var a=e.querySelectorAll(f);a&&a.forEach((function(e){i.includes(e)||i.push(e)}))}for(var s=window.location.hostname,c=document.getElementsByTagName("iframe"),d=0,u=Array.from(c);d0&&l.contentDocument.querySelectorAll(f).forEach((function(e){i.includes(e)||i.push(e)}))}}return i}function O(e,t){var n=0,i=null;return new MutationObserver((function(r,o){var a=Date.now(),s=a-n;s>=t?(n=a,e(r,o)):(i&&clearTimeout(i),i=setTimeout((function(){n=Date.now(),e(r,o)}),t-s))}))}function j(e,t){if(!t.src)return!1;try{var n=e===new URL(t.src).hostname;return n&&R("Iframe "+t.src+" can be accessed"),n}catch(e){return R("error: ",e),!1}}function P(e){var t=e.currentTarget;if(t&&t.__upixel_detection)try{D(t.__upixel_detection.root,t.__upixel_detection.scopeName,t.__upixel_detection.config)}catch(e){R(e)}}function U(e,t){return function(e,t){var n=/((([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,}))/i;if(t.detectionSubject.includes("email")&&n.test(e)){var i=function(e){return e.toLowerCase().trim()}(e.match(n)[0]);return R("We detected email: "+i),function(e,t){if(e&&t){var n=new CustomEvent("detected-identifier",{detail:{identifier:e,type:t}});R("Dispatched event with identifier: ",e," and type: ",t),window.dispatchEvent(n)}}(i,"email"),!0}return!1}(e,t)}function R(e){for(var t=[],n=1;n0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=200&&a.status<300)r(a.response);else{var n=ue(a);o(a.response),oe(e,t,n)}},a.onerror=function(){return Y(n,void 0,void 0,(function(){var n;return Z(this,(function(i){return n=ue(a),o(a.statusText),oe(e,t,n),[2]}))}))},a.send(JSON.stringify(e))}))}(g,e).catch(se)}function oe(e,t,n){return Y(this,void 0,void 0,(function(){var i,r,o,a;return Z(this,(function(s){var c,d;return i="universal_pixel_realtime_fallback_"+t.pixel_ids.join("_"),ae("trigger GET realtime conversion event fallback"),c=e.data[0],d=Object.entries(c).filter((function(e){var t=e[0],n=e[1];return("string"==typeof n||"number"==typeof n||"boolean"==typeof n||"pixel_ids"===t)&&null!=n&&""!==n})),r=d.map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join("&"),o=ee.pixelVersion,a="".concat(ee.rootUrl,"/track/rt"),""!==r&&(a+="?"+r+"&eds=".concat("JsSdkGet")+"&edsv=".concat(o)+"&rt_fallback=1"),""!==n&&(a+="&rt_fbErr=".concat(n)),b(a,i,"TTD Universal Pixel Realtime Fallback"),[2]}))}))}function ae(e){ee.enableDebug&&console.info("TTD Pixel v3: "+e)}function se(e){ee.enableDebug&&console.error("TTD Pixel v3: "+e)}function ce(e,t,n,i,r,o){return Y(this,void 0,void 0,(function(){var a,s,c,d,u;return Z(this,(function(l){if(!e||""==e||!t||t.length<=0)return ae("no advertiser id or pixel id given"),[2];if(a="https://"+new URL(n).hostname,s={advertiserId:e,pixelIds:t,rootUrl:a,uidConfig:r,referrerUrl:o},c={adv:e,pixel_ids:t,referrer_url:o},i)for(d in i)u=i[d],"cookie_sync"===d?s.enableCookieSyncing="1"===u:void 0!==u&&(c[d]="fmt"===d&&"number"==typeof u?u.toString():u),"fmt"!==d||"4"!==u&&4!==u||(s.enableCookieSyncing=!1);return window.ttdConversionEventsLayer.push(["init",s]),setTimeout((function(){var e;!window._uidSdkListenerLock||(null===(e=ee.uidConfig)||void 0===e?void 0:e.uid_token)?window.ttdConversionEventsLayer.push(["event",c]):document.addEventListener("visibilitychange",de)}),1e3),[2]}))}))}function de(e){return Y(this,void 0,void 0,(function(){return Z(this,(function(t){return"hidden"===document.visibilityState&&(re(e,!1),document.removeEventListener("visibilitychange",de)),[2]}))}))}function ue(e){var t,n=null!==(t=e.responseText)&&void 0!==t?t:JSON.parse(e.responseText);return(null==n?void 0:n.Message)?n.Message:0!==e.status||e.responseText?"Status Code ".concat(e.status):"Request never hit server. Possible CSP violation."}window.ttdConversionEventsLayer=window.ttdConversionEventsLayer||[],window.ttdConversionEvents=null!==($=window.ttdConversionEvents)&&void 0!==$?$:{activeDetection:null,startDetection:null},ne(),window.ttdConversionEventsLayer.push=function(e){return Array.prototype.push.call(window.ttdConversionEventsLayer,e),ie(e),this.length},window.ttd_dom_ready=_,window.TTDUniversalPixelApi=function(e){this.init=function(t,n,i,r,o){ce(null!=t?t:void 0,null!=n?n:void 0,null!=i?i:void 0,null!=r?r:void 0,null!=o?o:void 0,null!=e?e:void 0)}},window.ttd_up_api={topLevelUrl:"",set_top_level_url:function(e){this.topLevelUrl=e},init:function(e,t,n,i,r){ce(e,t,n,i,r,this.topLevelUrl)}},TTDConversionEvents=t})();