!function(e,t,n){"use strict";new function(e,t){var r="px_debug=1",i="px2uid",o="px2uid",a=function(){},u=q(E(),r)||q(t.cookie,r)||O("px_debug");if(a=u&&e.console&&n.log.bind(n,"[ut]")||function(){},e.px2_ut&&e.px2_ut.initialized)a("already exists",_()-e.px2_ut.initialized,"ms");else{a("start",e.px2_ut);var s,c=(s=M())&&s.pvId||b(),d=[],l=!1,p=e.px2_ut=e.px2_ut||{queue:[]};p.data=p.data||{},p.initialized=_(),p.pv_id=c,p.event=function(e,t){return a("event:",e,t,l),d.push({name:e,data:t}),l&&function(){function e(){a("timer send events:",d.toString());var e=N();if(e.events.length){var t=new XMLHttpRequest;t.open("POST",h),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onload=function(e){var n=JSON.parse(t.responseText);a("from timed xhr:",n,e)},t.send(JSON.stringify(e))}}a("event trigger"),clearTimeout(w),w=setTimeout(e,2e3)}(),"ok"},p.setTags=function(e){j(null,null,e)};var f=t.currentScript.src.replace(/.js$/,".html")+(u?"?debug":""),v=e.px2_ut_server||"https://zipper.performax.cz",h=v+"/ut",m=v+"/et.js",x=e!==top,g=null,y=null;e.px2utc=function(e){a("etag",e),g=e};var T,S=!1,w=null;T=function(){var n;(n=t.createElement("script")).src=m,t.head.appendChild(n),function(){var n=t.createElement("iframe");n.src=f,n.style.width="0",n.style.height="0",n.style.border="none",n.style.position="absolute";var r=setTimeout((function(){a("ifr timeout"),j()}),1e3);e.addEventListener("message",(function(e){e.data.px2&&a("from iframe",e),"init"===e.data.px2&&(clearTimeout(r),j(n,e.data)),"exit"===e.data.px2&&(a("remove ifr"),n.remove())})),n.onload=function(){a("ifr loaded")},t.body.appendChild(n)}()},t.body?T():new MutationObserver((function(){t.body&&(T(),this.disconnect())})).observe(t.documentElement,{childList:!0})}function _(){return(new Date).getTime()}function b(){return Math.floor(_()/1e3)+"-"+Math.round(9e9*Math.random()+1e9)}function O(e){try{return localStorage.getItem(e)}catch(e){return void a("ls err",e)}}function q(e,t){return e.indexOf(t)>-1}function k(){try{var e=t.cookie}catch(e){return"0-err"}var n=e.match(new RegExp(o+"=([^;]+)"));return n&&n[1]||""}function M(){try{return e.px2||top.px2}catch(e){return null}}function C(){var e=M();if(e){var t=e.cmp||{};return t.versionFlexo=e.versionFlexo,t}}function E(){try{return top.location.href||""}catch(e){return a("location err",e),t.referrer||""}}function N(){var e;return{pv_id:c,req_id:b(),et_id:g,url:E(),ver:"v0.4.0",events:(e=d.slice(),d.length=0,e),storeUrl:!1,uids:[y],cmp:C()}}function j(n,r,u){!function(){var t;for(;t=p.queue.shift();)try{t()}catch(e){d.push({name:"error",data:e.toString()})}a("mock push"),p.queue.push=function(e){e()},l=!0,a("unload registered"),e.addEventListener("pagehide",(function(){var e=N();0!==e.events.length?(e.unload=1,a("unload start",e),fetch(h+"?unload",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(e),keepalive:!0}),a("unload end")):a("unload - skip")}))}();var s,c=N();c.uids=[(s=O(i),void 0===s?"0-err":s||""),k(),r&&r.uid],c.storeUrl=!0,(u=u||p.data.tags)&&(c.tags=u),a("send:",c,"api="+h);var f=new XMLHttpRequest;f.open("POST",h),f.withCredentials=!0,f.setRequestHeader("Content-Type","application/json;charset=UTF-8"),f.onload=function(e){var s=JSON.parse(f.responseText);if(s.uid&&(!function(e){try{a("set",e),localStorage.setItem(i,e)}catch(e){a("set ls err",e)}}(s.uid),function(e){var n="";x&&(n="SameSite=None;"),t.cookie=o+"="+e+"; path=/; Secure; "+n+" max-age=7776000;"}(s.uid),y=s.uid),a("from xhr:",s,e),s.new&&u&&!S)return S=!0,a("renew"),void j(n,r,u);n&&!s.new&&n.contentWindow.postMessage({px2:"set",uid:s.uid},"*")},f.send(JSON.stringify(c))}}(e,t)}(window,document,console);