/*! For license information please see api.v2.js.LICENSE.txt */ (()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],n=e.indexOf("?");return n>=0?(t&&(n+=1),e.slice(n)):""}function a(e,t){var n=i(e,!0),r={targetContent:"",newContent:""};if(n){var a=s(n),c=s(t),l=o(o({},a),c);r.targetContent=n,r.newContent=function(e){var t=new URLSearchParams;for(var n in e)e.hasOwnProperty(n)&&t.append(n,e[n]);return t.toString()}(l)}else r.targetContent=e,r.newContent="".concat(e,"?").concat(t);return r}function s(e){var n,r,o,i={},a=function(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=t(e))){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(new URLSearchParams(e).entries());try{for(a.s();!(n=a.n()).done;){var s=(r=n.value,o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(r,o)||t(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=s[0],l=s[1];i[c]=l}}catch(e){a.e(e)}finally{a.f()}return i}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function l(){l=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof w?t:w,a=Object.create(i.prototype),s=new A(r||[]);return o(a,"_invoke",{value:j(e,n,s)}),a}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=f;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",g={};function w(){}function b(){}function _(){}var E={};d(E,a,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(L([])));O&&O!==n&&r.call(O,a)&&(E=O);var P=_.prototype=w.prototype=Object.create(E);function I(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(o,i,a,s){var l=p(e[o],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==c(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,n,r){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var c=S(s,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var l=p(t,n,r);if("normal"===l.type){if(o=r.done?m:y,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=m,r.method="throw",r.arg=l.arg)}}}function S(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t\n ")):r.innerHTML='\n \n '),r.querySelector("iframe").onload=function(){n.iframe=r.querySelector("iframe").contentWindow,window.addEventListener("message",n.captureMessage,!1)}};if(h)fetch("https://api-v2.pandavideo.com/oembed?url="+encodeURIComponent(h)).then((function(e){if(200===e.status)return e.json();throw new Error("PandaPlayer: invalid url")})).then((function(e){var t=e.video_external_id,r=e.pullzone_name,o=e.live_id,i=e.video_hls,a=e.video_ids,s=e.id,c=e.height,l=e.width;n.video_hls=i,n.live_id=o,n.video_external_id=t,n.library_id=r,n.video_width=l,n.video_height=c,a&&s&&(n.comparison_id=s),w()}));else{if(p)this.video_external_id=p;else{if(!u)return void console.error("PandaPlayer: video_external_id is required");this.video_external_id=u}if(!d)return void console.error("PandaPlayer: library_id is required");this.library_id=d,w()}}else if("IFRAME"===r.tagName&&r.src){var b,_=document.getElementById(e),E=document.querySelector(e);b=_&&_.contentWindow?_:E,this.iframe=b.contentWindow;var x=new URL(b.src);this.video_external_id=x.searchParams.get("v");var O=x.searchParams.get("l");this.library_id=O||x.hostname.split(".tv")[0].split("player-")[1],window.addEventListener("message",this.captureMessage,!1)}}else r.addEventListener("load",(function(){n._onCreate(e,t)}))}},{key:"pipScrollFollow",value:function(e){var t=e.panda_id_player,n=e.style,r=document.getElementById(t);if(r){var o=!1,i=null,a=!1,s=null;n=n||{};var c={position:r.style.position||"",bottom:r.style.bottom||"",right:r.style.right||"",left:r.style.left||"",top:r.style.top||"",width:r.style.width||"",height:r.style.height||"",zIndex:r.style.zIndex||""};r.dataset.originalStyles=JSON.stringify(c),window.addEventListener("scroll",(function(){clearTimeout(a),a=setTimeout((function(){if(!o&&function(e){var t=e.getBoundingClientRect();return t.bottom<.4*t.height&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)}(r)){var e=r.getBoundingClientRect();s||((s=document.createElement("div")).style.width=r.offsetWidth+"px",s.style.height=r.offsetHeight+"px",s.style.backgroundColor="black",s.style.position=r.style.position,s.style.top=r.style.top,s.style.right=r.style.right,s.style.left=r.style.left,s.style.margin=window.getComputedStyle(r).margin,r.parentNode.insertBefore(s,r)),r.style.position="fixed",r.style.bottom=n.bottom?"".concat(parseInt(n.bottom),"px"):"10px",r.style.top=n.top?"".concat(parseInt(n.top),"px"):"auto",r.style.right=n.right?"".concat(parseInt(n.right),"px"):"10px",r.style.left=n.left?"".concat(parseInt(n.left),"px"):"auto",r.style.width=n.width?"".concat(parseInt(n.width),"px"):"420px",r.style.height=n.height?"".concat(parseInt(n.height),"px"):"236px",r.style.zIndex="9999",i=e.bottom+window.scrollY-.4*e.height,o=!0}else if(o&&null!==i&&window.scrollY<=i+1){console.log(s,"placeholderDiv"),s&&(s.parentNode.removeChild(s),s=null);var t=JSON.parse(r.dataset.originalStyles);r.style.position=t.position,r.style.bottom=t.bottom,r.style.right=t.right,r.style.left=t.left,r.style.top=t.top,r.style.width=t.width,r.style.height=t.height,r.style.zIndex=t.zIndex,o=!1,i=null}}),100)}))}}},{key:"loadWindowScreen",value:function(e){var t=e.panda_id_player,n=!1,r=0,o=0,i=0,a=document.getElementById(t).style.position,s=function(){var e=document.getElementById(t);r||(r=e.height?e.height:e.style.height),o||(o=e.width?e.width:e.style.width),i||(i=e.style.zIndex),e.style.height=window.innerHeight+"px",e.style.width=window.innerWidth+"px",e.style.position="fixed",e.style.overflow="hidden",e.style.left=0,e.style.top=0,e.style.zIndex=999999,document.body.style.overflow="hidden",n=!0},c=function(){var e=document.getElementById(t);e.style.height=r?r.match(/%/)?r:r+"px":"100%",e.style.width=o?o.match(/%/)?o:o+"px":"100%",e.style.position=a,e.style.zIndex=i,document.body.style.overflow="inherit",n=!1};this.onEvent((function(e){"panda_open_window_fullscreen"==e.message?s():"panda_close_window_fullscreen"==e.message&&c()})),document.onkeydown=function(e){27==(e=e||window.event).keyCode&&n&&c()},window.addEventListener("resize",(function(){n&&s()}))}},{key:"loadButtonInTime",value:(r=l().mark((function e(t){var n,r,o,i,s,c,u,f,p,h,y,m,g=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.time,r=t.divId,o=t.script,i=t.fetchApi,s=t.duration,c=t.isAsync,u=t.metadata,!i){e.next=23;break}if(f="https://config.tv.pandavideo.com.br/".concat(this.library_id,"/").concat(this.video_external_id,".json?date=").concat((new Date).getTime()),!c){e.next=20;break}return e.prev=4,e.next=7,fetch(f);case 7:return p=e.sent,e.next=10,p.json();case 10:h=e.sent,(y=h.outsideCta)&&y.length&&(this.outsideCtas=y,y.forEach((function(e){g.loadButtonInTime(d(d({},e),{},{time:parseInt(""+e.time,10)}))}))),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(4),console.error(e.t0);case 18:e.next=21;break;case 20:fetch(f).then((function(e){return e.json()})).then((function(e){if(e.outsideCta){var t=e.outsideCta;g.outsideCtas=t,t.forEach((function(e){g.loadButtonInTime(d(d({},e),{},{time:parseInt(""+e.time,10)}))}))}}));case 21:e.next=29;break;case 23:if(!r){e.next=29;break}if(m=this,document.getElementById(r)){e.next=28;break}return e.abrupt("return");case 28:this.onEvent((function(e){if("panda_timeupdate"===e.message){var t=e.currentTime;if(e.isMutedIndicator)return;var i=document.getElementById(r),c=document.getElementById("".concat(r,"_iframe"));try{s=parseInt(s+"",10)}catch(e){s=0}if(isNaN(n)&&(n=0),0===s&&(s=g.duration+1),t>=n&&t(.|\n)*?<\/script>/gm,n=o.match(t),i=o.replace(t,"");if(n&&n.length){var s=n[0].replace("