(()=>{"use strict";var e={};let t,n,i,o,r,a,s,c,d;function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&u(e,t)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return g(this,n)}}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){for(var n=0;n{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),function(e){let t=!1;function i(){const e=(new Error).stack;if(!e)return null;const t=e.split("\n")[3].split(" ");let n=t[t.length-1];return"("!==n[0]&&(n="("+n+")"),n}e.setAllowLogging=function(e){t=!!n.findHighestWindow().location.search.includes("bex_logging=true")||e},e.logInfo=function(...e){if(!t)return;const n=i(),o=Date.now()-performance.timing.navigationStart;console.log("%c%s%c%s%s","background: #00008B; color: White; font-weight: bold;","[CeX Header Bidding]","",o,n?" ".concat(n):"","",...e)},e.logWarning=function(...e){if(!t)return;const n=i(),o=Date.now()-performance.timing.navigationStart;console.log("%c%s%c%s%s","background: #FF8C00; color: White; font-weight: bold;","[CeX Header Bidding]","",o,n?" ".concat(n):"","",...e)},e.logError=function(e,...n){if(!t)return;const o=i(),r=Date.now()-performance.timing.navigationStart;n.length>0&&console.log("%c%s%c%s%s","background: #8B0000; color: White; font-weight: bold;","[CeX Header Bidding]","",r,o?" ".concat(o):"","",...n),console.error(e),console.trace()},e.logProblem=function(...e){if(!t)return;const n=i(),o=Date.now()-performance.timing.navigationStart;console.log("%c%s%c%s%s","background: #8B0000; color: White; font-weight: bold;","[CeX Header Bidding]","",o,n?" ".concat(n):"","",...e),console.trace()}}(t||(t={})),function(e){function n(){const e=window.top;let t=window;for(;t!==e;)try{t.parent.document,t=t.parent}catch(e){break}return t}function i(){return n().document}e.getRandomInt=function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e)+e)},e.replaceAll=function(e,t,n){return e.split(t).join(n)},e.fixDomain=function(e){return(e=(e=e.toLowerCase()).replace(/^http(s?):\/\//i,"")).startsWith("www.")&&(e=e.slice(4)),e.endsWith("/")&&(e=e.slice(0,-1)),e},e.guid=function(e=4){return e>11&&(e=11),Math.random().toString(36).substr(2,e)},e.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},e.findHighestWindow=n,e.findHighestDocument=i,e.hbFrameId="__bexHBFrame";const o=e.hbdevFrameId="__bexHBDevFrame";function r(e,t){const n=i();n.body||(n.body=n.createElement("body"));let o=n.querySelector("#".concat(t));return o||(o=n.createElement("iframe"),o.id=t,o.style.display="none",o.onload=function(){const t=o.contentDocument,n=t?.createElement("script");n&&(n.src="https://".concat(e,"/hbscript"),n.async=!0,n.defer=!0,t?.head.appendChild(n))},n.body.appendChild(o),o)}e.createHbFrame=r,e.initalizeHb=function(e,n){"www.slovenskenovice.si"===window.location.host&&window.afterIpromPrebid?(t.logInfo("Setting iframe creation through iprom initalizer..."),window.afterIpromPrebid.push((function(){return r(e,n)}))):r(e,n)},e.isDevelMode=function(e=!1,t){return!(!e&&void 0===t)&&(e?window.frameElement?.id===o:void 0===t||t.includes("hbdev.contentexchange.me"))},e.sendEventImage=function(e){const t=i(),n=t.createElement("img");n.src=e,n.onload=function(){t.body.removeChild(n)},n.style.display="none",t.body.appendChild(n)},e.crawlToPost=function(e){let t=e;for(;t&&!t.classList.contains("$bexAd_post");){if("BODY"===t.tagName)return null;if(!t.parentElement)return null;t=t.parentElement}return t},e.getCookie=function(e,t){const n="; ".concat(t).split("; ".concat(e,"="));if(2===n.length)return n.pop()?.split(";").shift()}}(n||(n={})),function(e){function t(){const e=n.findHighestWindow();let t=e.bextag;return t||(e.bextag=t={targeting:{},headerbidding:{queue:[]},_internals:{headerbidding:{bexDisplayHB:{},bexNativeHB:{}},loaders:{},bds:{}},sendQueue:[],onBexAdFailed:[],onBexAdSuccess:[]}),"sendQueue"in e.bextag||(e.bextag.sendQueue=[]),"targeting"in e.bextag||(e.bextag.targeting={}),"headerbidding"in e.bextag||(e.bextag.headerbidding={}),"queue"in e.bextag.headerbidding||(e.bextag.headerbidding.queue=[]),"_internals"in e.bextag||(e.bextag._internals={}),"headerbidding"in e.bextag._internals||(e.bextag._internals.headerbidding={}),"bexDisplayHB"in e.bextag._internals.headerbidding||(e.bextag._internals.headerbidding.bexDisplayHB={}),"bexNativeHB"in e.bextag._internals.headerbidding||(e.bextag._internals.headerbidding.bexNativeHB={}),"loaders"in e.bextag._internals||(e.bextag._internals.loaders={}),"bds"in e.bextag._internals||(e.bextag._internals.bds={}),"onBexAdFailed"in e.bextag||(e.bextag.onBexAdFailed=[]),"onBexAdSuccess"in e.bextag||(e.bextag.onBexAdSuccess=[]),t}e.getBexTag=t,e.getBexDevTag=function(){const e=t();let n=e._devTag;n||(e._devTag=n={targeting:{},headerbidding:{queue:[]},_internals:{headerbidding:{bexDisplayHB:{},bexNativeHB:{}},loaders:{},bds:{}},sendQueue:[],onBexAdFailed:[],onBexAdSuccess:[]});const i=n;return"sendQueue"in i||(i.sendQueue=[]),"targeting"in i||(i.targeting={}),"headerbidding"in i||(i.headerbidding={}),"queue"in i.headerbidding||(i.headerbidding.queue=[]),"_internals"in i||(i._internals={}),"headerbidding"in i._internals||(i._internals.headerbidding={}),"bexDisplayHB"in i._internals.headerbidding||(i._internals.headerbidding.bexDisplayHB={}),"bexNativeHB"in i._internals.headerbidding||(i._internals.headerbidding.bexNativeHB={}),"loaders"in i._internals||(i._internals.loaders={}),"bds"in i._internals||(i._internals.bds={}),"onBexAdFailed"in i||(i.onBexAdFailed=[]),"onBexAdSuccess"in i||(i.onBexAdSuccess=[]),n}}(i||(i={})),(o||(o={})).getAdformTag=function(){const e=window;return e.adformtag=e.adformtag||[]},(r||(r={})).getPrebid=function(){const e=window;let t=e.pbjs;return t||(e.pbjs=t={que:[]}),t},a||(a={}),function(e){let i=v((function e(){x(this,e)}));e.MemoryStorage=i;let o=function(e){l(i,e);var n=f(i);function i(e,t){var o;return x(this,i),m(p(o=n.call(this)),"_name",void 0),m(p(o),"_storage",void 0),m(p(o),"_data",void 0),m(p(o),"_isLoaded",void 0),o._name=e,o._storage=t,o._data={},o._isLoaded=!1,o}return v(i,[{key:"getValue",value:function(e){return this.load(),this._data[e]}},{key:"setValue",value:function(e,t){this._data[e]=t,this.save()}},{key:"deleteKey",value:function(e){this.hasKey(e)&&(delete this._data[e],this.save())}},{key:"hasKey",value:function(e){return this.load(),void 0!==this._data[e]}},{key:"save",value:function(){try{this._storage.setItem(this._name,JSON.stringify(this._data))}catch(e){t.logError(e,"Failed to save browser storage!",this._name)}}},{key:"load",value:function(){if(!this._isLoaded){this._isLoaded=!0;try{const e=this._storage.getItem(this._name);if(!e)return;this._data=JSON.parse(e)}catch(e){t.logError(e,"Failed to load browser storage!",this._name),this._data={}}}}},{key:"clear",value:function(){this._data={},this.save()}}]),i}(i);e.BrowserStorage=o;let r=function(e){l(i,e);var t=f(i);function i(e){return x(this,i),t.call(this,e,n.findHighestWindow().sessionStorage)}return v(i)}(o);e.Session=r}(s||(s={})),function(e){const i={};e.registerFallback=function(e){return e?i[e.id]?t.logWarning("Fallback already registered!",e.name):void(i[e.id]=e):t.logWarning("No fallback provided during registration!")},e.invokeFallback=async function(e,o){if(!e||!o)return!1;const r=n.uuidv4();let a=e.execList;for(;null!=a;)try{const n=i[a.type];if(!n){t.logWarning("Fallback is not registered!",a.type),a=a?.next;continue}if(!n.isAvailable){t.logWarning("Fallback is not available!",n.name),a=a?.next;continue}if("object"==typeof a.config&&(a.config.adFormat=e.execList.config.adFormat||a.config.adFormat),await n.invoke(a.config,o,r))return t.logInfo("Fallback was successfully invoked and rendered an ad!",n.name),!0;a=a?.next}catch(e){t.logError(e,"An error occured while trying to execute a fallback!"),a=a?.next}return t.logWarning("Ad was not able to be processed by the fallback system!"),!1}}(c||(c={})),function(e){const i={},o=n.findHighestDocument();function r(e,t,n,i){const o=t.children;for(let r=0;r');var u="push"==d?"position:absolute;right:5px;bottom:5px;":"float:right;margin:0 0 8px 8px;";c.querySelector("$bexAd_title_html").outerHTML+=' ")+titles[0].outerHTML,c?.classList.add("bexvideo")}else r.setAttribute("src",m),r.setAttribute("alt",o.title),r.style["background-image"]="url("+(o[s[1]]||"")+")",a.useImageContain?r.style["background-size"]="contain":r.style["background-size"]="cover",r.style["background-repeat"]="no-repeat",r.style["background-position"]="center"}else if("$type"===s[2]&&3===s.length)switch(s[1]){case"image":d.push("bexImage");break;case"title":d.push("bexTitle");break;case"post":d.push("bexPost");break;default:t.logWarning("Invalid template element type",s[1],i)}else if("$replace"===s[2]&&5===s.length){let e=i.getAttribute(s[3]);if(!e)continue;e=n.replaceAll(e,s[4],o[s[1]]),i.setAttribute(s[3],e)}else"$style"===s[2]&&4===s.length?c[s[1]]=s[3]:("clickUrl"===s[1]&&(o.clickTrackers&&i.addEventListener("click",(function(){t.logInfo("Advertisement has been clicked!",i);for(let e of o.clickTrackers)n.sendEventImage(e)})),o.clickFuncs&&i.addEventListener("click",(function(){t.logInfo("Executing click functions for",i);for(let e of o.clickFuncs)try{e()}catch(n){t.logError(n,"Failed to execute click function",e)}}))),i.setAttribute(s[2],o[s[1]]||""))}for(let e in c)i.style[e]=c[e];for(let e of d)i.classList.add(e);return r(e,i,o,a),i}e.registerRenderer=function(e){return e?i[e.id]?t.logWarning("Renderer already registered!",e.name):void(i[e.id]=e):t.logWarning("No renderer provided during registration!")},e.renderSticker=function(e,t){if(e.querySelector(".cex-adform-sticker")){const n=e.querySelector(".cex-adform-sticker");n.style.display="inline-block",n.innerHTML=!n?.classList.contains("cex-sticker-replace")&&n.innerHTML||t||"Ad"}else{const n=o.createElement("div");n.style="\n line-height: 1.5;\n position: absolute;\n padding:0px 5px;\n top:3px;\n left:3px;\n border-radius: 3px;\n box-shadow: 1px 1px 1px 0 rgba(50, 50, 50, 0.2);\n background-color: rgba(255, 255, 255, 0.7);\n color: #2f2f2f;\n font-size: 12px;\n border: 1px solid #b3b3b3;\n z-index:10;\n display:block",n.className="cex-adform-sticker",n.innerHTML=n.innerHTML||t||"Ad",e.appendChild(n)}},e.renderTemplate=r,e.renderElement=a,e.createHTMLTemplate=function(e){const t=o.createElement("template"),i=n.guid();return e=e.replace(/##rnd##/g,i),t.innerHTML=e,t},e.invokeRenderer=async function(e,n,o,r,a){if(!e||!o)return!1;const s=i[e];if(!s)return t.logWarning("Renderer is not registered!",e),!1;if(!s.isAvailable)return t.logWarning("Renderer is not available!",s.name),!1;try{if(await s.render(n,o,r,a))return t.logInfo("Successfuly rendered advertisment!",s.name,n),!0}catch(e){t.logError(e,"An error occured while trying to render ad!",s.name,n)}return t.logWarning("Failed to render ad using the renderer system!"),!1}}(d||(d={}));let y,w,I,_,k=[],E=null;function F(){if(E)for(let e of k)"resolve"===E.func?e[0](E.passedData):e[1](E.passedData)}!function(e){function i(){const e=n.findHighestWindow();let t=null,i=null,o=null,r=window;for(;!i;){try{if("function"==typeof r.__tcfapi){"function"==typeof r.__tcfapi&&(o=2,t=r.__tcfapi),i=r;break}}catch(e){}try{r.frames.__tcfapiLocator&&(o=2,i=r)}catch(e){}if(r===e)break;r=r.parent}return{cmpFunction:t,cmpFrame:i,cmpVersion:o}}e.findCMP=i,e.IsCMPAvailable=function(){return null!==i().cmpVersion},e.getTCString=async function(){return new Promise((function(e,t){const n=i();if(!n||!n.cmpFunction)return t("No CMP function found!");n.cmpFunction("getTCData",2,(function(n,i){return i?e(n.tcString):t("Failed to get TCData!")}))}))},e.WaitForConsent=function(){return new Promise((function(e,n){if(E)return t.logInfo("Already passed consent system! Continuing..."),"resolve"===E.func?e(E.passedData):n(E.passedData);if(k.push([e,n]),1===k.length){const{cmpFunction:e,cmpVersion:n}=i();if(!e)return E={func:"reject"},F();if(2!==n)return E={func:"resolve"},F();let o=!1;setTimeout((function(){o||(o=!0,E={func:"reject",passedData:"Timeout reached"},F())}),500);const r=function(n,i){if(!o){if(!i)return t.logProblem("Failed to set event listener for consent!"),o=!0,E={func:"resolve"},F();if("tcloaded"===n.eventStatus||"useractioncomplete"===n.eventStatus){if(t.logInfo("Successfully gotten tcloaded/useractioncomplete event!"),e("removeEventListener",2,(function(e){if(e)return t.logInfo("Successfully removed event listener for consent!")}),r),o)return;return o=!0,E={func:"resolve"},F()}}};e("addEventListener",2,r)}}))},e.RunTest=function(){const{cmpFunction:e,cmpVersion:n}=i();e&&2===n&&e("addEventListener",2,(function(e,n){n?t.logInfo("Caught tcdata",e):t.logProblem("Failed to set event listener for consent!")}))}}(y||(y={})),function(e){const i=n.findHighestWindow(),o="https://hb.contentexchange.me/stats",a={},s={},c={},d={},l={},u={},f={},g=r.getPrebid();function p(e){if(!e)return t.logProblem("No adId specified!");const n=c[e];if(!n)return t.logProblem("Failed to find registered response",e);const i=new XMLHttpRequest;i.open("POST","".concat(o,"/click")),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(JSON.stringify(n)),t.logInfo("Sending click data",n)}function h(e){if(!e)return t.logProblem("No adId specified!");const n=c[e];if(!n)return t.logProblem("Failed to find registered response",e);const i=new XMLHttpRequest;i.open("POST","".concat(o,"/viewImpression")),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(JSON.stringify(n)),t.logInfo("Sending viewable impression data",n)}e.setWinningBid=function(e){if(!e)return t.logWarning("Bid was not specified!");const n=c[e.adId];if(!n)return t.logWarning("Failed to find registered response",e.adId);n.hasWon=!0},e.mapAdUnitBidder=function(e,t,n){e&&t&&n&&((f[e]=f[e]||{})[t]=n)},e.registerBidResponse=function(e,t){c[e]=t},e.sendAuctionData=function(e){if(!e)return t.logWarning("No auction id specified!");if(!d[e])return t.logWarning("Failed to find registered auction",e);if(!a[e])return t.logWarning("Failed to find registered auction",e);const n=[];for(let t of d[e])c[t]&&n.push(c[t]);const i=new XMLHttpRequest;i.open("POST","".concat(o,"/auctionData")),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(JSON.stringify({responses:n,requests:a[e]}));const r=a[e][0].placement;t.logInfo("Sending auction data ("+r+") "+e,{responses:n,requests:a[e]})},e.sendGoogleData=function(e,n,i,o){if(!e||!n)return t.logProblem("No id or slot specified!")},e.sendImpression=function(e){if(!e)return t.logProblem("No adId specified!");const n=c[e];if(!n)return t.logProblem("Failed to find registered response",e);const i=new XMLHttpRequest;i.open("POST","".concat(o,"/impression")),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(JSON.stringify(n)),t.logInfo("Sending impression data",n)},e.sendClick=p,e.sendViewableImpression=h,e.trackAdViewability=function(e,n){if(!e||!n)return t.logWarning("No adId or targetElement specified!");const i=new IntersectionObserver((function(t){for(let o of t)if(o.isIntersecting){h(e),i.unobserve(n);break}}),{root:null,rootMargin:"0px",threshold:.5});i.observe(n)},e.init=function(){return new Promise((function(e,o){i.focus(),i.addEventListener("blur",(function(){setTimeout((function(){const e=i.document.activeElement;if(!e)return;if("IFRAME"!==e.tagName)return;const t=e.getAttribute("data-adId");t&&(i.focus(),p(t))}),0)})),g.que.push((function(){if(!g.onEvent)return o("Failed to find onEvent function!");g.onEvent("auctionInit",(function(e){l[e.auctionId]=e,s[e.auctionId]={},d[e.auctionId]=[],u[e.auctionId]=e.labels||[],t.logInfo("Auction initialized",e)})),g.onEvent("bidRequested",(function(e){const i=l[e.auctionId];if(!i)return t.logProblem("Failed to find registered auction",e.auctionId);const o=u[e.auctionId];if(!o)return t.logProblem("Failed to find labels for auction",e.auctionId);const r=i.adUnits[0];let c=i.adUnitCodes[0],d=n.findHighestDocument(),g=d.getElementById(c),p=n.findHighestWindow(),h=(d.referrer||"").split("/")[2]||"direct",m=p!=top?n.fixDomain(h):n.fixDomain(p.location.host),b=g&&g.getAttribute("domain")||m,v=c.split("-"),x=v[v.length-2];const y="native"in r.mediaTypes?"NATIVE":"DISPLAY";e.bids.forEach((function(t){let n;n="DISPLAY"===y&&"sizes"in t?{width:o[0],height:o[1]}:{width:0,height:0};let i=[];if("DISPLAY"===y&&"sizes"in t)for(let e of t.sizes)i.push({width:e[0],height:e[1]});else i.push({width:0,height:0});const r=t.mediaType,c=s[e.auctionId][e.bidderCode+"_"+r]={id:f["div-ppas-mid-"+x][e.bidderCode+"_"+r],domain:b,placement:x,source:e.bidderCode,placement_size:n,availableSizes:i,size:null,type:y,mediaType:r,hasResponse:!1,hasWon:!1,cpm:0};(a[e.auctionId]=a[e.auctionId]||[]).push(c)}))})),g.onEvent("bidResponse",(function(e){if(!l[e.auctionId])return t.logProblem("Failed to find registered auction",e.auctionId);const n=s[e.auctionId][e.bidderCode+"_"+e.mediaType];if(!n)return t.logProblem("Failed to find registered request",e.bidderCode,e.mediaType,s[e.auctionId]);const i=Object.assign({},n);i.hasResponse=!0,i.cpm=e.cpm,"NATIVE"===i.type?i.size={width:0,height:0}:i.size={width:e.width,height:e.height},"contentexchange"===e.bidderCode&&(i.cpm=i.cpm/(.95*.65)),d[e.auctionId].push(e.adId),c[e.adId]=i})),e()}))}))}}(w||(w={})),function(e){let t;!function(e){e.Request="request",e.Response="response",e.Fallback="fallback",e.FallbackRequest="fallback_request"}(t||(t={})),n.isDevelMode();const i=(n.findHighestWindow(),r.getPrebid()),o={},a={};e.sendAuctionData=function(e,n){t.Request,o[n],t.Response,a[n]},e.sendFallbackData=function(e,n){t.Fallback},e.sendFallbackRequestData=function(e){t.FallbackRequest},e.initPrebid=function(){return new Promise((function(e,t){i.que.push((function(){if(!i.onEvent)return t("Failed to find onEvent function!");i.onEvent("bidRequested",(function(e){o[e.auctionId]=o[e.auctionId]||[];const t=JSON.parse(JSON.stringify(e));t.gdprConsent&&delete t.gdprConsent,o[e.auctionId].push(t)})),i.onEvent("bidResponse",(function(e){a[e.auctionId]=a[e.auctionId]||[],a[e.auctionId].push(e)})),e()}))}))}}(I||(I={})),function(e){const n=[],i=r.getPrebid();function o(e,n,i,o){return new Promise((function(r,a){const s=new XMLHttpRequest,c={source:e.bidderCode,creativeId:e.creativeId,link:e.native.clickUrl,image:e.native.image.url||e.native.image,market:n,domain:i,strict_check:o};s.open("POST","https://adcheck.contentexchange.me/native"),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.timeout=1e3,s.onloadend=function(){return t.logInfo("Got bid scan response from AdChecker with status",s.status,"and response",s.response),200!==s.status&&201!==s.status?a(s.responseText):'"pass"'===s.response?r(!0):r(!1)},s.onerror=function(){return a("Error occured during request")},s.ontimeout=function(){return a("Reached server timeout")},t.logInfo("Sending bid payload to scan on AdChecker",c),s.send(JSON.stringify(c))}))}function a(e){return new Promise((function(n,i){const o=new XMLHttpRequest,r={source:e.bidderCode,creativeId:e.creativeId,data:e};o.open("POST","https://adcheck.contentexchange.me/logvideo"),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.timeout=1e3,o.onloadend=function(){return t.logInfo("Got bid log response from AdChecker with status",o.status,"and response",o.response),200!==o.status&&201!==o.status?i(o.responseText):'"pass"'===o.response?n(!0):n(!1)},o.onerror=function(){return i("Error occured during request")},o.ontimeout=function(){return i("Reached server timeout")},t.logInfo("Sending bid payload to be logged on AdChecker",r),o.send(JSON.stringify(r))}))}e.sendAdUnit=function(e,r=[],s){let{floorPrice:c,ssp_id:d,strict_check:l,market:u,domain:f}=s;return c=c||0,new Promise((function(s,g){t.logInfo("Sending pbjs bid request",e),i.que.push((function(){if(!i.requestBids)return g("Failed to find requestBids function in prebid!");if(d){const e={validation:"strict",config:{ver:"1.0",complete:1,nodes:[{asi:"ssp.adnetwork.agency",sid:d,hp:1}]}};i.setConfig&&i.setConfig({schain:e})}i.setConfig&&i.setConfig({cache:{url:"https://prebid.adnxs.com/pbc/v1/cache"}});var p=e[0];i.requestBids({adUnits:e,labels:r,bidsBackHandler:async function(e,r,d){if(t.logInfo("Got prebid responses",e,"for auction",d,"for adUnit",p.code),!e)return s({id:p.code,winner:null,auctionId:d});const g=e[p.code];let h=[];if(!g)return s({id:p.code,winner:null,auctionId:d});g.bids.length&&(h=function(e,t){let n=[];if(!e.length)return n;for(let i of e)"contentexchange"===i.bidderCode&&(i.cpm=i.cpm/(.95*.65)),i.cpmb.length)continue;let o=b[i.position-1];if(i.useContainer){let t=document.createElement("div");t.className="cex-adform-container cex-adform-style",t.style.zIndex="-5",Object.assign(t.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",background:"white"}),o.appendChild(t),o.id="div-widget-"+i.placement.id+"-"+Math.floor(1e4*Math.random()),o.setAttribute("widget_id",e.widget_id),o=t}const r="direct-native-"+n.guid(),d={id:r,domain:i.placement.execList.config.domain,placement:i.placement.id,source:"adform-direct",placement_size:{width:0,height:0},availableSizes:[{width:0,height:0}],size:null,type:"NATIVE",mediaType:"native",hasResponse:!1,hasWon:!1,cpm:0},l={},u="https://hb.contentexchange.me/stats";l.requests=[d];const f="adx.adform.net/adx/?mid="+i.placement.id+"&rnd="+String(n.getRandomInt(1,1e4));a?_[f]={loaded:!1,auctionData:null}:(s.placementHandlers=s.placementHandlers||{},_[f]=new Promise((function(n,o){s.placementHandlers[f]=function(o){if(t.logInfo("ON_ LOAD",e.widget_id,i.placement.id,o?.place?"visible":"hidden",o?.isEmpty?"fallback":"hit",o),o&&!o.isEmpty){t.logInfo("direct-native resposnse",o);const e={id:r,domain:i.placement.execList.config.domain,placement:i.placement.id,source:"adform-direct",placement_size:{width:0,height:0},availableSizes:[{width:0,height:0}],size:{width:0,height:0},type:"NATIVE",mediaType:"native",hasResponse:!0,hasWon:!0,cpm:0};l.responses=[e],w.registerBidResponse(r,e),n({loaded:!0,auctionData:l})}else l.responses=[],n({loaded:!1,auctionData:l})}})),g.push((function(){g.onLoaded(Number(i.placement.id),(function(e){s.placementHandlers[e.data](e)})),g.onRendered(Number(i.placement.id),(function(n){if(t.logInfo("ON_ RENDER",i.position,e.widget_id,i.placement.id,n.ad.parentElement),!n||!n.ad||!n.ad.parentElement)return;const o=n.ad.contentDocument;if(o){const e=o.querySelectorAll("script");for(let t of e)if(t.src&&t.src.startsWith("https://hbdev.contentexchange.me/"))return v(i,n.ad.parentElement,n.ad)}const a=n.ad.contentWindow;if(a&&"cleanAdForm"in a&&"cleanUpDone"in a)return v(i,n.ad.parentElement,n.ad);const s=n.ad.parentElement?.parentElement;if(!s)return t.logInfo("NO ELEMENT FOR direct-native",i);w.sendImpression(r),w.trackAdViewability(r,s),s.querySelectorAll("a.\\$bexAd_clickUrl_href").forEach((function(e){e.addEventListener("click",(function(e){t.logInfo("sending direct-native click",e),w.sendClick(r)}))}));for(let e of c)try{e(n.ad.parentElement)}catch(e){t.logError(e,"Failed to execute success event!",e)}}))}))),I(o,i,(async function(){const{loaded:e,auctionData:n}=await _[f];if(n){const i=new XMLHttpRequest;i.open("POST","".concat(u,"/auctionData")),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.send(JSON.stringify(n)),t.logInfo("Sending native data for adform-direct",e?"hit":"fallback",n)}if(a||!e)v(i,o);else{let e=document.createElement("script");e.setAttribute("data-adfscript",f),p.push(e),e.onerror=function(){const t=p.indexOf(e);-1!==t&&p.splice(t,1),x(o)},o.appendChild(e)}}))}const k=Object.keys(_);if(k.length&&(t.logInfo("ADFORM PRELOAD WIDGET",k),g.push({preload:k})),c.push((function(e){e&&e.classList.contains("bexAdloaded")&&(t.logInfo("Successfully loaded direct-native ad!",e),e.classList.contains("cex-ad-loaded")||e.classList.add("cex-ad-loaded"))})),!e.allowKeywords||!d.segment&&d.loaded)y(!1);else if(d.segment)y(!0);else{setTimeout((function(){d.loaded||(d.loaded=!0,y(!1))}),300);let e=new XMLHttpRequest;e.addEventListener("load",(function(){d.loaded=!0,d.segment=r.responseText,y(!0)})),e.open("GET","https://analytics.contentexchange.me/bex/keywords"),e.withCredentials=!0,e.send()}s.sendQueue.push({type:"widget",id:e.widget_id}),delete S.bex.loaders.loadNativeWidget};var A=self;for(var C in e)A[C]=e[C];e.__esModule&&Object.defineProperty(A,"__esModule",{value:!0})})();window.bex.loaders.loadNativeWidget({"widget_id":"eRMF6vzum2vtwESpw","posts":[{"position":2,"useContainer":true,"placement":{"id":"1159705","type":"HB-Google","noLazy":false,"execList":{"type":"headerbidding","config":{"id":"div-ppas-mid-1159705","translation":"Reklama","floorPrice":0.2211,"adFormat":"widget","ssp_id":"203","strict_check":false,"market":"hr","domain":"n1info.hr","type":"NATIVE","bids":[{"bidder":"adformOpenRTB","mediaType":"native","params":{"mid":"1159706"}},{"bidder":"criteo","mediaType":"native","params":{"zoneId":"1412679"}},{"bidder":"appnexus","mediaType":"native","params":{"placementId":"22955473"}},{"bidder":"mgid","mediaType":"native","params":{"accountId":305,"placementId":"893499"}},{"bidder":"contentexchange","mediaType":"native","params":{"placementId":"2049","adFormat":"native"}}]},"next":{"type":"google","config":{"Placement_ID":"1159705","Domain":"n1info.hr","Google":{"Key":"-7l+ez-1j-38+bu","Slot":"6890213612"},"ignoreDiv":false}}}}},{"position":4,"useContainer":true,"placement":{"id":"1159707","type":"HB-Google","noLazy":false,"execList":{"type":"headerbidding","config":{"id":"div-ppas-mid-1159707","translation":"Reklama","floorPrice":0.2211,"adFormat":"widget","ssp_id":"203","strict_check":false,"market":"hr","domain":"n1info.hr","type":"NATIVE","bids":[{"bidder":"adformOpenRTB","mediaType":"native","params":{"mid":"1159708"}},{"bidder":"criteo","mediaType":"native","params":{"zoneId":"1412679"}},{"bidder":"appnexus","mediaType":"native","params":{"placementId":"22955473"}},{"bidder":"mgid","mediaType":"native","params":{"accountId":305,"placementId":"893499"}},{"bidder":"contentexchange","mediaType":"native","params":{"placementId":"2050","adFormat":"native"}}]},"next":{"type":"google","config":{"Placement_ID":"1159707","Domain":"n1info.hr","Google":{"Key":"-7l+ez-1j-38+bu","Slot":"3894372070"},"ignoreDiv":false}}}}},{"position":9,"useContainer":true,"placement":{"id":"1704828","type":"HB-Google","noLazy":false,"execList":{"type":"headerbidding","config":{"id":"div-ppas-mid-1704828","translation":"Reklama","floorPrice":0.2211,"adFormat":"widget","ssp_id":"203","strict_check":false,"market":"hr","domain":"n1info.hr","type":"NATIVE","bids":[{"bidder":"adformOpenRTB","mediaType":"native","params":{"mid":"1704829"}},{"bidder":"criteo","mediaType":"native","params":{"zoneId":"1412679"}},{"bidder":"mgid","mediaType":"native","params":{"accountId":305,"placementId":"893499"}},{"bidder":"contentexchange","mediaType":"native","params":{"placementId":"5126","adFormat":"native"}}]},"next":{"type":"google","config":{"Placement_ID":"1704828","Domain":"n1info.hr","Google":{"Key":"-7l+ez-1j-38+bu","Slot":"9415395715"},"ignoreDiv":false}}}}},{"position":10,"useContainer":true,"placement":{"id":"1704830","type":"HB-Google","noLazy":false,"execList":{"type":"headerbidding","config":{"id":"div-ppas-mid-1704830","translation":"Reklama","floorPrice":0.2211,"adFormat":"widget","ssp_id":"203","strict_check":false,"market":"hr","domain":"n1info.hr","type":"NATIVE","bids":[{"bidder":"adformOpenRTB","mediaType":"native","params":{"mid":"1704831"}},{"bidder":"criteo","mediaType":"native","params":{"zoneId":"1412679"}},{"bidder":"mgid","mediaType":"native","params":{"accountId":305,"placementId":"893499"}},{"bidder":"contentexchange","mediaType":"native","params":{"placementId":"5126","adFormat":"native"}}]},"next":{"type":"google","config":{"Placement_ID":"1704830","Domain":"n1info.hr","Google":{"Key":"-7l+ez-1j-38+bu","Slot":"3959016915"},"ignoreDiv":false}}}}}],"source":"hb.contentexchange.me","allowKeywords":false,"develMode":false,"generated":"2023-06-27T07:18:22.524Z"});