/*! * * @preserve * version: 2.0.18.eu * date: 2025-01-16T09:03:55.259Z * branch: master * commit: 2ae3defdc778a0a43426958ac7958dbe18e32518 */(()=>{var t={723:(t,n,o)=>{"use strict";o.d(n,{Z:()=>i});const i={adServerUrl:["https://wserver.vidazoo.com","https://wserver2.vidazoo.com"],cdnGatewayReadUrl:["https://cdn-gateway.vidazoo.com"],cdnGatewayWriteUrl:["https://cdn-gateway-w.vidazoo.com"]}},224:()=>{let t=window.onerror;window.onerror=function(n,o,i,s,a){try{let t=navigator?navigator.userAgent:"";if(o&&o.indexOf("vidazoo")>-1&&(o.indexOf("vwpt")>-1||o.indexOf("/basev/wgt/")>-1)&&"Script error"!=n&&": "!=n&&"Script error."!=n&&-1==t.indexOf("http://www.apple.com/go/applebot")){const c=new XMLHttpRequest;c.open("POST","https://pl.vidazoo.com/report/",!0),c.setRequestHeader("Content-Type","application/json"),50==Math.floor(101*Math.random())&&c.send(JSON.stringify({name:"Uncaught Widget Error",data:{pageUrl:document.URL,e:a?a.stack:n,ua:t,message:n,url:o,line:i,col:s}}))}}catch(t){console.error(t)}t&&t.apply(window,arguments)}},207:(t,n,o)=>{"use strict";var i=o(366),s=i(o(675)),a=i(o(860));t.exports=function(t){return new Promise((function(n,o){window.requestAnimationFrame((0,a.default)(s.default.mark((function e(){return s.default.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!(1<=t.length)){i.next=4;break}t(n,o),i.next=15;break;case 4:return i.prev=4,i.t0=n,i.next=8,t();case 8:i.t1=i.sent,(0,i.t0)(i.t1),i.next=15;break;case 12:i.prev=12,i.t2=i.catch(4),o(i.t2);case 15:case"end":return i.stop()}}),e,null,[[4,12]])}))))}))}},630:()=>{!function(t){var n="currentScript",o=t.getElementsByTagName("script");n in t||Object.defineProperty(t,n,{get:function(){try{throw new Error}catch(i){var t,n=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(i.stack)||[!1])[1];for(t in o)if(o[t].src==n||"interactive"==o[t].readyState)return o[t];return null}}})}(document)},860:t=>{function asyncGeneratorStep(t,n,o,i,s,a,c){try{var d=t[a](c),l=d.value}catch(t){return void o(t)}d.done?n(l):Promise.resolve(l).then(i,s)}t.exports=function _asyncToGenerator(t){return function(){var n=this,o=arguments;return new Promise((function(i,s){var a=t.apply(n,o);function _next(t){asyncGeneratorStep(a,i,s,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(a,i,s,_next,_throw,"throw",t)}_next(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},366:t=>{t.exports=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},658:(t,n,o)=>{var i=o(47).default;function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var n,o={},s=Object.prototype,a=s.hasOwnProperty,c=Object.defineProperty||function(t,n,o){t[n]=o.value},d="function"==typeof Symbol?Symbol:{},l=d.iterator||"@@iterator",u=d.asyncIterator||"@@asyncIterator",h=d.toStringTag||"@@toStringTag";function define(t,n,o){return Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{define({},"")}catch(n){define=function define(t,n,o){return t[n]=o}}function wrap(t,n,o,i){var s=n&&n.prototype instanceof Generator?n:Generator,a=Object.create(s.prototype),d=new Context(i||[]);return c(a,"_invoke",{value:makeInvokeMethod(t,o,d)}),a}function tryCatch(t,n,o){try{return{type:"normal",arg:t.call(n,o)}}catch(t){return{type:"throw",arg:t}}}o.wrap=wrap;var p="suspendedStart",g="suspendedYield",f="executing",_="completed",m={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var w={};define(w,l,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(values([])));y&&y!==s&&a.call(y,l)&&(w=y);var b=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(w);function defineIteratorMethods(t){["next","throw","return"].forEach((function(n){define(t,n,(function(t){return this._invoke(n,t)}))}))}function AsyncIterator(t,n){function invoke(o,s,c,d){var l=tryCatch(t[o],t,s);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==i(h)&&a.call(h,"__await")?n.resolve(h.__await).then((function(t){invoke("next",t,c,d)}),(function(t){invoke("throw",t,c,d)})):n.resolve(h).then((function(t){u.value=t,c(u)}),(function(t){return invoke("throw",t,c,d)}))}d(l.arg)}var o;c(this,"_invoke",{value:function value(t,i){function callInvokeWithMethodAndArg(){return new n((function(n,o){invoke(t,i,n,o)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(t,o,i){var s=p;return function(a,c){if(s===f)throw new Error("Generator is already running");if(s===_){if("throw"===a)throw c;return{value:n,done:!0}}for(i.method=a,i.arg=c;;){var d=i.delegate;if(d){var l=maybeInvokeDelegate(d,i);if(l){if(l===m)continue;return l}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(s===p)throw s=_,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);s=f;var u=tryCatch(t,o,i);if("normal"===u.type){if(s=i.done?_:g,u.arg===m)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(s=_,i.method="throw",i.arg=u.arg)}}}function maybeInvokeDelegate(t,o){var i=o.method,s=t.iterator[i];if(s===n)return o.delegate=null,"throw"===i&&t.iterator.return&&(o.method="return",o.arg=n,maybeInvokeDelegate(t,o),"throw"===o.method)||"return"!==i&&(o.method="throw",o.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m;var a=tryCatch(s,t.iterator,o.arg);if("throw"===a.type)return o.method="throw",o.arg=a.arg,o.delegate=null,m;var c=a.arg;return c?c.done?(o[t.resultName]=c.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=n),o.delegate=null,m):c:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,m)}function pushTryEntry(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function resetTryEntry(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t||""===t){var o=t[l];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,c=function next(){for(;++s=0;--i){var s=this.tryEntries[i],c=s.completion;if("root"===s.tryLoc)return handle("end");if(s.tryLoc<=this.prev){var d=a.call(s,"catchLoc"),l=a.call(s,"finallyLoc");if(d&&l){if(this.prev=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&a.call(i,"finallyLoc")&&this.prev=0;--n){var o=this.tryEntries[n];if(o.finallyLoc===t)return this.complete(o.completion,o.afterLoc),resetTryEntry(o),m}},catch:function _catch(t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc===t){var i=o.completion;if("throw"===i.type){var s=i.arg;resetTryEntry(o)}return s}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,o,i){return this.delegate={iterator:values(t),resultName:o,nextLoc:i},"next"===this.method&&(this.arg=n),m}},o}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports},47:t=>{function _typeof(n){return t.exports=_typeof="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,_typeof(n)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports},675:(t,n,o)=>{var i=o(658)();t.exports=i;try{regeneratorRuntime=i}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}}},n={};function __webpack_require__(o){var i=n[o];if(void 0!==i)return i.exports;var s=n[o]={exports:{}};return t[o](s,s.exports,__webpack_require__),s.exports}__webpack_require__.d=(t,n)=>{for(var o in n)__webpack_require__.o(n,o)&&!__webpack_require__.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},__webpack_require__.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),(()=>{"use strict";__webpack_require__(224);var extendStatics=function(t,n){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},extendStatics(t,n)};function __extends(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function __(){this.constructor=t}extendStatics(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}var tslib_es6_assign=function(){return tslib_es6_assign=Object.assign||function __assign(t){for(var n,o=1,i=arguments.length;o=0;d--)(s=t[d])&&(c=(a<3?s(c):a>3?s(n,o,c):s(n,o))||c);return a>3&&c&&Object.defineProperty(n,o,c),c}function tslib_es6_awaiter(t,n,o,i){return new(o||(o=Promise))((function(s,a){function fulfilled(t){try{step(i.next(t))}catch(t){a(t)}}function rejected(t){try{step(i.throw(t))}catch(t){a(t)}}function step(t){t.done?s(t.value):function adopt(t){return t instanceof o?t:new o((function(n){n(t)}))}(t.value).then(fulfilled,rejected)}step((i=i.apply(t,n||[])).next())}))}function tslib_es6_generator(t,n){var o,i,s,a,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function verb(d){return function(l){return function step(d){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(c=0)),c;)try{if(o=1,i&&(s=2&d[0]?i.return:d[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,d[1])).done)return s;switch(i=0,s&&(d=[2&d[0],s.value]),d[0]){case 0:case 1:s=d;break;case 4:return c.label++,{value:d[1],done:!1};case 5:c.label++,i=d[1],d=[0];continue;case 7:d=c.ops.pop(),c.trys.pop();continue;default:if(!(s=c.trys,(s=s.length>0&&s[s.length-1])||6!==d[0]&&2!==d[0])){c=0;continue}if(3===d[0]&&(!s||d[1]>s[0]&&d[1]0)&&!(i=a.next()).done;)c.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(o=a.return)&&o.call(a)}finally{if(s)throw s.error}}return c}function __spreadArray(t,n,o){if(o||2===arguments.length)for(var i,s=0,a=n.length;s=t&&s.apply(this,arguments)}}}!function(t){t[t.Silent=-1]="Silent",t[t.Error=0]="Error",t[t.Warn=1]="Warn",t[t.Info=2]="Info",t[t.Debug=3]="Debug"}(t||(t={}));const n=function(){function Logger(t,n){void 0===n&&(n=""),this.logLevel=t,this.namespace=n}return Object.defineProperty(Logger.prototype,"currentLogLevel",{get:function(){return this.logLevel},enumerable:!1,configurable:!0}),Logger.prototype.setLogLevel=function(t){return this.logLevel=t,this},Logger.prototype.setNamespace=function(t){return this.namespace=t,this},Logger.prototype.info=function(){for(var t=[],n=0;n=5)return t;var o=getCurrentFrameElement(t.ownerDocument);return o?getTopFrameElement(o,n+1):t}function getTopWindow(){var t=window;try{for(;t!==window.parent;)window.parent.document.URL,t=window.parent}catch(t){}return t}function getDomainFromUrl(t){return(t||"").replace("http://","").replace("https://","").split(/[/?#]/)[0]}function getTopPageUrl(){var t=getTopWindow(),n="";try{n=t!==top&&t.document.referrer||document.URL}catch(t){n=document.referrer||document.URL}return n}function createDocumentHeightResolver(t){var n;function getHeight(){return Math.max(t.body.scrollHeight,t.documentElement.scrollHeight,t.body.offsetHeight,t.documentElement.offsetHeight,t.body.clientHeight,t.documentElement.clientHeight)}function resizeHandler(){n=getHeight()}return t=t||document,window.addEventListener("resize",resizeHandler,{passive:!0}),{resolve:function(){return n||(n=getHeight()),n},dispose:function(){window.removeEventListener("resize",resizeHandler)}}}var o=["loading","interactive","complete"];function documentReadyState(t,n){function isReady(){return o.indexOf(n.readyState)>=o.indexOf(t)}return void 0===n&&(n=document),new Promise((function(t){if(isReady())t();else{var onReadyStateChange_1=function(){isReady()&&(n.removeEventListener("readystatechange",onReadyStateChange_1),t())};n.addEventListener("readystatechange",onReadyStateChange_1)}}))}Symbol("ref");var i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function strings_guid(t){void 0===t&&(t=8);for(var n="",o=0;o-1&&(t=t.split("?")[1]),t?t.split("&").reduce((function(t,n){var o=tslib_es6_read(n.split("="),2),i=o[0],s=o[1];if(function endsWith(t,n){return t.substr(-n.length)===n}(i=decodeURIComponent(i),"[]")){var a=i.substr(0,i.length-2);t[a]||(t[a]=[]),t[a].push(decodeURIComponent(s))}else t[i]=decodeURIComponent(s);return t}),{}):{}}function injectScript(t,n,o,i,s){return void 0===n&&(n=""),void 0===o&&(o=document.head),void 0===s&&(s=!1),new Promise((function(a,c){(i=i||document.createElement("script")).id=n,i.src=t,i.addEventListener("load",a),i.addEventListener("error",c),s&&o.prepend?o.prepend(i):o.appendChild(i)}))}const s=new n(t.Silent);function assert_isDefined(t){return void 0!==t}function assert_isNumber(t){return!isNaN(t)&&"number"==typeof t}const a=function(){function EventDispatcher(){this._eventTarget=document.createElement("a")}return Object.defineProperty(EventDispatcher.prototype,"requestHandler",{set:function(t){this._requestHandler=t},enumerable:!1,configurable:!0}),EventDispatcher.prototype.on=function(t,n,o){this._eventTarget.addEventListener(t,n,o)},EventDispatcher.prototype.un=function(t,n,o){this._eventTarget.removeEventListener(t,n,o)},EventDispatcher.prototype.dispatch=function(t,n){this._eventTarget.dispatchEvent(new CustomEvent(t,{detail:n}))},EventDispatcher.prototype.request=function(t,n){return this._requestHandler&&function isFunction(t){return t&&"function"==typeof t}(this._requestHandler)?this._requestHandler(t,n):null},EventDispatcher}();const c=function(){function TimeMarks(){this._marks={"page-load":0}}return TimeMarks.prototype.setMark=function(t,n,o){!o&&this.hasMark(t)||(this._marks[t]=Math.round(n||window.performance.now()))},TimeMarks.prototype.hasMark=function(t){return assert_isDefined(this._marks[t])},TimeMarks.prototype.getMarksDiff=function(t,n){var o=this._marks[t],i=this._marks[n];return assert_isNumber(o)&&assert_isNumber(i)?Math.abs(o-i):-1},TimeMarks}();__webpack_require__(207);function flatten(t,n){void 0===n&&(n=[]);for(var o=0,i=t.length;o>12&63,o=s>>6&63,i=63&s,d+=h.charAt(s>>18&63)+h.charAt(n)+h.charAt(o)+h.charAt(i)}while(c>16&255,o=c>>8&255,i=255&c,l.push(n),64!==s&&(l.push(o),64!==a&&l.push(i))}while(d=200?s(c):a(c))})),c.send(d)}))}function post(t,n,o,i,s){return void 0===o&&(o=!0),new Promise((function(a,c){var d=new XMLHttpRequest;d.open("POST",t,!0),i&&(d.timeout=i),s&&(d.withCredentials=!0),o&&(d.setRequestHeader("Content-Type","application/json"),n=JSON.stringify(n)),d.addEventListener("readystatechange",(function(){d.readyState===XMLHttpRequest.DONE&&(d.status<400&&d.status>=200?a(o&&d.responseText?JSON.parse(d.responseText):d.responseText):c(d))})),d.send(n)}))}function get(t,n,o){return void 0===n&&(n=!0),new Promise((function(i,s){var a=new XMLHttpRequest;a.open("GET",t,!0),o&&(a.timeout=o),a.addEventListener("timeout",(function(){s("TIMEOUT")})),a.addEventListener("error",(function(){s(a)})),a.addEventListener("load",(function(){a.status<400&&a.status>=200?i(n&&a.responseText?JSON.parse(a.responseText):a.responseText):s(a)})),a.send(null)}))}function getWithFallback(t,n,o,i,s){return void 0===n&&(n=!0),void 0===s&&(s={}),tslib_es6_awaiter(this,void 0,void 0,(function(){var a,c;return tslib_es6_generator(this,(function(d){switch(d.label){case 0:a=o instanceof Array?o.shift():o,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,get(t.shift(),n,a)];case 2:return[2,d.sent()];case 3:if(c=d.sent(),null==i||i(c),t.length)return o&&s.firstRequestTimeout&&(o=0),[2,getWithFallback(t,n,o,i)];throw c;case 4:return[2]}}))}))}function postWithFallback(t,n,o,i,s){return void 0===o&&(o=!0),tslib_es6_awaiter(this,void 0,void 0,(function(){var a,c;return tslib_es6_generator(this,(function(d){switch(d.label){case 0:a=i instanceof Array?i.shift():i,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,post(t.shift(),n,o,a)];case 2:return[2,d.sent()];case 3:if(c=d.sent(),null==s||s(c),t.length)return[2,postWithFallback(t,n,o,i,s)];throw c;case 4:return[2]}}))}))}function _loadWorker(){return tslib_es6_awaiter(this,void 0,void 0,(function(){var t;return tslib_es6_generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,get("https://static.vidazoo.com/basev/wgt/atlas/1.0.0/widget.js",!1)];case 1:return t=n.sent(),[2,new Worker("data:text/javascript;base64,".concat(btoa(t)))];case 2:return n.sent(),[2,null];case 3:return[2]}}))}))}window.__vdzworkers__=window.__vdzworkers__||{};const f=new(function(){function AtlasService(){this._requests={},this._onMessage=this._onMessage.bind(this)}return AtlasService.prototype._onMessage=function(t){var n=t.data,o=n.id,i=n.response;if("function"==typeof this._requests[o]){var s=this._requests[o];delete this._requests[o],s(i)}},AtlasService.prototype._getWorker=function(){return tslib_es6_awaiter(this,void 0,void 0,(function(){var t=this;return tslib_es6_generator(this,(function(n){return this._worker||null===this._worker?[2,Promise.resolve(this._worker)]:(window.__vdzworkers__.__atlas__||(window.__vdzworkers__.__atlas__=new Promise((function(n){return tslib_es6_awaiter(t,void 0,void 0,(function(){var t;return tslib_es6_generator(this,(function(o){switch(o.label){case 0:return[4,_loadWorker()];case 1:return t=o.sent(),n(t),[2]}}))}))}))),[2,window.__vdzworkers__.__atlas__.then((function(n){t._worker=n,t._worker&&t._worker.addEventListener("message",t._onMessage)}))])}))}))},AtlasService.prototype.decode=function(t){return tslib_es6_awaiter(this,void 0,void 0,(function(){var n;return tslib_es6_generator(this,(function(o){switch(o.label){case 0:return[4,this._getWorker()];case 1:return(n=o.sent())?[2,this._requestAction(n,"decode",t)]:[2,g.decodeAsync(t)]}}))}))},AtlasService.prototype.encode=function(t){return tslib_es6_awaiter(this,void 0,void 0,(function(){var n;return tslib_es6_generator(this,(function(o){switch(o.label){case 0:return[4,this._getWorker()];case 1:return(n=o.sent())?[2,this._requestAction(n,"encode",t)]:[2,g.encodeAsync(t)]}}))}))},AtlasService.prototype._requestAction=function(t,n,o){var i=this;return new Promise((function(s){var a=strings_guid();i._requests[a]=s,t.postMessage({type:n,id:a,payload:o})}))},AtlasService}()),_={silent:t.Silent,error:t.Error,warn:t.Warn,info:t.Info,debug:t.Debug},m=["checkDMode"],w=["outstream-prebid-mobile","prebid-native","mercury","hermes","prebid-npx","odin","orion","callisto"],v=["odin","orion"],y="551424a21b1b1f08006fb6f9",b={"outstream-prebid-mobile":"2.2.1"},S=`https://bis${randomInt(1,6)}.vidazoo.com/event/extend`;const E=new class BIService{constructor(){this._jsonParams=void 0,this._jsonParams={}}extendGlobalJSONParams(t){this._jsonParams={...this._jsonParams,...t}}async sendEvent(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4?arguments[4]:void 0;if(s.debug(`BI Event: '${t}'x${o} ~${i}`),i&&(o=parseFloat(o)*i),i>1&&!isValidRandom(i))return;const c=getDomainFromUrl(getTopPageUrl());let d,l,u;if(a&&a.conf&&a.conf.device&&(l=a.conf.device.os?.name??"",d=a.conf.device.browser?.name+"_"+parseInt(a.conf.device.browser?.version)),a?.conf?.json||this._jsonParams)try{const t={...a?.conf?.json,...this._jsonParams};Object.keys(t).length&&(u=JSON.stringify({...a?.conf?.json,...this._jsonParams}))}catch(t){}const h={name:t,domain:c,counter:o,vertical:"platform",browser:d,os:l,params:u,...a?.params,...n},p={trace:await f.encode(h)};return postUrlEncoded(S,p)}};const x=new class ReportService{async report(t,n){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(o&&!isValidRandom(o))return;(n=n||{}).ua=navigator?navigator.userAgent:"";let i={name:t,data:n};post("https://pl.vidazoo.com/report/",{trace:await f.encode(i)}).catch(noop)}},P="https://img.vidazoo.com";const I={artemis:function ArtemisWidgetHandler(t,n){let o;if(!t.hasPlaceholder||!(o=n?.cms?.results[0]?.poster))return;const i=assert_isDefined(n.widget.options.widgetPosition)&&n.widget.options.widgetPosition!==t.options.get("widgetPosition");if(n.widgetVersion.version<"1.9.21"||i)return void t.removePlaceholder();const{width:s,height:a}=t.placeholder.getBoundingClientRect();t.placeholder.style.backgroundImage=`url(${function cropImage(t,n,o){let i=`${P}/api/crop?url=${encodeURIComponent(t)}`;return n&&(i+=`&width=${n}`),o&&(i+=`&height=${o}`),i}(o,s,a)})`,t.placeholder.style.backgroundSize="cover",t.placeholder.style.backgroundPosition="center"}},L=["outstream-prebid-mobile","parse-outstream-prebid-mobile"],tryDecodeURIComponent=t=>{try{return decodeURIComponent(t)}catch(n){return t}},isObject=t=>"object"==typeof t&&"[object Object]"===t.toString();let C=function(t){return t.ADS="ads",t.CMS="cms",t}({});class EmptyServerResponseError extends Error{constructor(){super("EMPTY_SERVER_RESPONSE")}}class BadServerResponseError extends Error{constructor(t){super("BAD_SERVER_RESPONSE"),this.code=t}}class FetchWidgetDataAsyncAction extends d{constructor(t,n,o,i,s){super(),this._serverUrl=t,this._params=n,this._parent=o,this._didLoadTooFrequently=i,this._publisherTag=s,this._currentRequestParams=void 0,this._retryCount=void 0,this._initialEmptyResponseSent=void 0,this._staticCampaignFallbackEventSent=void 0,this._fetchFromCDN=void 0,this._retryCount=0,this._fetchFromCDN=!1,this._onError=this._onError.bind(this)}get _storageKey(){return`vdzwc_${this._params.widgetId}`}get _forceWidgetIdStorageKey(){return`vdzwf_${this._params.widgetId}`}async execute(){const{vdzwLocalCache:t}=this._params;let n=t?await this._tryLoadDataFromStorage():null,o=!1;if(n){s.debug("Widget data loaded from local storage.");const t=n.ads;o=t?.trace?.length>0,E.sendEvent("widgetServerLoadCache",{widget:n.widget._id},1,1,t)}else{this._currentRequestParams=await this._createRequestParams(),n=await this._loadDataFromRemote(),n.widget.options=await this._parseWidgetOptions(n.widget.options),n.widget.useForceWidgetId&&window.sessionStorage.setItem(this._forceWidgetIdStorageKey,n.widget._id);const t=n.ads;o=t?.trace?.length>0,t.conf.json=t.conf.json||{};const i=this._publisherTag.currentScript.dataset.rev;i&&(t.conf.json.vwptRevision=i),this._fetchFromCDN&&(t.conf.json.vwptStaticCampaign=!0);const s=t?.params?.playerId??"";n.playerId=s,this._params.gdprEnforcement&&true!==t.conf.geo.isEU&&(E.sendEvent("widgetEuropeMismatch"+(t.conf.geo.isEU?"True":"False"),{userId:n.widget.user,playerId:n.widget._id,widget:n.widget._id},1,100),x.report("widgetEuropeMismatch",{geo:t.conf.geo,clientIp:t.platform.ip,isEu:true},100)),this._shouldPersistWidgetData(n)&&this._persistWidgetData(n)}n.adsData=n.ads;const i=b[n.widget.type];return i&&i>=n.widgetVersion.version&&(n.ads=await f.encode(n.ads)),n?.cms?.results?.length>0&&(n.cms.results=n.cms.results.map((t=>(t.title&&(t.title=tryDecodeURIComponent(t.title)),t.caption&&(t.caption=tryDecodeURIComponent(t.caption)),t.description&&(t.description=tryDecodeURIComponent(t.description)),t)))),s.setNamespace(`WIDGET ${n.widget.name}`),s.debug("widget options",n.widget.options),I[n.widget.type]&&I[n.widget.type](this._publisherTag,n),this._publisherTag.setWidgetData(n,o),n}_shouldPersistWidgetData(t){const n=t.ads,o=(n?.params?.scenarioId??!1)&&(n?.trace?.length>0||!1);return(t.widget.useLocalCache||L.indexOf(t.widget.type)>-1&&t?.widget?.options?.parseOnlyMode)&&o}async _persistWidgetData(t){const n=await f.encode({created:Date.now(),data:t});try{window.localStorage.setItem(this._storageKey,n)}catch(t){}}async _tryLoadDataFromStorage(){try{s.debug("Trying to load the widget data from local storage...");const t=window.localStorage.getItem(this._storageKey),n=await f.decode(t);if(n){if(Date.now()-Number(n.created)<9e5)return n.data;window.localStorage.removeItem(this._storageKey)}}catch(t){}return s.debug("Local storage widget data not found."),null}_resolveServerUrls(){return this._serverUrl.map((t=>{if(t instanceof Array){const n=Math.round(99*Math.random()),o=t.sort(((t,n)=>t.percentage-n.percentage)),{url:i}=o.find(((t,i)=>{const s=i>0?o[i-1].percentage+t.percentage:t.percentage;return n1&&(n.retry=this._retryCount-1);const o=await this._getPtrace();n=`trace=${encodeURIComponent(await f.encode(n))}`,o&&(n+=`&ptrace=${o}`);const i=this._serverUrl.map(((o,i)=>`${o}/api/${t}?${n}${i>0?"&fallback=true":""}`));this._publisherTag.timeMarks.setMark("vwpt-server-request",null,!0);let a=null,c=!1;try{a=await getWithFallback(i,!0,[7e3,2e4],(t=>{this._onError(t),c=!0}))}catch(t){}if(a)this._publisherTag.cdnGateway.setRawCampaign(a);else if(c){try{a=await this._publisherTag.cdnGateway.getStaticCampaign(n),this._sendStaticCampaignFallbackEventOnce(),a||E.sendEvent("staticCampaignFallbackEmpty",{userId:this._params.userId,playerId:this._params.widgetId,widget:this._params.widgetId},1,10)}catch(t){this._sendStaticCampaignFallbackEventOnce(),E.sendEvent("staticCampaignFallbackFailed",{userId:this._params.userId,playerId:this._params.widgetId,widget:this._params.widgetId},1,10)}this._staticCampaignFallbackEventSent=!1,this._fetchFromCDN=!0}return this._publisherTag.timeMarks.setMark("vwpt-server-response",null,!0),a&&function isString(t){return"string"==typeof t}(a.trace)&&(a=await f.decode(a.trace)),this._handleResponse(a)}_getPtrace(){return new Promise((t=>{window.setTimeout((()=>{let n="";try{n=window.localStorage.getItem("vdzwopt")||""}catch(t){}finally{t(n)}}),0)}))}_sendStaticCampaignFallbackEventOnce(){this._staticCampaignFallbackEventSent||(this._staticCampaignFallbackEventSent=!0,E.sendEvent("staticCampaignFallback",{userId:this._params.userId,playerId:this._params.widgetId,widget:this._params.widgetId},1,10))}_onError(t){s.debug("Server request error",t),E.sendEvent("widgetServerRequestTimeout",{userId:this._params.userId,playerId:this._params.widgetId,widget:this._params.widgetId,param1:"TIMEOUT"===t?"TIMEOUT":"REQUEST_ERROR"},1,1e3)}async _handleResponse(t){try{this._throwOnInvalidResponse(t)}catch(n){if(s.debug("Failed to load data from remote."),n instanceof EmptyServerResponseError&&this._retryCount<3)return await this._waitForRequestParamsUpdate(),this._loadDataFromRemote();const o=t||null;throw this.dispatch("fetchError",{error:n,response:o}),n}return t}async _waitForRequestParamsUpdate(){s.debug("Retry to load data from widget data from remote in 10s..."),await wait(1e4);const t=await this._createRequestParams();if(s.debug("Done waiting. checking for request params equality..."),((t,n)=>{const o=Object.keys(t),i=Object.keys(n);if(o.length!==i.length)return!1;let s;for(let i=0,a=o.length;istartsWith(t,"idl_env=")))?.split("=")[1]}catch(t){return Promise.resolve()}}_getTimezoneForRequest(){let t="";try{t=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){}return{timezone:t,offset:(new Date).getTimezoneOffset()}}_getScreenSize(){return`${10*Math.floor(window.screen.width/10)}x${10*Math.floor(window.screen.height/10)}`}_getInnerPlayerSize(){const t=dimensions_rectOf(this._parent),n=getPlayerSize(Math.floor(t.width));return`${n.width}x${n.height}`}_getOuterPlayerSize(){const t=getPlayerSize(getTopWindow().innerWidth);return`${t.width}x${t.height}`}async _parseWidgetOptions(t){if("string"==typeof t){if((t=await this._tryDecodeOptions(t))&&isObject(t))return t;if((t=this._tryJSONParseOptions(t))&&isObject(t))return t}return isObject(t)?t:{}}async _tryDecodeOptions(t){try{return await f.decode(t)||t}catch(n){return t}}_tryJSONParseOptions(t){try{const n=JSON.parse(t);return n&&isObject(n)?n:t}catch(n){return t}}_getScrollHeight(){const t=createDocumentHeightResolver(getTopWindow().document),n=t.resolve();return t.dispose(),n}}class BaseResourceLoadAsyncAction extends d{constructor(t,n,o){super(),this._hostUrl=t,this._parent=n,this._params=o}get shouldSkip(){return!1}decorateScript(t){}onScriptLoadSuccess(){}onScriptLoadError(t){}async execute(){if(this.shouldSkip)return;const t=this.getResourcePath(...arguments),n=document.createElement("script");this.decorateScript(n);try{await injectScript(t,"",this._parent,n,!0),this.onScriptLoadSuccess()}catch(t){throw this.onScriptLoadError(t),this.loadErrorEventName&&E.sendEvent(this.loadErrorEventName,{userId:this._params.userId,playerId:this._params.widgetId,widget:this._params.widgetId}),t}}}class LoadPlayerAsyncAction extends BaseResourceLoadAsyncAction{constructor(t,n,o,i){super(t,n,o),this._publisherTag=i}get loadErrorEventName(){return"vwptPlayerScriptLoadError"}get shouldSkip(){return function includes(t,n){return(t&&"function"==typeof t.indexOf?t:[]).indexOf(n)>-1}(v,this._publisherTag.widgetData.widget.type)}getResourcePath(t){return this.isVdzwPlayerPathValid()?this._params.vdzwPlayerPath:`${this._hostUrl}/basev/${this._getPlayerVersion(t)}/sbt.js`}isVdzwPlayerPathValid(){return!isEmptyOrBlank(this._params.vdzwPlayerPath)&&(!!startsWith(this._params.vdzwPlayerPath,"http://localhost:")||!isEmptyOrBlank(this._params.cdn)&&startsWith(this._params.vdzwPlayerPath,`https://${this._params.cdn}`))}_updateDataPlayerVersion(t){"object"==typeof this._publisherTag.widgetData.ads&&(this._publisherTag.widgetData.playerVersion=t,this._publisherTag.widgetData.ads.version=t)}_getPlayerVersion(t){return"artemis"===t.widget.type&&"1.19.4-a.1"===t.widgetVersion.version?(this._updateDataPlayerVersion("2.0.0-alpha.4"),"2.0.0-alpha.4"):"artemis"===t.widget.type&&"1.19.4-a.2"===t.widgetVersion.version?(this._updateDataPlayerVersion("1.0.917"),"1.0.917"):t.widget?.options?.vwptForcePlayerVersion?t.widget.options.vwptForcePlayerVersion:t.playerVersion}onScriptLoadSuccess(){this._publisherTag.timeMarks.setMark("player-script-load")}}class LoadStdlibAsyncAction extends d{constructor(t,n){super(),this._hostUrl=t,this._parent=n}execute(t){if(t.widget.useStdlib){const n=`__vidazoo_stdlib_${t.widget._id}__`,o=!1,i=!1,s=`${this._hostUrl}/basev${o?"/debug":i?"/stage":""}/stdlib.js?jsonp=${n}`;return new Promise((t=>{window[n]=function(o){delete window[n],t(o)},injectScript(s,"",this._parent)}))}}}class LoadVidazooPublisherTagAsyncAction extends BaseResourceLoadAsyncAction{get loadErrorEventName(){return"vwptVptScriptLoadError"}get shouldSkip(){return!!this._params.skipVpt}getResourcePath(){return`${this._hostUrl}/basev/vptm.js`}}class LoadWidgetScriptAsyncAction extends BaseResourceLoadAsyncAction{constructor(t,n,o,i,s,a){super(t,n,s),this._widgetId=o,this._jsonpCallback=i,this._publisherTag=a}get loadErrorEventName(){return"vwptWidgetScriptLoadError"}decorateScript(t){t.setAttribute("data-widget-id",this._widgetId),t.setAttribute("data-jsonp",this._jsonpCallback)}_getWidgetPath(t){const n=`${this._hostUrl}/basev/wgt`;if("dynamic-script"===t.widget.type){const o=t.widget.useCompiledScript?".min":"";return`${n}/dynamic/${t.widget._id}/${t.widget._id}${o}.js`}return`${n}/${t.widget.type}/${t.widgetVersion.version}/widget.js`}getResourcePath(t){return this.isVdzwPathValid()?this._params.vdzwPath:this._getWidgetPath(t)}isVdzwPathValid(){return!isEmptyOrBlank(this._params.vdzwPath)&&(!!startsWith(this._params.vdzwPath,"http://localhost:")||!isEmptyOrBlank(this._params.cdn)&&startsWith(this._params.vdzwPath,`https://${this._params.cdn}`))}onScriptLoadSuccess(){this._publisherTag.timeMarks.setMark("widget-script-load")}}let k=function(t){return t.Scroll="scroll",t.Timeout="timeout",t.Pixels="pixels",t}({});const A=__webpack_require__(723).Z;class BaseLazyLoadStrategy{constructor(t){this.context=t}}class PixelsStrategy extends BaseLazyLoadStrategy{constructor(){super(...arguments),this.Type=k.Pixels,this._topWindow=void 0,this._pixels=void 0,this._observer=void 0,this._promiseResolver=void 0}run(t){this._topWindow=getTopWindow(),this._pixels=t;const n=this.context.dom.getAnchorElement(this.context.currentScript);return new Promise((o=>{if(this._promiseResolver=o,!n)return void this._resolve();const{top:i}=dimensions_rectOf(n);io&&(this._amount=Math.round(o/2)),this._topWindow.scrollY>=this._amount?Promise.resolve(!0):new Promise((t=>{const n=function throttle(t,n){var o,i={current:null};return function throttledFn(){i.current=Array.prototype.slice.apply(arguments),o||(throttledFn.$callCount=0,o=window.setTimeout((function(){o=null,t.apply(this,i.current),throttledFn.$callCount=0}),n)),throttledFn.$callCount++}}((()=>{this._topWindow.scrollY>=this._amount&&(window.removeEventListener("scroll",n),t(!0))}),100);window.addEventListener("scroll",n,{passive:!0})}))}}class TimeoutStrategy extends BaseLazyLoadStrategy{constructor(){super(...arguments),this.Type=k.Timeout}async run(t){return await wait(t),!0}}class DOMEnvironment{constructor(t){this._context=t}getInjectableElement(){if(isFrameContext()&&!this._context.options.get("allowFrame"))return getTopFrameElement().parentElement;const t=this._context.options.get("widgetPosition");if(t){if(t instanceof Array)for(const n of t){const t=document.getElementById(n);if(t)return t}const n=document.getElementById(t);if(n)return n}return this._context.parentScriptElement}getFrameElement(){return getCurrentFrameElement(self.document)}getAnchorElement(t){const n=this._context.options.get("widgetPosition"),getElement=n=>{switch(!0){case"$current"===n:return t.parentElement;case startsWith(n,"/"):const o=document.evaluate(n,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;return o?.parentElement??null;default:return document.querySelector("#"+n)}};if(n instanceof Array){for(const t of n){const n=getElement(t);if(n)return n}return null}return getElement(n)}getWidgetElement(t){const n=this._context.options.get("widgetPosition");if(!n||n instanceof Array&&0===n.length)return s.warn("'widgetPosition' is missing. make sure to set the parameter.\r\nrefer to the documentation for more details."),null;let o;const getElement=n=>{let o;switch(!0){case"$current"===n:o=document.createElement("div"),t.parentNode.insertBefore(o,t);break;case startsWith(n,"/"):const i=document.evaluate(n,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;i&&(o=document.createElement("div"),i.parentNode.insertBefore(o,i));break;default:o=document.querySelector("#"+n)}return o};if(n instanceof Array){for(const t of n)if(o=getElement(t),o)break}else o=getElement(n);return o&&!o.id&&(o.id="vdzw_"+strings_guid(4)),o}resolvePolyfills(){const t=getTopWindow();isFrameContext()&&t&&("Promise"in t==!1&&(t.Promise=window.Promise),"function"!=typeof window.CustomEvent&&(t.CustomEvent=window.CustomEvent),"URLSearchParams"in t==!1&&(t.URLSearchParams=window.URLSearchParams),"IntersectionObserver"in t==!1&&(t.IntersectionObserver=window.IntersectionObserver),"Symbol"in t==!1&&(t.Symbol=window.Symbol))}}function throwIf(t,n){if(void 0===n&&(n=""),t)throw new Error(n)}const T=["true","false"];class OptionsParser{constructor(t,n){this._context=t,this._parsed=void 0,this._options=void 0,this._config=void 0,this._parsed=!1,this._config=function defaultConfig(t){return{locationAdapterConfig:{},sessionStorageAdapterConfig:{},datasetAdapterConfig:{},...t}}(n)}get current(){return throwIf(!this._parsed,"get options before options parsed."),this._options}_parseAdapterOptions(t,n){const{exclude:o=[]}=n;for(let n=0,i=o.length;n-1&&(this._options[t[o]]="true"===n)}}function injectStyleRules(t,n){void 0===n&&(n=document);var o=document.createElement("style");return o.innerHTML=t.replace(/\n/g,""),n instanceof Document||"HTMLDocument"===n.constructor.name?n.head.appendChild(o):n.appendChild(o),o}function createStyleSheet(t,n){for(var o="",i={},s=Object.keys(t).sort((function(t,n){return t.indexOf(":")})).reduce((function(n,s){var a="_".concat(strings_guid(5));if(!0==(0===s.indexOf("@keyframes"))){var c=s.replace("@keyframes ","");i[c]=a,o+="@keyframes ".concat(a," {\n\t\t\t\t\t").concat(t[s],"\n\t\t\t\t}\n\t\t\t\t")}else{if(s.indexOf(":")>-1){var d=tslib_es6_read(s.split(":")),l=d[0],u=d.slice(1);n[l]&&(a="".concat(n[l])),a+=":".concat(u.join(":"))}n[s]=a,o+=".".concat(n[s]," {\n\t\t\t\t\t").concat(t[s],"\n\t\t\t\t}\n\t\t\t\t")}return n}),{}),a=Object.keys(i),c=0,d=a.length;c`${t}/campaign/${this._context.originalWidgetId}${n?"?"+n:""}`))}_getCDNGatewayUrls(t){const n="read"===t?A.cdnGatewayReadUrl:A.cdnGatewayWriteUrl;let o=[];return"string"==typeof n?o=[n]:n instanceof Array&&(o=this._resolveCDNGatewayUrls(n)),o}_resolveCDNGatewayUrls(t){return t.map((t=>{if(t instanceof Array){const n=Math.round(99*Math.random()),o=t.sort(((t,n)=>t.percentage-n.percentage)),{url:i}=o.find(((t,i)=>{const s=i>0?o[i-1].percentage+t.percentage:t.percentage;return n{const n=this._getStaticCampaignUrl(),o=new XMLHttpRequest;o.open("HEAD",n,!0),o.addEventListener("error",(()=>t(!0))),o.addEventListener("readystatechange",(()=>{if(o.readyState===XMLHttpRequest.DONE){const n=o.getResponseHeader("last-modified");if(o.status<400&&o.status>=200&&n){const o=new Date(n).getTime();Date.now()-o>864e5?t(!0):t(!1)}else t(!0)}})),o.send()}))}}class SessionManager{constructor(t){this._context=t,this._loadedTooFrequently=void 0}initialize(){const t=this._context.options.get("loadFrequentlyTime"),n=this._lastLoad,o=Date.now();this._loadedTooFrequently=!!n&&o-n-1}async initialize(){this._setValidExtensionRuntime(),this.options.parse(),this._handlePlaceholder(),this._scriptLoad(),this._setTimeOnPageEvent(),this.session.initialize(),this._setupLogger(),this.dom.resolvePolyfills(),this._originalWidgetId=this.options.current.widgetId,this._jsonpCallback=this.options.get("vdzwJsonpCallback",`__vdzw_${this.widgetId}_${this.id}_jsonp_`),this._currentUrl=function parseUrl(t){var n=document.createElement("a");return n.href=t,{host:n.host,hostname:n.hostname,pathname:n.pathname,hash:n.hash,protocol:n.protocol,origin:n.origin,port:n.port,search:n.search}}(this.currentScript.src),this.options.get("cdn")||this.options.set("cdn",this._currentUrl.host),s.info(`vidazoo widget created ${this.widgetId}`),s.debug("parsed options",this.options.current)}_setValidExtensionRuntime(){try{const t=sessionStorage.getItem("__VDZ_DEVTOOLS_RUNTIME__");this._isValidExtensionRuntime=Date.now()-g.decode(t).time<36e5}catch(t){this._isValidExtensionRuntime=!1}}createWidgetOptions(t){return{...t,...this.widgetData.widget.options,...this.options.current}}removePlaceholder(){this._placeholder&&this._placeholder.parentElement&&(this._placeholder.parentElement.removeChild(this._placeholder),this._placeholder=null)}setWidgetData(t,n){this.widgetData=t,this._hasDemand=n}_handlePlaceholder(){if(this.options.get("usePlaceholder")&&this.options.get("widgetPosition")){const t=this.options.get("placeholderRatio",16/9),n=this.dom.getAnchorElement(this.currentScript);let o;if(!n||!(o=n.offsetWidth))return;const{width:i,height:s}=getPlayerSize(o,t),a=this._placeholder=document.createElement("div");a.style.cssText=`width:${i}px;height:${s}px;background-color:#000;display:flex;align-items:center;justify-content:center;`,a.setAttribute("data-vdzw-placeholder","true"),a.innerHTML=`
`,n.appendChild(a)}}_scriptLoad(){const t=this.options.get("widgetId");E.sendEvent("widgetLoad",{userId:this.options.get("userId"),playerId:t,widget:t,param1:"2.0.18"},1,100)}_setupLogger(){let n=t.Silent;const o=this.options.get("vdzwLogLevel"),i=this.options.get("vdzwDebug");this._isValidExtensionRuntime&&(o&&o in _?n=_[o]:i&&(n=t.Debug)),s.setLogLevel(n),s.setNamespace(`WIDGET ${this.widgetId}`)}async load(){if(!this._isReadyState("loading","done")){this._setReadyState("loading"),await function documentReady(t){return void 0===t&&(t=document),documentReadyState("interactive",t)}();try{this.options.get("parallel")?await this._loadAsParallel():await this._loadAsLazy(),this._setReadyState("done")}catch(t){s.error("widget load failed with error",t),this._setReadyState("error")}}}_setTimeOnPageEvent(){const t=this.userId,n=this.widgetId;window.setTimeout((()=>{E.sendEvent("widgetTimeOnPage",{userId:t,playerId:n,widget:n},1,100)}),1e4)}async _loadAsLazy(){this.widgetData=await this._createFetchWidgetDataAsyncAction().execute(),this.options.extend(this.widgetData.widget.options);const{strategy:t,value:n,enabled:o,relativeToDocumentState:i}=this.widgetData?.widget?.lazyLoad??{};let s;switch(o&&i&&await documentReadyState(i),t){case k.Scroll:s=new ScrollStrategy(this);break;case k.Timeout:s=new TimeoutStrategy(this);break;case k.Pixels:s=new PixelsStrategy(this)}if(!s||!o||await s.run(n))return this._loadAsParallel()}async _loadAsParallel(){getTopWindow()[this._jsonpCallback]=this._onWidgetScriptLoad.bind(this);const[t,n]=await this._createParallelLoadSaga();this.widgetData=t,this.stdlib=n,this.options.set("userId",this.widgetData.widget.user),this.options.set("widgetId",this.widgetData.widget._id),s.debug("widget data load",this.widgetData),this.widgetData.widget.options&&this.options.extend(this.widgetData.widget.options)}async _onWidgetScriptLoad(t){this._widgetInitializer=t;if(delete getTopWindow()[this._jsonpCallback],this._isReadyState("done"))this._executeWidgetInitializer();else{const onReadyStateChange=async t=>{this._isReadyState("done")&&(this.un("readyStateChanged",onReadyStateChange),this._executeWidgetInitializer())};this.on("readyStateChanged",onReadyStateChange)}}async _executeWidgetInitializer(){setTimeout((async()=>{const t=getTopWindow();if(t._vdzwgt_&&t._vdzwgt_.loaded_widgets||(s.debug("unique widgets DB (_vdzwgt_) not found."),t._vdzwgt_={loaded_widgets:{}}),this.options.current.unique&&t._vdzwgt_.loaded_widgets[this._originalWidgetId])return;t._vdzwgt_.loaded_widgets[this._originalWidgetId]=!0;const n=this.widgetData.adsData,o=n&&n.params||{};E.sendEvent("widgetPreExecute",o,1,100);const i=await this._widgetInitializer(this,s,this.stdlib);E.sendEvent("widgetPostExecute",o,1,100),this._invokeWidgetCreated(i),this._hasDemand&&this.cdnGateway.handleEligibleCampaign()}))}_invokeWidgetCreated(t){const n=this.options.get("widgetCreated");n in window&&"function"==typeof window[n]&&window[n](t)}_createFetchWidgetDataAsyncAction(){if(this.widgetData)return new l((()=>Promise.resolve(this.widgetData)));const t=this.dom.getInjectableElement(),n=new FetchWidgetDataAsyncAction(A.adServerUrl,this.options.current,t,this.session.didLoadTooFrequently,this);return n.on("fetchError",this._onServerFetchError.bind(this)),n}_onServerFetchError(t){switch(!0){case t.detail.error instanceof BadServerResponseError:E.sendEvent("widgetServerDataResponseError",{param1:t.detail.error.code,userId:t.detail.response.widget.user,playerId:this.widgetId,widget:this.widgetId});break;case t.detail.error instanceof EmptyServerResponseError:E.sendEvent("widgetServerDataResponseEmpty",{userId:this.options.get("userId"),playerId:this.widgetId,widget:this.widgetId})}}async _createParallelLoadSaga(){const t=this.dom.getInjectableElement(),n=`https://${this.options.get("cdn")}`,o=u.compose(u.compose(this._createFetchWidgetDataAsyncAction(),u.compose(new LoadPlayerAsyncAction(n,t,this.options.current,this),new LoadWidgetScriptAsyncAction(n,t,this.widgetId,this._jsonpCallback,this.options.current,this),new LoadStdlibAsyncAction(n,t)).toParallelAsyncAction()).toSeriesAsyncAction(),new LoadVidazooPublisherTagAsyncAction(n,t,this.options.current)),[i,,,s]=await o.execParallel();return[i,s]}}let O=function(t){return t[t.CMPNotDetectedOnEu=1]="CMPNotDetectedOnEu",t[t.InvalidPurpose=2]="InvalidPurpose",t[t.FailedToDetectLocation=3]="FailedToDetectLocation",t}({});const D=getTopWindow(),F=D.performance.now(),z=D.scrollY,W=D._vdzwgt_=D._vdzwgt_||{loaded_widgets:{}};let M=!1,j=!1;let U=function script_currentScript(t,n){return void 0===t&&(t=document),t.currentScript?t.currentScript:n?document.querySelector(n):null}();if(!U&&"function"==typeof window.__getVidazooShadowRoot__){const t=window.__getVidazooShadowRoot__();U=t.querySelector('script[src*="/vwpt.js"][data-allow-shadow-root="true"]:not([data-parse])')}!async function(){const n=U.dataset.rev;n&&E.extendGlobalJSONParams({vwptRevision:n});const o="true"===U.dataset.paramUserGdpr,i=U.dataset.paramUserConsentStr,a=!o||!i,c="true"===parseQueryString(D.location.href).vdzwDebug,d="false"!==U.dataset.gdprEnforcement||D.document.URL.indexOf("vdzwGdprEnf=true")>-1,l="false"!==U.dataset.waitForTcString||D.document.URL.indexOf("vdzwWaitForTcString=true")>-1,u="true"===U.dataset.waitForGppString||D.document.URL.indexOf("vdzwWaitForGppString=true")>-1,h={userId:y,playerId:U.dataset.widgetId,widget:U.dataset.widgetId};function sendTcfFoundEvent(){E.sendEvent("vwptTcfCmpFound",h,1,100)}async function handleConsent(){const t=[injectScript("https://static.vidazoo.com/basev/cmp/1.0.1/cmp.js","vdzcmp"),a?injectScript("https://static.vidazoo.com/basev/tcf/1.0.3/tcf.js","vdztcf"):Promise.resolve()];if(await Promise.all(t),a){s.debug("GDPR Enforcement",d),s.debug("Wait For TC String",l),function sendEuVersionLoadedEvent(){E.sendEvent("vwptEuVersionLoaded",{...h,param1:d?"enforcementEnabled":"enforcementDisabled"},1,100)}(),M=!0;const t=window.vdzTcf.create({waitForTcString:l,isEuCallback:()=>Promise.resolve(!0)}),logTCData=async()=>{try{s.debug("tcData",await t.cmpService.getTcStringData())}catch(t){}};t.hooks.valid.tap((()=>{logTCData(),sendTcfFoundEvent(),loadWidget(t)})),t.hooks.invalid.tap((n=>{switch(n){case O.CMPNotDetectedOnEu:E.sendEvent("cmpNotDetectedOnEu",h,1,100);break;case O.InvalidPurpose:logTCData(),sendTcfFoundEvent(),E.sendEvent("cmpInvalidPurpose",h,1,100)}s.debug("TCF Invalid. Reason:",n),d||loadWidget(t)})),t.hooks.euWithoutTcString.tap((()=>{E.sendEvent("euDetectedNoTcString",h,1,100),l||loadWidget(t)})),t.apply()}else loadWidget()}async function loadWidget(t){j||(j=!0,setTimeout((async()=>{if(!U.dataset.widgetId){const t=document.querySelector('script[src*="vwpt"][data-widget-id]:not([data-parse="true"])');if(t){const n=document.createElement("script");for(let o=0,i=t.attributes.length;o