e.element.clientHeight-f,m=l>e.element.clientWidth-h&&d=L&&null===y&&(e.events.fire(Ge.targetTimeReached),e.events.off([Ge.playProgress,Ge.seeked],t))})}function m(){e.events.on($e.reset,function(){w=!0,k=!0,S=!0,T=!1,P=!1,v(),n()})}var g=2e3,_=4500,y=null,b=yt.touch?_:g,w=!0,k=!0,x=!1,S=!0,T=!1,E=!1,P=!1,L=1.75,C=t.querySelector(".target"),O=t.querySelector(".sidedock"),A=t.querySelector(".controls"),I=t.querySelector(".title"),M=t.querySelector(".video"),F=e.config.embed.autoplay&&e.config.request.flags.autohide_controls;return l(),d(),f(),h(),p(),v(),m(),{}}function Pe(e,t){function n(){return t.classList.contains("overflow")?void t.classList.remove("overflow"):void(t.clientHeight$&&($=t,l(j,Math.floor(t/1e3).toLocaleString()+" Kbps")),t',u=k[L].map(function(t){var n=t.time/e.telecine.duration*o,i=a-a*t.speed/$;return isNaN(i)&&(i=0),n+","+d(i,0,a)});if(Y){var f={time:e.telecine.currentTime,color:Y,type:Q[Y]};switch(f.type){case"resize":var h=i(W),p=r(h.width,h.height);T=p,f.title="Resized from "+T+" to "+p;break;case"downswitch":case"upswitch":f.title="Switched from "+E+" to "+P;break;default:f.title=Q[Y]}x[L].push(f),Y=!1}return x[L].forEach(function(t){var n=t.time,i=t.color,r=t.title,s=n/e.telecine.duration*o,u="";u+=""+r+"",u+='',u+="",c+=u}),c+="",c+='',c+=""}function h(){return window.devicePixelRatio&&window.devicePixelRatio>1?"@"+window.devicePixelRatio+"x":""}function p(e,t){L+=1,k.push([]),x.push([]),S.push([{title:e,time:Math.round(100*t)/100}])}function v(n,o){var a;C[n]||(C[n]=[]),C[n].length===b&&C[n].pop(),O||u(),C[n].unshift(o);var s=void 0;switch(n){case"resize":return Y=J.resize,s=i(W),e.events.fire(Ge.resize,s),void l(F,""+r(s.width,s.height));case"streamchange":var c=o.index,d=o.streams,h=d[c],v=e.config.request.files.dash.cdn,m=e.config.request.files.dash.streams[c].profile;return K!==h.bitrate&&(null!==K&&(Y=J.upswitch,h.bitrate=t.length?t[0]:i<0?t[t.length-1]:t[i],!r||(r.focus(),!1)}function m(){return!!A||(document.activeElement&&document.activeElement!==document.body?void 0:(e.events.fire(Ge[e.telecine.paused?"playButtonPressed":"pauseButtonPressed"]),i(),!1))}function g(){return A?(A.element.contains(document.activeElement)&&A.button.focus(),A.hide(),!1):document.activeElement&&t.contains(document.activeElement)?(document.activeElement.blur(),!0):O?(e.events.fire(Ge.overlayCloseButtonPressed),!1):void 0}function _(){if(A)return!A.element.contains(document.activeElement)||v("up");if(yt.threeSixtyVideo&&e.config.video.is_panorama)return e.telecine.getEffectByName("ThreeSixtyEffect").keyPress("up"),!1;if(e.config.embed.on_site&&document.activeElement&&!t.contains(document.activeElement))return!0;i();var n=!1,r=!0;return e.events.fire($e.changeVolume,Ao,n,r),!1}function y(){if(A)return!A.element.contains(document.activeElement)||v("down");if(yt.threeSixtyVideo&&e.config.video.is_panorama)return e.telecine.getEffectByName("ThreeSixtyEffect").keyPress("down"),!1;if(e.config.embed.on_site&&document.activeElement&&!t.contains(document.activeElement))return!0;i();var n=!1,r=!0;return e.events.fire($e.changeVolume,-Ao,n,r),!1}function b(t,n){if(A)return!A.element.contains(document.activeElement)||v("left"===n?"up":"down");if(i(),yt.threeSixtyVideo&&e.config.video.is_panorama)return e.telecine.getEffectByName("ThreeSixtyEffect").keyPress(n),!1;if(document.activeElement&&document.activeElement===C){var r=!1,o=!0,a="left"===n?-Ao:Ao;return e.events.fire($e.changeVolume,a,r,o),!1}return t.shiftKey||0===R?void u(n,t.shiftKey):void D(n,t.shiftKey)}function w(){e.events.on(Ge.overlayOpened,function(e){O=!0,P=e,"notsupported"===e&&(L=!0)}),e.events.on(Ge.overlayClosed,function(){O=!1,P=null})}function k(){e.events.on(Ge.menuVisibilityChanged,function(e,t){A=!!e&&t})}function x(){e.events.on(Ge.configChanged,function(e){e&&(L=!1)})}function S(){function t(e){if(r(e),a(e)&&!s(e)&&n()){var t=o(e);if(t in u){if("function"==typeof u[t])return void(u[t](e,t)===!1&&(e.preventDefault(),e.stopPropagation()));c(u[t])===!1&&(e.preventDefault(),e.stopPropagation())}}}function i(t){if(r(t),!s(t)&&n()){var i=o(t);return yt.threeSixtyVideo&&e.config.video.is_panorama&&("left"===i||"right"===i||"up"===i||"down"===i)?void e.telecine.getEffectByName("ThreeSixtyEffect").keyUp(i):void("left"!==i&&"right"!==i||d(t))}}var u={l:Ge.likeButtonPressed,w:Ge.watchLaterButtonPressed,s:Ge.shareButtonPressed,c:[Ge.ccButtonPressed,!0],h:[Ge.hdButtonPressed,!0],f:Ge.fullscreenButtonPressed,x:[Ge.effectButtonPressed,!0],e:[Ge.effectButtonPressed,!0],d:Ge.debugButtonPressed,space:m,up:_,down:y,left:b,right:b,esc:g,"?":[$e.showOverlay,"help"]};e.config.embed.on_site||(u.v=$e.openVimeo),document.addEventListener("keydown",t,!1),document.addEventListener("keypress",t,!1),document.addEventListener("keyup",i,!1)}function T(){e.events.on(Ge.becameActive,function(){L=!1}).on(Ge.becameInactive,function(){L=!0}),e.config.embed.on_site&&document.querySelector(".player")===t&&(L=!1)}function E(){var e=void 0,t=!1;document.body.addEventListener("keydown",function(n){9!==n.which||document.body.classList.contains("showfocus")?27===n.which?document.body.classList.remove("showfocus"):32!==n.which&&13!==n.which||(t=!0,clearTimeout(e),e=setTimeout(function(){t=!1},200)):document.body.classList.add("showfocus")}),document.body.addEventListener("click",function(e){
t||document.body.classList.remove("showfocus")})}var P,L=!!e.config.embed.on_site,C=t.querySelector(".volume"),O=!1,A=!1,I=e.config.video.fps/5,M=Math.max(I,.618*e.config.video.duration),F=100,q=I,R=0,B=!1,D=p(u,80);return w(),k(),x(),S(),T(),E(),{pause:function(){L=!0},unpause:function(){L=!1}}}function Ce(e,t){function n(e){var n="watchlater"===e||"unwatchlater"===e?.5:.4,i=t.clientHeight;return t.clientHeight>t.clientWidth&&(i=t.clientWidth),{height:Math.round(i*n),width:Math.round(i*n*1.6)}}function i(e,t){var n=e.querySelector(".hour-hand"),i=e.querySelector(".minute-hand");if(n&&i){var r=t?1:-1,o=new Date,a=Math.abs(o.getHours()-12),s=o.getMinutes(),c=s/60*360-135,u=a/12*360+s/60*5,l=1.5,d=u+30*l*r,f=c+360*l*r;if(yt.browser.firefox||yt.browser.opera){var h="10 10";n.setAttribute("transform","rotate("+u+","+h+")"),i.setAttribute("transform","rotate("+c+","+h+")");var p=document.createElementNS("http://www.w3.org/2000/svg","animateTransform");p.setAttribute("attributeName","transform"),p.setAttribute("type","rotate"),p.setAttribute("begin","0.1s"),p.setAttribute("repeatCount","indefinite");var v=p.cloneNode(!1);v.setAttribute("from",u+" "+h),v.setAttribute("to",u+360*r+" "+h),v.setAttribute("dur","0.8s"),n.appendChild(v);var m=p.cloneNode(!1);m.setAttribute("from",c+" "+h),m.setAttribute("to",c+360*r+" "+h),m.setAttribute("dur","9.6s"),i.appendChild(m)}else n.style[yt.transformProperty+"Origin"]="46% 81.5%",i.style[yt.transformProperty+"Origin"]="25.5% 26.5%",n.style[yt.transformProperty]="rotate("+u+"deg)",i.style[yt.transformProperty]="rotate("+c+"deg)";window.requestAnimationFrame(function(){e.classList.add("animate"),yt.browser.firefox||yt.browser.opera||window.requestAnimationFrame(function(){n.style[yt.transformProperty]="rotate("+d+"deg)",i.style[yt.transformProperty]="rotate("+f+"deg)"})})}}function r(e,r){if(null!==t.parentElement.offsetParent){t.classList.remove("hidden"),t.removeAttribute("hidden"),t.setAttribute("data-name",e);var a=n(e),s="width:"+a.width+"px;height:"+a.height+"px";d.style.cssText=s,d.innerHTML=r,"watchlater"!==e&&"unwatchlater"!==e||i(d,"watchlater"===e),clearTimeout(l),t.classList.remove("animate"),window.requestAnimationFrame(function(){t.classList.remove("invisible"),l=setTimeout(o,750)})}}function o(){t.classList.add("animate"),t.classList.add("invisible")}function a(){t.classList.remove("animate"),t.classList.remove("invisible"),t.classList.add("hidden"),t.setAttribute("hidden",""),t.removeAttribute("data-name"),d.innerHTML="",d.classList.remove("filled"),d.classList.remove("animate"),e.events.fire(Ge.notificationHidden)}function s(){e.events.on(Ge.liked,function(e){e||r("like",ut.render("icon_heart"))}),e.events.on(Ge.unliked,function(e){e||r("unlike",ut.render("icon_broken_heart"))})}function c(){e.events.on(Ge.addedToWatchLater,function(e){e||r("watchlater",ut.render("icon_clock"))}),e.events.on(Ge.removedFromWatchLater,function(e){e||r("unwatchlater",ut.render("icon_clock"))})}function u(){et(t).on("transitionend",function(e){d.contains(e.target)&&"height"===e.propertyName?setTimeout(o,100):e.target===t&&"opacity"===e.propertyName&&window.requestAnimationFrame(a)})}var l,d=t.querySelector(".notification");return u(),s(),c(),e.events.fire(Ge.notificationModuleReady),{}}function Oe(e,t){function n(t){if("vod"===e.config.embed.outro){var n="undefined"!=typeof e.config.video.vod.is_preorder?e.config.video.vod.is_preorder:!!e.config.video.vod.date_available,i=e.config.video.vod.is_coming_soon,o=e.config.video.vod.date_available_formatted_datetime||e.config.video.vod.date_available,s="Coming soon to Vimeo On Demand.";return i&&o&&(s="Coming soon to Vimeo On Demand on "+o+"."),n&&(s="Pre-order now. Watch on "+o+"."),g={purchased:e.config.user.purchased,title:e.config.video.vod.feature_title,url:e.config.video.vod.url,currency:e.config.request.currency,countries:e.config.video.vod.countries,country:e.config.request.country,buttons:e.config.video.vod.purchase_options,translationMap:e.config.request.dynamic_translation_map,isPreorder:n,isComingSoon:i,releaseDate:o,strings:{watch:n?"Watch on "+o:"Watch Now",preRelease:s}},void(b===!0&&a())}x=!0;var c=new XMLHttpRequest;c.open("GET","https://"+e.config.player_url+"/video/"+e.config.video.id+"/outro?on_site="+e.config.embed.on_site+"&type="+e.config.embed.outro,!0),c.withCredentials=!0,c.onload=function(){try{var n=JSON.parse(c.response);g=n.data,"videos"!==n.type&&"promoted"!==n.type||(g={contexts:Array.isArray(g)?g:[g],owner:e.config.video.owner.id},r()),"function"==typeof t&&t()}catch(e){}},c.send()}function i(e){for(var t=e.innerHTML;e.scrollHeight>e.clientHeight;)t=t.substring(0,t.length-1),e.innerHTML=t+"…"}function r(){for(var e=0,t=g.contexts.length;e0&&n.push(o)}e.events.fire(Ge.outroDisplayed,n)}}function u(){e.events.on(Ge.playProgress,function(e,t,i){b=!1,!x&&null===g&&e>=t-k&&n()})}function l(){e.events.on(Ge.playInitiated,function(){"nothing"!==e.config.embed.outro&&"beginning"!==e.config.embed.outro||(g=!1)}),e.events.on(Ge.ended,function(){return e.config.embed.email&&1===e.config.embed.email.time?(e.events.fire($e.showOverlay,"email-capture"),void e.events.once(Ge.overlayClosed,function(){return e.events.fire($e.showOutro)})):void e.events.fire($e.showOutro)}),e.events.on($e.showOutro,function(){e.performDelegateAction(Ve.showOutro,function(){b=!0,a()})}),e.events.on($e.hideOutro,function(){s()}),et(t).on("click",".videos a",function(t){e.events.fire(Ge.outroVideoPressed,parseInt(this.getAttribute("data-video-id"),10))}),et(t).on("transitionend",function(e){t.classList.contains("in")||(t.classList.add("hidden"),t.setAttribute("hidden",""))},!1),e.events.on([Ge.played,Ge.seeked,Ge.scrubbingStarted],s)}function d(){e.events.on($e.showOverlay,function(){setTimeout(function(){t.classList.add("hidden")},150)}),e.events.on(Ge.overlayClosed,function(){t.classList.contains("in")&&t.classList.remove("hidden")})}function f(){e.events.on($e.reset,function(){g=null,x=!1})}function h(){w(t,".vod-button",function(){var t=this.getAttribute("data-product-id");return e.events.fire(Ge.vodButtonPressed,t),!1}),w(t,".vod-watch-button",function(){if(!("date_available"in e.config.video.vod))return s(),e.events.fire(Ge.vodButtonPressed),!1})}function v(){window.removeEventListener("resize",S),window.addEventListener("resize",S)}var m=t.querySelector(".outro"),g=null,_=!1,y=!1,b=!1,k=10,x=!1,S=p(c,250);return u(),l(),d(),f(),h(),v(),{}}function Ae(){return Mo[Math.floor(Math.random()*Mo.length)]}function Ie(e,t){function n(){var e=t.getBoundingClientRect(),n=J.getBoundingClientRect(),i=te.getBoundingClientRect(),r=n.bottom+(e.height-n.bottom)/2;return e.height-r-i.height/2+"px"}function i(){var e=t.getBoundingClientRect(),n=J.getBoundingClientRect(),i=Z.getBoundingClientRect(),r=e.height/2,o=n.bottom+(e.height-n.bottom)/2;return{top:r-i.height/2+"px",transform:"translateY("+(o-r)+"px)"}}function r(r,o){t.setAttribute("data-name",r),J.innerHTML=o.template,Y=document.activeElement,Y.blur(),o.modal&&c(),o.preventBackgroundClose&&t.setAttribute("data-background-close","false"),o.wrapperClass&&t.classList.add(o.wrapperClass),o.icon.type&&(o.logo&&(te.classList.remove("hidden"),Z.classList.add("cloaked"),window.requestAnimationFrame(function(){te.innerHTML=ut.render("logo"),te.style.bottom=n()})),Z.classList.remove("hidden"),ee.innerHTML=o.icon.html,window.requestAnimationFrame(function(){var e=i();Z.style.top=e.top,Z.style[yt.transformProperty]=e.transform}),t.setAttribute("data-icon",o.icon.type),Z.setAttribute("data-icon",o.icon.type),ee.setAttribute("data-icon",o.icon.type),"private-unlocked"===r&&ee.classList.add("open")),t.classList.add("invisible"),t.classList.remove("hidden"),t.removeAttribute("hidden"),t.classList.add("in"),re=o,ie=r,ne=!0,e.events.fire(Ge.overlayOpened,r),["share","hd-not-allowed"].indexOf(r)>-1&&f(t),window.requestAnimationFrame(function(){t.classList.remove("invisible"),window.requestAnimationFrame(function(){J.classList.add("in"),Q.classList.add("in")})})}function o(){J.classList.remove("in"),J.classList.add("out")}function a(n){if(!d()&&ne){t.removeAttribute("data-background-close"),Q.classList.remove("in"),Q.classList.add("out"),o(),t.classList.remove("in"),t.classList.add("out"),clearTimeout(X),X=setTimeout(s,200),n&&n.preventDefault&&n.preventDefault();var i=t.querySelector(".back");i&&i.classList.add("cloaked"),e.events.fire(Ge.overlayClosed,ie),ne=!1,ie=null,re=null,window.requestAnimationFrame(function(){Y&&(Y.focus(),Y=null)})}}function s(){t.setAttribute("hidden",""),t.removeAttribute("data-name"),t.removeAttribute("data-icon"),t.classList.add("hidden"),t.classList.remove("out"),t.classList.remove("embed-active"),t.classList.remove("modal"),t.classList.remove("embed-only"),Q.classList.remove("out"),Q.classList.remove("in"),Z.removeAttribute("data-icon"),Z.classList.add("hidden"),Z.classList.remove("animate"),ee.removeAttribute("data-icon"),ee.innerHTML="",te.classList.add("hidden"),J.classList.remove("out"),J.innerHTML="",e.events.fire(Ge.overlayCleared)}function c(){t.classList.add("modal"),t.setAttribute("data-modal","true")}function l(){t.setAttribute("data-modal","false")}function d(){return"true"===t.getAttribute("data-modal")}function h(e){if("yes"===e.form.getAttribute("data-bubble")){e.form.setAttribute("data-bubble","no");var n=t.querySelector(".validation-bubble"),i=n.querySelector(".validation-bubble-message");i.innerHTML=e.validationMessage||"There is an error with this input.";var r=e.getBoundingClientRect(),o=e.form.getBoundingClientRect();n.style.left=r.left-o.left+"px",n.style.top=r.height+1+"px",n.classList.remove("hidden"),e.focus(),window.requestAnimationFrame(function(){n.classList.add("animate")}),p()}}function p(e){var n=t.querySelector(".validation-bubble");if(n){if(e)return clearTimeout(K),void n.classList.remove("animate");clearTimeout(K),K=setTimeout(function(){n.classList.remove("animate")},5e3)}}function v(e){var n=t.querySelector("input[type=password]");return n.form.classList.contains("submitted")?(n.setAttribute("aria-invalid","false"),n.setCustomValidity(""),n.checkValidity&&!n.checkValidity()?(n.setAttribute("aria-invalid","true"),n.validity.valueMissing&&n.setCustomValidity("Please enter the password."),e||h(n),!1):(p(!0),!0)):null}function m(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.showBubble,i=void 0===n||n,r=t.querySelector("input[type=email]");return r.setAttribute("aria-invalid","false"),r.setCustomValidity(""),r.checkValidity&&!r.checkValidity()?(r.setAttribute("aria-invalid","true"),r.validity.valueMissing&&r.setCustomValidity("Please enter your email."),r.validity.typeMismatch&&r.setCustomValidity("Please enter a valid email."),i&&h(r),!1):(p(!0),!0)}function g(e,n,i){f(t);var r=ti(e.querySelectorAll("input")),o=r.map(function(e){return e.name?encodeURIComponent(e.name)+"="+encodeURIComponent(e.value):encodeURIComponent(e.value)}).join("&"),a=new XMLHttpRequest;a.open(e.method,e.action+window.location.search,!0),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.withCredentials=!0,a.timeout=3e3,a.onload=function(){var e;try{e=JSON.parse(a.responseText)}catch(e){}n(e,a)},a.onerror=function(e){i(e)},a.send(o)}function _(){y(),k(),l(),o()}function y(){te.classList.add("animate")}function b(){te.classList.add("hidden"),te.classList.remove("animate")}function k(){Z.classList.remove("cloaked"),Z.classList.add("animate"),window.requestAnimationFrame(function(){Z.style[yt.transformProperty]="translateY(-10px)"})}function x(){Z.classList.add("centered"),Z.style[yt.transformProperty]=""}function S(){ee.classList.add("open")}function T(){ee.classList.add("pulled-back")}function E(){ee.classList.add("out"),ee.classList.remove("pulled-back")}function P(){et(t).on("transitionend",".overlay-logo",function(e){"opacity"===e.propertyName&&this.classList.contains("animate")&&b()}),et(t).on("transitionend",".overlay-icon-wrapper",function(e){e.propertyName.indexOf("transform")>-1&&(""===this.style[yt.transformProperty]?(this.classList.remove("centered"),"lock"!==this.getAttribute("data-icon")||ee.classList.contains("open")||ee.querySelector("canvas")?T():setTimeout(S,100)):"translateY(-10px)"===this.style[yt.transformProperty]&&x())}),et(t).on("transitionend",".overlay-icon",function(e){e.propertyName.indexOf("transform")>-1&&(this.classList.contains("out")?(l(),a()):this.classList.contains("pulled-back")?E():this.classList.contains("open")&&T())})}function L(){return{modal:!1,template:null,logo:!1,icon:{type:null,html:null}}}function C(t,n){var i=e.config.video.title,r=e.config.video.owner.name,o=e.config.video.share_url;return t.template=ut.render("share",{url:e.config.video.url,shareUrl:o,playerShareUrl:"https://"+e.config.player_url+"/video/"+e.config.video.id+"/share",title:i,owner:r,embed:"public"===e.config.video.embed_permission&&e.config.embed.settings.embed,embedOnly:e.config.embed.settings.share&&e.config.embed.settings.share.embed_only,embedCode:e.config.video.embed_code.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""),copyButton:oe||yt.flash.installed,customizeEmbed:!!e.config.video.url,readOnly:!yt.touch,strings:{share:"Share",facebook:"Share on Facebook",twitter:"Share on Twitter",tumblr:"Share on Tumblr",email:"Share via Email",emailSubject:"Check out “"+i+"” from "+r+" on Vimeo",emailBody:"Check out “"+i+"” from "+r+" on Vimeo.\n\nThe video is available for your viewing pleasure at "+o+"\n\nIf you like this video, make sure you share it, too!\n\nVimeo is filled with lots of amazing videos. See more at https://vimeo.com.",embedCode:"Get embed code",embedTitle:"Embed",embedSubtitle:"Add this video to your site with the embed code below.",copy:"Copy",copySuccess:"Copied!",customize:'Customize this embed on Vimeo'}}),e.config.embed.settings.share&&e.config.embed.settings.share.embed_only&&(t.wrapperClass="embed-only"),t}function O(t){return t.icon={type:"lock",html:ut.render("icon_lock")},t.modal=!0,t.logo=!0,t.template=ut.render("private_locked",{action:"https://"+e.config.vimeo_url+"/log_in",strings:{title:"Private Video",subtitle:"Log in to watch (if you have permission)",logIn:"Log in",logInLabel:"Log in (opens in a new window)"}}),t}function A(t){return t.icon={type:"lock",html:ut.render("icon_lock")},t.template=ut.render("password",{action:"https://"+e.config.player_url+"/video/"+e.config.video.id+"/check-password?referrer="+e.config.request.referrer,strings:{title:"Password Required",subtitle:"If you’ve got it, enter it below.",password:"Password",watch:"Watch Video"}}),t.modal=!0,t.logo=!!e.config.embed.settings.branding,t}function I(e){return e.icon={type:"lock",html:ut.render("icon_lock")},e.template=ut.render("private_unlocked",{strings:{title:"Private Video",subtitle:"You are logged in and have permission to watch (congrats).",watch:"Watch Video"}}),e}function M(e){return e.template=ut.render("content_rating",{logo:ut.render("logo"),strings:{title:"Hold up!",subtitle:"This video is hidden because it may contain mature content including: nudity, strong language, and violence.",update:'You can update your mature content filter at any time.',watch:"I still want to watch this video"}}),e.modal=!0,e}function F(e,t){return e.template=ut.render("error",{title:t.title,message:t.message}),e.modal=!!t.modal,e.logo=!!t.logo,t.icon&&"lock"===t.icon&&(e.icon={type:"lock",html:ut.render("icon_lock")}),e}function q(t){return t.template=ut.render("help",{onSite:e.config.embed.on_site,strings:{title:"Keyboard Shortcuts",volumeUp:"Volume up",volumeDown:"Volume down",scrubForward:"Scrub forward",scrubBackwards:"Scrub backwards",like:"Like",share:"Share",watchLater:"Watch Later",captions:"Toggle Captions",hd:"Toggle HD menu",fullscreen:"Toggle fullscreen",viewOnVimeo:"View on Vimeo"}}),t}function R(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return t.template=ut.render("overlay_email_capture",{text:n.text||e.config.embed.email.text,subtitle:n.subtitle||"Share your email address with "+e.config.video.owner.name+".",action:"https://"+e.config.player_url+"/video/"+e.config.video.id+"/submit-email",confirmation:n.confirmation||e.config.embed.email.confirmation,referrer:e.config.request.referrer,strings:{email:"Email address",fullName:"Full name (optional)",submit:"Submit"}}),t.modal=!1,t.logo=!1,t.preventBackgroundClose=!0,t}function B(e){var t=window.getComputedStyle(e),n=document.createElement("button");n.style.visibility="hidden",n.style.padding=0,e.parentElement.appendChild(n),n.innerText="Copy";var i=n.clientWidth;n.innerText="Copied!";var r=n.clientWidth,o=parseFloat(t.fontSize),a=parseFloat(t.paddingLeft),s=parseFloat(t.paddingRight),c=a+Math.max(i,r)+s;return e.parentElement.removeChild(n),(c+2)/o+"em"}function D(){e.events.on($e.showOverlay,function(n,i){oe=document.queryCommandSupported&&document.queryCommandSupported("copy");var o=function(){var e=L();switch(n){case"share":r(n,C(e,i));var o=t.querySelector(".embed-copy");return void(o.style.width=B(o));case"private-locked":return void r(n,O(e));case"password":return void r(n,A(e));case"private-unlocked":return void r(n,I(e));case"error":return void r(n,F(e,i));case"help":return void r(n,q(e));case"content-rating":return void r(n,M(e));case"email-capture":return void r(n,R(e,i))}};return ne?"share"!==ie&&"help"!==ie&&"hd-not-allowed"!==ie||ie!==n?(e.events.once(Ge.overlayCleared,o),l(),void a()):void a():void o()}),et(t).on("input","input",function(){this.form.classList.add("interacted")}).on(["focus","blur"],"input",function(){p(!0)}).on("transitionend",".validation-bubble",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&this.classList.add("hidden")}),e.events.on([Ge.overlayCloseButtonPressed,Ge.played],a),e.events.on(Ge.privateUnlocked,function(){"private-locked"===ie&&(l(),a())}),e.events.on(Ge.configChanged,function(){"share"===ie&&(re=C(L(),e.config.embed.settings.share.embed_only),J.innerHTML=re.template)}),et(window).on("resize",function(){if(ne){te.style.bottom=n();var e=i();Z.style.top=e.top,Z.style[yt.transformProperty]=e.transform}})}function N(){function n(){e.events.fire(Ge.embedCodeCopied);var t=document.querySelector(".embed-copy");t.innerHTML=t.getAttribute("data-success-label"),clearTimeout(i),i=setTimeout(function(){t.innerHTML=t.getAttribute("data-label")},2e3)}var i;et(t).on("transitionend",".share-screen",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&this.classList.add("cloaked")}).on("transitionend",".embed-screen",function(e){"opacity"===e.propertyName&&"0"===window.getComputedStyle(this,"").opacity&&(t.querySelector(".back").classList.add("cloaked"),this.classList.add("cloaked"),f(t))}).on("copy","input[name=embed_code]",function(){e.events.fire(Ge.embedCodeCopied)}),w(t,".back",function(){return t.querySelector(".share-screen").classList.remove("cloaked"),t.classList.remove("embed-active"),!1}),w(t,".facebook",function(){e.events.fire(Ge.facebookButtonPressed,this.href);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".twitter",function(){e.events.fire(Ge.twitterButtonPressed,this.href);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".tumblr",function(){e.events.fire(Ge.tumblrButtonPressed,this.href);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".email",function(){e.events.fire(Ge.emailButtonPressed),window.location=this.href;try{document.activeElement.blur()}catch(e){}return!1}),w(t,".embed",function(){e.events.fire(Ge.embedButtonPressed);try{document.activeElement.blur()}catch(e){}return!1}),w(t,".embed-copy",function(){if(oe){var e=document.querySelector("input[name=embed_code]");e.select();try{document.execCommand("copy")&&n()}catch(e){}return document.activeElement.blur(),!1}}),yt.touch?et(J).on("focus","input[name=embed_code]",function(){var e=this;setTimeout(function(){e.setSelectionRange(0,9999),e.setAttribute("readonly","readonly")},0)}).on("blur","input",function(){this.removeAttribute("readonly")}):et(J).on("click","input[name=embed_code]",function(){this.setSelectionRange(0,9999)}),e.events.on(Ge.facebookButtonPressed,function(e){u(e,"facebook",{width:580,height:400})}).on(Ge.twitterButtonPressed,function(e){u(e,"twitter",{width:550,height:420})}).on(Ge.tumblrButtonPressed,function(e){u(e,"tumblr",{width:540,height:600})}).on(Ge.embedButtonPressed,function(){function i(){var t=document.querySelector(".embed-copy"),i=new ZeroClipboard(t,{moviePath:e.config.request.urls.zeroclip_swf,trustedDomains:["*"],allowScriptAccess:"always"});i.on("complete",n)}if(e.config.embed.settings.share.embed_only||(t.querySelector(".back").classList.remove("cloaked"),t.querySelector(".embed-screen").classList.remove("cloaked"),t.classList.add("embed-active")),!oe&&yt.flash.installed){var r="zc_script_loaded";if(!document.getElementById(r)){var o,a=document.createElement("script");return a.setAttribute("id",r),a.setAttribute("src",e.config.request.urls.zeroclip_js),a.onreadystatechange=a.onload=function(){o||i(),o=!0},void document.getElementsByTagName("head")[0].appendChild(a)}i()}})}function j(){et(J).on("click",".popup",function(){return e.events.fire($e.openPopup,"login-private-locked"),!1})}function H(){function t(t){function n(t,n){return t===!1?void i(n.status,n):(e.events.fire(Ge.passwordUnlocked,t),"icon-hidden"===window.getComputedStyle(Q,":after").content?(l(),void a()):void _())}function i(e){s.classList.remove("loading"),o.setCustomValidity("Uh oh. There was a problem. Please try again."),o.setAttribute("aria-invalid","true"),h(o)}var r=v();if(!r)return!1;var o=t.querySelector("input[type=password]"),s=t.querySelector("input[type=submit]");s.classList.add("loading"),g(t,n,i)}et(J).on("click",".password input[type=submit]",function(){this.form.classList.add("submitted"),this.form.setAttribute("data-bubble","yes"),v(!0)}).on("submit",".password form",function(){return t(this),!1}).on(["focus","input"],[".password input[type=email]",".password input[type=password]"],function(){v()})}function V(){w(J,".unlocked button",function(){_(),yt.iPad||yt.iPhone||e.events.once(Ge.overlayCleared,function(){e.events.fire(Ge.playButtonPressed)})})}function U(){w(J,".content-rating button",function(){l(),a()})}function z(){function t(){var e=J.querySelector(".email-capture-form"),t=J.querySelector(".email-capture-confirm");e.classList.add("invisible"),t.classList.remove("hidden"),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){t.classList.add("in"),setTimeout(a,2750)})})}function n(n){function i(n,i){return n===!1?void r(i.status,i):(e.events.fire(Ge.emailCaptureSuccess),void t())}function r(e){a.classList.remove("loading"),o.setCustomValidity("Uh oh. There was a problem. Please try again."),o.setAttribute("aria-invalid","true"),h(o)}if(!m())return!1;var o=n.querySelector("input[type=email]"),a=n.querySelector("input[type=submit]"),s={signature:"signature",time:"timestamp",expires:"expires"};Object.keys(s).forEach(function(t){var i=n.querySelector("input[name="+t+"]");i.value=e.config.request[s[t]]}),a.classList.add("loading"),g(n,i,r)}et(J).on("click",".email-capture input[type=submit]",function(){this.form.classList.add("submitted"),this.form.setAttribute("data-bubble","yes"),m()}).on("submit",".email-capture form",function(){return e.events.fire(Ge.emailCaptureSubmitted),n(this),!1}).on(["focus","input"],".email-capture input[type=email]",function(){m({showBubble:!1})})}function W(){var t=function(e,t,n){var i=window.location.search.indexOf("partypooper=1")>-1||window.location.search.indexOf("fun=0")>-1;switch(e){case"not-supported":return{name:"notsupported",title:i?"Sorry":Ae(),message:n>.5?"There was an issue playing this video.":"This video can’t be played with your current setup."};default:return{name:e,title:t&&t.title||"Sorry",message:t&&t.message||"There was an issue with playback."}}};e.events.on(Ge.error,function(n){var i=arguments.length<=1||void 0===arguments[1]?{modal:!0,final:!0}:arguments[1];if(i.final!==!1){var o=e.telecine?e.telecine.currentTime:0,s=t(n,i,o),c=s.name,u=s.title,l=s.message,d=L();return d.modal=i.modal,d.template=ut.render("error",{title:u,message:l}),ne?(a(),void e.events.once(Ge.overlayClosed,function(){return r(c,d)})):void r(c,d)}})}function $(){e.events.on(Ge.configChanged,function(){window.requestAnimationFrame(function(){l(),a()})})}function G(){w(t,".close",function(){e.events.fire(Ge.overlayCloseButtonPressed)}),et(t).on(["click","touchend"],[".window-wrapper",".share-wrapper",".overlay-logo"],function(e){e.stopPropagation()}).on(["click","touchend"],[".overlay-cell","nav"],function(){return"false"===t.getAttribute("data-background-close")||(e.events.fire(Ge.overlayCloseButtonPressed),!1)})}var X,K,Y,Q=t.querySelector(".overlay-cell"),J=t.querySelector(".overlay"),Z=t.querySelector(".overlay-icon-wrapper"),ee=Z.querySelector(".overlay-icon"),te=t.querySelector(".overlay-logo"),ne=!1,ie=null,re=null,oe=!1;return D(),P(),N(),j(),H(),V(),U(),z(),W(),$(),G(),e.events.fire(Ge.overlayModuleReady),{}}function Me(e,t){function i(e,t){var n=".player-"+u+" ",i=n+e.join(","+n);if(t){var r=l+" ";i+=","+r+e.join(","+r)}return d&&(i=i.replace(/:hover/g,":active")),i=i.replace(/ &/g,"")}function r(){var e=document.createElement("style");return e.setAttribute("data-player",u),document.querySelector("head").appendChild(e),f=e.sheet}function o(){for(;f.cssRules.length>0;)f.deleteRule(0)}function a(){f?o():r()}function s(e){a();var t=e.complement,r=new q(23,35,34,.75),o=new q(0,0,0,.15),s=o.overlayOn(e);r.contrast(t).ratio<3&&t.lighten(5,3,r);var c,u=e.lightness<40?e.clone().lighten(15,3,e):e.clone().darken(15,3,e);return n(i(Fo,!0),"color:"+e.hex+" !important",f),n(i(qo,!0),"color:"+t.hex+" !important",f),n(i(Ro),"color:"+e.hex,f),n(i(No),"fill:"+e.hex,f),n(i(Ho),"stroke:"+e.hex,f),n(i(Uo),"background-color:"+e.hex,f),n(i(zo),"border-color:"+e.hex,f),n(i(Bo),"color:"+t.hex,f),n(i(Do),"fill:"+t.hex,f),n(i(jo),"fill:"+u.hex,f),n(i(Vo),"stroke:"+u.hex,f),n(i(Qo),"border-color:"+s.hex,f),n(i(Jo),"background-color:"+s.hex,f),e.luminance>.95&&(t=e.clone().darken(15,3,e),n(i(Wo),"color:"+t.hex,f),n(i($o),"fill:"+t.hex,f),n(i(Go),"stroke:"+t.hex,f),u=t.clone().darken(15,3,t),n(i(jo),"fill:"+u.hex,f),n(i(Vo),"stroke:"+u.hex,f)),e.yiq>175&&e.luminance<.95&&(c=u.clone().darken(15,3,u),n(i(jo),"fill:"+c.hex,f),n(i(Vo),"stroke:"+c.hex,f),n(i(Xo),"color:"+u.hex,f),n(i(Ko),"fill:"+u.hex,f),n(i(Yo),"stroke:"+u.hex,f)),{main:e.hex,selected:u.hex,sidedockHover:c?u.hex:e.luminance>.95?t.hex:q.white.hex,sidedockSelected:e.luminance>.95?t.hex:e.hex,sidedockSelectedHover:c?c.hex:u.hex}}function c(){e.events.on($e.changeColor,function(t){var n;try{n=new q(t)}catch(e){n=new q("00adef")}var i=s(n);e.config._colors=i,e.config.embed.color=i.main.replace("#",""),e.events.fire(Ge.colorChanged,e.config.embed.color)}),e.events.fire($e.changeColor,e.config.embed.color)}var u=t.uuid,l=t.id,d=t.isMobileDevice,f=null;return c(),{}}function Fe(e){function t(){e.events.on($e.openPopup,function(t,n){var i="https://"+e.config.player_url,o=i+"/video/"+e.config.video.id,a=670,s=545;switch(t){case"login-like":r=u(o+"/login/like","login",{width:a,height:s}),e.events.fire(Ge.popupOpened,t);break;case"login-watch-later":r=u(o+"/login/watch-later","login",{width:a,height:s}),e.events.fire(Ge.popupOpened,t);break;case"login-private-locked":r=u(o+"/login/private","login",{width:a,height:s}),e.events.fire(Ge.popupOpened,t);break;case"purchase":var c=i+"/video/"+(e.config.video.vod.feature_id||e.config.video.id)+"/purchase/vod";n&&n.productId&&(c+="/"+n.productId),c+="?referrer="+encodeURIComponent(e.config.request.referrer),r=u(c,"purchase",{width:790,height:670}),e.events.fire(Ge.popupOpened,t)}}),window.closePopup=function(t){if(r){try{r.close(),e.events.fire(Ge.popupClosed,t)}catch(e){}r=null}}}function n(){e.config.embed.on_site||(window.confirmPurchase=function(t,n,i){return n?void e.loadVideo(t):void(i&&e.events.fire(Ge.playButtonPressed))})}function i(){e.config.embed.on_site||(window.confirmLoginAction=function(t,n){e.events.fire(Ge.userLogIn,n)})}var r=null;return t(),n(),i(),{}}function qe(e,t){function n(){D&&(K||(N&&X||H||z||Q)&&(j||(!V&&!U||H||z)&&(D=!1,e.events.fire(Ge.sidedockVisibilityChanged,D),(Y||t).classList.add("invisible"))))}function i(){if(!D&&!z&&!H){var n=Y||t;n.classList.add("invisible"),n.classList.remove("hidden"),n.removeAttribute("hidden"),t.classList.remove("hidden"),t.removeAttribute("hidden"),t.classList.contains("vod")&&t.classList.remove("vod"),setTimeout(function(){D=!0,e.events.fire(Ge.sidedockVisibilityChanged,D),n.classList.remove("invisible")},0)}}function r(){N=!1,j=!1,K=!1}function o(t,n,i){var r="data-label-"+i,o="add"!==i||e.config.user.logged_in?r:"data-label-add-logged-out";t.setAttribute("aria-label",t.getAttribute(o)),n.classList.add("hidden"),n.setAttribute("hidden",""),n.firstChild.innerHTML=t.getAttribute(r)}function a(){var e=W.indexOf(this);$.forEach(function(t,n){n!==e&&t&&t.classList.add("invisible")}),e>=0&&$[e]&&($[e].classList.add("invisible"),$[e].classList.remove("hidden"),$[e].removeAttribute("hidden",""),G=window.requestAnimationFrame(function(){G=window.requestAnimationFrame(function(){$[e].classList.remove("invisible"),$[e].classList.add("visible")})}))}function s(){var e="BUTTON"===this.tagName?this:this.querySelector("button"),t=W.indexOf(e);t>=0&&$[t]&&(G&&(window.cancelAnimationFrame(G),G=null),$[t].classList.add("invisible"))}function c(){if(C){var e=C.parentElement;Y.insertBefore(e,Y.firstChild)}}function u(){if(C){var e=C.parentElement;t.insertBefore(e,Y)}}function l(){if(e.config.view===He.main||e.config.view===He.privateUnlocked){var n=e.config.embed.settings,i=e.config.video.vod&&"purchase_options"in e.config.video.vod&&e.config.video.vod.purchase_options.length,r=i&&e.config.video.vod.is_coming_soon,o="ondemand.main"===e.config.embed.context,a=e.config.video.vod&&e.config.user.purchased?1:0,s=i&&n.vod&&_(e.config.video.vod.countries,e.config.request.country);s&&r&&o&&(s=!1);var u=i&&e.config.video.vod.purchase_options[0],l=null;u&&(l=m(e.config.request.dynamic_translation_map,"label_string",e.config.request.currency,u)),t.innerHTML=ut.render("sidedock",{loggedIn:!!e.config.user.logged_in,vodButton:s,purchased:a,vodPurchaseInfo:u,vodDisplayLabel:l,likeButton:n.like,liked:e.config.user.liked,watchLaterButton:n.watch_later,addedToWatchLater:e.config.user.watch_later,collectionsButton:n.collections,
shareButton:n.share,strings:{like:"Like",likeLoggedOut:"Like (opens in a new window)",unlike:"Unlike",watchLaterAdd:"Add to Watch Later",watchLaterAddLoggedOut:"Add to Watch Later (opens in a new window)",watchLaterRemove:"Remove from Watch Later",collections:"Add to collections",share:n.share&&n.share.embed_only?"Embed":"Share"}}),C=t.querySelector(".vod-button"),s&&(Y=t.querySelector(".sidedock-inner"),a&&c());var d=Y||t;i&&s&&!e.config.embed.settings.instant_sidedock?t.classList.add("vod"):yt.touch&&(D=!0,e.events.fire(Ge.sidedockVisibilityChanged,D),d.classList.remove("hidden"),d.removeAttribute("hidden"),d.classList.remove("invisible")),O=t.querySelector(".like-button"),A=t.querySelector(".like-label"),I=t.querySelector(".watch-later-button"),M=t.querySelector(".watch-later-label"),F=t.querySelector(".collections-button"),q=t.querySelector(".collections-label"),R=t.querySelector(".share-button"),B=t.querySelector(".share-label"),W=[C,O,I,R,F],$=[null,A,M,B,q]}}function d(){var t=e.config.embed.settings.instant_sidedock,n=e.config.video.vod,r=n&&"purchase_options"in n&&n.purchase_options.length,o=n&&_(e.config.video.vod.countries,e.config.request.country);(t||r&&o)&&(Q||i())}function f(){w(t,".vod-button",function(){var t=C.getAttribute("data-product-id");e.events.fire(Ge.vodButtonPressed,t)},s),e.events.on(Ge.outroDisplayed,function(){c()}),e.events.on(Ge.outroHidden,function(){u()})}function h(){w(t,".like-button",function(){e.events.fire(Ge.likeButtonPressed)},s),e.events.on(Ge.liked,function(){O&&(O.classList.add("on"),o(O,A,"remove"))}),e.events.on(Ge.unliked,function(){O&&(O.classList.remove("on"),o(O,A,"add"))})}function p(){w(t,".watch-later-button",function(){e.events.fire(Ge.watchLaterButtonPressed)},s),e.events.on(Ge.addedToWatchLater,function(){I&&(I.classList.add("on"),o(I,M,"remove"))}),e.events.on(Ge.removedFromWatchLater,function(){I&&(I.classList.remove("on"),o(I,M,"add"))})}function v(){w(t,".collections-button",function(){e.events.fire(Ge.collectionsButtonPressed)},s)}function g(){w(t,".share-button",function(){return e.events.fire(e.config.embed.settings.share.embed_only?Ge.embedButtonPressed:Ge.shareButtonPressed),!1},s)}function y(){var e=function(e){"opacity"===e.propertyName&&e.target.classList.contains("invisible")&&(e.target.classList.add("hidden"),e.target.setAttribute("hidden",""),e.target.classList.remove("visible"))};et(t).on("blur","button",s).on("mouseleave",".box",s).on(["focus","pointerdown","touchstart","mouseenter"],"button",a).on("transitionend","label",e),w(t,"label",function(){var e=$.indexOf(this);e>=0&&W[e].click()})}function b(){e.events.on([Ge.mousedOut,Ge.mouseTimeout],n).on(Ge.mousedOver,i).on(Ge.targetTimeReached,function(){X=!0,n()}).on(Ge.played,function(){N=!0}),et(t).on(["pointerenter","pointerleave","mouseenter","mouseleave"],function(e){return"pointerType"in e?void("mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||(j="pointerenter"===e.type||"MSPointerEnter"===e.type)):void(j="mouseover"===e.type)}),et(t).on("transitionend",function(e){var n=Y||t;"opacity"===e.propertyName&&n.classList.contains("invisible")&&(n.classList.add("hidden"),n.setAttribute("hidden",""),C&&n.contains(C)&&(t.classList.add("hidden"),t.setAttribute("hidden","")))})}function k(){e.events.on(Ge.willEnterFullscreen,function(){j=!1,n()}).on(Ge.didExitFullscreen,function(e){e||(K=!0)})}function x(){e.events.on([Ge.airPlayActivated],function(){V=!0,i()}).on([Ge.airPlayDeactivated],function(){V=!1})}function S(){e.events.on(Ge.pictureInPictureActivated,function(){U=!0,i()}).on(Ge.pictureInPictureDeactivated,function(){U=!1})}function T(){e.events.on(Ge.overlayOpened,function(){H=!0,j=!1,n()}).on(Ge.overlayClosed,function(){H=!1,i()})}function E(){e.events.on(Ge.alertVisibilityChanged,function(e){z=e,e&&n()})}function P(){e.events.on(Ge.configChanged,function(){l()})}function L(){e.events.on($e.reset,function(){j=!1,X=!1,n(),r()})}var C,O,A,I,M,F,q,R,B,D=!1,N=!1,j=!1,H=!1,V=!1,U=!1,z=!1,W=[],$=[],G=null,X=!1,K=!1,Y=null,Q=e.config.embed.autoplay&&e.config.request.flags.autohide_controls;return l(),d(),f(),h(),p(),v(),g(),y(),b(),k(),x(),S(),T(),E(),P(),L(),e.events.fire(Ge.sidedockModuleReady),{}}function Re(e,t){function n(){p=!1,t.classList.add("invisible")}function i(){t.classList.remove("hidden"),t.removeAttribute("hidden"),setTimeout(function(){p=!0,t.classList.remove("invisible")},0)}function r(){if(p){if(m)return void n();if(b)return void n();if(!g&&_)return y&&v?void 0:void n()}}function o(){if(!p){if(g&&!m)return void i();if(y&&!k&&!b)return _||m?e.config.embed.settings.info_on_pause&&y&&!m?void i():void 0:void i()}}function a(){if(e.config.view===He.main||e.config.view===He.privateUnlocked){var n=!!e.config.embed.settings.byline,i=null!==e.config.video.owner.url,r=e.config.video.owner.url,o=0===e.config.embed.on_site,a="v1"===e.config.video.design_version_360,s="v2"===e.config.video.design_version_360,c={linkToOwner:i,ownerLink:r,targetBlank:o,showPortrait:!!e.config.embed.settings.portrait,portraitImg:e.config.video.owner[yt.devicePixelRatio>1?"img_2x":"img"],showByline:n,showTitle:!!e.config.embed.settings.title,showTitleLink:null!==e.config.video.url,titleLink:e.config.video.url,title:e.config.video.title,is360:e.config.video.is_panorama&&(a||s),strings:{}};if(e.config.embed.settings.byline){var u=e.config.embed.settings.byline_badge,l="";u&&u.type&&(l=ut.render("title_byline_badge",{targetBlank:o,cssClass:u.type,link:u.url||!1})),c.strings.byline="from "+ut.render("title_owner_byline",{linkToOwner:i,ownerLink:r,targetBlank:o,owner:e.config.video.owner.name})+l}var d=e.config.embed.settings.badge;if(d){var f=yt.devicePixelRatio>1?"img_2x":"img";yt.svg&&d.svg&&(f="svg"),c.showPortrait=!1,c.badge={link:d.link,img:d[f],offset:d.offset||!1,width:d.width,height:d.height,name:d.name,shadow:d.shadow||!1}}e.config.embed.autoplay&&(t.classList.add("hidden"),t.setAttribute("hidden","")),t.innerHTML=ut.render("title",c)}}function s(){e.events.on([Ge.mousedOut,Ge.mouseTimeout],r).on(Ge.mousedOver,o).on(Ge.playInitiated,function(){_=!0,y=!1,r()}).on([Ge.playButtonPressed,Ge.played],function(){y=!1,k=!1,r()}).on(Ge.paused,function(e,t){t||(y=!0,o())}).on(Ge.ended,function(){b=!0,r()}).on(Ge.scrubbingStarted,function(){x=y,k=!0}).on(Ge.scrubbingEnded,function(){x&&(k=!1)}).on(Ge.willEnterFullscreen,function(){r()}).on(Ge.didExitFullscreen,function(e){e||o()}),et(t).on(["pointerenter","pointerleave","mouseenter","mouseleave"],function(e){return"pointerType"in e?void("mouse"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_MOUSE||(v="pointerenter"===e.type||"MSPointerEnter"===e.type)):void(v="mouseover"===e.type)}),et(t).on("transitionend",function(e){"opacity"===e.propertyName&&t.classList.contains("invisible")&&(t.classList.add("hidden"),t.setAttribute("hidden",""))},!1)}function c(){e.events.on(Ge.ended,function(e){r()})}function u(){e.events.on([Ge.airPlayActivated],function(){g=!0,o()}).on([Ge.airPlayDeactivated],function(){g=!1,r()})}function l(){e.events.on(Ge.overlayOpened,function(e){"notsupported"!==e&&"private-unlocked"!==e&&"help"!==e&&(m=!0,v=!1,r())}).on(Ge.overlayClosed,function(){m=!1,v=!1,setTimeout(o,0)})}function d(){w(t,".badge",function(){e.events.fire(Ge.badgePressed,e.config.embed.settings.badge.id)})}function f(){e.events.on(Ge.configChanged,function(){a(),e.config.view===He.privateUnlocked&&o()})}function h(){e.events.on($e.reset,function(){_=!1,y=!0,b=!1,k=!1,o()})}var p=!0,v=!1,m=!1,g=!1,_=!1,y=!0,b=!1,k=!1,x=!1;return a(),s(),c(),u(),l(),d(),f(),h(),e.events.fire(Ge.titleModuleReady),{}}function Be(e,t,n,r){function o(){var t=F,n=window.getComputedStyle(e,":after");n&&(F=n.getPropertyValue("content").replace(/["'\s]*/g,""),F&&t!==F&&"undefined"!=typeof q[F]&&S.events.fire(q[F]))}function a(){var t=(S.config.view===He.main||S.config.view===He.privateUnlocked)&&S.config.embed.settings&&!S.config.embed.settings.playbar;e.classList.toggle("no-playbar",t),e.classList.toggle("with-fullscreen",!!S.config.embed.settings.fullscreen);var n=S.config.embed.settings.custom_logo;e.classList.toggle("with-custom-logo",!!n),e.classList.toggle("with-sticky-custom-logo",n&&n.sticky),e.classList.toggle("background-mode",!!S.config.embed.settings.background),e.classList.toggle("touch-support",yt.touch)}function s(e){var t=arguments.length<=1||void 0===arguments[1]?S.config.video.url:arguments[1];if(!(!t||e&&e.metaKey))return t.indexOf("#")===-1&&S.telecine.currentTime>0&&S.telecine.currentTime0&&window.innerHeight>0},i=null,r=function t(){return clearTimeout(i),n()?void e():void(i=setTimeout(t,250))};S.events.once(Ge.ready,r),S.events.once(Ge.error,r)})}function f(){var e=function(e,t){return S.verifyConfig().then(function(){var n=S.config.request,i=n.signature,r=n.session,o=n.timestamp,a=n.expires,s="https://"+S.config.player_url+"/video/"+S.config.video.id+"/"+e+"?signature="+i+"&session="+r+"&time="+o+"&expires="+a;return d(s,{method:t})})};S.events.on(Ge.vodButtonPressed,function(e){if(S.config.user.purchased){if(!S.config.video.vod.is_feature&&S.config.video.vod.feature_id)return void S.loadVideo(S.config.video.vod.feature_id).then(function(){return S.events.fire(Ge.playButtonPressed),S.config.video.vod.feature_id}).catch(function(e){S.reportException(e),S.events.fire($e.showOverlay,"error",{title:"Sorry",message:"There was a problem. Please try again."})});if(S.config.video.vod&&S.config.video.vod.is_coming_soon)return;return void S.events.fire(Ge.playButtonPressed)}S.performDelegateAction(Ve.purchase,function(){S.events.fire($e.openPopup,"purchase",{productId:e})},e)}),S.events.on(Ge.likeButtonPressed,function(){return S.config.user.logged_in?void(S.config.user.id!==S.config.video.owner.id&&(S.config.user.liked?S.performDelegateAction(Ve.unlike,function(){e("like","DELETE"),S.config.user.liked=!1,S.events.fire(Ge.unliked)}):S.performDelegateAction(Ve.like,function(){e("like","PUT"),S.config.user.liked=!0,S.events.fire(Ge.liked)}))):void S.performDelegateAction(Ve.loginForm,function(){S.events.fire($e.openPopup,"login-like")},"like")}),S.events.on(Ge.watchLaterButtonPressed,function(){if(S.config.video.url||"unlisted"===S.config.video.privacy)return S.config.user.logged_in?S.config.user.watch_later?void S.performDelegateAction(Ve.removeFromWatchLater,function(){e("watch-later","DELETE"),S.config.user.watch_later=!1,S.events.fire(Ge.removedFromWatchLater)}):void S.performDelegateAction(Ve.addToWatchLater,function(){e("watch-later","PUT"),S.config.user.watch_later=!0,S.events.fire(Ge.addedToWatchLater)}):void S.performDelegateAction(Ve.loginForm,function(){S.events.fire($e.openPopup,"login-watch-later")},"watch-later")}),S.events.on(Ge.collectionsButtonPressed,function(){S.performDelegateAction(Ve.collectionsOverlay,function(){return S.config.video.vod&&S.config.video.vod.url?void s(null,S.config.video.vod.url+"#collections"):S.config.video.url?void s(null,S.config.video.url+"#collections"):void 0})}),S.events.on(Ge.shareButtonPressed,function(){var e=S.config.embed.settings.share&&S.config.embed.settings.share.embed_only,t=function(){S.events.fire($e.showOverlay,"share",e)};return dt.element?void t():void S.performDelegateAction(Ve.shareOverlay,t)}),S.events.on(Ge.embedButtonPressed,function(){S.config.embed.settings.share.embed_only&&S.performDelegateAction(Ve.shareOverlay,function(){S.events.fire($e.showOverlay,"share",!0)})})}function h(){function t(){var e=90===Math.abs(window.orientation)?screen.height:screen.width;return yt.mobileAndroid&&!yt.browser.chrome&&!yt.browser.opera&&yt.android>=4&&(e/=window.devicePixelRatio),e/window.innerWidth}function n(e){var t=Math.round(10*Math.pow(e,-1.2));return Math.max(t,10)+"px"}function i(e){var t=Math.round(10*Math.pow(e,-.7));return Math.max(t,10)+"px"}function r(){C.then(function(){var e=t(),r=n(e),o=i(e);return O.style.fontSize=r,A.style.fontSize=o,I.style.fontSize=o,!0}).catch(function(){})}function o(){O.style.fontSize="",A.style.fontSize="",I.style.fontSize=""}S.events.on(Ge.didEnterFullscreen,o),S.events.on(Ge.didExitFullscreen,r),M&&(e.classList.add("mobile"),r())}function p(){if(et(window).on("resize",o),"undefined"!=typeof MutationObserver){var t=new MutationObserver(o);t.observe(e,{attributes:!0,attributeFilter:["class"]})}}function v(){function t(){var t=e;if(r&&r.getFullscreenElement&&"function"==typeof r.getFullscreenElement){var n=r.getFullscreenElement();n&&n instanceof HTMLElement&&n.contains(e)&&n.classList.contains("js-player-fullscreen")&&(t=n)}return t}function n(t,n){return s?void(s=!1):void(o||(o=!0,S.events.fire(Ge.didEnterFullscreen,e===t,a)))}function i(e){return s?void(s=!1):void(o&&(o=!1,S.events.fire(Ge.didExitFullscreen,a),a||S.events.fire($e.toggleNativeControls,!1),a=!1))}S.config.embed.fullscreen=!0,yt.iPad&&e.classList.add("no-fullscreen-api-support"),dt.enabled&&!yt.browser.bb10||yt.iPad||(e.classList.add("no-fullscreen-support"),yt.iOS||(S.config.embed.fullscreen=!1));var o=!1,a=!1,s=!1;S.events.on([Ge.pictureInPictureActivated,Ge.pictureInPictureDeactivated],function(){s=!0}),S.events.on($e.forceFullscreen,function(){return dt.enabled||dt.videoEnabled(e)?(S.events.fire(Ge.willEnterFullscreen),a=!1,void dt.request(t())):void S.events.fire($e.toggleNativeControls,!0)}),S.events.on(Ge.fullscreenButtonPressed,function(){"picture-in-picture"===S.telecine.presentationMode&&S.events.fire($e.deactivatePictureInPicture),dt.element?(S.events.fire(Ge.willExitFullscreen),dt.exit()):(S.events.fire(Ge.willEnterFullscreen),a=!0,dt.request(t()))});var c=dt.onenter,u=dt.onexit;if(dt.onenter=function(t){if(!o)return e.contains(t)?void n(t,!0):void("function"==typeof c&&c(t))},dt.onexit=function(){return o?void i(!0):void("function"==typeof u&&u())},et(e).on("click","a",function(e){dt.element===t()&&dt.exit()}),et(e).on("gestureend",function(e){e.scale>1&&S.events.fire(Ge.fullscreenButtonPressed)}),"undefined"!=typeof MSGesture){var l=1,d=new MSGesture;d.target=e,et(e).on("pointerdown",function(e){d.addPointer(e.pointerId)}).on(["MSGestureChange"],function(e){l*=e.scale}).on(["MSGestureEnd"],function(){(!o&&l>=2||o&&l<1)&&S.events.fire(Ge.fullscreenButtonPressed),l=1})}}function m(){w(e,"a[data-clip-link]",s),S.events.on($e.openVimeo,s)}function g(){u(),l(),f(),h(),p(),v(),m()}function _(){E||(E=new Ie(S,e.querySelector(".overlay-wrapper")))}function y(){P||(P=new Me(S,{uuid:S.uuid,id:e.id,isMobileDevice:!1}))}function b(){L||(L=new Fe(S))}function k(){_(),y(),b(),void new Te(S,O),void new Ee(S,e);var t=new Le(S,e);void new Ce(S,e.querySelector(".notification-wrapper")),void new Oe(S,e.querySelector(".outro-wrapper")),void new qe(S,A),void new Re(S,I),Object.defineProperties(T,{pauseKeyboard:{enumerable:!0,value:t.pause},unpauseKeyboard:{enumerable:!0,value:t.unpause}})}ut.helpers=Je;var x=c(n),S=new we({element:e,delegate:r,cssLoadedPromise:x});e.classList.add("js-player-fullscreen");var T=S.externalApi,E=null,P=null,L=null,C=null,O=e.querySelector(".controls"),A=e.querySelector(".sidedock"),I=e.querySelector(".title"),M=yt.mobileAndroid||yt.iPhone||yt.windowsPhone||yt.browser.bb10,F="normal",q={tiny:Ge.enteredTinyMode,mini:Ge.enteredMiniMode,normal:Ge.enteredNormalMode,none:Ge.enteredNormalMode},R={initializationHandler:function(){return k(),g(),je.resolve()},postInitializationHandler:function(){return S.telecine&&void new Pe(S,e.querySelector(".stats-debug")),je.resolve()},authorizationHandler:function(e){e(),_(),y();var t="Error",n="Unhandled video privacy";switch(S.config.view){case He.privatePassword:return new je(function(e,t){S.events.fire($e.showOverlay,"password"),S.events.once(Ge.passwordUnlocked,function(t){e(t)})});case He.privateLocked:b();var i="private-locked",r=null;return S.config.user.logged_in&&(i="error",r={title:"Private Video",message:"Sorry, you don’t have permission to watch.",modal:!0,logo:!!S.config.embed.settings.branding,icon:"lock"}),S.events.fire($e.showOverlay,i,r),je.reject();case He.error:t=S.config.title,n=S.config.message}return S.events.fire($e.showOverlay,"error",{title:t,message:n,modal:!0}),je.reject()}};return S.init(t,R).then(function(){return S.config.view!==He.privateUnlocked||S.config.embed.autoplay||S.events.fire($e.showOverlay,"private-unlocked"),!0}).catch(function(t){S.reportException(t),_(),y(),e.classList.remove("loading"),S.events.fire(Ge.error,"error",{message:"There was an error loading this video.",modal:!0,final:!0})}),T}var De="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ne=t(function(e){!function(t,n,i){n[t]=n[t]||i(),"undefined"!=typeof e&&e.exports?e.exports=n[t]:"function"==typeof define&&define.amd&&define(function(){return n[t]})}("Promise","undefined"!=typeof De?De:De,function(){function e(e,t){f.add(e,t),d||(d=p(f.drain))}function t(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function n(){for(var e=0;e0&&e(n,c))}catch(e){o.call(new s(c),e)}}}function o(t){var i=this;i.triggered||(i.triggered=!0,i.def&&(i=i.def),i.msg=t,i.state=2,i.chain.length>0&&e(n,i))}function a(e,t,n,i){for(var r=0;r":">",'"':""","'":"'","/":"/"},t.escape=function(e){return e.replace(/[&<>"'\/]/g,function(e){return t.map[e]})},t.helpers={},t.templates.stream_studder=function(e){var t=" ";return t+=this.render("icon_warning")||"",t+=' Having issues? for smoother streaming.
'},t.templates.threesixty_support_alert=function(e){var t=" ";return t+=this.render("icon_warning")||"",t+=' Looking for 360? See supported browsers for the full experience.
'},t.templates.buffer_pattern=function(e){var t='';return t},t.templates.compass=function(e){var t='"},t.templates.content_rating=function(e){var t=''+e.strings.title+'
'+e.strings.subtitle+"
"+e.strings.update+"
'+e.logo+"
";return t},t.templates.controlbar=function(e){var t=' ",
e.volume&&(t+='
'),e.ccButton&&(t+='
"),e.hdButton&&(t+='
"),t+='
',e.airplayButton&&(t+='
"),t+='
",e.vimeoLogo.show&&(t+='
"),t+='
'+e.duration+"
",e.customLogo&&(t+=' "),t+=""},t.templates.controlbar_trailer=function(e){var t='",e.vimeoLogo.show&&(t+=' "),t+="",e.customLogo&&(t+=' "),t+=""},t.templates.error=function(e){var t=''+e.title+"
";return e.message&&(t+="
"+e.message+"
"),t+="
"},t.templates.help=function(e){var t=''+e.strings.title+'
- ↑
- '+e.strings.volumeUp+'
- ↓
- '+e.strings.volumeDown+'
- →
- '+e.strings.scrubForward+'
- ←
- '+e.strings.scrubBackwards+'
- L
- '+e.strings.like+'
- S
- '+e.strings.share+'
- W
- '+e.strings.watchLater+'
- C
- '+e.strings.captions+'
- H
- '+e.strings.hd+'
- F
- '+e.strings.fullscreen+"
";return e.onSite||(t+='- V
- '+e.strings.viewOnVimeo+"
"),t+="
"},t.templates.icon_airplay=function(e){var t='';return t},t.templates.icon_back=function(e){var t='';return t},t.templates.icon_broken_heart=function(e){var t='';return t},t.templates.icon_cc=function(e){var t='';return t},t.templates.icon_clock=function(e){var t='';return t},t.templates.icon_close=function(e){var t='';return t},t.templates.icon_collections=function(e){var t='';return t},t.templates.icon_embed=function(e){var t='';return t},t.templates.icon_facebook=function(e){var t='';return t},t.templates.icon_fullscreen=function(e){var t='';return t},t.templates.icon_hd=function(e){var t=''},t.templates.icon_heart=function(e){var t='';return t},t.templates.icon_lock=function(e){var t='';return t},t.templates.icon_mail=function(e){var t='';return t},t.templates.icon_pause=function(e){var t='';return t},t.templates.icon_play=function(e){var t='';return t},t.templates.icon_share=function(e){var t='';return t},t.templates.icon_tumblr=function(e){var t='';return t},t.templates.icon_twitter=function(e){var t='';return t},t.templates.icon_unfullscreen=function(e){var t='';return t},t.templates.icon_vod=function(e){var t='';return t},t.templates.icon_check=function(e){var t='';return t},t.templates.icon_pip=function(e){var t='';return t},t.templates.icon_vod_download=function(e){var t='';return t},t.templates.icon_vod_rent=function(e){var t='';return t},t.templates.icon_vod_subscribe=function(e){var t='';return t},t.templates.icon_warning=function(e){var t='';return t},t.templates.logo=function(e){var t='';return t},t.templates.outer=function(e){var t='
'},t.templates.outro_image=function(e){var t=""},t.templates.outro_link=function(e){var t='";return t},t.templates.outro_text=function(e){var t='";return t},t.templates.outro_videos=function(e){for(var t="",n=0,i=e.contexts.length;n'+r.context+'
';for(var o=0,a=r.videos.length;o ";t+="
"}return t+=""},t.templates.outro_vod=function(e){var t=' ";var n=e.countries,i=e.country;if(this.helpers.isAvailableInCountry(n,i))if(e.purchased)t+='
'+e.strings.watch+" ";else{if(!e.isComingSoon){t+='
"}(e.isPreorder||e.isComingSoon)&&(t+="
"+e.strings.preRelease+"
")}return t+="
"},t.templates.overlay_email_capture=function(e){var t='"},t.templates.password=function(e){var t='';return t},t.templates.private_locked=function(e){var t=''+e.strings.title+'
'+e.strings.subtitle+'
";return t},t.templates.private_unlocked=function(e){var t='";return t},t.templates.share=function(e){var t=''+e.strings.share+'
",e.embed&&(t+=' "),e.url&&(t+=' "),t+=" ",e.embed&&(t+='
'+e.strings.embedTitle+'
'+e.strings.embedSubtitle+'
",e.customizeEmbed&&(t+=' "),t+="
"),t+="
"},t.templates.sidedock=function(e){var t="";return e.vodButton&&(t+=' '),e.likeButton&&(t+='
"),e.watchLaterButton&&(t+='
"),e.collectionsButton&&(t+='
"),e.shareButton&&(t+='
"),e.vodButton&&(t+="
"),t+=""},t.templates.stats_debug=function(e){var t='Clip ID:'+e.clipId+"
";return e.displayProfile&&(t+='Profile ID:'+e.profileId+"
"),t+='Delivery:'+e.delivery+'
Playing:'+e.resolution+'
Embed size:'+e.dimensions+'
CDN:'+e.cdn+"
",e.displayAudioVideoStream&&(t+='Separate AV:'+e.separateAudioVideo+"
"),t+="",e.testGroup&&(t+='Tests:'+e.testGroup+"
"),t+="",e.displayDroppedFrames&&(t+='Dropped frames:0 / 0
'),t+="",e.displayBandwidth&&(t+='Bandwidth:0 Kbps ()
'),t+='Open link'},t.templates.threesixty_instruct=function(e){var t=' ';return t+=e.textOnly?"
Click and drag to look around ":'
',t+=""},t.templates.title=function(e){var t=" ";return e.badge&&(t+=' "),e.showPortrait&&(t+=' "),t+=' "},t.templates.title_byline_badge=function(e){var t=" ";return e.link&&(t+='"),t+=' '+e.cssClass+"",e.link&&(t+=""),t+=""},t.templates.title_owner_byline=function(e){var t="";return e.linkToOwner?(t+='",t+=this.escape(e.owner)||"",t+=""):(t+='',t+=this.escape(e.owner)||"",t+=""),t+=""},"undefined"!=typeof e&&e.exports?e.exports=t:window.Aftershave=t}()}),ut=e(ct),lt=t(function(e){!function(t,n,i){function r(){var e=Array.prototype.slice.apply(arguments),t=e.shift();v[t].forEach(function(t){"function"==typeof t&&t.apply(t,e)})}function o(e){return function(t,n){p.indexOf(t)!==-1&&e.call(this,t,n)}}function a(e){var t=null;if("VIDEO"===e.tagName)t=e;else{var n=e.getElementsByTagName("video");n[0]&&(t=n[0])}return t}function s(e){var t=a(e);if(t&&t.webkitEnterFullscreen){try{t.readyState=7,f=function(){var e=n.createElement("video"),t={request:["requestFullscreen","webkitRequestFullscreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],exit:["exitFullscreen","webkitCancelFullScreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],enabled:["fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled"],element:["fullscreenElement","webkitFullscreenElement","webkitCurrentFullScreenElement","mozFullScreenElement","msFullscreenElement"],change:["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],error:["fullscreenerror","webkitfullscreenerror","mozfullscreenerror","MSFullscreenError"]},i={};for(var r in t)for(var o=0,a=t[r].length;o0){var n=b.pop();t=t||n.element,n.error.call(t,e),P.onerror(t,e),r(h.ERROR,t,e)}},P={request:function(e,r,o,a){if(e=e||n.body,b.push({element:e,enter:r||y,exit:o||y,error:a||y}),void 0===f.request)return s(e);if(i&&n[f.enabled]===!1)return s(e);if(w!==!1&&w<32)return s(e);if(i&&void 0===f.enabled)return f.enabled="webkitFullscreenEnabled",e[f.request](),void setTimeout(function(){n[f.element]?n[f.enabled]=!0:(n[f.enabled]=!1,s(e))},250);try{!i&&t&&(m=t.scrollY),e[f.request](),k>=5.1&&setTimeout(function(){n[f.element]||E(i?"not_enabled":"not_allowed",e)},100)}catch(t){E("not_enabled",e)}},exit:function(){l(),!n[f.exit]&&P.element?P.element[f.exit]():n[f.exit]()},toggle:function(e,t,n,i){P.element?P.exit():P.request(e,t,n,i)},videoEnabled:function(e){if(P.enabled)return!0;e=e||n.body;var t=a(e);return!(!t||void 0===t.webkitSupportsFullscreen)&&(t.readyState-1&&v[e].splice(n,1)}),onenter:y,onexit:y,onchange:y,onerror:y};try{Object.defineProperties(P,{element:{enumerable:!0,get:function(){return g&&g.webkitDisplayingFullscreen?g:n[f.element]||null}},enabled:{enumerable:!0,get:function(){return"webkitCancelFullScreen"===f.exit&&!i||!(w!==!1&&w<32)&&(n[f.enabled]||!1)}}})}catch(e){P.element=null,P.enabled=!1}f.change&&n.addEventListener(f.change,function(e){if(P.onchange(P.element),r(h.CHANGE,P.element),P.element){var t=b[b.length-2];t&&t.element===P.element?T():(S(P.element),u())}else T()},!1),n.addEventListener("webkitbeginfullscreen",function(e){var t=!0;if(b.length>0)for(var n=0,i=b.length;n1||window.navigator.msMaxTouchPoints||!1,transformProperty:x("transform"),windowsPhone:vt};if(yt.threeSixtyVideo=!(yt.browser.safari||yt.iOS||yt.iPad),function(){for(var e=["webkit","moz"],t=0;t=0;--t)m[t]===e&&m.splice(t,1)}function s(){d(),m=[]}function c(e,t){var r=null;if(!t||n.collectWindowErrors){for(var o in m)if(m.hasOwnProperty(o))try{m[o].apply(null,[e].concat(i.call(arguments,2)))}catch(e){r=e}if(r)throw r}}function u(e,i,a,s,u){var l=null;if(y)n.computeStackTrace.augmentStackTraceWithInitialElement(y,i,a,e),f();else if(u)l=n.computeStackTrace(u),c(l,!0);else{var d,h={url:i,line:a,column:s},v=void 0,m=e;if("[object String]"==={}.toString.call(e)){var d=e.match(o);d&&(v=d[1],m=d[2])}h.func=r,l={name:v,message:m,url:t(),stack:[h]},c(l,!0)}return!!p&&p.apply(this,arguments)}function l(){v||(p=window.onerror,window.onerror=u,v=!0)}function d(){v&&(window.onerror=p,v=!1,p=void 0)}function f(){var e=y,t=g;g=null,y=null,_=null,c.apply(null,[e,!1].concat(t))}function h(e,t){var r=i.call(arguments,1);if(y){if(_===e)return;f()}var o=n.computeStackTrace(e);if(y=o,_=e,g=r,setTimeout(function(){_===e&&f()},o.incomplete?2e3:0),t!==!1)throw e}var p,v,m=[],g=null,_=null,y=null;return h.subscribe=e,h.unsubscribe=a,h.uninstall=s,h}(),n.computeStackTrace=function(){function e(e){if("undefined"!=typeof e.stack&&e.stack){for(var n,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[native).*?)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=e.stack.split("\n"),u=[],l=(/^(.*) is undefined$/.exec(e.message),0),d=c.length;l0&&e.stack[0].url===o.url){if(e.stack[0].line===o.line)return!1;if(!e.stack[0].line&&e.stack[0].func===o.func)return e.stack[0].line=o.line,!1}return e.stack.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function o(e,s){for(var c,u,l=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,d=[],f={},h=!1,p=o.caller;p&&!h;p=p.caller)if(p!==a&&p!==n.report){if(u={url:null,func:r,line:null,column:null},p.name?u.func=p.name:(c=l.exec(p.toString()))&&(u.func=c[1]),"undefined"==typeof u.func)try{u.func=c.input.substring(0,c.input.indexOf("{"))}catch(e){}f[""+p]?h=!0:f[""+p]=!0,d.push(u)}s&&d.splice(0,s);var v={name:e.name,message:e.message,url:t(),stack:d};return i(v,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),v}function a(i,r){var a=null;r=null==r?0:+r;try{if(a=e(i))return a}catch(e){if(n.debug)throw e}try{if(a=o(i,r+1))return a}catch(e){if(n.debug)throw e}return{name:i.name,message:i.message,url:t()}}return a.augmentStackTraceWithInitialElement=i,a.computeStackTraceFromStackProp=e,a}(),e.exports=n}),St=e(xt),Tt=Object.freeze({default:St}),Et=t(function(e){function t(e){this.name="RavenConfigError",this.message=e}t.prototype=new Error,t.prototype.constructor=t,e.exports=t}),Pt=e(Et),Lt=Object.freeze({default:Pt}),Ct=t(function(e,t){function n(e,t,n,r){return JSON.stringify(e,i(t,r),n)}function i(e,t){var n=[],i=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]"}),function(r,o){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?i.splice(a,1/0,r):i.push(r),~n.indexOf(o)&&(o=t.call(this,r,o))}else n.push(o);return null==e?o:e.call(this,r,o)}}t=e.exports=n,t.getSerialize=i}),Ot=e(Ct),At=Ct.getSerialize,It=Object.freeze({default:Ot,getSerialize:At}),Mt=t(function(e){var t=function(e,t,n){var i=e[t],r=e;if(t in e){var o="warn"===t?"warning":t;e[t]=function(){var e=[].slice.call(arguments),t=""+e.join(" "),a={level:o,logger:"console",extra:{arguments:e}};n&&n(t,a),i&&Function.prototype.apply.call(i,r,e)}}};e.exports={wrapMethod:t}}),Ft=e(Mt),qt=Mt.wrapMethod,Rt=Object.freeze({default:Ft,wrapMethod:qt}),Bt=t(function(t){function n(){return+new Date}function i(){this._hasJSON=!("object"!=typeof JSON||!JSON.stringify),this._hasDocument=!r(L),this._lastCapturedException=null,this._lastEventId=null,this._globalServer=null,this._globalKey=null,this._globalProject=null,this._globalContext={},this._globalOptions={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],crossOrigin:"anonymous",collectWindowErrors:!0,maxMessageLength:0,stackTraceLimit:50,autoBreadcrumbs:!0},this._ignoreOnError=0,this._isRavenInstalled=!1,this._originalErrorStackTraceLimit=Error.stackTraceLimit,this._originalConsole=P.console||{},this._originalConsoleMethods={},this._plugins=[],this._startTime=n(),this._wrappedBuiltIns=[],this._breadcrumbs=[],this._lastCapturedEvent=null,this._keypressTimeout,this._location=P.location,this._lastHref=this._location&&this._location.href;for(var e in this._originalConsole)this._originalConsoleMethods[e]=this._originalConsole[e]}function r(e){return void 0===e}function o(e){return"function"==typeof e}function a(e){return"[object String]"===C.toString.call(e)}function s(e){return"object"==typeof e&&null!==e}function c(e){for(var t in e)return!1;return!0}function u(e){var t=C.toString.call(e);return s(e)&&"[object Error]"===t||"[object Exception]"===t||e instanceof Error}function l(e,t){var n,i;if(r(e.length))for(n in e)h(e,n)&&t.call(null,n,e[n]);else if(i=e.length)for(n=0;n ",c=s.length;e&&o++1&&a+r.length*c+t.length>=i));)r.push(t),a+=t.length,e=e.parentNode;return r.reverse().join(s)}function y(e){var t,n,i,r,o,s=[];if(!e||!e.tagName)return"";if(s.push(e.tagName.toLowerCase()),e.id&&s.push("#"+e.id),t=e.className,t&&a(t))for(n=t.split(" "),o=0;othis._globalOptions.maxBreadcrumbs&&this._breadcrumbs.shift(),this},addPlugin:function(e){var t=[].slice.call(arguments,1);return this._plugins.push([e,t]),this._isRavenInstalled&&this._drainPlugins(),this},setUserContext:function(e){return this._globalContext.user=e,this},setExtraContext:function(e){return this._mergeContext("extra",e),this},setTagsContext:function(e){return this._mergeContext("tags",e),this},clearContext:function(){return this._globalContext={},this},getContext:function(){return JSON.parse(x(this._globalContext))},setEnvironment:function(e){return this._globalOptions.environment=e,this},setRelease:function(e){return this._globalOptions.release=e,this},setDataCallback:function(e){var t=this._globalOptions.dataCallback;return this._globalOptions.dataCallback=o(e)?function(n){return e(n,t)}:e,this},setShouldSendCallback:function(e){var t=this._globalOptions.shouldSendCallback;return this._globalOptions.shouldSendCallback=o(e)?function(n){return e(n,t)}:e,this},setTransport:function(e){return this._globalOptions.transport=e,this},lastException:function(){return this._lastCapturedException},lastEventId:function(){return this._lastEventId},isSetup:function(){return!!this._hasJSON&&(!!this._globalServer||(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this._logDebug("error","Error: Raven has not been configured.")),!1))},afterLoad:function(){var e=P.RavenConfig;e&&this.config(e.dsn,e.config).install()},showReportDialog:function(e){if(L){e=e||{};var t=e.eventId||this.lastEventId();if(!t)throw new k("Missing eventId");var n=e.dsn||this._dsn;if(!n)throw new k("Missing DSN");var i=encodeURIComponent,r="";r+="?eventId="+i(t),r+="&dsn="+i(n);var o=e.user||this._globalContext.user;o&&(o.name&&(r+="&name="+i(o.name)),o.email&&(r+="&email="+i(o.email)));var a=this._getGlobalServer(this._parseDSN(n)),s=L.createElement("script");s.async=!0,s.src=a+"/api/embed/error-page/"+r,(L.head||L.body).appendChild(s)}},_ignoreNextOnError:function(){var e=this;this._ignoreOnError+=1,setTimeout(function(){e._ignoreOnError-=1})},_triggerEvent:function(e,t){var n,i;if(this._hasDocument){t=t||{},e="raven"+e.substr(0,1).toUpperCase()+e.substr(1),L.createEvent?(n=L.createEvent("HTMLEvents"),n.initEvent(e,!0,!0)):(n=L.createEventObject(),n.eventType=e);for(i in t)h(t,i)&&(n[i]=t[i]);if(L.createEvent)L.dispatchEvent(n);else try{L.fireEvent("on"+n.eventType.toLowerCase(),n)}catch(e){}}},_breadcrumbEventHandler:function(e){var t=this;return function(n){if(t._keypressTimeout=null,t._lastCapturedEvent!==n){t._lastCapturedEvent=n;var i,r=n.target;try{i=_(r)}catch(e){i=""}t.captureBreadcrumb({category:"ui."+e,message:i})}}},_keypressEventHandler:function(){var e=this,t=1e3;return function(n){var i=n.target,r=i&&i.tagName;if(r&&("INPUT"===r||"TEXTAREA"===r||i.isContentEditable)){var o=e._keypressTimeout;o||e._breadcrumbEventHandler("input")(n),clearTimeout(o),e._keypressTimeout=setTimeout(function(){e._keypressTimeout=null},t)}}},_captureUrlChange:function(e,t){var n=m(this._location.href),i=m(t),r=m(e);this._lastHref=t,n.protocol===i.protocol&&n.host===i.host&&(t=i.relative),n.protocol===r.protocol&&n.host===r.host&&(e=r.relative),this.captureBreadcrumb({category:"navigation",data:{to:t,from:e}})},_instrumentTryCatch:function(){function e(e){return function(t,i){for(var r=new Array(arguments.length),a=0;a2?arguments[2]:void 0;return n&&t._captureUrlChange(t._lastHref,n+""),e.apply(this,arguments)}},i)}if(n.console&&"console"in P&&console.log){var f=function(e,n){t.captureBreadcrumb({message:e,level:n.level,category:"console"})};l(["debug","info","warn","error","log"],function(e,t){S(console,t,f)})}},_restoreBuiltIns:function(){for(var e;this._wrappedBuiltIns.length;){e=this._wrappedBuiltIns.shift();var t=e[0],n=e[1],i=e[2];t[n]=i}},_drainPlugins:function(){var e=this;l(this._plugins,function(t,n){var i=n[0],r=n[1];i.apply(e,[e].concat(r))})},_parseDSN:function(e){var t=E.exec(e),n={},i=7;try{for(;i--;)n[T[i]]=t[i]||""}catch(t){throw new k("Invalid DSN: "+e)}if(n.pass&&!this._globalOptions.allowSecretKey)throw new k("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return n},_getGlobalServer:function(e){var t="//"+e.host+(e.port?":"+e.port:"");return e.protocol&&(t=e.protocol+":"+t),t},_handleOnErrorStackInfo:function(){this._ignoreOnError||this._handleStackInfo.apply(this,arguments)},_handleStackInfo:function(e,t){var n=this._prepareFrames(e,t);this._triggerEvent("handle",{stackInfo:e,options:t}),this._processException(e.name,e.message,e.url,e.lineno,n,t)},_prepareFrames:function(e,t){var n=this,i=[];if(e.stack&&e.stack.length&&(l(e.stack,function(e,t){var r=n._normalizeFrame(t);r&&i.push(r)}),t&&t.trimHeadFrames))for(var r=0;r0&&(e.breadcrumbs={values:[].slice.call(this._breadcrumbs,0)}),c(e.tags)&&delete e.tags,this._globalContext.user&&(e.user=this._globalContext.user),t.environment&&(e.environment=t.environment),t.release&&(e.release=t.release),t.serverName&&(e.server_name=t.serverName),o(t.dataCallback)&&(e=t.dataCallback(e)||e),e&&!c(e)&&(o(t.shouldSendCallback)&&!t.shouldSendCallback(e)||this._sendProcessedPayload(e))},_getUuid:function(){return g()},_sendProcessedPayload:function(e,t){var n=this,i=this._globalOptions;if(this._lastEventId=e.event_id||(e.event_id=this._getUuid()),e=this._trimPacket(e),this._logDebug("debug","Raven about to send:",e),this.isSetup()){var r={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this._globalKey};this._globalSecret&&(r.sentry_secret=this._globalSecret);var o=e.exception&&e.exception.values[0];this.captureBreadcrumb({category:"sentry",message:o?(o.type?o.type+": ":"")+o.value:e.message,event_id:e.event_id,level:e.level||"error"});var a=this._globalEndpoint;(i.transport||this._makeRequest).call(this,{url:a,auth:r,data:e,options:i,onSuccess:function(){n._triggerEvent("success",{data:e,src:a}),t&&t()},onError:function(i){n._triggerEvent("failure",{data:e,src:a}),i=i||new Error("Raven send failed (no additional details provided)"),t&&t(i)}})}},_makeRequest:function(e){function t(){200===n.status?e.onSuccess&&e.onSuccess():e.onError&&e.onError(new Error("Sentry error code: "+n.status))}var n=new XMLHttpRequest,i="withCredentials"in n||"undefined"!=typeof XDomainRequest;if(i){var r=e.url;"withCredentials"in n?n.onreadystatechange=function(){4===n.readyState&&t()}:(n=new XDomainRequest,r=r.replace(/^https?:/,""),n.onload=t),n.open("POST",r+"?"+v(e.auth)),n.send(x(e.data))}},_logDebug:function(e){this._originalConsoleMethods[e]&&this.debug&&Function.prototype.apply.call(this._originalConsoleMethods[e],this._originalConsole,[].slice.call(arguments,1))},_mergeContext:function(e,t){r(t)?delete this._globalContext[e]:this._globalContext[e]=d(this._globalContext[e]||{},t)}};var C=Object.prototype;"undefined"!=typeof __false__&&__false__&&(i.utils={isUndefined:r,isFunction:o,isString:a,isObject:s,isEmptyObject:c,isError:u,each:l,objectMerge:d,truncate:f,hasKey:h,joinRegExp:p,urlencode:v,uuid4:g,htmlTreeAsString:_,htmlElementAsString:y,parseUrl:m,fill:b}),i.prototype.setUser=i.prototype.setUserContext,i.prototype.setReleaseContext=i.prototype.setRelease,t.exports=i}),Dt=e(Bt),Nt=Object.freeze({default:Dt}),jt=t(function(t){var n=e(Nt),i=window.Raven,r=new n;r.noConflict=function(){return window.Raven=i,r},r.afterLoad(),t.exports=r}),Ht=e(jt),Vt={false:!1,LIB_VERSION:"2.9.16"};kt="undefined"==typeof window?{navigator:{}}:window;var Ut=Array.prototype,zt=Function.prototype,Wt=Object.prototype,$t=Ut.slice,Gt=Wt.toString,Xt=Wt.hasOwnProperty,Kt=kt.console,Yt=kt.navigator,Qt=kt.document,Jt=Yt.userAgent,Zt=zt.bind,en=Ut.forEach,tn=Ut.indexOf,nn=Array.isArray,rn={},on={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},an={log:function(){if(Vt.false&&!on.isUndefined(Kt)&&Kt)try{Kt.log.apply(Kt,arguments)}catch(e){on.each(arguments,function(e){Kt.log(e)})}},error:function(){if(Vt.false&&!on.isUndefined(Kt)&&Kt){var e=["Mixpanel error:"].concat(on.toArray(arguments));try{Kt.error.apply(Kt,e)}catch(t){on.each(e,function(e){Kt.error(e)})}}},critical:function(){if(!on.isUndefined(Kt)&&Kt){var e=["Mixpanel error:"].concat(on.toArray(arguments));try{Kt.error.apply(Kt,e)}catch(t){on.each(e,function(e){Kt.error(e)})}}}};on.bind=function(e,t){var n,i;if(Zt&&e.bind===Zt)return Zt.apply(e,$t.call(arguments,1));if(!on.isFunction(e))throw new TypeError;return n=$t.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat($t.call(arguments)));var r={};r.prototype=e.prototype;var o=new r;r.prototype=null;var a=e.apply(o,n.concat($t.call(arguments)));return Object(a)===a?a:o}},on.bind_instance_methods=function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=on.bind(e[t],e))},on.each=function(e,t,n){if(null!==e&&void 0!==e)if(en&&e.forEach===en)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,r=e.length;i/g,">").replace(/"/g,""").replace(/'/g,"'")),t},on.extend=function(e){return on.each($t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},on.isArray=nn||function(e){return"[object Array]"===Gt.call(e)},on.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},on.isArguments=function(e){return!(!e||!Xt.call(e,"callee"))},on.toArray=function(e){return e?e.toArray?e.toArray():on.isArray(e)?$t.call(e):on.isArguments(e)?$t.call(e):on.values(e):[]},on.values=function(e){var t=[];return null===e?t:(on.each(e,function(e){t[t.length]=e}),t)},on.identity=function(e){return e},on.include=function(e,t){var n=!1;return null===e?n:tn&&e.indexOf===tn?e.indexOf(t)!=-1:(on.each(e,function(e){if(n||(n=e===t))return rn}),n)},on.includes=function(e,t){return e.indexOf(t)!==-1},on.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},on.isObject=function(e){return e===Object(e)&&!on.isArray(e)},on.isEmptyObject=function(e){if(on.isObject(e)){for(var t in e)if(Xt.call(e,t))return!1;return!0}return!1},on.isUndefined=function(e){return void 0===e},on.isString=function(e){return"[object String]"==Gt.call(e)},on.isDate=function(e){return"[object Date]"==Gt.call(e)},on.isNumber=function(e){return"[object Number]"==Gt.call(e)},on.isElement=function(e){return!(!e||1!==e.nodeType)},on.encodeDates=function(e){return on.each(e,function(t,n){on.isDate(t)?e[n]=on.formatDate(t):on.isObject(t)&&(e[n]=on.encodeDates(t))}),e},on.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},on.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},on.safewrap=function(e){return function(){try{return e.apply(this,arguments)}catch(e){an.critical("Implementation error. Please contact support@mixpanel.com.")}}},on.safewrap_class=function(e,t){for(var n=0;n0&&(t[n]=e)}),t},on.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):on.isArray(e)?(n=[],on.each(e,function(e){n.push(on.truncate(e,t))})):on.isObject(e)?(n={},on.each(e,function(e,i){n[i]=on.truncate(e,t)})):n=e,n},on.JSONEncode=function(){return function(e){var t=e,n=function(e){var t=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},i=function(e,t){var r="",o=" ",a=0,s="",c="",u=0,l=r,d=[],f=t[e];switch(f&&"object"==typeof f&&"function"==typeof f.toJSON&&(f=f.toJSON(e)),typeof f){case"string":return n(f);case"number":return isFinite(f)?String(f):"null";case"boolean":case"null":return String(f);case"object":if(!f)return"null";if(r+=o,d=[],"[object Array]"===Gt.apply(f)){for(u=f.length,a=0;a="0"&&t<="9";)n+=t,a();if("."===t)for(n+=".";a()&&t>="0"&&t<="9";)n+=t;if("e"===t||"E"===t)for(n+=t,a(),"-"!==t&&"+"!==t||(n+=t,a());t>="0"&&t<="9";)n+=t,a();return e=+n,isFinite(e)?e:void o("Bad number")},c=function(){var e,n,i,s="";if('"'===t)for(;a();){if('"'===t)return a(),s;if("\\"===t)if(a(),"u"===t){for(i=0,n=0;n<4&&(e=parseInt(a(),16),isFinite(e));n+=1)i=16*i+e;s+=String.fromCharCode(i)}else{if("string"!=typeof r[t])break;s+=r[t]}else s+=t}o("Bad string")},u=function(){for(;t&&t<=" ";)a()},l=function(){switch(t){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o('Unexpected "'+t+'"')},d=function(){var e=[];if("["===t){if(a("["),u(),"]"===t)return a("]"),e;for(;t;){if(e.push(i()),u(),"]"===t)return a("]"),e;a(","),u()}}o("Bad array")},f=function(){var e,n={};if("{"===t){if(a("{"),u(),"}"===t)return a("}"),n;for(;t;){if(e=c(),u(),a(":"),Object.hasOwnProperty.call(n,e)&&o('Duplicate key "'+e+'"'),n[e]=i(),u(),"}"===t)return a("}"),n;a(","),u()}}o("Bad object")};return i=function(){switch(u(),t){case"{":return f();case"[":return d();case'"':return c();case"-":return s();default:return t>="0"&&t<="9"?s():l()}},function(r){var a;return n=r,e=0,t=" ",a=i(),u(),t&&o("Syntax error"),a}}(),on.base64Encode=function(e){var t,n,i,r,o,a,s,c,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,d=0,f="",h=[];if(!e)return e;e=on.utf8Encode(e);do t=e.charCodeAt(l++),n=e.charCodeAt(l++),i=e.charCodeAt(l++),c=t<<16|n<<8|i,r=c>>18&63,o=c>>12&63,a=c>>6&63,s=63&c,h[d++]=u.charAt(r)+u.charAt(o)+u.charAt(a)+u.charAt(s);while(l127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(r+=e.substring(t,n)),r+=s,t=n=i+1)}return n>t&&(r+=e.substring(t,e.length)),r},on.UUID=function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")},n=function(){function e(e,t){var n,i=0;for(n=0;n=4&&(o=e(o,r),r=[]);return r.length>0&&(o=e(o,r)),o.toString(16)};return function(){var i=(screen.height*screen.width).toString(16);return e()+"-"+t()+"-"+n()+"-"+i+"-"+e()}}(),on.isBlockedUA=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp)/i.test(e)},on.HTTPBuildQuery=function(e,t){var n,i,r=[];return on.isUndefined(t)&&(t="&"),on.each(e,function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),r[r.length]=i+"="+n}),r.join(t)},on.getQueryParam=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+t+"=([^]*)",i=new RegExp(n),r=i.exec(e);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":decodeURIComponent(r[1]).replace(/\+/g," ")},on.getHashParam=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},on.cookie={get:function(e){for(var t=e+"=",n=Qt.cookie.split(";"),i=0;i=0}function n(n){if(!Qt.getElementsByTagName)return[];var i,r,o,a,s,c,u,l,d,f,h=n.split(" "),p=[Qt];for(c=0;c-1){r=i.split("#"),o=r[0];var v=r[1],m=Qt.getElementById(v);if(!m||o&&m.nodeName.toLowerCase()!=o)return[];p=[m]}else if(i.indexOf(".")>-1){r=i.split("."),o=r[0];var g=r[1];for(o||(o="*"),a=[],s=0,u=0;u-1};break;default:k=function(e){return e.getAttribute(y)}}for(p=[],f=0,u=0;u=3?t[2]:""},properties:function(){return on.extend(on.strip_empty_properties({$os:on.info.os(),$browser:on.info.browser(Jt,Yt.vendor,window.opera),$referrer:Qt.referrer,$referring_domain:on.info.referringDomain(Qt.referrer),$device:on.info.device(Jt)}),{$current_url:window.location.href,$browser_version:on.info.browserVersion(Jt,Yt.vendor,window.opera),$screen_height:screen.height,$screen_width:screen.width,mp_lib:"web",$lib_version:Vt.LIB_VERSION})},people_properties:function(){return on.extend(on.strip_empty_properties({$os:on.info.os(),$browser:on.info.browser(Jt,Yt.vendor,window.opera)}),{$browser_version:on.info.browserVersion(Jt,Yt.vendor,window.opera)})},pageviewInfo:function(e){return on.strip_empty_properties({mp_page:e,mp_referrer:Qt.referrer,mp_browser:on.info.browser(Jt,Yt.vendor,window.opera),mp_platform:on.info.os()})}},on.toArray=on.toArray,on.isObject=on.isObject,on.JSONEncode=on.JSONEncode,on.JSONDecode=on.JSONDecode,on.isBlockedUA=on.isBlockedUA,on.isEmptyObject=on.isEmptyObject,on.info=on.info,on.info.device=on.info.device,on.info.browser=on.info.browser,on.info.properties=on.info.properties;var sn="__mpced",cn=1,un=3,ln={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;do e=e.previousSibling;while(e&&e.nodeType!==cn);return e},_loadScript:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var i=document.getElementsByTagName("script");i.length>0?i[0].parentNode.insertBefore(n,i[0]):document.body.appendChild(n)},_getClassName:function(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}},_getPropertiesFromElement:function(e){var t={classes:this._getClassName(e).split(" "),tag_name:e.tagName.toLowerCase()};if(on.includes(["input","select","textarea"],e.tagName.toLowerCase())){var n=this._getFormFieldValue(e);this._includeProperty(e,n)&&(t.value=n)}on.each(e.attributes,function(e){t["attr__"+e.name]=e.value});for(var i=1,r=1,o=e;o=this._previousElementSibling(o);)i++,o.tagName===e.tagName&&r++;return t.nth_child=i,t.nth_of_type=r,t},_isTag:function(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()},_shouldTrackDomEvent:function(e,t){if(!e||this._isTag(e,"html")||e.nodeType!==cn)return!1;var n=e.tagName.toLowerCase();switch(n){case"html":return!1;case"form":return"submit"===t.type;case"input":return["button","submit"].indexOf(e.getAttribute("type"))===-1?"change"===t.type:"click"===t.type;case"select":case"textarea":return"change"===t.type;default:return"click"===t.type}},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1,$host:window.location.host,$pathname:window.location.pathname}},_getInputValue:function(e){var t=null,n=e.type.toLowerCase();switch(n){case"checkbox":e.checked&&(t=[e.value]);break;case"radio":e.checked&&(t=e.value);break;default:t=e.value}return t},_getSelectValue:function(e){var t;if(e.multiple){var n=[];on.each(e.querySelectorAll("[selected]"),function(e){n.push(e.value)}),t=n}else t=e.value;return t},_includeProperty:function(e,t){for(var n=e;n.parentNode&&!this._isTag(n,"body");n=n.parentNode){var i=this._getClassName(n).split(" ");if(on.includes(i,"mp-sensitive")||on.includes(i,"mp-no-track"))return!1}if(on.includes(this._getClassName(e).split(" "),"mp-include"))return!0;if(null===t)return!1;var r=e.type||"";switch(r.toLowerCase()){case"hidden":return!1;case"password":return!1}var o=e.name||e.id||"",a=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(a.test(o.replace(/[^a-zA-Z0-9]/g,"")))return!1;if("string"==typeof t){var s=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(s.test((t||"").replace(/[\- ]/g,"")))return!1;var c=/(^\d{3}-?\d{2}-?\d{4}$)/;if(c.test(t))return!1}return!0},_getFormFieldValue:function(e){var t;switch(e.tagName.toLowerCase()){case"input":t=this._getInputValue(e);break;case"select":t=this._getSelectValue(e);break;default:t=e.value||e.textContent}return this._includeProperty(e,t)?t:null},_getFormFieldProperties:function(e){var t={};return on.each(e.elements,function(e){var n=e.getAttribute("name")||e.getAttribute("id");if(null!==n){n="$form_field__"+n;var i=this._getFormFieldValue(e);if(this._includeProperty(e,i)){var r=t[n];void 0!==r?t[n]=[].concat(r,i):t[n]=i}}},this),t},_extractCustomPropertyValue:function(e){var t=[];return on.each(document.querySelectorAll(e.css_selector),function(e){["input","select"].indexOf(e.tagName.toLowerCase())>-1?t.push(e.value):e.textContent&&t.push(e.textContent)}),t.join(", ")},_getCustomProperties:function(e){var t={};return on.each(this._customProperties,function(n){on.each(n.event_selectors,function(i){var r=document.querySelectorAll(i);on.each(r,function(i){on.includes(e,i)&&(t[n.name]=this._extractCustomPropertyValue(n))},this)},this)},this),t},checkForBackoff:function(e){var t=parseInt(e.getResponseHeader("X-MP-CE-Backoff"));if(!isNaN(t)&&t>0){on.timestamp()+1e3*t;on.cookie.set_seconds(sn,!0,t,!0)}},_getEventTarget:function(e){return"undefined"==typeof e.target?e.srcElement:e.target},_trackEvent:function(e,t){var n=this._getEventTarget(e);if(n.nodeType===un&&(n=n.parentNode),this._shouldTrackDomEvent(n,e)){for(var i=[n],r=n;r.parentNode&&!this._isTag(r,"body");)i.push(r.parentNode),r=r.parentNode;var o,a,s,c=[],u=!1;if(on.each(i,function(e,t){if("a"===e.tagName.toLowerCase()?o=e.getAttribute("href"):"form"===e.tagName.toLowerCase()&&(s=e),!a&&t<5&&e.textContent){var n=on.trim(e.textContent);n&&(a=n.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}var i=this._getClassName(e).split(" ");on.includes(i,"mp-no-track")&&(u=!0),c.push(this._getPropertiesFromElement(e))},this),u)return!1;var l=on.extend(this._getDefaultProperties(e.type),{$elements:c,$el_attr__href:o,$el_text:a},this._getCustomProperties(i));return!s||"submit"!==e.type&&"click"!==e.type||on.extend(l,this._getFormFieldProperties(s)),t.track("$web_event",l),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=on.bind(function(t){on.cookie.parse(sn)!==!0&&(t=t||window.event,this._trackEvent(t,e))},this);on.register_event(document,"submit",t,!1,!0),on.register_event(document,"change",t,!1,!0),on.register_event(document,"click",t,!1,!0)},_customProperties:{},init:function(e){if(!document||!document.body){var t=this;return void setTimeout(function(){t.init(e)},500)}var n=e.get_config("token");if(!(this._initializedTokens.indexOf(n)>-1||(this._initializedTokens.push(n),this._maybeLoadEditor(e)))){var i=on.bind(function(t){t&&t.config&&t.config.enable_collect_everything===!0?(t.custom_properties&&(this._customProperties=t.custom_properties),e.track("$web_event",on.extend({$title:document.title},this._getDefaultProperties("pageview"))),this._addDomEventHandlers(e)):e.__autotrack_enabled=!1},this);e._send_request(e.get_config("decide_host")+"/decide/",{verbose:!0,version:"1",lib:"web",token:n},e._prepare_callback(i))}},_editorParamsFromHash:function(e,t){var n;try{var i=on.getHashParam(t,"state");i=JSON.parse(decodeURIComponent(i));var r=on.getHashParam(t,"expires_in");n={accessToken:on.getHashParam(t,"access_token"),accessTokenExpiresAt:(new Date).getTime()+1e3*Number(r),bookmarkletMode:!!i.bookmarkletMode,projectId:i.projectId,projectOwnerId:i.projectOwnerId,projectToken:i.token,readOnly:i.readOnly,userFlags:i.userFlags,userId:i.userId},window.sessionStorage.setItem("editorParams",JSON.stringify(n)),i.desiredHash?window.location.hash=i.desiredHash:window.history?history.replaceState("",document.title,window.location.pathname+window.location.search):window.location.hash=""}catch(e){}return n},_maybeLoadEditor:function(e){var t=!1;if(on.getHashParam(window.location.hash,"state")){var n=on.getHashParam(window.location.hash,"state");n=JSON.parse(decodeURIComponent(n)),t="mpeditor"===n.action}var i,r=!!window.sessionStorage.getItem("_mpcehash");return t?i=this._editorParamsFromHash(e,window.location.hash):r?(i=this._editorParamsFromHash(e,window.sessionStorage.getItem("_mpcehash")),window.sessionStorage.removeItem("_mpcehash")):i=JSON.parse(window.sessionStorage.getItem("editorParams")||"{}"),
!(!i.projectToken||e.get_config("token")!==i.projectToken)&&(this._loadEditor(e,i),!0)},_editorLoaded:!1,_loadEditor:function(e,t){if(!this._editorLoaded){this._editorLoaded=!0;var n,i="?_ts="+(new Date).getTime(),r=e.get_config("app_host")+"/site_media";return n=Vt.false?r+"/compiled/reports/collect-everything/editor.js"+i:r+"/bundle-webpack/reports/collect-everything/editor.min.js"+i,this._loadScript(n,function(){window.mp_load_editor(t)}),!0}return!1},enabledForProject:function(e,t,n){t=on.isUndefined(t)?10:t,n=on.isUndefined(n)?10:n;for(var i=0,r=0;rt&&delete e[n];on.isEmptyObject(e)&&delete this.props[Ln]}}),Nn.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register_once(on.info.campaignParams()),this.campaign_params_saved=!0)},Nn.prototype.update_search_keyword=function(e){this.register(on.info.searchInfo(e))},Nn.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:on.info.referringDomain(e)||"$direct"},"")},Nn.prototype.get_referrer_info=function(){return on.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Nn.prototype.safe_merge=function(e){return on.each(this.props,function(t,n){n in e||(e[n]=t)}),e},Nn.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},Nn.prototype.set_disabled=function(e){this.disabled=e,this.disabled&&this.remove()},Nn.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},Nn.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Nn.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},Nn.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],r=this._get_or_create_queue(wn),o=this._get_or_create_queue(kn),a=this._get_or_create_queue(xn),s=this._get_or_create_queue(Tn),c=this._get_or_create_queue(Sn,[]);n===mn?(on.extend(r,i),this._pop_from_people_queue(xn,i),this._pop_from_people_queue(Tn,i)):n===gn?on.each(i,function(e,t){t in o||(o[t]=e)}):n===_n?on.each(i,function(e,t){t in r?r[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this):n===bn?on.each(i,function(e,t){on.isArray(e)&&(t in s||(s[t]=[]),s[t]=s[t].concat(e))}):n===yn&&c.push(i),an.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),an.log(t),this.save()},Nn.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);on.isUndefined(n)||(on.each(t,function(e,t){delete n[t]},this),this.save())},Nn.prototype._get_queue_key=function(e){return e===wn?mn:e===kn?gn:e===xn?_n:e===Sn?yn:e===Tn?bn:void an.error("Invalid queue:",e)},Nn.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]},Nn.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=on.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},Nn.prototype.set_event_timer=function(e,t){var n=this.props[Cn]||{};n[e]=t,this.props[Cn]=n,this.save()},Nn.prototype.remove_event_timer=function(e){var t=this.props[Cn]||{},n=t[e];return on.isUndefined(n)||(delete this.props[Cn][e],this.save()),n};var jn,Hn=function(){},Vn=function(){},Un=function(e,t,n){var i,r=n===vn?fn:fn[n];if(r&&dn===hn)i=r;else{if(r&&!on.isArray(r))return void an.error("You have already initialized "+n);i=new Hn}if(i._init(e,t,n),i.people=new Vn,i.people._init(i),Vt.false=Vt.false||i.get_config("debug"),i.__autotrack_enabled=i.get_config("autotrack"),i.get_config("autotrack")){var o=100,a=100;ln.enabledForProject(i.get_config("token"),o,a)?ln.isBrowserSupported()?ln.init(i):(i.__autotrack_enabled=!1,an.log("Disabling Automatic Event Collection because this browser is not supported")):(i.__autotrack_enabled=!1,an.log("Not in active bucket: disabling Automatic Event Collection."));try{Xn(i)}catch(e){an.error(e)}}return!on.isUndefined(r)&&on.isArray(r)&&(i._execute_array.call(i.people,r.people),i._execute_array(r)),i};Hn.prototype.init=function(e,t,n){if(on.isUndefined(n))return void an.error("You must name your new library: init(token, config, name)");if(n===vn)return void an.error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");var i=Un(e,t,n);return fn[n]=i,i._loaded(),i},Hn.prototype._init=function(e,t,n){this.__loaded=!0,this.config={},this.set_config(on.extend({},Fn,t,{name:n,token:e,callback_fn:(n===vn?n:"mixpanel."+n)+"._jsc"})),this._jsc=function(){},this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.persistence=this.cookie=new Nn(this.config),this.register_once({distinct_id:on.UUID()},"")},Hn.prototype._loaded=function(){this.get_config("loaded")(this),this.get_config("track_pageview")&&this.track_pageview()},Hn.prototype._dom_loaded=function(){on.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),on.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},Hn.prototype._track_dom=function(e,t){if(this.get_config("img"))return an.error("You can't use DOM tracking functions with img = true."),!1;if(!qn)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},Hn.prototype._prepare_callback=function(e,t){if(on.isUndefined(e))return null;if(In){var n=function(n){e(n,t)};return n}var i=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return i[r]=function(n){delete i[r],e(n,t)},o},Hn.prototype._send_request=function(e,t,n){if(Mn)return void this.__request_queue.push(arguments);var i=this.get_config("verbose");if(t.verbose&&(i=!0),this.get_config("test")&&(t.test=1),i&&(t.verbose=1),this.get_config("img")&&(t.img=1),In||(n?t.callback=n:(i||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),e+="?"+on.HTTPBuildQuery(t),"img"in t){var r=document.createElement("img");r.src=e,document.body.appendChild(r)}else if(In)try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.withCredentials=!0,o.onreadystatechange=function(){if(4===o.readyState)if(e.indexOf("api.mixpanel.com/track")!==-1&&ln.checkForBackoff(o),200===o.status)n&&n(i?on.JSONDecode(o.responseText):Number(o.responseText));else{var t="Bad HTTP status: "+o.status+" "+o.statusText;an.error(t),n&&n(i?{status:0,error:t}:0)}},o.send(null)}catch(e){an.error(e)}else{var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.defer=!0,a.src=e;var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(a,s)}},Hn.prototype._execute_array=function(e){var t,n=[],i=[],r=[];on.each(e,function(e){e&&(t=e[0],"function"==typeof e?e.call(this):on.isArray(e)&&"alias"===t?n.push(e):on.isArray(e)&&t.indexOf("track")!==-1&&"function"==typeof this[t]?r.push(e):i.push(e))},this);var o=function(e,t){on.each(e,function(e){this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(i,this),o(r,this)},Hn.prototype.push=function(e){this._execute_array([e])},Hn.prototype.disable=function(e){"undefined"==typeof e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},Hn.prototype.track=function(e,t,n){if("function"!=typeof n&&(n=function(){}),on.isUndefined(e))return void an.error("No event name provided to mixpanel.track");if(this._event_is_disabled(e))return void n(0);t=t||{},t.token=this.get_config("token");var i=this.persistence.remove_event_timer(e);if(!on.isUndefined(i)){var r=(new Date).getTime()-i;t.$duration=parseFloat((r/1e3).toFixed(3))}this.persistence.update_search_keyword(document.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(document.referrer),t=on.extend({},on.info.properties(),this.persistence.properties(),t);try{this.get_config("autotrack")&&"mp_page_view"!==e&&"$create_alias"!==e&&(t=on.extend({},t,this.mp_counts),this.mp_counts={$__c:0},on.cookie.set("mp_"+this.get_config("name")+"__c",0,1,!0))}catch(e){an.error(e)}var o=this.get_config("property_blacklist");on.isArray(o)?on.each(o,function(e){delete t[e]}):an.error("Invalid value for property_blacklist config: "+o);var a={event:e,properties:t},s=on.truncate(a,255),c=on.JSONEncode(s),u=on.base64Encode(c);return an.log("MIXPANEL REQUEST:"),an.log(s),this._send_request(this.get_config("api_host")+"/track/",{data:u},this._prepare_callback(n,s)),s},Hn.prototype.track_pageview=function(e){on.isUndefined(e)&&(e=document.location.href),this.track("mp_page_view",on.info.pageviewInfo(e))},Hn.prototype.track_links=function(){return this._track_dom.call(this,Bn,arguments)},Hn.prototype.track_forms=function(){return this._track_dom.call(this,Dn,arguments)},Hn.prototype.time_event=function(e){return on.isUndefined(e)?void an.error("No event name provided to mixpanel.time_event"):void(this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime()))},Hn.prototype.register=function(e,t){this.persistence.register(e,t)},Hn.prototype.register_once=function(e,t,n){this.persistence.register_once(e,t,n)},Hn.prototype.unregister=function(e){this.persistence.unregister(e)},Hn.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},Hn.prototype.identify=function(e,t,n,i,r,o){e!==this.get_distinct_id()&&e!==this.get_property(Pn)&&(this.unregister(Pn),this._register_single("distinct_id",e)),this._check_and_handle_notifications(this.get_distinct_id()),this._flags.identify_called=!0,this.people._flush(t,n,i,r,o)},Hn.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1,this.register_once({distinct_id:on.UUID()},"")},Hn.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},Hn.prototype.alias=function(e,t){if(e===this.get_property(En))return an.critical("Attempting to create alias for existing People user - aborting."),-2;var n=this;return on.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Pn,e),this.track("$create_alias",{alias:e,distinct_id:t},function(){n.identify(e)})):(an.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},Hn.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},Hn.prototype.set_config=function(e){on.isObject(e)&&(on.extend(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Vt.false=Vt.false||this.get_config("debug"))},Hn.prototype.get_config=function(e){return this.config[e]},Hn.prototype.get_property=function(e){return this.persistence.props[e]},Hn.prototype.toString=function(){var e=this.get_config("name");return e!==vn&&(e="mixpanel."+e),e},Hn.prototype._event_is_disabled=function(e){return on.isBlockedUA(Jt)||this._flags.disable_all_events||on.include(this.__disabled_events,e)},Hn.prototype._check_and_handle_notifications=function(e){if(e&&!this._flags.identify_called&&!this.get_config("disable_notifications")){an.log("MIXPANEL NOTIFICATION CHECK");var t={verbose:!0,version:"1",lib:"web",token:this.get_config("token"),distinct_id:e},n=this;this._send_request(this.get_config("decide_host")+"/decide/",t,this._prepare_callback(function(e){e.notifications&&e.notifications.length>0&&n._show_notification.call(n,e.notifications[0])}))}},Hn.prototype._show_notification=function(e){var t=new jn(e,this);t.show()},Vn.prototype._init=function(e){this._mixpanel=e},Vn.prototype.set=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this),n=t):r[e]=t,this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r=on.extend({},on.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r),i[wn]=r,this._send_request(i,n)},Vn.prototype.set_once=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this),n=t):r[e]=t,i[kn]=r,this._send_request(i,n)},Vn.prototype.increment=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void an.error("Invalid increment value passed to mixpanel.people.increment - must be a number");r[t]=e}},this),n=t):(on.isUndefined(t)&&(t=1),r[e]=t),i[xn]=r,this._send_request(i,n)},Vn.prototype.append=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this),n=t):r[e]=t,i[Sn]=r,this._send_request(i,n)},Vn.prototype.union=function(e,t,n){var i={},r={};return on.isObject(e)?(on.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=on.isArray(e)?e:[e])},this),n=t):r[e]=on.isArray(t)?t:[t],i[Tn]=r,this._send_request(i,n)},Vn.prototype.track_charge=function(e,t,n){return!on.isNumber(e)&&(e=parseFloat(e),isNaN(e))?void an.error("Invalid value passed to mixpanel.people.track_charge - must be a number"):this.append("$transactions",on.extend({$amount:e},t),n)},Vn.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},Vn.prototype.delete_user=function(){if(!this._identify_called())return void an.error("mixpanel.people.delete_user() requires you to call identify() first");var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)},Vn.prototype.toString=function(){return this._mixpanel.toString()+".people"},Vn.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=on.encodeDates(e),i=on.truncate(n,255),r=on.JSONEncode(n),o=on.base64Encode(r);return this._identify_called()?(an.log("MIXPANEL PEOPLE REQUEST:"),an.log(i),this._mixpanel._send_request(this._get_config("api_host")+"/engage/",{data:o},this._mixpanel._prepare_callback(t,i)),i):(this._enqueue(e),on.isUndefined(t)||t(this._get_config("verbose")?{status:-1,error:null}:-1),i)},Vn.prototype._get_config=function(e){return this._mixpanel.get_config(e)},Vn.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},Vn.prototype._enqueue=function(e){wn in e?this._mixpanel.persistence._add_to_people_queue(wn,e):kn in e?this._mixpanel.persistence._add_to_people_queue(kn,e):xn in e?this._mixpanel.persistence._add_to_people_queue(xn,e):Sn in e?this._mixpanel.persistence._add_to_people_queue(Sn,e):Tn in e?this._mixpanel.persistence._add_to_people_queue(Tn,e):an.error("Invalid call to _enqueue():",e)},Vn.prototype._flush=function(e,t,n,i,r){var o=this,a=on.extend({},this._mixpanel.persistence._get_queue(wn)),s=on.extend({},this._mixpanel.persistence._get_queue(kn)),c=on.extend({},this._mixpanel.persistence._get_queue(xn)),u=this._mixpanel.persistence._get_queue(Sn),l=on.extend({},this._mixpanel.persistence._get_queue(Tn));if(on.isUndefined(a)||!on.isObject(a)||on.isEmptyObject(a)||(o._mixpanel.persistence._pop_from_people_queue(wn,a),this.set(a,function(t,n){0===t&&o._mixpanel.persistence._add_to_people_queue(wn,a),on.isUndefined(e)||e(t,n)})),on.isUndefined(s)||!on.isObject(s)||on.isEmptyObject(s)||(o._mixpanel.persistence._pop_from_people_queue(kn,s),this.set_once(s,function(e,t){0===e&&o._mixpanel.persistence._add_to_people_queue(kn,s),on.isUndefined(i)||i(e,t)})),on.isUndefined(c)||!on.isObject(c)||on.isEmptyObject(c)||(o._mixpanel.persistence._pop_from_people_queue(xn,c),this.increment(c,function(e,n){0===e&&o._mixpanel.persistence._add_to_people_queue(xn,c),on.isUndefined(t)||t(e,n)})),on.isUndefined(l)||!on.isObject(l)||on.isEmptyObject(l)||(o._mixpanel.persistence._pop_from_people_queue(Tn,l),this.union(l,function(e,t){0===e&&o._mixpanel.persistence._add_to_people_queue(Tn,l),on.isUndefined(r)||r(e,t)})),!on.isUndefined(u)&&on.isArray(u)&&u.length){for(var d,f=function(e,t){0===e&&o._mixpanel.persistence._add_to_people_queue(Sn,d),on.isUndefined(n)||n(e,t)},h=u.length-1;h>=0;h--)d=u.pop(),o.append(d,f);o._mixpanel.persistence.save()}},Vn.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e},Hn._Notification=function(e,t){on.bind_instance_methods(this),this.mixpanel=t,this.persistence=this.mixpanel.persistence,this.campaign_id=on.escapeHTML(e.id),this.message_id=on.escapeHTML(e.message_id),this.body=(on.escapeHTML(e.body)||"").replace(/\n/g,"
"),this.cta=on.escapeHTML(e.cta)||"Close",this.dest_url=on.escapeHTML(e.cta_url)||null,this.image_url=on.escapeHTML(e.image_url)||null,this.notif_type=on.escapeHTML(e.type)||"takeover",this.style=on.escapeHTML(e.style)||"light",this.thumb_image_url=on.escapeHTML(e.thumb_image_url)||null,this.title=on.escapeHTML(e.title)||"",this.video_url=on.escapeHTML(e.video_url)||null,this.video_width=jn.VIDEO_WIDTH,this.video_height=jn.VIDEO_HEIGHT,this.clickthrough=!0,this.dest_url||(this.dest_url="#dismiss",this.clickthrough=!1),this.mini="mini"===this.notif_type,this.mini||(this.notif_type="takeover"),this.notif_width=this.mini?jn.NOTIF_WIDTH_MINI:jn.NOTIF_WIDTH,this._set_client_config(),this.imgs_to_preload=this._init_image_html(),this._init_video()},jn=Hn._Notification,jn.ANIM_TIME=200,jn.MARKUP_PREFIX="mixpanel-notification",jn.BG_OPACITY=.6,jn.NOTIF_TOP=25,jn.NOTIF_START_TOP=200,jn.NOTIF_WIDTH=388,jn.NOTIF_WIDTH_MINI=420,jn.NOTIF_HEIGHT_MINI=85,jn.THUMB_BORDER_SIZE=5,jn.THUMB_IMG_SIZE=60,jn.THUMB_OFFSET=Math.round(jn.THUMB_IMG_SIZE/2),jn.VIDEO_WIDTH=595,jn.VIDEO_HEIGHT=334,jn.prototype.show=function(){var e=this;return this._set_client_config(),this.body_el?(this._init_styles(),this._init_notification_el(),void this._preload_images(this._attach_and_animate)):void setTimeout(function(){e.show()},300)},jn.prototype.dismiss=on.safewrap(function(){this.marked_as_shown||this._mark_delivery({invisible:!0});var e=this.showing_video?this._get_el("video"):this._get_notification_display_el();if(this.use_transitions)this._remove_class("bg","visible"),this._add_class(e,"exiting"),setTimeout(this._remove_notification_el,jn.ANIM_TIME);else{var t,n,i;this.mini?(t="right",n=20,i=-100):(t="top",n=jn.NOTIF_TOP,i=jn.NOTIF_START_TOP+jn.NOTIF_TOP),this._animate_els([{el:this._get_el("bg"),attr:"opacity",start:jn.BG_OPACITY,goal:0},{el:e,attr:"opacity",start:1,goal:0},{el:e,attr:t,start:n,goal:i}],jn.ANIM_TIME,this._remove_notification_el)}}),jn.prototype._add_class=on.safewrap(function(e,t){t=jn.MARKUP_PREFIX+"-"+t,"string"==typeof e&&(e=this._get_el(e)),e.className?~(" "+e.className+" ").indexOf(" "+t+" ")||(e.className+=" "+t):e.className=t}),jn.prototype._remove_class=on.safewrap(function(e,t){t=jn.MARKUP_PREFIX+"-"+t,"string"==typeof e&&(e=this._get_el(e)),e.className&&(e.className=(" "+e.className+" ").replace(" "+t+" ","").replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,""))}),jn.prototype._animate_els=on.safewrap(function(e,t,n,i){var r,o,a,s=this,c=!1,u=1*new Date;for(i=i||u,a=u-i,r=0;r=o.start?1:-1;o.val=o.start+l*a/t,"opacity"!==o.attr&&(o.val=Math.round(o.val)),(d>0&&o.val>=o.goal||d<0&&o.val<=o.goal)&&(o.val=o.goal)}if(!c)return void(n&&n());for(r=0;r'):this.img_html="",this.thumb_image_url?(e.push(this.thumb_image_url),this.thumb_img_html=''):this.thumb_img_html=""),e},jn.prototype._init_notification_el=function(){var e="",t="",n="",i='';if(this.notification_el=document.createElement("div"),this.notification_el.id=jn.MARKUP_PREFIX+"-wrapper",this.mini)e='';else{var r=this.clickthrough||this.show_video?"":'',o=this.show_video?'':"";this._browser_lte("ie",7)&&(r="",o=""),e=''+this.thumb_img_html+'
'+i+'
'+this.img_html+'
'+this.title+'
'+this.body+'
"}this.youtube_video?(t="//www.youtube.com/embed/"+this.youtube_video+"?wmode=transparent&showinfo=0&modestbranding=0&rel=0&autoplay=1&loop=0&vq=hd1080",this.yt_custom&&(t+="&enablejsapi=1&html5=1&controls=0",n='')):this.vimeo_video&&(t="//player.vimeo.com/video/"+this.vimeo_video+"?autoplay=1&title=0&byline=0&portrait=0"),this.show_video&&(this.video_iframe='',n='");var a=n+e;this.flip_animate&&(a=(this.mini?e:"")+'"),this.notification_el.innerHTML=('").replace(/class=\"/g,'class="'+jn.MARKUP_PREFIX+"-").replace(/id=\"/g,'id="'+jn.MARKUP_PREFIX+"-")},jn.prototype._init_styles=function(){"dark"===this.style?this.style_vals={bg:"#1d1f25",bg_actions:"#282b32",bg_hover:"#3a4147",bg_light:"#4a5157",border_gray:"#32353c",cancel_opacity:"0.4",mini_hover:"#2a3137",text_title:"#fff",text_main:"#9498a3",text_tagline:"#464851",text_hover:"#ddd"}:this.style_vals={bg:"#fff",bg_actions:"#e7eaee",bg_hover:"#eceff3",bg_light:"#f5f5f5",border_gray:"#e4ecf2",cancel_opacity:"1.0",mini_hover:"#fafafa",text_title:"#5c6578",text_main:"#8b949b",text_tagline:"#ced9e6",text_hover:"#7c8598"};var e="0px 0px 35px 0px rgba(45, 49, 56, 0.7)",t=e,n=e,i=jn.THUMB_IMG_SIZE+2*jn.THUMB_BORDER_SIZE,r=jn.ANIM_TIME/1e3+"s";this.mini&&(e="none");var o={},a=jn.NOTIF_WIDTH_MINI+20;o["@media only screen and (max-width: "+(a-1)+"px)"]={"#overlay":{display:"none"}};var s={".flipped":{transform:"rotateY(180deg)"},"#overlay":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",overflow:"auto","text-align":"center","z-index":"10000","font-family":'"Helvetica", "Arial", sans-serif',"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"},"#overlay.mini":{height:"0",overflow:"visible"},"#overlay a":{width:"initial",padding:"0","text-decoration":"none","text-transform":"none",color:"inherit"},"#bgwrapper":{position:"relative",width:"100%",height:"100%"},"#bg":{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","min-width":4*this.doc_width+"px","min-height":4*this.doc_height+"px","background-color":"black",opacity:"0.0","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)",filter:"alpha(opacity=60)",transition:"opacity "+r},"#bg.visible":{opacity:jn.BG_OPACITY},".mini #bg":{width:"0",height:"0","min-width":"0"},"#flipcontainer":{perspective:"1000px",position:"absolute",width:"100%"},"#flipper":{position:"relative","transform-style":"preserve-3d",transition:"0.3s"},"#takeover":{position:"absolute",left:"50%",width:jn.NOTIF_WIDTH+"px","margin-left":Math.round(-jn.NOTIF_WIDTH/2)+"px","backface-visibility":"hidden",transform:"rotateY(0deg)",opacity:"0.0",top:jn.NOTIF_START_TOP+"px",transition:"opacity "+r+", top "+r},"#takeover.visible":{opacity:"1.0",top:jn.NOTIF_TOP+"px"},"#takeover.exiting":{opacity:"0.0",top:jn.NOTIF_START_TOP+"px"},"#thumbspacer":{height:jn.THUMB_OFFSET+"px"},"#thumbborder-wrapper":{position:"absolute",top:-jn.THUMB_BORDER_SIZE+"px",left:jn.NOTIF_WIDTH/2-jn.THUMB_OFFSET-jn.THUMB_BORDER_SIZE+"px",width:i+"px",height:i/2+"px",overflow:"hidden"},"#thumbborder":{position:"absolute",width:i+"px",height:i+"px","border-radius":i+"px","background-color":this.style_vals.bg_actions,opacity:"0.5"},"#thumbnail":{position:"absolute",top:"0px",left:jn.NOTIF_WIDTH/2-jn.THUMB_OFFSET+"px",
width:jn.THUMB_IMG_SIZE+"px",height:jn.THUMB_IMG_SIZE+"px",overflow:"hidden","z-index":"100","border-radius":jn.THUMB_IMG_SIZE+"px"},"#mini":{position:"absolute",right:"20px",top:jn.NOTIF_TOP+"px",width:this.notif_width+"px",height:2*jn.NOTIF_HEIGHT_MINI+"px","margin-top":20-jn.NOTIF_HEIGHT_MINI+"px","backface-visibility":"hidden",opacity:"0.0",transform:"rotateX(90deg)",transition:"opacity 0.3s, transform 0.3s, right 0.3s"},"#mini.visible":{opacity:"1.0",transform:"rotateX(0deg)"},"#mini.exiting":{opacity:"0.0",right:"-150px"},"#mainbox":{"border-radius":"4px","box-shadow":e,"text-align":"center","background-color":this.style_vals.bg,"font-size":"14px",color:this.style_vals.text_main},"#mini #mainbox":{height:jn.NOTIF_HEIGHT_MINI+"px","margin-top":jn.NOTIF_HEIGHT_MINI+"px","border-radius":"3px",transition:"background-color "+r},"#mini-border":{height:jn.NOTIF_HEIGHT_MINI+6+"px",width:jn.NOTIF_WIDTH_MINI+6+"px",position:"absolute",top:"-3px",left:"-3px","margin-top":jn.NOTIF_HEIGHT_MINI+"px","border-radius":"6px",opacity:"0.25","background-color":"#fff","z-index":"-1","box-shadow":n},"#mini-icon":{position:"relative",display:"inline-block",width:"75px",height:jn.NOTIF_HEIGHT_MINI+"px","border-radius":"3px 0 0 3px","background-color":this.style_vals.bg_actions,background:"linear-gradient(135deg, "+this.style_vals.bg_light+" 0%, "+this.style_vals.bg_actions+" 100%)",transition:"background-color "+r},"#mini:hover #mini-icon":{"background-color":this.style_vals.mini_hover},"#mini:hover #mainbox":{"background-color":this.style_vals.mini_hover},"#mini-icon-img":{position:"absolute","background-image":"url("+this.thumb_image_url+")",width:"48px",height:"48px",top:"20px",left:"12px"},"#content":{padding:"30px 20px 0px 20px"},"#mini-content":{"text-align":"left",height:jn.NOTIF_HEIGHT_MINI+"px",cursor:"pointer"},"#img":{width:"328px","margin-top":"30px","border-radius":"5px"},"#title":{"max-height":"600px",overflow:"hidden","word-wrap":"break-word",padding:"25px 0px 20px 0px","font-size":"19px","font-weight":"bold",color:this.style_vals.text_title},"#body":{"max-height":"600px","margin-bottom":"25px",overflow:"hidden","word-wrap":"break-word","line-height":"21px","font-size":"15px","font-weight":"normal","text-align":"left"},"#mini #body":{display:"inline-block","max-width":"250px",margin:"0 0 0 30px",height:jn.NOTIF_HEIGHT_MINI+"px","font-size":"16px","letter-spacing":"0.8px",color:this.style_vals.text_title},"#mini #body-text":{display:"table",height:jn.NOTIF_HEIGHT_MINI+"px"},"#mini #body-text div":{display:"table-cell","vertical-align":"middle"},"#tagline":{"margin-bottom":"15px","font-size":"10px","font-weight":"600","letter-spacing":"0.8px",color:"#ccd7e0","text-align":"left"},"#tagline a":{color:this.style_vals.text_tagline,transition:"color "+r},"#tagline a:hover":{color:this.style_vals.text_hover},"#cancel":{position:"absolute",right:"0",width:"8px",height:"8px",padding:"10px","border-radius":"20px",margin:"12px 12px 0 0","box-sizing":"content-box",cursor:"pointer",transition:"background-color "+r},"#mini #cancel":{margin:"7px 7px 0 0"},"#cancel-icon":{width:"8px",height:"8px",overflow:"hidden","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/cancel-x.png)",opacity:this.style_vals.cancel_opacity},"#cancel:hover":{"background-color":this.style_vals.bg_hover},"#button":{display:"block",height:"60px","line-height":"60px","text-align":"center","background-color":this.style_vals.bg_actions,"border-radius":"0 0 4px 4px",overflow:"hidden",cursor:"pointer",transition:"background-color "+r},"#button-close":{display:"inline-block",width:"9px",height:"60px","margin-right":"8px","vertical-align":"top","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/close-x-"+this.style+".png)","background-repeat":"no-repeat","background-position":"0px 25px"},"#button-play":{display:"inline-block",width:"30px",height:"60px","margin-left":"15px","background-image":"url(//cdn.mxpnl.com/site_media/images/icons/notifications/play-"+this.style+"-small.png)","background-repeat":"no-repeat","background-position":"0px 15px"},"a#button-link":{display:"inline-block","vertical-align":"top","text-align":"center","font-size":"17px","font-weight":"bold",overflow:"hidden","word-wrap":"break-word",color:this.style_vals.text_title,transition:"color "+r},"#button:hover":{"background-color":this.style_vals.bg_hover,color:this.style_vals.text_hover},"#button:hover a":{color:this.style_vals.text_hover},"#video-noflip":{position:"relative",top:2*-this.video_height+"px"},"#video-flip":{"backface-visibility":"hidden",transform:"rotateY(180deg)"},"#video":{position:"absolute",width:this.video_width-1+"px",height:this.video_height+"px",top:jn.NOTIF_TOP+"px","margin-top":"100px",left:"50%","margin-left":Math.round(-this.video_width/2)+"px",overflow:"hidden","border-radius":"5px","box-shadow":t,transform:"translateZ(1px)",transition:"opacity "+r+", top "+r},"#video.exiting":{opacity:"0.0",top:this.video_height+"px"},"#video-holder":{position:"absolute",width:this.video_width-1+"px",height:this.video_height+"px",overflow:"hidden","border-radius":"5px"},"#video-frame":{"margin-left":"-1px",width:this.video_width+"px"},"#video-controls":{opacity:"0",transition:"opacity 0.5s"},"#video:hover #video-controls":{opacity:"1.0"},"#video .video-progress-el":{position:"absolute",bottom:"0",height:"25px","border-radius":"0 0 0 5px"},"#video-progress":{width:"90%"},"#video-progress-total":{width:"100%","background-color":this.style_vals.bg,opacity:"0.7"},"#video-elapsed":{width:"0","background-color":"#6cb6f5",opacity:"0.9"},"#video #video-time":{width:"10%",right:"0","font-size":"11px","line-height":"25px",color:this.style_vals.text_main,"background-color":"#666","border-radius":"0 0 5px 0"}};this._browser_lte("ie",8)&&on.extend(s,{"* html #overlay":{position:"absolute"},"* html #bg":{position:"absolute"},"html, body":{height:"100%"}}),this._browser_lte("ie",7)&&on.extend(s,{"#mini #body":{display:"inline",zoom:"1",border:"1px solid "+this.style_vals.bg_hover},"#mini #body-text":{padding:"20px"},"#mini #mini-icon":{display:"none"}});var c=["backface-visibility","border-radius","box-shadow","opacity","perspective","transform","transform-style","transition"],u=["khtml","moz","ms","o","webkit"];for(var l in s)for(var d=0;d=33||this.browser_versions.firefox>=15)&&this.body_el&&i("backfaceVisibility")&&i("perspective")&&i("transform")},jn.prototype._switch_to_video=on.safewrap(function(){var e=this,t=[{el:e._get_notification_display_el(),attr:"opacity",start:1,goal:0},{el:e._get_notification_display_el(),attr:"top",start:jn.NOTIF_TOP,goal:-500},{el:e._get_el("video-noflip"),attr:"opacity",start:0,goal:1},{el:e._get_el("video-noflip"),attr:"top",start:2*-e.video_height,goal:0}];if(e.mini){var n=e._get_el("bg"),i=e._get_el("overlay");n.style.width="100%",n.style.height="100%",i.style.width="100%",e._add_class(e._get_notification_display_el(),"exiting"),e._add_class(n,"visible"),t.push({el:e._get_el("bg"),attr:"opacity",start:0,goal:jn.BG_OPACITY})}var r=e._get_el("video-holder");r.innerHTML=e.video_iframe;var o=function(){window.YT&&window.YT.loaded&&e._yt_video_ready(),e.showing_video=!0,e._get_notification_display_el().style.visibility="hidden"};e.flip_animate?(e._add_class("flipper","flipped"),setTimeout(o,jn.ANIM_TIME)):e._animate_els(t,jn.ANIM_TIME,o)}),jn.prototype._track_event=function(e,t,n){this.campaign_id?(t=t||{},t=on.extend(t,{campaign_id:this.campaign_id,message_id:this.message_id,message_type:"web_inapp",message_subtype:this.notif_type}),this.mixpanel.track(e,t,n)):n&&n.call()},jn.prototype._yt_video_ready=on.safewrap(function(){var e=this;if(!e.video_inited){e.video_inited=!0;var t=e._get_el("video-elapsed"),n=e._get_el("video-time"),i=e._get_el("video-progress");new window.YT.Player(jn.MARKUP_PREFIX+"-video-frame",{events:{onReady:function(r){var o=r.target,a=o.getDuration(),s=function(e){return("00"+e).slice(-2)},c=function(e){var t=Math.round(a-e),i=Math.floor(t/60),r=Math.floor(i/60);t-=60*i,i-=60*r,n.innerHTML="-"+(r?r+":":"")+s(i)+":"+s(t)};c(0),e._video_progress_checker=window.setInterval(function(){var e=o.getCurrentTime();t.style.width=e/a*100+"%",c(e)},250),on.register_event(i,"click",function(e){var t=Math.max(0,e.pageX-i.getBoundingClientRect().left);o.seekTo(a*t/i.clientWidth,!0)})}}})}}),Hn.prototype.init=Hn.prototype.init,Hn.prototype.reset=Hn.prototype.reset,Hn.prototype.disable=Hn.prototype.disable,Hn.prototype.time_event=Hn.prototype.time_event,Hn.prototype.track=Hn.prototype.track,Hn.prototype.track_links=Hn.prototype.track_links,Hn.prototype.track_forms=Hn.prototype.track_forms,Hn.prototype.track_pageview=Hn.prototype.track_pageview,Hn.prototype.register=Hn.prototype.register,Hn.prototype.register_once=Hn.prototype.register_once,Hn.prototype.unregister=Hn.prototype.unregister,Hn.prototype.identify=Hn.prototype.identify,Hn.prototype.alias=Hn.prototype.alias,Hn.prototype.name_tag=Hn.prototype.name_tag,Hn.prototype.set_config=Hn.prototype.set_config,Hn.prototype.get_config=Hn.prototype.get_config,Hn.prototype.get_property=Hn.prototype.get_property,Hn.prototype.get_distinct_id=Hn.prototype.get_distinct_id,Hn.prototype.toString=Hn.prototype.toString,Hn.prototype._check_and_handle_notifications=Hn.prototype._check_and_handle_notifications,Hn.prototype._show_notification=Hn.prototype._show_notification,Nn.prototype.properties=Nn.prototype.properties,Nn.prototype.update_search_keyword=Nn.prototype.update_search_keyword,Nn.prototype.update_referrer_info=Nn.prototype.update_referrer_info,Nn.prototype.get_cross_subdomain=Nn.prototype.get_cross_subdomain,Nn.prototype.clear=Nn.prototype.clear,Vn.prototype.set=Vn.prototype.set,Vn.prototype.set_once=Vn.prototype.set_once,Vn.prototype.increment=Vn.prototype.increment,Vn.prototype.append=Vn.prototype.append,Vn.prototype.union=Vn.prototype.union,Vn.prototype.track_charge=Vn.prototype.track_charge,Vn.prototype.clear_charges=Vn.prototype.clear_charges,Vn.prototype.delete_user=Vn.prototype.delete_user,Vn.prototype.toString=Vn.prototype.toString,on.safewrap_class(Hn,["identify","_check_and_handle_notifications","_show_notification"]);var zn={},Wn=function(){on.each(zn,function(e,t){t!==vn&&(fn[t]=e)}),fn._=on},$n=function(){fn.init=function(e,t,n){if(n)return fn[n]||(fn[n]=zn[n]=Un(e,t,n),fn[n]._loaded()),fn[n];var i=fn;zn[vn]?i=zn[vn]:e&&(i=Un(e,t,vn),i._loaded(),zn[vn]=i),fn=i,dn===pn&&(window[vn]=fn),Wn()}},Gn=function(){function e(){e.done||(e.done=!0,qn=!0,Mn=!1,on.each(zn,function(e){e._dom_loaded()}))}function t(){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}e()}if(document.addEventListener)"complete"===document.readyState?e():document.addEventListener("DOMContentLoaded",e,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",e);var n=!1;try{n=null===window.frameElement}catch(e){}document.documentElement.doScroll&&n&&t()}on.register_event(window,"load",e,!0)},Xn=function(e){var t=e.get_config("name");e.mp_counts=e.mp_counts||{},e.mp_counts.$__c=parseInt(on.cookie.get("mp_"+t+"__c"))||0;var n=function(){e.mp_counts.$__c=(e.mp_counts.$__c||0)+1,on.cookie.set("mp_"+t+"__c",e.mp_counts.$__c,1,!0)},i=function(){try{e.mp_counts=e.mp_counts||{},n()}catch(e){an.error(e)}};on.register_event(document,"submit",i),on.register_event(document,"change",i);var r=null;on.register_event(document,"mousedown",function(e){r=e.target}),on.register_event(document,"mouseup",function(e){e.target===r&&i(e)})},Kn=O(),Yn={VIDEO_BUFFER_END:"video-buffer-end",VIDEO_BUFFER_START:"video-buffer-start",VIDEO_CHANGE_QUALITY:"video-change-quality",VIDEO_CONFIG_CHANGE:"video-config-change",VIDEO_ENDED:"video-ended",VIDEO_ERROR:"video-error",VIDEO_LEAVE:"video-leave",VIDEO_MINUTE_WATCHED:"video-minute-watched",VIDEO_PAUSE:"video-pause",VIDEO_PLAY:"video-play",VIDEO_PLAYING:"video-playing",VIDEO_READY:"video-ready",VIDEO_SEEK:"video-seek",VIDEO_SEEKED:"video-seeked",VIDEO_STALLED:"video-stalled",VIDEO_STREAM_CHANGE:"video-stream-change",VIDEO_STREAM_SELECT:"video-stream-select"},Qn=function(){function e(t){Ke(this,e),this.player=t,this.minuteWatchedTimerActive=!1,this.videoStarted=!1,this.videoSeeking=!1,this.videoPaused=!1,this.initialMinuteWatched=!0,this.currentMinuteWatchedTime=0,this.seekStartVideoTime=0,this.totalMinutesWatched=0,this.streamInfo=null,this.initMinuteWatchedTimer(),this.initMixPanel(),this.initEventListeners()}return Ye(e,[{key:"initMixPanel",value:function(){Kn.init(this.player.config.request.mixpanel_token),this.trackEvent(Yn.VIDEO_READY,this.eventGlobalProperties()),Kn.time_event(Yn.VIDEO_LEAVE),Kn.time_event(Yn.VIDEO_STREAM_SELECT)}},{key:"initEventListeners",value:function(){var e=this;this.player.events.on(Ge.playButtonPressed,function(){Kn.time_event(Yn.VIDEO_PLAYING);var t=e.eventGlobalProperties();e.videoStarted||(t.StartRequest=!0),e.trackEvent(Yn.VIDEO_PLAY,t)}),this.player.telecine.on("playing",function(){if(!e.minuteWatchedTimerActive){var t=e.eventGlobalProperties();e.videoStarted||(t.StartRequest=!0),e.minuteWatchedTimerActive=!0,e.videoStarted=!0,e.videoPaused=!1,e.trackEvent(Yn.VIDEO_PLAYING,t)}}),this.player.events.on(Ge.pauseButtonPressed,function(){e.minuteWatchedTimerActive=!1,e.videoPaused||(e.videoPaused=!0,e.trackEvent(Yn.VIDEO_PAUSE,e.eventGlobalProperties()))}),this.player.telecine.on("ended",function(){e.minuteWatchedTimerActive=!1,e.videoStarted=!1,e.trackEvent(Yn.VIDEO_ENDED,e.eventGlobalProperties())}),this.player.events.on(Ge.scrubbingStarted,function(){e.videoSeeking=!0,e.seekStartVideoTime=e.player.telecine.currentTime,Kn.time_event(Yn.VIDEO_SEEKED),e.trackEvent(Yn.VIDEO_SEEK,e.eventGlobalProperties())}),this.player.telecine.on("seeked",function(){if(e.videoSeeking){e.videoSeeking=!1;var t=e.eventGlobalProperties();t.SeekStartTime=e.seekStartVideoTime,t.SeekEndTime=e.player.telecine.currentTime,e.trackEvent(Yn.VIDEO_SEEKED,t)}}),this.player.telecine.on("error",function(t){e.minuteWatchedTimerActive=!1;var n=e.eventGlobalProperties();n.ErrorMessage=t.message,e.trackEvent(Yn.VIDEO_ERROR,n)}),this.player.telecine.on([Ge.bufferStarted,"streambufferstart"],function(){e.videoStarted&&(Kn.time_event(Yn.VIDEO_BUFFER_END),e.trackEvent(Yn.VIDEO_BUFFER_START,e.eventGlobalProperties()))}),this.player.telecine.on([Ge.bufferEnded,"streambufferend"],function(){e.videoStarted&&e.trackEvent(Yn.VIDEO_BUFFER_END,e.eventGlobalProperties())}),this.player.events.on($e.changeQuality,function(t){var n=e.eventGlobalProperties();n.RequestQuality=t,e.trackEvent(Yn.VIDEO_CHANGE_QUALITY,n)}),this.player.telecine.on("streamchange",function(t){var n=t.index,i=(t.streams,e.streamInfo);e.streamInfo=e.player.config.request.files.dash.streams[n];var r=e.eventGlobalProperties();e.videoStarted?(r.PreviousProfile=i.profile,r.PreviousStreamId=i.id,r.PreviousQuality=i.quality,e.trackEvent(Yn.VIDEO_STREAM_CHANGE,r)):e.trackEvent(Yn.VIDEO_STREAM_SELECT,r)}),this.player.events.on(Ge.configChanged,function(){e.minuteWatchedTimerActive=!1,e.videoSeeking=!1,e.videoPaused=!1,e.videoStarted=!1,e.minuteWatchedTimerActive=!1,Kn.time_event(Yn.VIDEO_STREAM_SELECT),e.trackEvent(Yn.VIDEO_CONFIG_CHANGE,e.eventGlobalProperties())}),this.player.telecine.on("bandwidth",function(t){e.streamInfo.bitrate=t.bitrate}),this.player.telecine.on("stalled",function(){e.trackEvent(Yn.VIDEO_STALLED,e.eventGlobalProperties())}),A(function(){e.trackEvent(Yn.VIDEO_LEAVE,e.eventGlobalProperties())})}},{key:"trackEvent",value:function(e,t){Kn.track(e,t)}},{key:"eventGlobalProperties",value:function(){var e={Autoplay:this.player.config.embed.autoplay,Bitrate:this.streamInfo?this.streamInfo.bitrate:null,CDN:this.player.telecine.currentFile.metadata.cdn||"akamai",Context:this.player.config.embed.context,Delivery:Ue[this.player.telecine.currentFile.mime],Embed:!this.player.config.embed.on_site,FileQuality:this.player.telecine.currentFile.metadata.quality,Fullscreen:!!dt.element,FPS:this.streamInfo?this.streamInfo.fps:null,ID:this.player.config.video.id,Loop:!!this.player.config.embed.loop,Mime:this.player.telecine.currentFile.mime,MinutesWatched:this.totalMinutesWatched,Origin:this.player.telecine.currentFile.metadata.origin,OwnerAccountType:this.player.config.video.owner.account_type,OwnerID:this.player.config.video.owner?this.player.config.video.owner.id:0,PlayerBuild:this.player.config.request.build.player,PlayerHeight:this.player.element.querySelector(".video").getBoundingClientRect().height,PlayerURL:this.player.config.player_url,PlayerWidth:this.player.element.querySelector(".video").getBoundingClientRect().width,Privacy:this.player.config.video.privacy,Profile:this.streamInfo?this.streamInfo.profile:null,Rating:this.player.config.video.rating?this.player.config.video.rating.id:null,Referrer:this.player.config.request.referrer,SeparateAV:!!this.player.config.request.files.dash&&this.player.config.request.files.dash.separate_av,Session:this.player.config.request.session,StreamID:this.streamInfo?this.streamInfo.id:null,StreamQuality:this.streamInfo?this.streamInfo.quality:null,Type:We[this.player.telecine.currentScanner],UserAccountType:this.player.config.user.account_type,UserIsMod:this.player.config.user.mod,VODID:this.player.config.video.vod&&this.player.config.video.vod.id?this.player.config.video.vod.id:null,VODSaleID:this.player.config.video.vod&&this.player.config.video.vod.sale_id?this.player.config.video.vod.sale_id:null,VideoDuration:this.player.config.video.duration,VideoTime:this.player.telecine.currentTime,ViewMode:window.getComputedStyle(this.player.element,":after").getPropertyValue("content").replace(/["'\s]*/g,""),Volume:Math.round(100*this.player.telecine.volume),Source:this.player.telecine.currentFile.src};for(var t in this.player.config.request.ab_tests)e["Test_"+t]=this.player.config.request.ab_tests[t];return e}},{key:"logMinuteWatched",value:function(){this.trackEvent(Yn.VIDEO_MINUTE_WATCHED,this.eventGlobalProperties())}},{key:"initMinuteWatchedTimer",value:function(){var e=this,t=Math.floor(60*Math.random());setInterval(function(){if(e.minuteWatchedTimerActive)return e.currentMinuteWatchedTime++,e.initialMinuteWatched?void(e.currentMinuteWatchedTime===t&&(e.initialMinuteWatched=!1,e.currentMinuteWatchedTime=0,e.totalMinutesWatched++,e.logMinuteWatched())):void(e.currentMinuteWatchedTime>=60&&(e.currentMinuteWatchedTime=0,e.totalMinutesWatched++,e.logMinuteWatched()))},1e3)}}]),e}();q.prototype={get complement(){var e=this.clone();return e.rgb={red:255-this.red,green:255-this.green,blue:255-this.blue},e},get hex(){return q.rgbToHex(this.red,this.green,this.blue)},set hex(e){return this.rgba=q.hexToRgb(e),this},get hsl(){return"hsl("+this.hue+","+this.saturation+"%,"+Math.round(this.lightness)+"%)"},set hsl(e){this.hue=e.hue,this.saturation=e.saturation,this.lightness=e.lightness;var t=q.hslToRgb(e.hue,e.saturation,e.lightness);return this.red=t.red,this.green=t.green,this.blue=t.blue,this.alpha=t.alpha,this},get luminance(){function e(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}var t=e(this.red/255),n=e(this.green/255),i=e(this.blue/255),r=.2126*t+.7152*n+.0722*i;return r},get rgb(){return"rgb("+this.red+","+this.green+","+this.blue+")"},set rgb(e){return this.rgba=e,this},get rgba(){return"rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")"},set rgba(e){this.red=e.red,this.green=e.green,this.blue=e.blue,this.alpha=e.alpha||1;var t=q.rgbToHsl(e.red,e.green,e.blue);return this.hue=t.hue,this.saturation=t.saturation,this.lightness=t.lightness,this},get yiq(){return(299*this.red+587*this.green+114*this.blue)/1e3},clone:function(){return new q(this)},lighten:function(e,t,n){if(this.hsl={hue:this.hue,saturation:this.saturation,lightness:this.lightness+e},t&&n)for(var i=n.contrast(this).ratio;i=100)););return this},darken:function(e,t,n){if(this.hsl={hue:this.hue,saturation:this.saturation,lightness:this.lightness-e},t&&n)for(var i=n.contrast(this).ratio;i=1)return this;var t=this.clone();return t.rgba={red:t.red*this.alpha+e.red*e.alpha*(1-this.alpha),green:t.green*this.alpha+e.green*e.alpha*(1-this.alpha),blue:t.blue*this.alpha+e.blue*e.alpha*(1-this.alpha),alpha:t.alpha+e.alpha*(1-this.alpha)},t},contrast:function(e){var t=this.alpha;if(t>=1){e.alpha<1&&(e=e.overlayOn(this));var n=this.luminance+.05,i=e.luminance+.05,r=n/i;return i>n&&(r=1/r),r=Math.round(10*r)/10,{ratio:r,error:0,min:r,max:r}}var o=this.overlayOn(q.white).contrast(e).ratio,a=this.overlayOn(q.black).contrast(e).ratio,s=Math.max(o,a),c={red:Math.min(Math.max(0,(e.red-this.red*t)/(1-t)),255),green:Math.min(Math.max(0,(e.green-this.green*t)/(1-t)),255),blue:Math.min(Math.max(0,(e.blue-this.blue*t)/(1-t)),255)},u=this.clone();u.rgb=c;var l=this.overlayOn(u).contrast(e).ratio;return{ratio:Math.round((l+s)/2*10)/10,error:Math.round((s-l)/2*10)/10,min:l,max:s,closest:u,farthest:a===s?q.white:q.black}},wcagAACompliant:function(e){return this.contrast(e).ratio>=4.5},wcagAAACompliant:function(e){return this.contrast(e).ratio>=7},yiqContrastColor:function(){return this.yiq>=120?new q(0,0,0):new q(255,255,255)}},q.hexToRgb=function(e){var t;return e=String(e),3===e.length||4===e.length?(t=/^#?([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e),t&&(t[1]+=t[1],t[2]+=t[2],t[3]+=t[3])):t=/^#?([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e),t?{red:parseInt(t[1],16),green:parseInt(t[2],16),blue:parseInt(t[3],16),alpha:1}:null},q.rgbToHex=function(e,t,n){return"#"+((1<<24)+(Math.round(e)<<16)+(Math.round(t)<<8)+Math.round(n)).toString(16).slice(1)},q.rgbToHsl=function(e,t,n){e/=255,t/=255,n/=255;var i=Math.max(e,t,n),r=Math.min(e,t,n),o=(i+r)/2,a=o,s=o;if(i===r)return{hue:0,saturation:0,lightness:100*s};var c=i-r;return a=s>.5?c/(2-i-r):c/(i+r),i===e?o=(t-n)/c+(t1&&(n-=1),6*n<1?e+6*(t-e)*n:2*n<1?t:3*n<2?e+(t-e)*(6*(2/3-n)):e}if(e/=360,t/=100,n/=100,0===t)return{red:Math.floor(255*n),green:Math.floor(255*n),blue:Math.floor(255*n)};var r=n<.5?n*(1+t):n+t-t*n,o=2*n-r;return{red:Math.floor(255*i(o,r,e+1/3)),green:Math.floor(255*i(o,r,e)),blue:Math.floor(255*i(o,r,e-1/3))}},q.hslToHex=function(e,t,n){var i=q.hslToRgb(e,t,n);return q.rgbToHex(i.red,i.green,i.blue)},q.white=new q("fff"),q.black=new q("000");var Jn=6e4,Zn=window.Array.from,ei=[1];"function"==typeof Zn&&Zn(ei)===ei&&(Zn=!1);var ti=Zn||function(e){return[].slice.call(e,0)},ni=["quality","volume","captions"],ii=null,ri=function(){function e(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=n.displayTimeout,r=void 0===i?0:i,o=n.label,a=void 0===o?"Alert":o;Ke(this,e),C(this),this._container=t,this._visible=!1,this._message=null,this._alert=null,this._alertLabel=a;var s=Math.round(r/1e3);0!==s&&(this._alertLabel=a+" Will be dismissed in "+s+" seconds"),this._displayTimer=null,this._displayTimeout=r,this._renderTemplate(),this._attachEvents()}return Ye(e,[{key:"show",value:function(e){var t=this;if(this._visible!==!0){clearTimeout(this._displayTimer),this._alert.classList.remove("hidden"),this._alert.removeAttribute("hidden"),window.requestAnimationFrame(function(){t._alert.classList.add("in")});var n=this._alert.querySelector("[data-alert-autofocus]")||this._alert;n.focus(),this._visible=!0,this.fire("show",e),0!==this._displayTimeout&&(this._displayTimer=setTimeout(function(){t.hide("timeout")},this._displayTimeout))}}},{key:"hide",value:function(e){var t=this;this._visible!==!1&&(clearTimeout(this._displayTimer),this._alert.classList.add("leaving"),window.requestAnimationFrame(function(){var e=t;t._setHideAttributes(),et(t._alert).on("transitionend",function t(n){"opacity"===n.propertyName&&(e._alert.classList.remove("leaving"),e._alert.classList.add("hidden"),e._alert.setAttribute("hidden",""),et(e._alert).off("transitionend",t))})}),this._visible=!1,this.fire("hide",e))}},{key:"_setHideAttributes",value:function(){this._alert.classList.remove("in")}},{key:"_renderTemplate",value:function(){this._alert||(this._alert=document.createElement("div"),this._alert.setAttribute("role","alertdialog"),this._alert.setAttribute("aria-label",this._alertLabel),this._alert.setAttribute("aria-atomic","true"),this._alert.classList.add("player-alert"),this._alert.classList.add("hidden"),this._alert.setAttribute("hidden",""),this._container.appendChild(this._alert),this._setHideAttributes()),this._message instanceof HTMLElement?(this._alert.innerHTML="",this._alert.appendChild(this._message)):(this._alert.textContent=this._message,this._alert.innerHTML=this._message);var e=document.createElement("button");e.setAttribute("data-close",""),e.setAttribute("aria-label","Close alert"),e.classList.add("close"),e.innerHTML=ut.render("icon_close"),this._alert.appendChild(e)}},{key:"_attachEvents",value:function(){var e=this;et(this._alert).on("click","[data-close]",function(t){e.hide(t)})}},{key:"visible",get:function(){return this._visible}},{key:"message",get:function(){return this._message},set:function(e){e instanceof HTMLElement&&this._message&&e.textContent===this._message.textContent||e!==this._message&&(this._message=e,this._renderTemplate())}}]),e}(),oi=function(){function e(t,n,i){var r=this;Ke(this,e),C(this),this.version=i,this.visible=!1;var o=this._wrap=document.createElement("div");o.classList.add("compass-wrapper"),o.innerHTML=ut.render("compass",{version:i}),o.classList.add("cloaked"),t.appendChild(o),n&&o.addEventListener("click",n),this._layerSlice=o.querySelector(".compass-slice"),this._lineSlice=o.querySelector(".compass-line");var a=function(){r._mouseIn=!0},s=function(e){return function(){setTimeout(function(){r._mouseIn||(r.fade(),r._mouseIn=!1)},e)}};et(this._wrap).on("mousein",a).on("pointerin",a).on("mouseout",s(1e3)).on("pointerout",s(1e3)),s(2e3)()}return Ye(e,[{key:"setAngle",value:function(e,t){var n=this;this._animationFrame&&window.cancelAnimationFrame(this._animationFrame);var i=0;1===this.version?i=-45:2===this.version&&(i=-30);var r=""+(i+t),o=(e+85)/170,a=18;this._animationFrame=window.requestAnimationFrame(function(){n._layerSlice.setAttribute("transform","rotate("+r+", "+a+", "+a+")"),n._lineSlice&&n._lineSlice.setAttribute("d",n._getLinePath(o,a))})}},{key:"_getLinePath",value:function(e,t){var n=5,i=2*t-Math.round(2*t*e),r=2*Math.sqrt(2*i*t-Math.pow(i,2)),o=(2*t-r)/2,a=o+n,s=2*t-o-n;return"M"+a+","+i+" L"+s+","+i+" z"}},{key:"reveal",value:function(){var e=this;this._wrap.classList.remove("cloaked"),window.requestAnimationFrame(function(){e._wrap.classList.add("in")}),this.visible=!0}},{key:"fade",value:function(){this._wrap.classList.add("fade"),this.visible=!0}},{key:"hide",value:function(){var e=this;this._wrap.classList.remove("in"),this._wrap.classList.remove("fade"),this._wrap.classList.add("leaving");var t=function t(){"opacity"===event.propertyName&&(e._wrap.classList.remove("leaving"),e._wrap.classList.add("cloaked"),e.visible=!1),et(e._wrap).off("transitionend",t)};et(this._wrap).on("transitionend",t)}}]),e}(),ai=t(function(e){e.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{String(e)}catch(e){return!1}return"symbol"==typeof Symbol.iterator||"object"==typeof Symbol.isConcatSpreadable&&("object"==typeof Symbol.iterator&&("object"==typeof Symbol.toPrimitive&&("object"==typeof Symbol.toStringTag&&"object"==typeof Symbol.unscopables)))}}),si=e(ai),ci=Object.freeze({default:si}),ui=t(function(e){e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}}),li=e(ui),di=Object.freeze({
default:li}),fi=t(function(e){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}}),hi=e(fi),pi=Object.freeze({default:hi}),vi=t(function(e){var t=Object.keys;e.exports=function(e){return t(null==e?e:Object(e))}}),mi=e(vi),gi=Object.freeze({default:mi}),_i=t(function(t){t.exports=e(pi)()?Object.keys:e(gi)}),yi=e(_i),bi=Object.freeze({default:yi}),wi=t(function(e){e.exports=function(e){if(null==e)throw new TypeError("Cannot use null or undefined");return e}}),ki=e(wi),xi=Object.freeze({default:ki}),Si=t(function(t){var n=e(bi),i=e(xi),r=Math.max;t.exports=function(e,t){var o,a,s,c=r(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(e){o||(o=e)}},a=1;a-1}}),ji=e(Ni),Hi=Object.freeze({default:ji}),Vi=t(function(t){t.exports=e(Di)()?String.prototype.contains:e(Hi)}),Ui=e(Vi),zi=Object.freeze({default:Ui}),Wi=t(function(t){var n,i=e(Ci),r=e(Ii),o=e(qi),a=e(zi);n=t.exports=function(e,t){var n,o,s,c,u;return arguments.length<2||"string"!=typeof e?(c=t,t=e,e=null):c=arguments[2],null==e?(n=s=!0,o=!1):(n=a.call(e,"c"),o=a.call(e,"e"),s=a.call(e,"w")),u={value:t,configurable:n,enumerable:o,writable:s},c?i(r(c),u):u},n.gs=function(e,t,n){var s,c,u,l;return"string"!=typeof e?(u=n,n=t,t=e,e=null):u=arguments[3],null==t?t=void 0:o(t)?null==n?n=void 0:o(n)||(u=n,n=void 0):(u=t,t=n=void 0),null==e?(s=!0,c=!1):(s=a.call(e,"c"),c=a.call(e,"e")),l={get:t,set:n,configurable:s,enumerable:c},u?i(r(u),l):l}}),$i=e(Wi),Gi=Object.freeze({default:$i}),Xi=t(function(e){e.exports=function(e){return e&&("symbol"==typeof e||"Symbol"===e["@@toStringTag"])||!1}}),Ki=e(Xi),Yi=Object.freeze({default:Ki}),Qi=t(function(t){var n=e(Yi);t.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}}),Ji=e(Qi),Zi=Object.freeze({default:Ji}),er=t(function(t){var n,i,r,o=e(Gi),a=e(Zi),s=Object.create,c=Object.defineProperties,u=Object.defineProperty,l=Object.prototype,d=s(null);"function"==typeof Symbol&&(n=Symbol);var f=function(){var e=s(null);return function(t){for(var n,i,r=0;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,n="@@"+t,u(l,n,o.gs(null,function(e){i||(i=!0,u(this,n,o(e)),i=!1)})),n}}();r=function(e){if(this instanceof r)throw new TypeError("TypeError: Symbol is not a constructor");return i(e)},t.exports=i=function e(t){var n;if(this instanceof e)throw new TypeError("TypeError: Symbol is not a constructor");return n=s(r.prototype),t=void 0===t?"":String(t),c(n,{__description__:o("",t),__name__:o("",f(t))})},c(i,{for:o(function(e){return d[e]?d[e]:d[e]=i(String(e))}),keyFor:o(function(e){var t;a(e);for(t in d)if(d[t]===e)return t}),hasInstance:o("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:o("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:o("",n&&n.iterator||i("iterator")),match:o("",n&&n.match||i("match")),replace:o("",n&&n.replace||i("replace")),search:o("",n&&n.search||i("search")),species:o("",n&&n.species||i("species")),split:o("",n&&n.split||i("split")),toPrimitive:o("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:o("",n&&n.toStringTag||i("toStringTag")),unscopables:o("",n&&n.unscopables||i("unscopables"))}),c(r.prototype,{constructor:o(i),toString:o("",function(){return this.__name__})}),c(i.prototype,{toString:o(function(){return"Symbol ("+a(this).__description__+")"}),valueOf:o(function(){return a(this)})}),u(i.prototype,i.toPrimitive,o("",function(){return a(this)})),u(i.prototype,i.toStringTag,o("c","Symbol")),u(r.prototype,i.toStringTag,o("c",i.prototype[i.toStringTag])),u(r.prototype,i.toPrimitive,o("c",i.prototype[i.toPrimitive]))}),tr=e(er),nr=Object.freeze({default:tr}),ir=t(function(t){t.exports=e(ci)()?Symbol:e(nr)}),rr=e(ir),or=window.WeakMap||function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};return n.prototype.set=function(t,n){if("object"!==("undefined"==typeof t?"undefined":Xe(t))&&"function"!=typeof t)throw new TypeError("Invalid value used as weak map key");var i=t[this.name];return i&&i[0]===t?i[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},n.prototype.get=function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},n.prototype.delete=function(e){var t=e[this.name];return!(!t||t[0]!==e)&&(t[0]=t[1]=void 0,!0)},n.prototype.has=function(e){var t=e[this.name];return!!t&&t[0]===e},n}(),ar="function"==typeof rr&&"symbol"==typeof rr.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof rr&&e.constructor===rr&&e!==rr.prototype?"symbol":typeof e},sr=(function(){function e(e){this.value=e}function t(t){function n(e,t){return new je(function(n,r){var s={key:e,arg:t,resolve:n,reject:r,next:null};a?a=a.next=s:(o=a=s,i(e,t))})}function i(n,o){try{var a=t[n](o),s=a.value;s instanceof e?je.resolve(s.value).then(function(e){i("next",e)},function(e){i("throw",e)}):r(a.done?"return":"normal",a.value)}catch(e){r("throw",e)}}function r(e,t){switch(e){case"return":o.resolve({value:t,done:!0});break;case"throw":o.reject(t);break;default:o.resolve({value:t,done:!1})}o=o.next,o?i(o.key,o.arg):a=null}var o,a;this._invoke=n,"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof rr&&rr.asyncIterator&&(t.prototype[rr.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),cr=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};sr(this,e),this._telecine=t,this._element=t._element,this._options=n}return cr(e,null,[{key:"displayName",get:function(){return"Effect"}},{key:"supported",get:function(){return!1}},{key:"supportedScanners",get:function(){return[]}}]),cr(e,[{key:"activate",value:function(){throw new TelecineError("NotImplemented","The effect must implement the activate method.")}},{key:"deactivate",value:function(){throw new TelecineError("NotImplemented","The effect must implement the deactivate method.")}}]),e}(),gr=/Firefox/.test(navigator.userAgent),_r=/i(Phone|Pad|Pod touch);/.test(navigator.userAgent),yr=/Android/.test(navigator.userAgent),br=yr&&/mobile/.test(navigator.userAgent.toLowerCase()),wr={firefox:gr,iOS:_r,android:yr,androidMobile:br},kr=function(e){for(var t=0,n=this.length;t1&&void 0!==arguments[1]?arguments[1]:{};sr(this,e),this._element=t,this._options=n,this._telecineVideo=null,this._currentFile=null,this._externalDisplays=[],ne(this)}return cr(e,null,[{key:"displayName",get:function(){return"Scanner"}},{key:"supported",get:function(){return!1}},{key:"supportedVideoTypes",get:function(){return[]}},{key:"supportedAudioTypes",get:function(){return[]}},{key:"supportedExternalDisplays",get:function(){return[]}},{key:"supportsSettingVolume",get:function(){return!0}},{key:"supportsTextTracks",get:function(){return!1}}]),cr(e,[{key:"deactivate",value:function(){this._telecineVideo&&(this._telecineVideo.off("filesrcupdate"),this._telecineVideo.off("texttracksrcupdate"))}},{key:"reactivate",value:function(){}},{key:"play",value:function(){throw new TelecineError("NotImplemented","The scanner must implement the play method.")}},{key:"pause",value:function(){throw new TelecineError("NotImplemented","The scanner must implement the pause method.")}},{key:"addTextTrack",value:function(e){return this}},{key:"removeTextTrack",value:function(e){return this}},{key:"getCuesForTrack",value:function(e){return[]}},{key:"getActiveCuesForTrack",value:function(e){return[]}},{key:"setModeForTrack",value:function(e,t){return this}},{key:"setSrcForTrack",value:function(e,t){return this}},{key:"addCuePoint",value:function(e){arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};throw new TelecineError("CuePointsNotSupported","Cue points are not supported in this scanner.")}},{key:"removeCuePoint",value:function(e){return!1}},{key:"removeAllCuePoints",value:function(){return!1}},{key:"showExternalDisplayPicker",value:function(e){if(!this._externalDisplays.length)throw new TelecineError("ExternalDisplayUnvailable","No external displays are available.");if(!e)return void this._externalDisplays[0].showPicker();var t=this._externalDisplays.filter(function(t){return t.constructor.displayName.replace("ExternalDisplay","")===e})[0];if(!t)throw new TelecineError("InvalidExternalDisplay","The specified external display is not available.");t.showPicker()}},{key:"_pickFile",value:function(){if(this._files.length<1)return null;var e=this._files.slice(0).sort(function(e,t){return e.priority-t.priority});return e[0]}},{key:"_updateCurrentFile",value:function(){var e=this._pickFile();return e?void(this.currentFile=e):void this.fire("scannererror",{reason:"all files failed"})}},{key:"_switchToNextFile",value:function(){var e=this._files.indexOf(this._currentFile);this._files.splice(e,1),this._updateCurrentFile()}},{key:"buffered",get:function(){return ve()}},{key:"cuePoints",get:function(){return[]}},{key:"currentFile",get:function(){return this._currentFile},set:function(e){this._currentFile=e,this.fire("currentfilechange",e)}},{key:"currentTime",get:function(){return 0},set:function(e){}},{key:"duration",get:function(){return NaN}},{key:"ended",get:function(){return!1}},{key:"externalDisplayAvailable",get:function(){return this._externalDisplays.some(function(e){return e.available})}},{key:"externalDisplayActive",get:function(){return this._externalDisplays.some(function(e){return e.active})}},{key:"loop",get:function(){return!1},set:function(e){}},{key:"muted",get:function(){return!1},set:function(e){}},{key:"paused",get:function(){return!0}},{key:"playbackRate",get:function(){return 1},set:function(e){}},{key:"preload",get:function(){return"none"},set:function(e){}},{key:"presentationMode",get:function(){return"inline"},set:function(e){if(this.supportedPresentationModes.indexOf(e)===-1)throw new TelecineError("InvalidPresentationMode","The “"+e+"” presentation mode is not supported.")}},{key:"supportedPresentationModes",get:function(){return["inline"]}},{key:"video",get:function(){return this._telecineVideo},set:function(e){var t=this;this.reactivate(),this._telecineVideo!==e&&(this._telecineVideo&&(this._telecineVideo.off("filesrcupdate"),this._telecineVideo.off("texttracksrcupdate")),this.removeAllCuePoints(),this._telecineVideo=e,this._files=e.files.filter(function(e){return t.constructor.supportedVideoTypes.indexOf(e.mime)!==-1}),this._telecineVideo.on("filesrcupdate",function(e){e===t._currentFile&&t._updateCurrentFile()}),this._telecineVideo.on("texttracksrcupdate",function(e){t.video.currentScanner&&t.video.currentScanner.setSrcForTrack(e,e.src)}),this._options.externalDisplays&&this._options.externalDisplays.length&&!function(){t._externalDisplays=[];var n=t.constructor.supportedExternalDisplays.map(function(e){return e.displayName});t._options.externalDisplays.filter(function(e){return e.supported&&n.indexOf(e.displayName)!==-1}).forEach(function(n){var i=new n(e),r=n.displayName.replace("ExternalDisplay","");i.on("available",function(){return t.fire("externaldisplayavailable",{type:r})}),i.on("unavailable",function(){return t.fire("externaldisplayunavailable",{type:r})}),i.on("activated",function(){"function"==typeof t.onexternaldisplayactivated&&t.onexternaldisplayactivated(i),t.fire("externaldisplayactivated",{type:r})}),i.on("deactivated",function(){"function"==typeof t.onexternaldisplaydeactivated&&t.onexternaldisplaydeactivated(i),t.fire("externaldisplaydeactivated",{type:r})}),t._externalDisplays.push(i)})}(),this._updateCurrentFile())}},{key:"videoWidth",get:function(){return 0}},{key:"videoHeight",get:function(){return 0}},{key:"volume",get:function(){return 1},set:function(e){}}]),e}(),Tr=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"],Er=["externaldisplayavailable","externaldisplayunavailable","externaldisplayactivated","externaldisplaydeactivated"],Pr=["scannerchange","scannererror","drmauthfailure","drmauthsuccess","drmfailure","emeunsupported","currentfilechange","streamchange","streambufferstart","streambufferend","droppedframes","bandwidth","streamtargetchange","alert","presentationmodechange","cuepoint"],Lr=[].concat(Tr,Er,Pr),Cr=new or,Or=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};sr(this,e);var i=parseFloat(t);if(isNaN(i))throw new TypeError("Time must be a number.");if(i<0)throw new TypeError("Time must be a positive number.");this.time=t,this.data=n,this.id=ue(),this.vttCue=new VTTCue(t,t+.25,JSON.stringify(n)),this.vttCue.id=this.id,Cr.set(this.vttCue,this),Object.freeze(this)}return cr(e,null,[{key:"fromVTTCue",value:function(t){if(Cr.has(t))return Cr.get(t);var n={};try{n=JSON.parse(t.text)}catch(e){}return new e(t.startTime,n)}}]),e}(),Ar=function(){function e(t){var n=this;sr(this,e),this._interval=null,this._rates=[],this._averageRate=0,this._lastChecked=null,this._lastLoaded=0,this._scanner=t,this._scanner.on("loadstart",function(){return n.startInterval()}),this._scanner.on("progress",function(){return n.startInterval()}),this._scanner.on("ended",function(){return n.stopInterval()})}return cr(e,[{key:"startInterval",value:function(){var e=this;this._interval||(this._interval=window.setInterval(function(){return e.updateDownloadRate()},1e3))}},{key:"stopInterval",value:function(){window.clearInterval(this._interval)}},{key:"updateDownloadRate",value:function(){for(var e=ce(),t=0,n=this._scanner.buffered,i=Array.isArray(n),r=0,n=i?n:n[rr.iterator]();;){var o;if(i){if(r>=n.length)break;o=n[r++]}else{if(r=n.next(),r.done)break;o=r.value}var a=o,s=pr(a,2),c=s[0],u=s[1];t+=u-c}if(!this._lastChecked)return this._lastChecked=e,void(this._lastLoaded=t);if(this._lastLoaded!==t){var l=Math.max(t-this._lastLoaded,0);this._rates.push(l),this._rates=this._rates.slice(-15),this._averageRate=this._rates.reduce(function(e,t){return e+t})/this._rates.length,this._lastChecked=e,this._lastLoaded=t,Math.round(t)>=Math.round(this._scanner.duration)&&this.stopInterval()}}},{key:"averageDownloadRate",get:function(){return this._averageRate}}]),e}(),Ir=function(){function e(t){sr(this,e),this._available=!1,this._active=!1,this._video=t,ne(this)}return cr(e,null,[{key:"displayName",get:function(){return"ExternalDisplay"}},{key:"supported",get:function(){return!1}},{key:"supportedVideoTypes",get:function(){return[]}}]),cr(e,[{key:"showPicker",value:function(){}},{key:"getFile",value:function(){var e=this.constructor.displayName.replace("ExternalDisplay","");if(this._video.externalDisplayFiles[e])return this._video.externalDisplayFiles[e];var t=this.constructor.supportedVideoTypes,n=this._video.files.filter(function(e){return t.indexOf(e.mime)!==-1}).sort(function(e,n){return e.mime===n.mime?e.priority-n.priority:t.indexOf(e.mime)-t.indexOf(n.mime)});if(!n.length)throw new Error("No files available for "+this.constructor.displayName+" external display.");return n[0]}},{key:"active",get:function(){return this._active}},{key:"available",get:function(){return this._available}},{key:"element",get:function(){return document.createElement("div")}}]),e}(),AirPlayExternalDisplay=function(e){function AirPlayExternalDisplay(e){sr(this,AirPlayExternalDisplay);var t=fr(this,(AirPlayExternalDisplay.__proto__||Object.getPrototypeOf(AirPlayExternalDisplay)).call(this,e));return t._videoElement=document.createElement("video"),t._videoElement.setAttribute("data-airplay",""),t._videoElement.setAttribute("x-webkit-airplay","allow"),t.addVideoEventListeners(),t}return dr(AirPlayExternalDisplay,e),cr(AirPlayExternalDisplay,null,[{key:"displayName",get:function(){return"AirPlayExternalDisplay"}},{key:"supported",get:function(){return"WebKitPlaybackTargetAvailabilityEvent"in window}},{key:"supportedVideoTypes",get:function(){return["application/vnd.apple.mpegurl","video/mp4"]}}]),cr(AirPlayExternalDisplay,[{key:"addVideoEventListeners",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._videoElement;t.addEventListener("webkitplaybacktargetavailabilitychanged",function(t){switch(t.availability){case"available":e._available||(e._available=!0,e.fire("available"));break;case"not-available":e._available&&(e._available=!1,e.fire("unavailable"))}}),t.addEventListener("webkitcurrentplaybacktargetiswirelesschanged",function(t){return t.target.webkitCurrentPlaybackTargetIsWireless?(e._active=!0,void e.fire("activated")):(e._active=!1,void e.fire("deactivated"))})}},{key:"showPicker",value:function(){var e=this;this._videoElement.webkitShowPlaybackTargetPicker(),this.loadMetadata().then(function(){e._videoElement.webkitShowPlaybackTargetPicker()})}},{key:"loadMetadata",value:function(){var e=this;return this._videoElement.readyState>=1?je.resolve():new je(function(t,n){e._videoElement.addEventListener("loadedmetadata",function(){t()}),e._videoElement.src=e.getFile().src})}},{key:"element",get:function(){return this._videoElement},set:function(e){if(!(e instanceof HTMLVideoElement))throw new TypeError("The element for AirPlay must be a