2025-03-22 00:49:46 +01:00

1 line
71 KiB
JavaScript

!function(){"use strict";var t=function(){function t(t){this.funnel=t,this.initialCallPromise=null,this.maxCallDelayMs=2e3}return t.prototype.callPixel=function(t,e){var n=this;return this.funnel.withRaceProtection((function(){return new Promise((function(r){Object.entries(e).forEach((function(e){var n=e[0],r=e[1];void 0!==r&&t.searchParams.append(n,r)}));var o=new Image;o.addEventListener("load",(function(){1==o.width&&1==o.height?r({isThirdPartyTrackable:!1}):r({isThirdPartyTrackable:!0})})),o.addEventListener("error",(function(){1==o.width&&1==o.height?r({isThirdPartyTrackable:!1}):r({isThirdPartyTrackable:!0})})),window.setTimeout((function(){r({isThirdPartyTrackable:!1})}),n.maxCallDelayMs),o.src=t.toString()}))}))},t}();function e(e){return new t(e)}var n=function(){function t(){this.initialCallPromise=null}return t.prototype.withRaceProtection=function(t){return null===this.initialCallPromise?(this.initialCallPromise=t(),this.initialCallPromise):this.initialCallPromise.then((function(){return t()}))},t.create=function(){return new t},t}();var r=["tcf2","implied","usp","noConsent","auto","gpp"],o=function(){function t(){}return t.parseStringOrNull=function(t){return null==t||null==t?null:t.toString()},t.parseString=function(t){return t.toString()},t.parseStringArray=function(t){if(Array.isArray(t)){for(var e=!0,n=0;n<t.length&&e;n++)"string"!=typeof t[0]&&(e=!1);if(e)return t;throw new Error("There are non strings in the array")}throw new Error("Expected array but got ".concat(t))},t.parseBoolean=function(t){if("boolean"==typeof t)return t;throw new Error("Expected boolean, but got ".concat(t))},t.parseObject=function(t){if("object"==typeof t)return t;throw new Error("Expected object, got ".concat(t))},t.parseOptions=function(e){return e?t.parseObject(e):{}},t.validateOptCallback=function(e){return e?t.validateCallback(e):void 0},t.validateCallback=function(t){if("function"==typeof t)return t;throw new Error("Expected callback function, but got ".concat(t))},t.parseCmpName=function(e){var n=r.find((function(n){return n===t.parseString(e)}));if(n)return n;throw new Error("Invalid cmp name: ".concat(e))},t.parseSeatId=function(t){if(/^[a-zA-Z0-9\.-]+$/.test(t))return t;throw new Error('Invalid seat id "'.concat(t,'"'))},t}(),i=function(t,e,n){var r=this;this.sdkStates=t,this.globalContext=e,this.commandParser=n,this.ope=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{var n=o.parseSeatId(t[0]),i=o.parseString(t[1]),a=r.commandParser.parse(n,i,t.slice(2));null!==a&&r.sdkStates.set(n,a.run(r.sdkStates.get(n),r.globalContext))}catch(t){}}},a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var c,u=function(t){return"string"==typeof t&&a.test(t)},s=new Uint8Array(16);function l(){if(!c&&!(c="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return c(s)}for(var p=[],f=0;f<256;++f)p.push((f+256).toString(16).substr(1));var h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(p[t[e+0]]+p[t[e+1]]+p[t[e+2]]+p[t[e+3]]+"-"+p[t[e+4]]+p[t[e+5]]+"-"+p[t[e+6]]+p[t[e+7]]+"-"+p[t[e+8]]+p[t[e+9]]+"-"+p[t[e+10]]+p[t[e+11]]+p[t[e+12]]+p[t[e+13]]+p[t[e+14]]+p[t[e+15]]).toLowerCase();if(!u(n))throw TypeError("Stringified UUID is invalid");return n};var d,y=function(t,e,n){var r=(t=t||{}).random||(t.rng||l)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return h(r)},v=function(){function t(t){this.storage=t}return t.instance=function(e){return new t(e)},t.prototype.getIds=function(){var t=this.getFpid();return this.isOptedOut()||!u(t)?{}:{fpid:t}},t.prototype.getOrCreateFpid=function(e){if(this.isOptedOut()||!(null==e?void 0:e.trackingEnabled()))return{};var n=this.getFpid();if(!u(n))try{var r=y();return this.storage.setItem(t.key,r),{fpid:r}}catch(t){return{}}return n?{fpid:n}:{}},t.prototype.getFpid=function(){try{return this.storage.getItem(t.key)}catch(t){return null}},t.prototype.setFpid=function(e){try{return this.storage.setItem(t.key,e),e}catch(t){return null}},t.prototype.removeFpid=function(){try{this.storage.removeItem(t.key)}catch(t){}},t.prototype.isOptedOut=function(){try{return this.storage.getItem(t.trackingStatusKey)===t.optedOut}catch(t){return!1}},t.prototype.optin=function(){var e;try{this.storage.removeItem(t.trackingStatusKey)}catch(t){var n=new Error("First party id optin failed with: ".concat(null!==(e=null==t?void 0:t.message)&&void 0!==e?e:t.toString));throw n.name="FpidOptinError",n}},t.prototype.optout=function(){var e;try{this.storage.setItem(t.trackingStatusKey,t.optedOut)}catch(t){var n=new Error("First party id optout failed with: ".concat(null!==(e=null==t?void 0:t.message)&&void 0!==e?e:t.toString));throw n.name="FpidOptoutError",n}},t.prototype.getPapiParameters=function(t){return this.getOrCreateFpid(t)},t.key="ope_fpid",t.trackingStatusKey="ope_fpid_tracking_status",t.optedOut="opted_out",t}(),g=function(){function t(t,e){this.document=t,this.domain=e,this.length=null}return t.prototype.getItem=function(t){var e=this.readCookie(t);if(e)return e;var n=localStorage.getItem(t);return n?(localStorage.removeItem(t),this.setItem(t,n),n):null},t.prototype.setItem=function(t,e){var n=new Date,r=new Date;return r.setFullYear(n.getFullYear()+1),this.setCookie(t,e,r)},t.prototype.removeItem=function(t){var e=new Date;e.setSeconds(42),this.setCookie(t,"",e)},t.prototype.clear=function(){this.removeItem(v.key)},t.prototype.setCookie=function(t,e,n){var r="".concat(t,"=").concat(e,";Expires=").concat(n.toUTCString(),";Path=/;Domain=").concat(this.domain,";SameSite=Lax");return this.document.cookie=r,e},t.prototype.readCookie=function(t){var e=this.document.cookie.split(";").find((function(e){return e.trim().startsWith(t)}));return e?e.split("=")[1].trim():null},t.prototype.key=function(t){throw"Not implemented!"},t}(),w=function(){function t(t,e){this.seat=t,this.cb=e}return t.prototype.run=function(t){var e,n=this;try{return this.action(t).then((function(){var t;return null===(t=n.cb)||void 0===t?void 0:t.call(n,null,!0)}),(function(t){var e;return null===(e=n.cb)||void 0===e?void 0:e.call(n,t,!1)})),t}catch(n){return null===(e=this.cb)||void 0===e||e.call(this,n,!1),t}},t.prototype.getFpidProvider=function(t){var e=t.firstPartyDomain?new g(document,t.firstPartyDomain):localStorage;return v.instance(e)},t}(),m=(d=function(t,e){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},d(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),b=function(t){function e(e,n,r){var o=t.call(this,e,r)||this;return o.tenant=n,o}return m(e,t),e.prototype.run=function(t){var e,n=this;try{return this.action(t).then((function(){var t;return null===(t=n.cb)||void 0===t?void 0:t.call(n,null,!0)}),(function(t){var e;return null===(e=n.cb)||void 0===e?void 0:e.call(n,t,!1)})),t}catch(n){return null===(e=this.cb)||void 0===e||e.call(this,n,!1),t}},e.prototype.getFpidProvider=function(t){var e=t.firstPartyDomain?new g(document,t.firstPartyDomain):localStorage;return v.instance(e)},e}(w),S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),k=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},O=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},P=function(t){function e(e,n,r,o,i){var a=t.call(this,e,n,i)||this;return a.email=r,a.language=o,a}return S(e,t),e.prototype.action=function(e){return k(this,void 0,void 0,(function(){var n;return O(this,(function(r){switch(r.label){case 0:return n=t.prototype.getFpidProvider.call(this,e).getFpid(),[4,e.taggerGdprClient.dataAccess(this.seat,this.tenant,this.email,this.language,n)];case 1:return r.sent(),[2]}}))}))},e}(b),_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),C=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},x=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},E=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.tenant=n,o}return _(e,t),e.prototype.action=function(e){return C(this,void 0,void 0,(function(){var n,r;return x(this,(function(o){switch(o.label){case 0:return n=t.prototype.getFpidProvider.call(this,e),r=n.getFpid(),n.optout(),[4,e.taggerGdprClient.optOut(this.seat,this.tenant,r)];case 1:return o.sent(),[2]}}))}))},e}(b),I=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),T=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},A=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},F=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.tenant=n,o}return I(e,t),e.prototype.action=function(e){return T(this,void 0,void 0,(function(){var n,r=this;return A(this,(function(o){switch(o.label){case 0:return n=t.prototype.getFpidProvider.call(this,e).getFpid(),[4,e.taggerGdprClient.dataDeletion(this.seat,this.tenant,n)];case 1:return o.sent(),[4,new Promise((function(t,n){new E(r.seat,r.tenant,(function(e,r){e?n(e):r?t():n("failed optout")})).run(e)}))];case 2:return o.sent(),[2]}}))}))},e}(b),j=function(t){this.args=t,this.metric="sdk-consent-delayed"},D=function(t){this.args=t,this.metric="sdk-consent-rejected"},U=function(t){this.args=t,this.metric="sdk-consent-error"};function R(t,e){return function(n){var r=function(t,e){var n=new URL("".concat(e.metric),t);return Object.entries(e.args).forEach((function(t){var e=t[0],r=t[1];n.searchParams.set(e,r)})),n}(new URL("".concat(e,"/v2/metrics/"),t),n),o=new XMLHttpRequest;o.open("GET",r.toString()),o.send()}}R(new URL("https://tagger.opecloud.com"),"undefined");var L=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.message=e.errorMessage,n}return L(e,t),e.errorMessage="failed to locate consent framework",e}(Error);var N=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},V=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},K=function(){function t(t){this.storage=t}return t.prototype.withConsent=function(t){return N(this,void 0,void 0,(function(){return V(this,(function(e){switch(e.label){case 0:return[4,t.deviceAccessOk()];case 1:if(e.sent())return[2,this.storage];throw Error("Missing consent for accessing device storage.")}}))}))},t.prototype.removeItem=function(t){this.storage.removeItem(t)},t}(),G=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},z=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},q=function(){function t(t,e,n){this.storageKey=t,this.pStorage=e,this.ttlMs=n}return t.prototype.get=function(t,e){return G(this,void 0,void 0,(function(){var n,r;return z(this,(function(o){switch(o.label){case 0:return[4,this.pStorage.withConsent(t)];case 1:return n=o.sent(),r=this.load(n),e in r&&r[e].exp>Date.now()?[2,r[e].value]:[2,null]}}))}))},t.prototype.put=function(t,e,n){return G(this,void 0,void 0,(function(){var r,o;return z(this,(function(i){switch(i.label){case 0:return[4,this.pStorage.withConsent(t)];case 1:return r=i.sent(),(o=this.load(r))[e]={exp:Date.now()+this.ttlMs,value:n},this.save(r,this.removeExpiredEntries(o)),[2]}}))}))},t.prototype.removeExpiredEntries=function(t){var e=Date.now();return Object.fromEntries(Object.entries(t).filter((function(t){t[0];return t[1].exp>e})))},t.prototype.load=function(t){var e=t.getItem(this.storageKey);return this.deserialize(e)},t.prototype.save=function(t,e){t.setItem(this.storageKey,this.serialize(e))},t.prototype.serialize=function(t){return JSON.stringify(t)},t.prototype.deserialize=function(t){return t?JSON.parse(t):{}},t}();function $(t){if(0===t.length)return 0;for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}var J=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},B=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}};var Y=function(){function t(e,n,r){this._cache=new q(t.localStorageKey(r),e,n)}return t.localStorageKey=function(e){switch(e){case"contextual":return t.contextualKey;case"fullProfile":return t.profileKey;default:throw Error("Unknown papi CacheInstanceType: '".concat(e,"'"))}},t.instance=function(e){return new t(new K(localStorage),t.defaultTtl,e)},t.prototype.get=function(t,e){return J(this,void 0,void 0,(function(){return B(this,(function(n){return[2,this._cache.get(t,$(e).toString())]}))}))},t.prototype.put=function(t,e,n){return J(this,void 0,void 0,(function(){return B(this,(function(r){return[2,this._cache.put(t,$(e).toString(),n)]}))}))},t.contextualKey="opecloud_papi_c",t.profileKey="opecloud_papi_p",t.cacheInstances=new Map,t.defaultTtl=864e5,t}();function Q(){try{return"eu-central-1"}catch(t){return""}}var H=function(){var t=this;this.promise=new Promise((function(e,n){t.reject=n,t.resolve=e}))},W=(function(){function t(t,e){if(this.idSpace=t,this.cpid=e,!t||!/^[^\s\:]+$/.test(t))throw Error("Invalid idSpace '".concat(t,"' for cpid"));if(!e||!/^[^\s\:]+$/.test(e))throw Error("Invalid value '".concat(e,"' for cpid"))}t.prototype.toString=function(){return"".concat(this.idSpace,":").concat(this.cpid)}}(),function(){function t(){this.cpid=null,this.optedOut=!1}return t.prototype.getIds=function(){var t=this.cpid;return!this.isOptedOut()&&this.cpid?{cpid:t.toString()}:{}},t.prototype.getPapiParameters=function(t){return this.isOptedOut()?{}:this.getCpid()},t.prototype.getCpid=function(){return null!==this.cpid&&null!==this.cpid.cpid&&null!==this.cpid.idSpace?{cpid:this.cpid.cpid,idSpace:this.cpid.idSpace}:{}},t.prototype.optin=function(){throw new Error("Optout state for custom provided identifiers cannot be modified through the SDK")},t.prototype.optout=function(){throw new Error("Optout state for custom provided identifiers cannot be modified through the SDK")},t.prototype.isOptedOut=function(){return this.optedOut},t.prototype.set=function(t,e){this.cpid=t,this.optedOut=e},t.prototype.clear=function(){this.cpid=null,this.optedOut=!1},t}()),X=function(){return X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},X.apply(this,arguments)},Z=function(){function t(e,n,r,o){if(void 0===r&&(r=!0),this.isInitialized=!1,this.resolvableOnInit=new H,this.resolvableOnSetCookieCompleted=new H,this.resolvableOnThirdPartyTrackability=new H,this.onInit$=this.resolvableOnInit.promise,this.onSetCookieCompleted$=this.resolvableOnSetCookieCompleted.promise,this.name=t.strategyName,this.isThirdPartyTrackable$=this.resolvableOnThirdPartyTrackability.promise,this.cpidProvider=new W,n){var i=o?new g(document,o):localStorage;this.fpidProvider=v.instance(i)}e||this.initialize(),r||this.resolvableOnSetCookieCompleted.resolve()}return t.parseAdaptiveTracking=function(e){var n,r,o;if(e&&e.name!==t.strategyName)throw"Unknown strategy name: ".concat(e.name);return new t(null!==(n=null==e?void 0:e.awaitUserSignal)&&void 0!==n&&n,null===(r=null==e?void 0:e.fpidEnabled)||void 0===r||r,null===(o=null==e?void 0:e.awaitSetCookieCompleted)||void 0===o||o,null==e?void 0:e.firstPartyIdTrackingDomain)},t.progInstance=function(e){return new t(!1,!0,!0,e)},t.prototype.initialize=function(){this.isInitialized||(this.isInitialized=!0,this.resolvableOnInit.resolve())},t.prototype.firstVisitEventSent=function(){this.resolvableOnSetCookieCompleted.resolve()},t.prototype.setThirdPartyTrackability=function(t){this.resolvableOnThirdPartyTrackability.resolve(t)},t.prototype.identifyUser=function(t,e){this.cpidProvider.set(t,e),this.initialize(),this.resolvableOnSetCookieCompleted.resolve()},t.prototype.logoutUser=function(){this.initialize(),this.cpidProvider.clear()},t.prototype.getIds=function(){var t,e,n=null===(t=this.fpidProvider)||void 0===t?void 0:t.getIds(),r=null!==(e=this.cpidProvider.getIds())&&void 0!==e?e:{};return X(X({},n),r)},t.prototype.getOrCreateIds=function(t){var e,n,r=null===(e=this.fpidProvider)||void 0===e?void 0:e.getOrCreateFpid(t),o=null!==(n=this.cpidProvider.getIds())&&void 0!==n?n:{};return X(X({},r),o)},t.prototype.discardTrackingEvents=function(){var t,e;return this.cpidProvider.isOptedOut()||null!==(e=null===(t=this.fpidProvider)||void 0===t?void 0:t.isOptedOut())&&void 0!==e&&e},t.prototype.getPapiParameters=function(t){var e,n;return X(X({},null!==(n=null===(e=this.fpidProvider)||void 0===e?void 0:e.getPapiParameters(t))&&void 0!==n?n:{}),this.cpidProvider.getPapiParameters(t))},t.strategyName="adaptive",t}(),tt=function(){return tt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},tt.apply(this,arguments)},et=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},nt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},rt=function(){function t(t,e,n,r){this.seat=t,this.tenant=e,this.papiUrl=n,this.trackingStrategy=r}return t.progInstance=function(e){var n,r,o=null!==(n=e.seat)&&void 0!==n?n:"pdmp",i=null!==(r=e.profileApiUrl)&&void 0!==r?r:"https://".concat(o,".papi-public.").concat(Q(),".dmp.3lift.com/v1/targeting");return new t(o,e.tenantId,new URL(i),Z.progInstance())},t.prototype.determineProfileCacheKey=function(){return this.trackingStrategy.getIds().cpid||"adaptive_tracking"},t.prototype.getContextual=function(t){return et(this,void 0,void 0,(function(){return nt(this,(function(e){switch(e.label){case 0:return[4,this.fetchPapi(this.contextualTargetingUrl(t))];case 1:return[2,e.sent()]}}))}))},t.prototype.getCacheBackedContextual=function(t){var e=this;return new Promise((function(n,r){e.getContextual().then((function(r){e.updateCache(t,r),n(r)})),e.loadContextualFromCache(t).then((function(t){n(t)}))}))},t.prototype.loadContextualFromCache=function(t){var e=this.pageUrl();return new Promise((function(n,r){Y.instance("contextual").get(t,e).then((function(t){if(null!=t){var e={t:t.content,s:t.kid?"":[],kid:null==t?void 0:t.kid};n(e)}}))}))},t.prototype.getProfile=function(t,e){return et(this,void 0,void 0,(function(){var n;return nt(this,(function(r){switch(r.label){case 0:return[4,t.consent];case 1:return(n=r.sent()).trackingEnabled()?[2,this.fetchPapi(this.profileTargetingUrl(n,e))]:[2,this.getContextual(e)]}}))}))},t.prototype.getCacheBackedProfile=function(t){var e=this;return new Promise((function(n,r){e.getProfile(t).then((function(r){e.updateCache(t,r),n(r)})),e.loadProfileFromCache(t).then((function(t){n(t)}))}))},t.prototype.loadProfileFromCache=function(t){var e=this,n=this.determineProfileCacheKey();return new Promise((function(r,o){Y.instance("fullProfile").get(t,n).then((function(n){null!=n&&e.loadContextualFromCache(t).then((function(t){var e=tt({t:t.t,s:n.content},(t.kid||n.kid)&&{kid:t.kid||n.kid});r(e)}))}))}))},t.prototype.updateCache=function(t,e){return et(this,void 0,void 0,(function(){return nt(this,(function(n){return(null==e?void 0:e.t)&&Y.instance("contextual").put(t,this.pageUrl(),tt({content:e.t},e.kid&&{kid:e.kid})),(null==e?void 0:e.s)&&Y.instance("fullProfile").put(t,this.determineProfileCacheKey(),tt({content:e.s},e.kid&&{kid:e.kid})),!e.t&&e.s,[2]}))}))},t.prototype.fetchPapi=function(t){return et(this,void 0,void 0,(function(){var e,n,r;return nt(this,(function(o){switch(o.label){case 0:return[4,this.fetchFromUrl(t)];case 1:return(e=o.sent()).status>=400?(n=Error,r="Fetch failed: ",[4,e.text()]):[3,3];case 2:throw n.apply(void 0,[r+o.sent()]);case 3:return[2,e]}}))}))},t.prototype.fetchFromUrl=function(t){return fetch(t.toString(),{referrerPolicy:"no-referrer-when-downgrade",mode:"cors",credentials:"include"}).then((function(t){return t.json()}),(function(t){}))},t.prototype.papiRequestUrl=function(t){for(var e=new URL("",this.papiUrl),n=0,r=Object.entries(t);n<r.length;n++){var o=r[n],i=o[0],a=o[1];e.searchParams.set(i,a)}return e},t.prototype.getTenantQueryParams=function(){return this.tenant?{tenant:this.tenant}:{}},t.prototype.profileTargetingUrl=function(t,e){var n=null!=e?e:this.pageUrl();return this.papiRequestUrl(tt(tt(tt({url:n},this.trackingStrategy.getPapiParameters(t)),t.papiParameters()),this.getTenantQueryParams()))},t.prototype.contextualTargetingUrl=function(t){null!=t||this.pageUrl();return this.papiRequestUrl(tt({url:this.pageUrl(),gdpr_applies:"1",consent_string:""},this.getTenantQueryParams()))},t.prototype.pageUrl=function(){return window.location.href},t}(),ot=function(){return ot=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ot.apply(this,arguments)},it=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},at=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},ct=function(){function t(t){this.url=null,this.url=t}return t.prototype.sendRequest=function(t,e,n,r,o,i){return void 0===n&&(n={}),void 0===r&&(r={}),it(this,void 0,void 0,(function(){var a,c,u,s,l,p,f,h;return at(this,(function(d){switch(d.label){case 0:for(a=new URL(e,this.url),c=0,u=Object.entries(n);c<u.length;c++)s=u[c],l=s[0],p=s[1],a.searchParams.set(l,p);f=ot(ot({},i),{referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",method:t,credentials:"include",headers:r}),(null==o?void 0:o.contentType)&&(f.headers=ot(ot({},f.headers),{"Content-Type":o.contentType})),(null==o?void 0:o.content)&&(f.body=o.content),d.label=1;case 1:return d.trys.push([1,3,,4]),[4,fetch(a.toString(),f)];case 2:if((h=d.sent()).ok)return[2,h.text()];throw{status:h.status,statusText:h.statusText};case 3:throw d.sent();case 4:return[2]}}))}))},t}(),ut=function(){function t(t){this.taggerUrl=t,this.httpClient=new ct(t)}return t.prototype.optOut=function(t,e,n){var r={contentType:"application/x-www-form-urlencoded",content:this.encodeAsFormUrlString({fpid:null!=n?n:""})},o=e?"/".concat(t,"/").concat(e,"/v2/tagger/optout"):"/".concat(t,"/v2/tagger/optout");return this.httpClient.sendRequest("POST",o,{},{},r)},t.prototype.optIn=function(t,e,n){var r=n?{fpid:n}:{},o=e?"/".concat(t,"/").concat(e,"/v2/tagger/optout"):"/".concat(t,"/v2/tagger/optout");return this.httpClient.sendRequest("DELETE",o,r)},t.prototype.dataDeletion=function(t,e,n){var r={contentType:"application/x-www-form-urlencoded",content:this.encodeAsFormUrlString({fpid:null!=n?n:""})},o=e?"/".concat(t,"/").concat(e,"/v2/tagger/delete"):"/".concat(t,"/v2/tagger/delete");return this.httpClient.sendRequest("POST",o,{},{},r)},t.prototype.dataAccess=function(t,e,n,r,o){var i={contentType:"application/x-www-form-urlencoded",content:this.encodeAsFormUrlString({email:n,languageCode:r,fpid:null!=o?o:""})},a=e?"/".concat(t,"/").concat(e,"/v2/tagger/access"):"/".concat(t,"/v2/tagger/access");return this.httpClient.sendRequest("POST",a,{},{},i)},t.prototype.encodeAsFormUrlString=function(t){return Object.entries(t).map((function(t,e){var n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&")},t}(),st=function(){return st=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},st.apply(this,arguments)},lt=function(){function t(t,e){this.dcAPIUrl=t,this.funnel=e,this.httpClient=new ct(this.dcAPIUrl)}return t.prototype.ingestEvent=function(t,e,n,r){var o=this;return void 0===r&&(r={}),this.funnel.withRaceProtection((function(){return o.httpClient.sendRequest("POST",t,n?{fpid:n}:{},{},{contentType:"text/plain",content:JSON.stringify(e)},st({redirect:"follow"},r))}))},t.initializeClient=function(e,n){return new t(e,n)},t.visitEndpoint="/web/visit",t.eventEndpoint="/ingest/event",t}(),pt=function(){return pt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pt.apply(this,arguments)},ft=function(){function t(){}return t.chooseUrlAndRef=function(t,e,n,r,o){return window.parent!=window?{url:e||r||n,ref:o}:{url:e||n,ref:r||o}},t.fromVisitEvent=function(t){var e=this.chooseUrlAndRef(window,t.visiturl,t.url,t.ref,t.tref);return{ope_channel:"tagger",ope_event_type:"ope_visit",ope_item_uri:e.url,ope_ref:e.ref,ope_dc_region:t.dcRegion}},t.fromCustomEvent=function(t){var e=this.chooseUrlAndRef(window,void 0,t.url,t.ref,t.tref),n=e.url,r=e.ref;return pt(pt({},t.content),{ope_channel:"tagger-custom",ope_event_type:t.type,ope_item_uri:n,ope_ref:r})},t}(),ht=function(){return ht=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ht.apply(this,arguments)},dt=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},yt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},vt=function(){function t(t,e,n,r,o,i,a,c){this.seat=t,this.dcapiClient=e,this.consent=n,this.trackingStrategy=r,this.storage=o,this.cookiesyncBaseUrl=i,this.tenant=a,this.cookieSyncIntervalMillis=c,this.cookiesyncEndpoint="/".concat(this.seat,"/v2/cookiesync"),this.localNextCookieSync=null}return t.progInstance=function(e){return new t(e.seat,e.dcapiClient,e.consent,Z.progInstance(e.firstPartyIdTrackingDomain),e.storage,void 0,e.tenant,432e5)},t.prototype.checkTrackingConsent=function(t){if(this.trackingStrategy.discardTrackingEvents())throw"Tracking events should be discarded.";if(!t.trackingEnabled())throw"Consent has not been given."},t.prototype.enrichEvent=function(t,e,n){var r=n.extraEventProperties();return e.cpid&&(r=ht(ht({},r),{ope_user_id:e.cpid})),this.tenant&&(r=ht(ht({},r),{ope_tenant:this.tenant})),ht(ht({},t),r)},t.prototype.setThirdPartyTrackability=function(t){if("cookie"==t||"chips"==t)this.trackingStrategy.setThirdPartyTrackability(!0);else{if("fpid"!==t&&"cpid"!==t)throw"Unknown mode returned by visit API: ".concat(t);this.trackingStrategy.setThirdPartyTrackability(!1)}},t.prototype.sendVisitEvent=function(t){return dt(this,void 0,void 0,(function(){var e,n,r,o,i,a,c;return yt(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),[4,Promise.all([this.consent,this.trackingStrategy.onInit$])];case 1:return e=u.sent(),n=e[0],e[1],this.checkTrackingConsent(n),r=ft.fromVisitEvent(t),o=this.trackingStrategy.getOrCreateIds(n),i=this.enrichEvent(r,o,n),[4,this.dcapiClient.ingestEvent(lt.visitEndpoint,i,o.fpid,null)];case 2:return a=u.sent(),this.setThirdPartyTrackability(a),this.trackingStrategy.firstVisitEventSent(),"cookie"==a&&this.dispatchCookieSync(n),[3,4];case 3:return c=u.sent(),this.onRejection("VisitEvent",c),[3,4];case 4:return[2]}}))}))},t.prototype.dispatchCookieSync=function(t){if(this.cookieSyncIntervalMillis){var e=this.localNextCookieSync;try{e||(e=this.storage.getItem("ope_cs"))}catch(t){}var n=Date.now();if(e&&parseInt(e)>n)return;var r=Date.now()+this.cookieSyncIntervalMillis;try{this.storage.setItem("ope_cs",r.toString())}catch(t){}this.localNextCookieSync=r.toString()}if(this.cookiesyncBaseUrl){var o=new URL(this.cookiesyncEndpoint,this.cookiesyncBaseUrl);Object.entries(t.extraEventProperties()).forEach((function(t){var e=t[0],n=t[1];void 0!==n&&o.searchParams.append(e,n)})),this.loadImage(o.toString())}},t.prototype.loadImage=function(t){var e=this,n=new Image;n.addEventListener("error",(function(t){e.storage.removeItem("ope_cs")})),n.src=t},t.prototype.sendCustomEvent=function(t){return dt(this,void 0,void 0,(function(){var e,n,r,o,i,a,c;return yt(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),[4,Promise.all([this.consent,this.trackingStrategy.onInit$])];case 1:return e=u.sent(),n=e[0],e[1],this.checkTrackingConsent(n),r=ft.fromCustomEvent(t),o=this.trackingStrategy.getOrCreateIds(n),i=this.enrichEvent(r,o,n),[4,this.dcapiClient.ingestEvent(lt.visitEndpoint,i,o.fpid,null)];case 2:return a=u.sent(),this.setThirdPartyTrackability(a),"cookie"==a&&this.dispatchCookieSync(n),[3,4];case 3:return c=u.sent(),this.onRejection("CustomEvent",c),[3,4];case 4:return[2]}}))}))},t.prototype.onRejection=function(t,e){},t}(),gt=function(){return gt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},gt.apply(this,arguments)},wt=function(){function t(t){t.sendVisitEvent(bt({}))}return t.prototype.processSendVisitCommand=function(){throw Error('"sendVisit" command is not supported with automatic visit provider')},t}(),mt=function(){function t(t){this.tracker=t}return t.prototype.processSendVisitCommand=function(t){this.tracker.sendVisitEvent(bt(t))},t}();function bt(t){return gt(gt({},function(){var t,e;return{url:window.location.href,ref:document.referrer,tref:null===(e=null===(t=window.top)||void 0===t?void 0:t.document)||void 0===e?void 0:e.referrer}}()),{tz:(new Date).getTimezoneOffset()/60,screen:window.screen.width+"x"+window.screen.height+"x"+window.screen.colorDepth,visiturl:t.visitUrl,dcRegion:Q()})}var St=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},kt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Ot=function(){function t(t){this.privacyAwareStorage=t}return t.instance=function(){return new t(new K(localStorage))},t.prototype.update=function(t,e,n,r){return St(this,void 0,void 0,(function(){return kt(this,(function(n){switch(n.label){case 0:return[4,e.consent];case 1:return n.sent().trackingEnabled()||this.remove(),[4,e.deviceAccessOk()];case 2:return n.sent()&&this.doUpdate(t,e,r),[2]}}))}))},t.prototype.doUpdate=function(t,e,n){return St(this,void 0,void 0,(function(){var r,o=this;return kt(this,(function(i){return r=t.getProfile(e,n).catch((function(t){return{error:t.message||"Unknown error"}})),[2,this.privacyAwareStorage.withConsent(e).then((function(t){return St(o,void 0,void 0,(function(){var e,n;return kt(this,(function(o){switch(o.label){case 0:return e=this.save,n=[t],[4,r];case 1:return e.apply(this,n.concat([o.sent()])),[2]}}))}))}),(function(t){return St(o,void 0,void 0,(function(){return kt(this,(function(t){return[2,void 0]}))}))}))]}))}))},t.prototype.save=function(e,n){e.setItem(t.localStorageKey,JSON.stringify(n))},t.prototype.remove=function(){this.privacyAwareStorage.removeItem(t.localStorageKey)},t.localStorageKey="opecloud_ctx",t}(),Pt=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},_t=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Ct=function(){function t(t){this.timeoutInMillis=2e3,this.consent=this.loadConsent(t)}return t.prototype.deviceAccessOk=function(){return Pt(this,void 0,void 0,(function(){return _t(this,(function(t){switch(t.label){case 0:return this.deviceAccessRestricted?[3,1]:[2,!0];case 1:return[4,this.consent];case 2:return[2,t.sent().deviceAccessAllowed()]}}))}))},t.prototype.isAvailable=function(){var t=this,e=this.ping().then((function(){return!0})),n=new Promise((function(e){return setTimeout((function(){return e(!1)}),t.timeoutInMillis)}));return Promise.race([e,n])},t}(),xt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Et=function(){function t(){}return t.prototype.applies=function(){return!0},t.prototype.trackingEnabled=function(){return!0},t.prototype.deviceAccessAllowed=function(){return!0},t.prototype.extraEventProperties=function(){return{cmpstatus:"notrequired"}},t.prototype.consentString=function(){return null},t.prototype.papiParameters=function(){return{}},t}(),It=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deviceAccessRestricted=!1,e}return xt(e,t),e.prototype.loadConsent=function(t){return Promise.resolve(new Et)},e.prototype.ping=function(){return Promise.resolve()},e}(Ct),Tt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),At=function(){function t(){}return t.prototype.applies=function(){return!0},t.prototype.trackingEnabled=function(){return!1},t.prototype.deviceAccessAllowed=function(){return!1},t.prototype.extraEventProperties=function(){return{}},t.prototype.consentString=function(){return null},t.prototype.papiParameters=function(){return{}},t}(),Ft=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deviceAccessRestricted=!0,e}return Tt(e,t),e.prototype.loadConsent=function(t){return Promise.resolve(new At)},e.prototype.ping=function(){return Promise.resolve()},e}(Ct);function jt(){return Math.random().toString().substring(2)}var Dt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ut=function(){function t(t){this.tcData=t}return t.prototype.applies=function(){return!1!==this.tcData.gdprApplies},t.prototype.checkVendorConsent=function(){var t,e,n=null===(e=null===(t=this.tcData)||void 0===t?void 0:t.vendor)||void 0===e?void 0:e.consents;return void 0!==n&&!0===n[this.vendorId]},t.prototype.purposeConsent=function(t){var e,n,r;return!!(null===(r=null===(n=null===(e=this.tcData)||void 0===e?void 0:e.purpose)||void 0===n?void 0:n.consents)||void 0===r?void 0:r[t])},t.prototype.legitimateInterest=function(t){var e,n,r;return!!(null===(r=null===(n=null===(e=this.tcData)||void 0===e?void 0:e.purpose)||void 0===n?void 0:n.legitimateInterests)||void 0===r?void 0:r[t])},t.prototype.deviceAccessAllowed=function(){var t=this.checkVendorConsent()&&this.purposeConsent(1);return!this.applies()||t},t.prototype.trackingEnabled=function(){return!this.applies()||this.checkConsent()},t.prototype.extraEventProperties=function(){return{cmpstatus:this.applies()?"cmpconsent":"gdprdoesnotapply",tcString:this.tcData.tcString}},t.prototype.consentString=function(){return this.tcData.tcString},t.prototype.papiParameters=function(){return{gdpr_applies:this.applies()?"1":"0",consent_string:this.tcData.tcString}},t}(),Rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vendorId=92,e}return Dt(e,t),e.prototype.checkConsent=function(){var t=this;return this.checkVendorConsent()&&this.purposeConsent(1)&&[3,5,7,8,9].every((function(e){return t.purposeConsent(e)||t.legitimateInterest(e)}))},e}(Ut),Lt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.vendorId=28,e}return Dt(e,t),e.prototype.checkConsent=function(){var t=this;return this.checkVendorConsent()&&[1,2,3,4,7,9,10].every((function(e){return t.purposeConsent(e)}))},e}(Ut),Mt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deviceAccessRestricted=!0,e}return Dt(e,t),e.prototype.locateTcfFrame=function(t){return t.frames.__tcfapiLocator||t==window.top?t:this.locateTcfFrame(t.parent)},e.prototype.registerTcfListener=function(t,e,n){window.addEventListener("message",n,!1),this.locateTcfFrame(window).postMessage({__tcfapiCall:{command:t,version:2,callId:e}},"*")},e.prototype.loadConsent=function(t){var e=this;return new Promise((function(n){var r=jt();e.registerTcfListener("addEventListener",r,(function(e){var o=e.data.__tcfapiReturn;o&&o.callId===r&&o.success&&(null==(i=o.returnValue)||function(t){return["useractioncomplete","tcloaded"].includes(t.eventStatus)}(i)&&("ope"==t?n(new Rt(i)):"tpl"==t&&n(new Lt(i))));var i;o&&o.callId===r&&o.success}))}))},e.prototype.ping=function(){var t=this;return new Promise((function(e){var n=jt();t.registerTcfListener("ping",n,(function(t){var r=t.data.__tcfapiReturn;r&&r.callId===n&&r.success?e():r&&r.callId===n&&r.success}))}))},e}(Ct),Nt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vt=function(){function t(e){if(!(null==e?void 0:e.match(t.regex)))throw new Error("invalid uspString: ".concat(e));this.uspString=e.toUpperCase()}return t.prototype.ccpaApplies=function(){return"1---"!=this.uspString},Object.defineProperty(t.prototype,"salesOptOut",{get:function(){var t,e=null===(t=this.uspString)||void 0===t?void 0:t.charAt(2);return"Y"===e||"N"!==e&&null},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return this.uspString},t.regex=/^[1][nNyY-][nNyY-][nNyY-]$/,t}(),Kt=function(){function t(t){this.uspData=t;try{this.uspString=new Vt(null==t?void 0:t.uspString)}catch(e){throw new Error("failed to initialize USPConsent. uspData: ".concat(t,", error: ").concat(e.message))}}return t.prototype.applies=function(){return this.uspString.ccpaApplies()},t.prototype.trackingEnabled=function(){return!this.uspString.ccpaApplies()||!this.uspString.salesOptOut},t.prototype.deviceAccessAllowed=function(){return!0},t.prototype.extraEventProperties=function(){return{uspstatus:this.uspString.ccpaApplies()?this.uspString.salesOptOut?"uspoptoutsaleconsent":"uspoptoutsalenoconsent":"ccpadoesnotapply"}},t.prototype.consentString=function(){return this.uspString.toString()},t.prototype.papiParameters=function(){return{}},t}(),Gt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deviceAccessRestricted=!0,e}return Nt(e,t),e.prototype.loadConsent=function(t){return new Promise((function(t,n){var r=jt();function o(t){return t.frames.__uspapiLocator?t:t==window.top?null:o(t.parent)}window.addEventListener("message",(function(e){var o=e.data.__uspapiReturn;if((null==o?void 0:o.callId)===r)if(o.success)try{var i=new Kt(o.returnValue);t(i)}catch(t){n(t)}else n(new Error(o.returnValue))}),!1),function t(n,r,i){void 0===r&&(r=e.retries);void 0===i&&(i=e.delay);return new Promise((function(e,a){var c=o(n);c?e(c):r>0?setTimeout((function(){return e(t(n,r-1,i))}),i):a(new M)}))}(window).then((function(t){t.postMessage({__uspapiCall:{callId:r,command:"getUSPData",version:1}},"*")})).catch((function(){n(new M)}))}))},e.prototype.ping=function(){return this.consent.then((function(t){}))},e.delay=100,e.retries=20,e}(Ct),zt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),qt=function(){function t(t,e){if(this.gppData=t,this.gppString=e,!t)throw Error("gppData must be defined to parse");this.optedOut=this.getOptoutFromField(t,"SharingNotice",[1])||this.getOptoutFromField(t,"SaleOptOutNotice",[1])||this.getOptoutFromField(t,"SharingOptOutNotice",[1])||this.getOptoutFromField(t,"TargetedAdvertisingOptOutNotice",[1])||this.getOptoutFromField(t,"SensitiveDataProcessingOptOutNotice",[0])||this.getOptoutFromField(t,"SensitiveDataLimitUseNotice",[0])||this.getOptoutFromField(t,"SaleOptOut",[2])||this.getOptoutFromField(t,"SharingOptOut",[2])||this.getOptoutFromField(t,"TargetedAdvertisingOptOut",[2])||this.getOptoutFromField(t,"SensitiveDataProcessing",[0])||this.getOptoutFromField(t,"KnownChildSensitiveDataConsents",[0])||this.getOptoutFromField(t,"PersonalDataConsents",[0,2]),1==t.MspaCoveredTransaction&&(this.optedOut||(this.optedOut=this.getOptoutFromField(t,"MspaOptOutOptionMode",[0,1])||this.getOptoutFromField(t,"MspaServiceProviderMode",[0,2])))}return t.prototype.getOptoutFromField=function(t,e,n){if(!(e in t))throw Error("gppdata field should be present: ".concat(e));return!n.includes(t[e])},t.prototype.applies=function(){return!0},t.prototype.deviceAccessAllowed=function(){return!this.optedOut},t.prototype.trackingEnabled=function(){return!this.optedOut},t.prototype.consentString=function(){return this.gppString},t.prototype.extraEventProperties=function(){return{}},t.prototype.papiParameters=function(){return{gppString:this.gppString}},t}(),$t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deviceAccessRestricted=!0,e.listenerId=null,e}return zt(e,t),e.prototype.locateGppFrame=function(t){return t.frames.__gppLocator||t==window.top?t:this.locateGppFrame(t.parent)},e.prototype.loadConsent=function(t){var e=this;return new Promise((function(t){var n=jt();window.addEventListener("message",(function(e){var r=e.data.__gppReturn;r&&r.callId===n&&r.success?function(e){if(e&&e.data){if(function(t){if("signalStatus"!==t.eventName||"ready"!==t.data)return!1;if("usnat"in t.pingData.parsedSections)return!0;return!1}(e)){var n=e.pingData.gppString,r=new qt(e.pingData.parsedSections.usnat,n);t(r)}}else;}(r.returnValue):r&&r.callId===n&&r.success}),!1),e.locateGppFrame(window).postMessage({__gppCall:{command:"addEventListener",version:1,callId:n}},"*")}))},e.prototype.ping=function(){var t=this;return new Promise((function(e){var n=jt();window.addEventListener("message",(function(t){var r=t.data.__gppReturn;r&&r.callId===n&&r.success?e():r&&r.callId===n&&r.success}),!1),t.locateGppFrame(window).postMessage({__gppCall:{command:"ping",version:1,callId:n}},"*")}))},e}(Ct),Jt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.deviceAccessRestricted=!0,e}return Jt(e,t),e.prototype.loadConsent=function(t){var e=this;return new Promise((function(n,r){e.frameworks=[new Mt(t),new Gt(t),new $t(t)],e.frameworks.map((function(t){return t.consent})).forEach((function(t){t.then((function(t){t.applies()&&n(t)})).catch((function(t){}))})),Promise.allSettled(e.frameworks.map((function(t){return t.isAvailable()}))).then((function(t){var n=e.frameworks.filter((function(n,r){var o=t[r];return e.frameworkShouldBeConsidered(o)}));return Promise.allSettled(n.map((function(t){return t.consent})))})).then((function(t){e.pickSignalOutOfAllSettled(t,n,r)}))}))},e.prototype.ping=function(){return Promise.resolve()},e.prototype.frameworkShouldBeConsidered=function(t){if("fulfilled"==t.status)return t.value;if(t.reason instanceof M)return!1;try{return t.reason.message!==M.errorMessage}catch(t){return!0}},e.prototype.pickSignalOutOfAllSettled=function(t,e,n){var r=t.find((function(t){return"fulfilled"==t.status&&t.value.applies()})),o=t.find((function(t){return"rejected"==t.status&&!(t.reason instanceof M)})),i=t.find((function(t){return"fulfilled"==t.status}));r?e(r.value):o?n(o.reason):e(i?new Et:new At)},e}(Ct),Yt=function(){function t(){}return t.initialize=function(t,e){switch(t){case"tcf2":return new Mt(e);case"implied":return new It(e);case"usp":return new Gt(e);case"auto":return new Bt(e);case"noConsent":return new Ft(e);case"gpp":return new $t(e);default:throw new Error("Privacy framework '".concat(t,"' not supported"))}},t}();function Qt(t,e,n,r){return void 0===n&&(n=0),void 0===r&&(r=0),new Promise((function(o,i){t().then(o).catch((function(a){r<e?setTimeout((function(){Qt(t,e,n,r+1).then(o).catch(i)}),n):i(a)}))}))}var Ht,Wt=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},Xt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Zt=function(){function t(t,e,n,r,o,i,a,c,u){void 0===i&&(i=4),void 0===a&&(a=40),void 0===c&&(c=window),void 0===u&&(u=864e5),this.tenantId=t,this.storage=e,this.tracker=n,this.consent=r,this.dcAPIClient=o,this.maxATSRetrievalRetries=i,this.retryDelay=a,this._window=c,this.ttl=u}return t.prototype.syncAvalaibleIDs=function(){return Wt(this,void 0,void 0,(function(){var e;return Xt(this,(function(n){switch(n.label){case 0:return this.syncAlreadySent()?[2]:[3,1];case 1:return[4,this.loadEnvelope()];case 2:return e=n.sent(),[4,this.sendSync(e)];case 3:n.sent(),this.storage.setItem(t.syncAlreadySentKey,JSON.stringify({exp:Date.now()+this.ttl})),n.label=4;case 4:return[2]}}))}))},t.prototype.loadEnvelope=function(){var t=this;return Qt((function(){return new Promise((function(e,n){t.ATSOnPage()?t.getFromATS().then((function(t){return e(t)})).catch((function(t){n(t)})):n(new Error("ATS.js could not be loaded from window. LiveRamp ID cannot be loaded at the moment."))}))}),this.maxATSRetrievalRetries,this.retryDelay)},t.prototype.ATSOnPage=function(){return this._window.ats},t.prototype.syncAlreadySent=function(){var e=this.storage.getItem(t.syncAlreadySentKey);return!!e&&JSON.parse(e).exp>Date.now()},t.prototype.sendSync=function(t){var e=this.tracker.trackingStrategy.getOrCreateIds(this.consent),n=e.cpid,r={ope_event_type:"encrypted-sync-event",ope_alt_user_ids:t,ope_channel:"liveramp-syncs",ope_tenant:this.tenantId,ope_user_id:n};this.dcAPIClient.ingestEvent(lt.eventEndpoint,r,e.fpid)},t.prototype.getFromATS=function(){return Wt(this,void 0,void 0,(function(){var t,e;return Xt(this,(function(n){switch(n.label){case 0:return[4,this._window.ats.retrieveEnvelope()];case 1:return t=n.sent(),e=JSON.parse(t).envelope,"xlr",[2,"".concat("xlr",":").concat(e)]}}))}))},t.syncAlreadySentKey="_sync_ope_liveramp_id",t}(),te=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},ee=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},ne=function(){function t(t,e,n,r,o,i,a,c,u){void 0===c&&(c=864e5),void 0===u&&(u="google-topics"),this.seat=t,this.trackingStrategy=e,this.privacyFramework=n,this.dcAPIClient=r,this.storage=o,this._document=i,this.tenant=a,this.sendInterval=c,this.channel=u}return t.instance=function(e,n,r,o,i,a,c,u,s){return void 0===u&&(u=864e5),void 0===s&&(s="google-topics"),new t(e,n,r,o,i,a,c,u,s)},t.prototype.upload=function(){var t=this;return Promise.all([this.privacyFramework.consent,this.trackingStrategy.onInit$]).then((function(e){var n=e[0];e[1];return te(t,void 0,void 0,(function(){var t,e;return ee(this,(function(r){switch(r.label){case 0:return n.trackingEnabled()&&(this._document.browsingTopics&&this.shouldSendTopics())?(t=this.trackingStrategy.getOrCreateIds(n),e={ope_channel:this.channel,ope_event_type:"topics",ope_item_uri:window.location.href,ope_tenant:this.tenant,ope_user_id:t.cpid},[4,this.dcAPIClient.ingestEvent(lt.eventEndpoint,e,t.fpid,{browsingTopics:!0})]):[2];case 1:return r.sent(),this.updateTopicsMarker(),[2]}}))}))}))},t.prototype.shouldSendTopics=function(){var e=this.storage.getItem(t.topicsLocalStoreMarker);return!e||JSON.parse(e).exp<Date.now()},t.prototype.updateTopicsMarker=function(){this.storage.setItem(t.topicsLocalStoreMarker,JSON.stringify({exp:Date.now()+this.sendInterval}))},t.topicsLocalStoreMarker="_ope_topics",t}(),re=function(){function t(t,e,n,r,o,i){void 0===o&&(o=localStorage),void 0===i&&(i=window.document),this.seat=t,this.tenantId=e,this.cmpName=n,this.options=r,this.storage=o,this.document=i}return t.prototype.run=function(t,e){var n,r,o,i,a,c,u,s,l,p,f,h,d,y,g=this;if(null==t){var w=new URL(null!==(r=null===(n=this.options)||void 0===n?void 0:n.taggerUrl)&&void 0!==r?r:"https://pdmp.tagger.opecloud.com"),m=new URL(null!==(i=null===(o=this.options)||void 0===o?void 0:o.dcAPIUrl)&&void 0!==i?i:"https://pdmp.dcapi.dmp.3lift.com"),b=null===(c=null===(a=this.options)||void 0===a?void 0:a.liveRampEnabled)||void 0===c||c,S=lt.initializeClient(m,e.funnel),k=R(w,this.seat),O=Yt.initialize(this.cmpName,"tpl");f=O.consent,h=k,d=this.cmpName,y=!1,f.then((function(t){y=!0,t.trackingEnabled()||h(new D({cmp:d,consentString:t.consentString()}))}),(function(t){h(new U({cmp:d,errorMessage:JSON.stringify(t)}))})),window.setTimeout((function(){y||h(new j({cmp:d}))}),5e3);var P=vt.progInstance({seat:this.seat,tenant:this.tenantId,dcapiClient:S,consent:O.consent,firstPartyIdTrackingDomain:null===(u=this.options)||void 0===u?void 0:u.firstPartyIdTrackingDomain,storage:this.storage}),_=function(t,e){switch(t){case"automatic":return new wt(e);case"cmd":return new mt(e);default:throw new Error("Invalid visit provider ".concat(t))}}(null!==(l=null===(s=this.options)||void 0===s?void 0:s.visitProvider)&&void 0!==l?l:"automatic",P),C=rt.progInstance({seat:this.seat,tenantId:this.tenantId,profileApiUrl:null===(p=this.options)||void 0===p?void 0:p.profileApiUrl}),x=Ot.instance();return _ instanceof wt&&x.update(C,O,P.trackingStrategy),O.consent.then((function(t){if(!(null==t?void 0:t.trackingEnabled()))throw"Tracking disabled";if(!b)throw"Liveramp Ingestion disabled";return new Zt(g.tenantId,g.storage,P,t,S).syncAvalaibleIDs()})).then((function(){})).catch((function(t){})),new ne(this.seat,P.trackingStrategy,O,S,this.storage,this.document,this.tenantId,864e5,"".concat(this.seat,"-google-topics-tagged")).upload().catch((function(t){})),O.consent.then((function(t){(null==t?void 0:t.trackingEnabled())||(new v(g.storage).removeFpid(),x.remove())})),{tracker:P,privacyFramework:O,profileApi:C,reporter:k,visitProvider:_,trackingStrategy:P.trackingStrategy,taggerUrl:w,taggerGdprClient:new ut(w)}}return t},t}(),oe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ie=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function c(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,c)}u((r=r.apply(t,e||[])).next())}))},ae=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},ce=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.tenant=n,o}return oe(e,t),e.prototype.action=function(e){return ie(this,void 0,void 0,(function(){var n,r,o,i;return ae(this,(function(a){switch(a.label){case 0:return(n=t.prototype.getFpidProvider.call(this,e)).optin(),i=(o=n).getOrCreateFpid,[4,e.privacyFramework.consent];case 1:return r=i.apply(o,[a.sent()]).fpid,[4,e.taggerGdprClient.optIn(this.seat,this.tenant,r)];case 2:return a.sent(),[2]}}))}))},e}(b),ue=function(){function t(t,e,n){void 0===n&&(n=localStorage),this.seat=t,this.options=e,this.storage=n}return t.prototype.run=function(t){var e=this;return null==t||t.visitProvider.processSendVisitCommand(this.options),t.privacyFramework.consent.then((function(n){t.trackingStrategy.getOrCreateIds(n),new Ot(new K(e.storage)).update(t.profileApi,t.privacyFramework,t.trackingStrategy,e.options.visitUrl)})),t},t}(),se=function(){function t(){}return t.prototype.parse=function(t,e,n){var r=this.redirectDMPLite(t);try{switch(e){case"dataAccess":return this.parseDataAccess(r,n);case"dataDeletion":return this.parseDataDeletion(r,n);case"init":return this.parseInit(r,n);case"optin":return this.parseOptIn(r,n);case"optout":return this.parseOptOut(r,n);case"sendVisit":return this.parseSendVisit(r,n);default:return null}}catch(t){return null}},t.prototype.redirectDMPLite=function(t){return"dmplite"==t?"pdmp":t},t.prototype.parseInit=function(t,e){var n=o.parseString(e[0]),r=o.parseCmpName(e[1]),i=o.parseOptions(e[2]);return new re(t,n,r,i)},t.prototype.parseDataAccess=function(t,e){var n=o.parseString(e[0]),r=o.parseString(e[1]),i=o.parseString(e[2]),a=o.validateOptCallback(null==e?void 0:e[3]);return new P(t,n,r,i,a)},t.prototype.parseDataDeletion=function(t,e){var n=o.parseString(e[0]),r=o.validateOptCallback(null==e?void 0:e[1]);return new F(t,n,r)},t.prototype.parseOptIn=function(t,e){var n=o.parseString(e[0]),r=o.validateOptCallback(null==e?void 0:e[1]);return new ce(t,n,r)},t.prototype.parseOptOut=function(t,e){var n=o.parseString(e[0]),r=o.validateOptCallback(null==e?void 0:e[1]);return new E(t,n,r)},t.prototype.parseSendVisit=function(t,e){var n=o.parseOptions(e[0]);return new ue(t,n)},t}(),le=window.ope,pe=new i(new Map,{taggerClient:e(Ht=n.create()),funnel:Ht},new se).ope;if(le.q)for(var fe=0,he=le.q;fe<he.length;fe++){var de=he[fe];pe.apply(void 0,de)}window.ope=pe}();