1var HermesVideo=(function(m){"use strict";const o={READY:"ready",LOAD_START:"loadstart",PLAY:"play",PLAYING:"playing",PAUSE:"pause",TIME_UPDATE:"timeupdate",WAITING:"waiting",VOLUME_CHANGE:"volumechange",SEEKING:"seeking",SEEKED:"seeked",ENDED:"ended",ERROR:"error",PLAY_BLOCKED:"playblocked",AD_STARTED:"ima3-started",AD_PROGRESS:"ima3-ad-progress",AD_FIRST_QUARTILE:"ima3-first-quartile",AD_MIDPOINT:"ima3-midpoint",AD_THIRD_QUARTILE:"ima3-third-quartile",AD_COMPLETE:"ima3-complete",AD_SKIPPED:"ima3-skipped",AD_ERROR:"ima3-ad-error",AD_TAG_PASSED:"ad-tag-passed"};class D{handlers=new Map;on(e,t){let i=this.handlers.get(e);return i||(i=new Set,this.handlers.set(e,i)),i.add(t),()=>i.delete(t)}emit(e,t){this.handlers.get(e)?.forEach(i=>i(t))}destroy(){this.handlers.clear()}}const b=new Map;function C(n){const e=b.get(n);if(e)return e;const t=new Promise((i,s)=>{const r=document.createElement("script");r.src=n,r.async=!0,r.addEventListener("load",()=>i()),r.addEventListener("error",()=>{b.delete(n),r.remove(),s(new Error(`HermesVideo: failed to load ${n}`))}),document.head.appendChild(r)});return b.set(n,t),t}const R="",V="default";function Q(n,e){return`https://players.brightcove.net/${n}/${e}_default/index.min.js`}function X(n){return n instanceof DOMException&&n.name==="NotAllowedError"}const E="data:text/xml;base64,"+btoa('<?xml version="1.0" encoding="UTF-8"?><VAST version="3.0"/>'),Z="data:video/mp4;base64,AAAAFGZ0eXBNU05WAAACAE1TTlYAAAOUbW9vdgAAAGxtdmhkAAAAAM9ghv7PYIb+AAACWAAACu8AAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAnh0cmFrAAAAXHRraGQAAAAHz2CG/s9ghv4AAAABAAAAAAAACu8AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAFAAAAA4AAAAAAHgbWRpYQAAACBtZGhkAAAAAM9ghv7PYIb+AAALuAAANq8AAAAAAAAAIWhkbHIAAAAAbWhscnZpZGVBVlMgAAAAAAABAB4AAAABl21pbmYAAAAUdm1oZAAAAAAAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAVdzdGJsAAAAp3N0c2QAAAAAAAAAAQAAAJdhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAFAAOABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAAEmNvbHJuY2xjAAEAAQABAAAAL2F2Y0MBTUAz/+EAGGdNQDOadCk/LgIgAAADACAAAAMA0eMGVAEABGjuPIAAAAAYc3R0cwAAAAAAAAABAAAADgAAA+gAAAAUc3RzcwAAAAAAAAABAAAAAQAAABxzdHNjAAAAAAAAAAEAAAABAAAADgAAAAEAAABMc3RzegAAAAAAAAAAAAAADgAAAE8AAAAOAAAADQAAAA0AAAANAAAADQAAAA0AAAANAAAADQAAAA0AAAANAAAADQAAAA4AAAAOAAAAFHN0Y28AAAAAAAAAAQAAA7AAAAA0dXVpZFVTTVQh0k/Ou4hpXPrJx0AAAAAcTVREVAABABIAAAAKVcQAAAAAAAEAAAAAAAAAqHV1aWRVU01UIdJPzruIaVz6ycdAAAAAkE1URFQABAAMAAAAC1XEAAACHAAeAAAABBXHAAEAQQBWAFMAIABNAGUAZABpAGEAAAAqAAAAASoOAAEAZABlAHQAZQBjAHQAXwBhAHUAdABvAHAAbABhAHkAAAAyAAAAA1XEAAEAMgAwADAANQBtAGUALwAwADcALwAwADYAMAA2ACAAMwA6ADUAOgAwAAABA21kYXQAAAAYZ01AM5p0KT8uAiAAAAMAIAAAAwDR4wZUAAAABGjuPIAAAAAnZYiAIAAR//eBLT+oL1eA2Nlb/edvwWZflzEVLlhlXtJvSAEGRA3ZAAAACkGaAQCyJ/8AFBAAAAAJQZoCATP/AOmBAAAACUGaAwGz/wDpgAAAAAlBmgQCM/8A6YEAAAAJQZoFArP/AOmBAAAACUGaBgMz/wDpgQAAAAlBmgcDs/8A6YEAAAAJQZoIBDP/AOmAAAAACUGaCQSz/wDpgAAAAAlBmgoFM/8A6YEAAAAJQZoLBbP/AOmAAAAACkGaDAYyJ/8AFBAAAAAKQZoNBrIv/4cMeQ==",J=new Set([o.PLAY,o.PLAYING,o.PAUSE,o.TIME_UPDATE,o.WAITING,o.SEEKING,o.SEEKED]),ee=[o.LOAD_START,o.PLAY,o.PLAYING,o.PAUSE,o.TIME_UPDATE,o.WAITING,o.VOLUME_CHANGE,o.SEEKING,o.SEEKED,o.ERROR,o.AD_STARTED,o.AD_PROGRESS,o.AD_FIRST_QUARTILE,o.AD_MIDPOINT,o.AD_THIRD_QUARTILE,o.AD_COMPLETE,o.AD_SKIPPED,o.AD_ERROR];class te{events=new D;container;options;element;player;endedForwarded=!1;constructor(e,t){this.container=e,this.options=t}async init(){const{accountId:e,playerId:t}=this.options;await C(Q(e,t));const i=window.bc;if(!i)throw new Error("HermesVideo: Brightcove global (window.bc) unavailable after load");this.element=this.createElement(),this.container.appendChild(this.element);const s=i(this.element);this.player=s,this.wireEvents();const r=this.options.muted??!1,d=(this.options.autoplay??!1)&&await this.canAutoplay(r);await new Promise(c=>{s.ready(()=>{typeof s.bcPlaylistUi=="function"&&s.bcPlaylistUi(),typeof s.playlist?.autoadvance=="function"&&s.playlist.autoadvance(this.options.continuousPlay??!0?0:null),typeof s.ima3=="function"&&s.ima3({serverUrl:l=>{const h=s.mediainfo,A=this.options.buildAdTag?this.options.buildAdTag(h?.hermesVideoId):h?.adTagUrl;if(!A||A===E){l(E);return}l(this.resolveAdMacros(A)),this.events.emit(o.AD_TAG_PASSED)}
1,adWillAutoplay:d,adWillPlayMuted:r,showVpaidControls:!0,timeout:1e4,vpaidMode:"ENABLED",ima3SdkSettings:{numRedirects:6}}),this.options.viewerId&&typeof s?.bcAnalytics?.client?.user=="function"&&s.bcAnalytics.client.user(this.options.viewerId),c()})}),this.events.emit(o.READY)}setPlaylist(e){this.loadVideos(e,t=>this.player?.playlist(t),!0)}appendPlaylist(e){this.loadVideos(e,t=>{let i=this.player?.playlist().length??0;for(const s of t)this.player?.playlist.add(s,i),i+=1},!1)}currentIndex(){return this.player?.playlist?.currentIndex?.()??0}currentHermesVideoId(){return this.player?.mediainfo?.hermesVideoId}playlistLength(){return this.player?.playlist?.().length??0}play(e="ctrl"){return this.trackPlayAttempt(this.player?.play(),e)}trackPlayAttempt(e,t){return e&&typeof e.catch=="function"?e.catch(i=>{throw X(i)&&this.events.emit(o.PLAY_BLOCKED,{reason:t,message:i instanceof Error?i.message:String(i)}),i}):e}pause(){this.player?.pause()}isMuted(){return this.player?.muted()??!1}setMuted(e){this.player?.muted(e)}async canAutoplay(e){const t=document.createElement("video");t.muted=e,t.setAttribute("playsinline","true"),t.src=Z;try{await t.play()}catch{return t.src="",!1}const i=!t.paused;return t.src="",i}destroy(){this.player?.dispose(),this.events.destroy(),this.element?.remove(),this.player=void 0,this.element=void 0}loadVideos(e,t,i){const s=this.player;if(!s||e.length===0)return;const r=e.map(d=>d.hermesVideoId);this.resolveVideos(r).then(d=>{const c=new Map(d.map(h=>[String(h.reference_id),h])),l=[];for(const h of e){const A=c.get(h.hermesVideoId);if(!A)continue;A.hermesVideoId=h.hermesVideoId,A.adTagUrl=h.adTagUrl??E;const p=A.name,_=A.duration;h.title==null&&typeof p=="string"&&(h.title=p),h.durationSeconds==null&&typeof _=="number"&&(h.durationSeconds=Math.round(_/1e3));const f=A.custom_fields;if(h.licensorId==null&&f!=null&&typeof f=="object"){const I=f.license_agreement_id;typeof I=="string"&&I.length>0&&(h.licensorId=I)}l.push(A)}if(l.length===0){this.events.emit(o.ERROR);return}t(l),i&&this.options.autoplay&&Promise.resolve(this.trackPlayAttempt(s.play(),"auto")).catch(()=>{})})}resolveVideos(e){const t=this.player?.catalog;if(!t)return Promise.resolve([]);if(typeof t.getMany=="function"){const i=e.map(s=>({type:"video",id:`ref:${s}`}));return new Promise(s=>{t.getMany(i,(r,d)=>{s(!r&&Array.isArray(d)?d:[])})})}return Promise.all(e.map(i=>new Promise(s=>{t.getVideo(`ref:${i}`,(r,d)=>s(r?null:d))}))).then(i=>i.filter(s=>s!==null))}createElement(){const e=document.createElement("video-js");return e.setAttribute("data-account",this.options.accountId),e.setAttribute("data-player",this.options.playerId),e.setAttribute("data-embed","default"),e.setAttribute("controls",""),e.setAttribute("playsinline",""),e.style.width="100%",e.style.height="100%",this.options.muted&&e.setAttribute("muted",""),this.options.loop&&e.setAttribute("loop",""),typeof this.options.startTime=="number"&&this.options.startTime>0&&e.setAttribute("data-start-time",String(this.options.startTime)),e}resolveAdMacros(e){const t=this.player?.muted()?"true":"false",i=this.options.isDocked?.()?"true":"false",s=this.options.autoplay?"0":"1",r=window.google?.ima?.VERSION??"";return e.replaceAll("[EVP_MUTED]",t).replaceAll("[EVP_DOCKED]",i).replaceAll("[EVP_FROM_USER]",s).replaceAll("[EVP_ADSDKVER]",r)}wireEvents(){const e=this.player;if(e){for(const t of ee)e.on(t,()=>{if(J.has(t)&&e.ads?.inAdBreak?.()===!0)return;if(t===o.PAUSE){const s=e.duration();if(e.ended()||s>0&&e.currentTime()>=s)return}let i;if(t===o.TIME_UPDATE||t===o.SEEKED)i=this.player?.currentTime();else if(t===o.VOLUME_CHANGE)i=this.player?.muted();else if(t===o.AD_PROGRESS){const s=this.player?.duration()??0,r=this.player?.currentTime()??0;i=Math.max(0,Math.floor(s-r))}this.events.emit(t,i)});e.on(o.PLAYING,()=>{e.ads?.inAdBreak?.()!==!0&&(this.endedForwarded=!1)}),e.on(o.ENDED,()=>{this.endedForwarded||(this.endedForwarded=!0,this.events.emit(o.ENDED))})}}}const ie=".hermes-video-container{position:relative;text-align:left}.hermes-video-container.hermes-video--floating{position:fixed;right:16px;bottom:16px;width:320px;height:auto;max-width:42vw;aspect-ratio:16 / 9;z-index:100;box-shadow:0 8px 28px #00000073;border-radius:8px;overflow:hidden}.hermes-video__dock-close{position:absolute;top:6px;right:6px;z-index:2;width:28px;height:28px;padding:0;border:0;border-radius:50%;background:#0009;color:#fff;font-size:16px;line-height:28px;cursor:pointer}.hermes-video__ad-timer{position:absolute;top:8px;left:8px;z-index:101;font-family:HelveticaNeue-Bold,Helvetica,Arial,sans-serif;font-size:10px;color:#333;background-color:#a4ff00;opacity:.75;padding:5px 10px;border-radius:2px;pointer-events:none}.hermes-video__ad-timer[hidden],.hermes-video-container .vjs-title-bar .vjs-title-bar-description{dis
1play:none}.hermes-video-container .vjs-control-bar{height:4em}.hermes-video-container .vjs-button>.vjs-icon-placeholder:before{font-size:2.4em;line-height:1.6}.hermes-video-container .vjs-button.vjs-mute-control>.vjs-icon-placeholder:before{font-size:2em;line-height:2}.hermes-video-container .vjs-control-bar .vjs-time-control{font-size:1.1em;line-height:3.6em;padding-left:0;padding-right:0}.hermes-video-container .vjs-playback-rate .vjs-playback-rate-value{line-height:2.5}.hermes-video-container .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.hermes-video-container .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal{height:4em}.hermes-video-container .vjs-volume-bar{margin:1.7em .45em}.hermes-video-container .vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-mode) .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.hermes-video-container .vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive:not(.vjs-audio-mode) .vjs-control-bar,.hermes-video-container .vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active:not(.vjs-audio-mode) .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.hermes-video-container .vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive:not(.vjs-audio-mode) .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.hermes-video-container .vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active:not(.vjs-audio-mode) .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.hermes-video-container .vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-mode) .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible){transform:translateY(4em)}.hermes-video__opss{position:absolute;top:0;left:0;z-index:2147483002;max-width:100%;max-height:100%;overflow:auto;box-sizing:border-box;background:#000c;color:#0f0;font:11px/1.4 Menlo,Monaco,Consolas,monospace;padding:8px 24px 8px 8px}.hermes-video__opss pre{margin:0;white-space:pre}.hermes-video__opss-close{position:absolute;top:2px;right:4px;padding:0;border:0;background:transparent;color:#fff;font-size:14px;line-height:1;cursor:pointer}.hermes-video__error-screen{position:relative;display:flex;flex-direction:column;width:100%;aspect-ratio:16 / 9;background-color:#16101e;container-type:inline-size;font-family:Helvetica Neue,Helvetica,Arial,sans-serif;overflow:hidden}.hermes-video__error-glyph{position:absolute;top:50%;left:50%;width:clamp(56px,16cqi,120px);aspect-ratio:1;transform:translate(-50%,-50%);pointer-events:none}.hermes-video__error-glyph svg{display:block;width:100%;height:100%}.hermes-video__error-message{position:relative;display:flex;flex-grow:1;align-items:center;justify-content:center;padding:0 6cqi;text-align:center;color:#ffffffe6;font-size:clamp(12px,2.5cqi,22px);font-weight:700;white-space:pre-wrap}.hermes-video__error-footer{position:relative;display:flex;flex-direction:row;align-items:center;justify-content:space-around;padding:0 2cqi 2.5cqi;color:#666;font-size:clamp(8px,1.8cqi,12px);font-weight:500;text-align:center}",O="hermes-video-styles";function P(){if(document.getElementById(O))return;const n=document.createElement("style");n.id=O,n.textContent=ie,document.head.appendChild(n)}const se="hermes-video__ad-timer";class ne{element;unsubscribe=[];constructor(e){P(),this.element=document.createElement("div"),this.element.className=se,this.element.hidden=!0,e.container.appendChild(this.element),this.unsubscribe.push(e.events.on(o.AD_STARTED,()=>this.show()),e.events.on(o.AD_PROGRESS,t=>this.update(t)),e.events.on(o.AD_COMPLETE,()=>this.hide()),e.events.on(o.AD_SKIPPED,()=>this.hide()),e.events.on(o.AD_ERROR,()=>this.hide()))}show(){this.element.hidden=!1}update(e){const t=typeof e=="number"&&Number.isFinite(e)?Math.max(0,e):0,i=Math.floor(t/60),s=Math.floor(t%60);this.element.textContent=`Ad: ${i}:${s.toString().padStart(2,"0")}`}hide(){this.element.hidden=!0,this.element.textContent=""}destroy(){this.unsubscribe.forEach(e=>e()),this.element.remove()}}const M="hermes-video--floating";class oe{container;events;enabled;onDismiss;observer;placeholder;closeButton;floating=!1;playing=!1;adActive=!1;dismissed=!1;constructor(e){this.container=e.container,this.events=e.events,this.enabled=e.enabled,this.onDismiss=e.onDismiss,this.enabled&&this.start()}isFloating(){return this.floating}destroy(){this.undock(),this.observer?.disconnect(),this.observer=void 0}start(){P(),this.events.on(o.PLAYING,()=>{this.playing=!0}),this.events.on(o.PAUSE,()=>{this.adActive||(this.playing=!1)}),this.events.on(o.AD_STARTED,()=>{this.adActive=!0,this.playing=!0});const e=()=>{this.adActive=!1};this.events.on(o.AD_COMPLETE,e),this.events.on(o.AD_SKIPPED,e),this.events.on(o.AD_ERROR,e),this.events.on(o.ENDED,()=>{this.playing=!1,this.adActive=!1,this.undock()}),this.observer=new IntersectionObserver(t=>this.onIntersect(t),{threshold:.2}),this.observer.observe(this.container)}onIntersect(e){const t=e[0];t&&(t.isIntersecting?this.undock():this.playing&&!this.dismissed&&this.dock())}dock(){if(this.floating)return;const e=this.container.getBoundingClientRect(),t=document.createElement("div");t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,this.container.parentElement?.insertBefore(t,this.container),this.placeholder=t,this.observer?.unobserve(this.container),this.observer?.observe(t),this.container.classList.add(M),this.addCloseButton(),this.floating=!0}undock(){this.floating&&(this.container.classList.remove(M),this.placeholder&&(this.observer?.unobserve(this.placeholder),this.placeholder.remove(),this.placeholder=void 0),this.observer?.observe(this.container),this.closeButton?.remove(),this.closeButton=void 0,this.floating=!1)}addCloseButton(){const e=document.createElement("button");e.className="hermes-video__dock-close",e.setAttribute("aria-label","Close floating player"),e.textContent="Ã",e.addEventListener("click",()=>{this.dismissed=!0,this.undock(),this.onDismiss?.()}),this.container.appendChild(e),this.closeButton=e}}const re="hermes-video__opss",N="opss",ae=500;class de{container;getConfig;panel;timer;typed="";onKeydown=e=>this.handleKey(e);constructor(e){P(),this.container=e.container,this.getConfig=e.getConfig,document.addEventListener("keydown",this.onKeydown)}handleKey(e){const t=e.target;if(t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable))return;const i=e.key.length===1?e.key.toLowerCase():"";
1i&&(this.typed=(this.typed+i).slice(-N.length),this.typed===N&&(this.typed="",this.toggle()))}toggle(){this.panel?this.hide():this.show()}show(){const e=document.createElement("div");e.className=re;const t=document.createElement("button");t.className="hermes-video__opss-close",t.textContent="Ã",t.setAttribute("aria-label","Close stats"),t.addEventListener("click",()=>this.hide());const i=document.createElement("pre");e.append(t,i);const s=this.getConfig?.();if(s!==void 0){const r=document.createElement("pre");r.textContent=`config 2${he(s)}`,e.appendChild(r)}this.container.appendChild(e),this.panel=e,this.render(i),this.timer=setInterval(()=>this.render(i),ae)}hide(){this.timer&&(clearInterval(this.timer),this.timer=void 0),this.panel?.remove(),this.panel=void 0}render(e){const t=this.container.querySelector("video");if(!t){e.textContent="no <video> yet";return}const i=ce(t),s=[`resolution ${t.videoWidth||"?"}Ã${t.videoHeight||"?"}`,`time ${L(t.currentTime)} / ${L(t.duration)}`,`buffered ${le(t).toFixed(1)}s ahead`,`rate ${t.playbackRate}Ã`,`muted ${t.muted}`,`readyState ${t.readyState}`];i&&s.push(`frames ${i.dropped} dropped / ${i.total}`),e.textContent=s.join(` 3`)}destroy(){document.removeEventListener("keydown",this.onKeydown),this.hide()}}function le(n){const e=n.buffered;for(let t=0;t<e.length;t++)if(n.currentTime>=e.start(t)&&n.currentTime<=e.end(t))return Math.max(0,e.end(t)-n.currentTime);return 0}function ce(n){if(typeof n.getVideoPlaybackQuality=="function"){const t=n.getVideoPlaybackQuality();return{dropped:t.droppedVideoFrames,total:t.totalVideoFrames}}const e=n;return typeof e.webkitDroppedFrameCount=="number"?{dropped:e.webkitDroppedFrameCount,total:e.webkitDecodedFrameCount??0}:null}function he(n){try{return JSON.stringify(n,null,2)}catch{return String(n)}}function L(n){if(!Number.isFinite(n))return"â";const e=Math.floor(n/60),t=Math.floor(n%60);return`${e}:${t.toString().padStart(2,"0")}`}function Ae(){return/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)}function ue(){return/SamsungBrowser|Tizen/i.test(navigator.userAgent)}function pe(n){return ue()&&n.startsWith("//")?`https:${n}`:n}function fe(n){const e=pe(n);if(Ae()||typeof navigator.sendBeacon!="function"){const t=new Image;t.src=e;return}try{navigator.sendBeacon(e)}catch{}}class me{baseUrl;constructor(e){this.baseUrl=e}send(e,t){const i={evt:e,...t},s=Object.keys(i).sort().filter(r=>i[r]!==void 0&&i[r]!=="").map(r=>`${encodeURIComponent(r)}=${encodeURIComponent(String(i[r]))}`).join("&");fe(`${this.baseUrl}?${s}`)}}const a={P_INIT:"p_init",P_INIT_FAIL:"p_init_fail",P_API_NOT_READY:"p_api_not_ready",PLAYER_READY:"player_ready",VAPI:"v_api",VREQ:"v_request",VSTART:"v_start",VSTRM_VIEW:"v_strm_view",VPROG:"v_prog",VPROG_ON_MUTE:"v_prog_on_mute",VCOMP:"v_comp",VNCOMP:"v_ncomp",VBTRT:"v_btrt",VSTALL:"v_stall",VPLAY_BLOCKED:"v_play_blocked",VIMP:"v_imp",UI_PP:"ui_pp",UI_INTERACT:"ui_interact",UI_CCTOGGLE:"ui_cctog",UI_SEEK:"ui_seek",UI_FOCUS:"ui_focus",ERROR:"error",INFO:"info",WARN:"warn",AD_DELIVERED:"ad_dlv",AD_ERROR:"ad_err",AD_VIEW:"ad_view",AD_PROG:"ad_prog",AD_SKIP:"ad_skip",AD_COMPLETE:"ad_comp",AD_EVENT:"ad_event",AD_TAG_PASSED:"ad_tag_passed",AD_OPPTY:"ad_oppty",AD_TB_RESP:"ad_tb",AD_CALL:"ad_call",SSAI_META:"ssai_meta",LOAD_START:"load_start",CONTENT_UPDATE:"content_update",MUTE_CHANGE:"mute_change"},ge="https://hermes.media.static.aol.com/player/comscore-7-11-1.min.js",u="*null",x="AOL",ve="AOL Video Player",k="aol";let U=!1;function B(){return typeof window>"u"?void 0:window}function y(){return B()?.ns_?.analytics}async function ye(){if(y()?.StreamingAnalytics)return!0;try{await C(ge)}catch{return console.warn("HermesVideo: could not load comScore StreamingAnalytics lib"),!1}return!!y()?.StreamingAnalytics}function _e(n,e){if(U)return;const t=y(),i=t?.configuration;if(!t?.StreamingAnalytics||!i?.PublisherConfiguration)return;U=!0;const s=t.PlatformApi?.PlatformApis?.WebBrowser;t.PlatformApi?.setPlatformAPI?.(s);const r=new i.PublisherConfiguration({publisherId:n});i.addClient?.(r),i.enableFirstPartyCookie?.(),i.disableTcfIntegration?.(),t.start?.(),i.setPersistentLabel?.("cs_ucfr",e),i.addPersistentLabels?.(be(e)),t.notifyHiddenEvent?.()}function Pe(n){if(n.gdprApplies)return"";const e=n.usPrivacy;if(e&&e.length>=3){const t=e[2].toUpperCase();if(t==="Y")return"0";if(t==="N")return"1"}return""}function be(n){const e=B()?.YAHOO?.comscore??{};if(n!=="1")return{cs_fpid:u,cs_fpit:u,cs_fpdm:u,cs_fpdt:u};const t=e.cs_fpid||u,i=e.cs_fpdm||u,s=t===u?u:e.cs_fpit||"c",r=i===u?u:e.cs_fpdt||"01";return{cs_fpid:t,cs_fpit:s,cs_fpdm:i,cs_fpdt:r}}class Ee{options;sa;destroyed=!1;constructor(e){this.options=e}
3async init(){const e=Pe(this.options.consent);if(!await ye()||this.destroyed)return;_e(this.options.publisherId,e);const t=y()?.StreamingAnalytics;t&&(this.sa=new t,this.sa.setMediaPlayerName?.(ve),this.sa.setMediaPlayerVersion?.(this.options.playerVersion??""))}destroy(){this.destroyed=!0,this.sa?.notifyEnd?.(),this.sa=void 0}onPlaybackRequest(){this.sa?.createPlaybackSession?.()}onContentPlay(){this.sa?.setMetadata?.(this.buildContentMetadata()),this.sa?.notifyPlay?.()}onContentPause(){this.sa?.notifyPause?.()}onContentComplete(){this.sa?.notifyEnd?.()}onError(){this.sa?.notifyEnd?.()}onAdStart(e){this.sa?.setMetadata?.(this.buildAdMetadata(e)),this.sa?.notifyPlay?.()}onAdComplete(){this.sa?.notifyEnd?.()}buildContentMetadata(){const e=y()?.StreamingAnalytics?.ContentMetadata;if(!e)return;const t=this.options.getContent(),i=new e;return i.setMediaType?.(this.contentType(t,e)),t.id&&i.setUniqueId?.(t.id),i.setLength?.(t.durationMs),i.setDictionaryClassificationC3?.(k),i.setDictionaryClassificationC4?.(u),i.setDictionaryClassificationC6?.(u),i.setStationTitle?.(x),i.setPublisherName?.(x),i.setProgramTitle?.(t.title||u),i.setEpisodeTitle?.(t.title||u),i.setVideoDimensions?.(t.width,t.height),i.addCustomLabels?.(this.customLabels()),i}buildAdMetadata(e){const t=y()?.StreamingAnalytics?.AdvertisementMetadata;if(!t)return;const i=new t;i.setMediaType?.(this.adType(e,t));const s=this.buildContentMetadata();return s&&i.setRelatedContentMetadata?.(s),i.setLength?.(0),i.addCustomLabels?.(this.customLabels()),i}customLabels(){return{ca2:u,ca3:`${k}s`,ca4:u}}contentType(e,t){const i=t.ContentType??{};return e.durationMs>6e5?i.LONG_FORM_ON_DEMAND:i.SHORT_FORM_ON_DEMAND}adType(e,t){const i=t.AdvertisementType??{};return e==="midroll"?i.ON_DEMAND_MID_ROLL:e==="postroll"?i.ON_DEMAND_POST_ROLL:i.ON_DEMAND_PRE_ROLL}}const Se={[a.P_INIT]:"video_player_init",[a.P_INIT_FAIL]:"video_player_init_failed",[a.P_API_NOT_READY]:"video_player_api_not_ready",[a.PLAYER_READY]:"video_player_ready",[a.VAPI]:"video_metadata_fetch",[a.VREQ]:"video_requested",[a.VIMP]:"video_impression",[a.VSTART]:"video_start",[a.VSTRM_VIEW]:"video_stream_view",[a.VPROG]:"video_player_progress",[a.VPROG_ON_MUTE]:"video_player_progress",[a.VCOMP]:"video_complete",[a.VNCOMP]:"video_incomplete",[a.VBTRT]:"video_bitrate",[a.VSTALL]:"video_stall",[a.VPLAY_BLOCKED]:"video_play_blocked",[a.LOAD_START]:"video_load_start",[a.CONTENT_UPDATE]:"video_content_update",[a.UI_PP]:"video_play_pause",[a.UI_INTERACT]:"video_interaction",[a.UI_CCTOGGLE]:"video_captions_toggle",[a.UI_SEEK]:"video_seek",[a.UI_FOCUS]:"video_focus_change",[a.MUTE_CHANGE]:"video_mute_change",[a.AD_DELIVERED]:"video_ad_delivered",[a.AD_VIEW]:"video_ad_start",[a.AD_PROG]:"video_ad_progress",[a.AD_SKIP]:"video_ad_skip",[a.AD_COMPLETE]:"video_ad_complete",[a.AD_ERROR]:"video_ad_error",[a.AD_EVENT]:"video_ad_event",[a.AD_TAG_PASSED]:"video_ad_tag_passed",[a.AD_OPPTY]:"video_ad_opportunity",[a.AD_TB_RESP]:"video_ad_thunderball_response",[a.AD_CALL]:"video_ad_call",[a.SSAI_META]:"video_ad_ssai_metadata",[a.ERROR]:"video_error",[a.INFO]:"video_info",[a.WARN]:"video_warn"},Te=new Set([a.VPROG,a.VPROG_ON_MUTE]);function we(n){return Se[n]??n}function Ie(n,e){const t={...e};return Te.has(n)&&(t.muted=e.snd==="m"),{name:we(n),params:t}}const De="picox:init";class S{static MAX_BUFFER=100;buffer=[];constructor(){typeof window<"u"&&window.addEventListener(De,()=>this.flush(),{once:!0})}send(e,t){const i=this.instance();if(i){this.flush(),this.emit(i,e,t);return}this.buffer.length>=S.MAX_BUFFER&&this.buffer.shift(),this.buffer.push({type:e,params:t})}flush(){const e=this.instance();if(!e||this.buffer.length===0)return;const t=this.buffer.splice(0);for(const{type:i,params:s}of t)this.emit(e,i,s)}emit(e,t,i){try{const{name:s,params:r}=Ie(t,i);e.beaconEvent(s,r)}catch{}}instance(){if(!(typeof window>"u"))return window.picoXInstance}}function G(n){const e=n.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}function Ce(n){const e=G("axids");if(!e)return null;for(const t of e.split("&")){const i=t.indexOf("=");if(i!==-1&&t.slice(0,i)===n)return t.slice(i+1)||null}return null}function Re(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}const j="abcdefghijklmnopqrstuvwxyz123456789";function F(){let n="";for(let e=0;e<12;e++)n+=j.charAt(Math.floor(Math.random()*j.length));return n}const g={SCHEDULED:"0",PAUSE:"1",SEEK:"2",FOCUS:"3",MUTE:"4",NA:"na"};class Ve{sessionId=F();sequence=0;initTime=Date.now();init;lastPlaybackPosition=0;totalWatched=0;watchTime=0;bufferingTime=0;bufferingStartTime=Number.NaN;timeupdateFrequency=0;lastProgDispatch=Date.now();pauseTs=Number.NaN;pauseTime=0;pauses=0;lastStallMs=0;seeking=!1;seekFromPos=0;updatePositionAfterResume=!1;playReason="";constructor(e){this.init=e}fillBeaconParams(e){const{init:t}=this;e._V="V",e.V_sec="pb",e.bckt="none",e.cdn="bcp",e.preload="true",e.errstate="none",e.replay=0,e.loc=this.playerLocation(),e.pltype=this.playerType(),t.playerVersion&&(e.pver=t.playerVersion),e.vs=this.sessionId;const i=t.getVideoUuid();e.vid=i,e.pstaid=i,e.auto=this.autoValue(),e.snd=t.getMuted()?"m":"um",e.psz=`${t.width}x${t.height}`,e.focus=document.visibilityState==="visible"?"1":"0",e._w=window.location.href,e._R=document.referrer,e.t=Math.random(),e.ts=Date.now()-this.initTime,e._sqno=this.sequence++;const s=t.getDurationSeconds?.();typeof s=="number"&&s>0&&(e.vlng=Math.round(s),e.type=s>=600?"vod long":"vod short");const r=t.getExperienceMode?.();r&&(e.expm=r);const d=t.getViewablePercent?.();typeof d=="number"&&!Number.isNaN(d)&&(e.view=`${Math.round(d)}%`);const c=t.getContinuousCount?.();typeof c=="number"&&(e.cont=c);const l=t.pageContext;l&&(l.site&&(e.site=l.site),l.region&&(e.region=l.region,e.intl=l.region.toLowerCase()),l.lang&&(e.lang=l.lang),l.expb&&(e.expb=l.expb,e.test=l.expb),l.expn&&(e.expn=l.expn),l.spaceId&&(e.s=l.spaceId));const h=G("A1S");h&&(e._a1s=h),t.pageParams&&Object.assign(e,t.pageParams)}adTagParams(){const e=this.init.getAdTagConsent?.();if(!e)return{};const t={has_ppid:e.hasPpid?"1":"0"};return e.limitedAds!==void 0&&(t.ad_ltd=e.limitedAds),e.nonPersonalizedAds!==void 0&&(t.ad_npa=e.nonPersonalizedAds),e.tcf&&(t.tcf_string=e.tcf),e.usPrivacy&&(t.us_privacy=e.usPrivacy),e.gpp&&(t.gpp=e.gpp
3),t}get totalWatchTime(){return this.totalWatched}startNewSession(){this.sessionId=F(),this.sequence=0,this.initTime=Date.now(),this.resetWatchStats()}resetWatchStats(){this.lastPlaybackPosition=0,this.totalWatched=0,this.watchTime=0,this.bufferingTime=0,this.bufferingStartTime=Number.NaN,this.timeupdateFrequency=0,this.lastProgDispatch=Date.now(),this.pauseTs=Number.NaN,this.pauseTime=0,this.pauses=0,this.lastStallMs=0,this.seeking=!1,this.seekFromPos=0,this.updatePositionAfterResume=!1}onTimeupdate(e){if(!this.seeking&&e>this.lastPlaybackPosition){this.updatePositionAfterResume&&(this.updatePositionAfterResume=!1,this.lastPlaybackPosition=e);const t=e-this.lastPlaybackPosition;this.totalWatched+=t,this.watchTime+=t,this.lastPlaybackPosition=e,this.timeupdateFrequency++}}onPause(){this.pauseTs=Date.now(),this.pauses++,this.updatePositionAfterResume=!0}onPlay(){this.updatePauseTime(),this.pauseTs=Number.NaN,this.updatePositionAfterResume=!0}updatePauseTime(){this.pauseTime=Number.isNaN(this.pauseTs)?0:Date.now()-this.pauseTs}onBufferingStart(){this.bufferingStartTime=Date.now()}onBufferingEnd(){if(Number.isNaN(this.bufferingStartTime))return 0;const e=Date.now()-this.bufferingStartTime;return this.bufferingTime+=e,this.lastStallMs=e,this.bufferingStartTime=Number.NaN,e}cancelBuffering(){this.bufferingStartTime=Number.NaN}cancelSeek(){this.seeking=!1}onSeekStart(){this.seeking||(this.seeking=!0,this.seekFromPos=this.lastPlaybackPosition)}onSeekEnd(e){this.seeking=!1,this.lastPlaybackPosition=e,this.updatePositionAfterResume=!0}clearPauseTime(){this.pauseTime=0,this.pauseTs=Number.NaN}get playbackPosition(){return this.lastPlaybackPosition}get stallTime(){return this.lastStallMs}get pauseCount(){return this.pauses}get seekFrom(){return this.seekFromPos}get isSeeking(){return this.seeking}get bufferingMs(){return this.bufferingTime}get isImmediateAutoplay(){return this.init.autoplay===!0}get hasAdTag(){return this.init.getHasAdTag?.()??!1}canSendProgress(){return this.totalWatched-this.lastPlaybackPosition>0||this.watchTime>0||this.bufferingTime>0}progressParams(e=g.NA){const t=this.bufferingTime>0?this.bufferingTime.toFixed(0):"0",i=Math.floor(this.watchTime),s=(Date.now()-this.lastProgDispatch)/1e3,r=Math.floor(s);return{src:e,buf_dur:t,dur:Math.floor(this.totalWatched),dur_d:i,freq:this.timeupdateFrequency,td:r,te:Math.floor(s-this.pauseTime/1e3-i),wt:i,lp:Math.floor(this.lastPlaybackPosition),buff_info:JSON.stringify({seg:[{buf_dur:t}]})}}afterProgressDispatch(){this.watchTime=this.watchTime%1,this.bufferingTime=0,this.lastProgDispatch=Date.now(),this.timeupdateFrequency=0}setPlayReason(e){this.init.autoplay===!1&&this.playReason===""?this.playReason=e:this.init.autoplay==="viewport"&&(this.playReason=e)}autoValue(){return this.init.autoplay===!0?"true":this.playReason==="api"?"vm":"false"}playerType(){const e=this.init.pageContext?.device;return e==="smartphone"||e==="tablet"?"hermes-mobile":"hermes-desktop"}playerLocation(){try{return window.top===window.self?"onProp":(window.top?.location.href,"Emb onNet")}catch{return"Emb offNet"}}}const H=[3,10,30],Oe=30,Me=3;class Ne{events;session;sinks;comscore;started=!1;videoLoaded=!1;contentPlaying=!1;contentStarted=!1;adActive=!1;ended=!1;vncompSent=!1;vimpSent=!1;playIntentAt;itemLoadAt=Date.now();firstItemSeen=!1;destroyed=!1;activeAdPosition="preroll";progressCheckpoints=[...H];adPlayedThisItem=!1;currentMuted;lastVisible=!0;onVisibilityChange=()=>this.handleVisibilityChange();onBeforeUnload=()=>this.reportNotComplete("unload");constructor(e,t,i,s){this.events=e,this.session=t,this.sinks=[new me(i.batsBase),new S],s?.publisherId&&(this.comscore=new Ee(s),this.comscore.init().then(()=>this.catchUpComscore())),this.wire()}catchUpComscore(){!this.comscore||!this.videoLoaded||(this.comscore.onPlaybackRequest(),this.adActive?this.comscore.onAdStart(this.activeAdPosition):this.contentPlaying&&this.comscore.onContentPlay())}destroy(){this.destroyed||(this.reportNotComplete("destroy"),typeof document<"u"&&(document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("beforeunload",this.onBeforeUnload)),this.destroyed=!0,this.comscore?.destroy())}reportNotComplete(e){if(this.vncompSent||this.ended||!(this.started||this.adPlayedThisItem))return;this.vncompSent=!0;const t={...this.session.progressParams(),ext_resn:e};this.adActive&&(t.pos=this.activeAdPosition),this.fire(a.VNCOMP,t)}handleVisibilityChange(){const e=document.visibilityState==="visible";if(e!==this.lastVisible){if(this.playbackState()!=="video"){this.lastVisible=e;return}this.session.updatePauseTime(),this.adActive||this.flushProgress(g.FOCUS),this.fire(a.UI_FOCUS,{V_sec:"ctrl",value:this.lastVisible?"1":"0",value_e:e?"1":"0",play_pos:Math.floor(this.session.playbackPosition)}),this.lastVisible=e}}start(){this.fire(a.P_INIT)}reportImpression(){this.markPlayIntent(),!this.vimpSent&&(this.vimpSent=!0,this.fire(a.VIMP))}markPlayIntent(){!this.started&&this.playIntentAt===void 0&&(this.playIntentAt=Date.now())}flushProgress(e){if(!this.started||!this.session.canSendProgress())return;const t=this.session.progressParams(e);e===g.FOCUS&&(t.focus=this.lastVisible?"1":"0"),this.fire(a.VPROG,t),this.session.afterProgressDispatch()}fire(e,t={}){if(this.destroyed)return;const i={};this.session.fillBeaconParams(i),i.pbst=this.playbackState(),Object.assign(i,t);for(const s of this.sinks)s.send(e,i)}playbackState(){return this.ended?"end":this.started?"video":"init"}wire(){typeof document<"u"&&(this.lastVisible=document.visibilityState==="visible",document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("beforeunload",this.onBeforeUnload)),this.events.on(o.READY,()=>this.fire(a.PLAYER_READY)),this.events.on(o.LOAD_START,()=>{this.started=!1,this.contentPlaying=!1,this.contentStarted=!1,this.adActive=!1,this.adPlayedThisItem=!1,this.vncompSent=!1,this.currentMuted=void 0,this.activeAdPosition="preroll",this.ended=!1,this.videoLoaded=!0,this.progressCheckpoints=[...H],this.itemLoadAt=Date.now(),this.firstItemSeen&&(this.playIntentAt=void 0),this.firstItemSeen=!0,this.session.startNewSession(),this.fire(a.VREQ),this.fire(a.LOAD_START),this.comscore?.onPlaybackRequest()}),this.events.on(o.PLAY,()=>{if(this.adActive)return;this.reportImpression();const e=this.started&&!this.session.isSeeking;this.session.onPlay(),e&&this.fire(a.UI_PP,this.playPauseParams("play"))}),this.events.on(o.PAUSE,()=>{this.adActive||this.session.isSeeking||(this.fire(a.UI_PP,this.playPauseParams("pause")),this.flushProgress(g.PAUSE),this.session.onPause(),this.contentPlaying=!1,this.comscore?.onContentPause())}),this.events.on(o.PLAYING,()=>{if(this.adActive)return;const e=this.session.onBufferingEnd();e>0&&this.started&&this.fire(a.VSTALL,{dur:Math.floor(this.session.totalWatchTime),value:(e/1e3).toFixed(3)}),this.started||(this.started=!0,this.fire(a.VSTART,this.vstartParams())),this.contentPlaying=!0,this.contentStarted=!0,this.comscore?.onContentPlay()}),this.events.on(o.WAITING,()=>{this.adActive||this.session.onBufferingStart()}),this.events.on(o.VOLUME_CHANGE,e=>this.onVolumeChange(e)),this.events.on(o.SEEKING,()=>{this.adActive||(this.session.isSeeking||this.flushProgress(g.SEEK),this.session.onSeekStart())}),this.events.on(o.SEEKED,e=>{this.adActive||this.onSeeked(e)}),this.events.on(o.TIME_UPDATE,e=>this.onTimeUpdate(e)),this.events.on(o.ENDED,()=>{this.contentPlaying=!1,this.ended=!0,this.fire(a.VCOMP,this.session.progressParams()),this.session.afterProgressDispatch(),this.comscore?.onContentComplete()}),this.events.on(o.ERROR,()=>{this.contentPlaying=!1,this.reportNotComplete("error"),this.fire(a.ERROR),this.comscore?.onError()}),this.events.on(o.PLAY_BLOCKED,e=>{const t=e;this.fire(a.VPLAY_BLOCKED,{ecode:"player-0",estring:t?.message??"",req_type:t?.reason??"ctrl",dur:Math.floor(this.session.totalWatchTime)})}),this.events.on(o.AD_TAG_PASSED,()=>this.fire(a.AD_TAG_PASSED,this.session.adTagParams())),this.events.on(o.AD_STARTED,()=>{this.adActive=!0,this.adPlayedThisItem=!0,this.session.cancelBuffering(),this.session.cancelSeek(),this.activeAdPosition=this.adPosition(),this.fire(a.AD_VIEW,this.adBeaconParams()),this.comscore?.onAdStart(this.activeAdPosition)}),this.events.on(o.AD_FIRST_QUARTILE,()=>this.fire(a.AD_PROG,{...this.adBeaconParams(),q:25})),this.events.on(o.AD_MIDPOINT,()=>this.fire(a.AD_PROG,{...this.adBeaconParams(),q:50})),this.events.on(o.AD_THIRD_QUARTILE,()=>this.fire(a.AD_PROG,{...this.adBeaconParams(),q:75})),this.events.on(o.AD_COMPLETE,()=>{this.adActive=!1,this.fire(a.AD_COMPLETE,this.adBeaconParams()),this.comscore?.onAdComplete()}),this.events.on(o.AD_SKIPPED,()=>{this.adActive=!1,this.fire(a.AD_SKIP,this.adBeaconParams()),this.comscore?.onAdComplete()}),this.events.on(o.AD_ERROR,()=>{this.adActive=!1,this.fire(a.AD_ERROR,this.adBeaconParams()),this.comscore?.onAdComplete()})}adBeaconParams(){return{pos:this.adPosition(),client:"ima3"}}adPosition(){return this.contentStarted?"midroll":"preroll"}vstartParams(){const e=this.playIntentAt??this.itemLoadAt,t=Math.max(0,Math.floor(Date.now()-e)),i={buf_dur:this.session.bufferingMs.toFixed(3),ad:this.adPlayedThisItem?1:0,notag:this.session.hasAdTag?0:1};return i[this.session.isImmediateAutoplay?"apl":"ucl"]=t,i}playPauseParams(e){return{value:e,dur:Math.floor(this.session.totalWatchTime),pos:Math.floor(this.session.playbackPosition),pcnt:this.session.pauseCount}}onVolumeChange(e){const t=!!e;if(this.currentMuted===void 0||this.currentMuted===t){this.currentMuted=t;return}this.currentMuted=t,!this.adActive&&(this.fire(a.MUTE_CHANGE,{V_sec:"ctrl",muted:String(t),V_slk:`ctrl-mute-btn-${t?"on":"off"}`,dur:Math.floor(this.session.totalWatchTime)}),this.session.canSendProgress()&&(this.fire(a.VPROG_ON_MUTE,{...this.session.progressParams(g.MUTE),snd:t?"um":"m"}),this.session.afterProgressDispatch(),this.session.clearPauseTime()))}onSeeked(e){const t=typeof e=="number"&&Number.isFinite(e)?e:this.session.playbackPosition;Math.floor(this.session.seekFrom)!==Math.floor(t)&&this.fire(a.UI_SEEK,{dur:Math.floor(this.session.totalWatchTime),value:Math.floor(this.session.seekFrom),value_e:Math.floor(t)}),this.session.onSeekEnd(t)}onTimeUpdate(e){if(typeof e!="number"||this.adActive||(this.session.onTimeupdate(e),!this.started))return;const t=this.progressCheckpoints[0];t!==void 0&&this.session.totalWatchTime>=t&&this.session.canSendProgress()&&(t===Me?this.fire(a.VSTRM_VIEW,{...this.session.progressParams(g.SCHEDULED),ad:this.adPlayedThisItem?1:0}):this.fire(a.VPROG,this.session.progressParams(g.SCHEDULED)),this.session.afterProgressDispatch(),this.session.clearPauseTime(),this.progressCheckpoints.shift(),this.progressCheckpoints.length===0&&this.progressCheckpoints.push(t+Oe))}}class Le{baseUrl;constructor(e){this.baseUrl=e.replace(/\/+$/,"")}async getVideoPlayback(e){const t=await fetch(`${this.baseUrl}/v1/video/${encodeURIComponent(e)}`);
3if(!t.ok)throw new Error(`HermesVideo: failed to load video ${e} (HTTP ${t.status})`);return await t.json()}async getVideoPlaybackBatch(e,t={}){if(e.length===0)return[];const i=new URLSearchParams;i.set("ids",e.join(","));for(const[d,c]of Object.entries(t))c!=null&&c!==""&&i.set(d,String(c));const s=await fetch(`${this.baseUrl}/v1/video/?${i.toString()}`);if(!s.ok)throw new Error(`HermesVideo: failed to load videos (HTTP ${s.status})`);return(await s.json()).videos}async getPlaylistPage(e,t,i=12){const s=new URLSearchParams({page_number:String(t),page_count:String(i),v:"2"}),r=await fetch(`${this.baseUrl}/v1/lists/${encodeURIComponent(e)}/?${s.toString()}`);if(!r.ok)throw new Error(`HermesVideo: failed to load playlist ${e} page ${t} (HTTP ${r.status})`);const d=await r.json();return{videoIds:d.items.filter(l=>l.contentType==="video").map(l=>l.content.id),hasNextPage:!!d.pagination?.nextPage}}}const xe="/v1/evp/asset",ke="hermes-1.0",Ue="https://tb.pbs.aol.com",Be="https://tb.pbs.staging.aol.com",Ge="https://tb.pbs.yahoo.com",je={"aol-prod":Ue,"aol-stg":Be},Fe={aver:"[EVP_ADSDKVER]",muted:"[EVP_MUTED]",docked:"[EVP_DOCKED]",fromUser:"[EVP_FROM_USER]",givn:"[GOOGLE_INSTREAM_VIDEO_NONCE]"},He="desktop",Ye=new Set(["ios","android"]),qe={"smartphone|ios":"ios-web","smartphone|android":"android-web","smartphone|":"mobile-web","tablet|ios":"ios-web-tablet","tablet|android":"android-web-tablet","tablet|":"mobile-web-tablet"},$e=150,Y="abcdefghijklmnopqrstuvwxyz0123456789";function We(n,e){const t=(n??"").trim().toLowerCase();if(t!=="smartphone"&&t!=="tablet")return He;let i=(e??"").trim().toLowerCase();return Ye.has(i)||(i=""),qe[`${t}|${i}`]}function T(n){return n==null?null:n?"true":"false"}function ze(){const n=new Uint8Array(12);crypto.getRandomValues(n);let e="";for(const t of n)e+=Y[t%Y.length];return e}function Ke(n){if(!n)return null;const e=new TextEncoder().encode(n);let t="";for(const i of e)t+=i.toString(16).padStart(2,"0");return t.slice(0,$e)}function Qe(n){return encodeURIComponent(n).replace(/[!*'()]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())}function Xe(n){const{bcid:e,pid:t,ctx:i,content:s,plseq:r=null,batchSize:d=1,referrer:c=null,geo:l={}}=n,h=je[i.tb_host??""]??Ge,A={bcid:e,pid:t,secure:"true","m.type":"VOD",device:We(i.device,i.os),v:"1",f:"json",content_id:s.id,rssId:s.id,content_len:s.durationSeconds,content_title:s.title,licensor_id:s.licensorId,site:i.site,region:i.region,lang:i.lang,space_id:i.space_id,experience:i.experience,expn:i.expn,expb:i.expb,pbckt:i.bckt,width:i.width,height:i.height,sid:i.sid,isDockable:T(i.is_dockable),autoplay:T(i.autoplay),ps:ze(),country:l.country,state:l.state,state_code:l.stateCode,place:l.place,place_type:l.placeType,ppid:Ke(i.ppid),plid:i.plid,b_id:null,us_privacy:i.usp,gpp:i.gpp,gpp_sid:i.gpp_sid,gdpr:T(i.gdpr),iabconsent:i.tcf,"ad.pl":i.ad_pl,"ad.pd":i.ad_pd,"ad.pt":i.ad_pt,"ad.pct":i.ad_pct,"ad.pg_name":i.ad_pg_name,"ad.ver":i.ad_ver,"ad.pubfamily":i.ad_pubfamily,npa:i.ad_nonPersonalizedAds,ltd:i.ad_limitedAds,"ad.nonPersonalizedAds":i.ad_nonPersonalizedAds,"ad.limitedAds":i.ad_limitedAds,[d<=1?"ad.plseq":"plseq"]:r,firstVideo:r===1?"true":null,pos:"preroll",evp:"bcp",fmt:"vmap",s2s:"true",pver:ke,r:c},p=[];for(const[_,f]of Object.entries(A))f==null||f===""||p.push(`${_}=${Qe(String(f))}`);for(const[_,f]of Object.entries(Fe))p.push(`${_}=${f}`);return`${h}${xe}?${p.join("&")}`}const q="hermes-video-config";function $(){if(typeof document>"u")return{};const e=document.getElementById(q)?.textContent?.trim();if(!e)return{};try{const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch(t){console.warn("HermesVideo: failed to parse page-level config",t)}return{}}function Ze(n,e){const t={...n,...e};return(n.pageParams||e.pageParams)&&(t.pageParams={...n.pageParams,...e.pageParams}),(n.adParams||e.adParams)&&(t.adParams={...n.adParams,...e.adParams}),(n.pageContext||e.pageContext)&&(t.pageContext={...n.pageContext,...e.pageContext}),(n.thunderball||e.thunderball)&&(t.thunderball={...n.thunderball,...e.thunderball}),(n.brightcove||e.brightcove)&&(t.brightcove={...n.brightcove,...e.brightcove}),t}const Je=[0,.1,.2,.25,.3,.4,.5,.6,.7,.75,.8,.9,1],et=.5;class tt{observer;targets=new Map;callbacks;constructor(e){this.callbacks=e,typeof IntersectionObserver<"u"&&(this.observer=new IntersectionObserver(t=>this.onIntersection(t),{threshold:Je}))}observe(e,t=et,i=t){!this.observer||this.targets.has(e)||(this.targets.set(e,{playThreshold:t,pauseThreshold:i,isViewable:!1}),this.observer.observe(e))}unobserve(e){this.observer&&(this.observer.unobserve(e),this.targets.delete(e))}destroy(){this.observer?.disconnect(),this.observer=void 0,this.targets.clear()}onIntersection(e){for(const t of e){const i=this.targets.get(t.target);if(!i)continue;const s=t.target;t.isIntersecting&&t.intersectionRatio>=i.playThreshold?i.isViewable||(i.isViewable=!0,this.callbacks.onViewable(s)):t.intersectionRatio<i.pauseThreshold&&i.isViewable&&(i.isViewable=!1,this.callbacks.onNotViewable(s))}}}const it=300;class st{players=new Set;elementToPlayer=new Map;viewable=[];playing=null;observer;debounceTimer;excludeNext=null;constructor(){this.observer=new tt({onViewable:e=>this.onViewable(e),onNotViewable:e=>this.onNotViewable(e)}
3)}register(e){this.players.has(e)||(this.players.add(e),e.isViewportManaged()&&(this.elementToPlayer.set(e.container,e),this.observer.observe(e.container,e.getPlayThreshold(),e.getPauseThreshold())))}unregister(e){this.players.delete(e),this.elementToPlayer.delete(e.container),this.observer.unobserve(e.container),this.removeViewable(e),this.playing===e&&(this.playing=null)}isEmpty(){return this.players.size===0}getPlaying(){return this.playing}notifyPlaying(e){this.playing=e,this.pauseAllExcept(e)}notifyPaused(e){this.playing===e&&(this.playing=null,this.excludeNext=e,this.schedulePlayNext())}destroy(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.observer.destroy(),this.players.clear(),this.elementToPlayer.clear(),this.viewable.length=0,this.playing=null}onViewable(e){const t=this.elementToPlayer.get(e);t&&(this.viewable.includes(t)||this.viewable.push(t),this.schedulePlayNext())}onNotViewable(e){const t=this.elementToPlayer.get(e);t&&(this.removeViewable(t),this.playing===t&&(t.isFloatingEnabled()||t.keepAliveOnScrollOut()||(t.pause(),this.notifyPaused(t))))}schedulePlayNext(){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>this.playNextViewable(),it)}playNextViewable(){const e=this.excludeNext;if(this.excludeNext=null,this.playing||typeof document<"u"&&document.hidden)return;const t=this.viewable.filter(i=>i.isViewportManaged()&&i!==e).sort((i,s)=>this.top(i)-this.top(s))[0];t&&(this.playing=t,this.pauseAllExcept(t),t.requestAutoplay())}pauseAllExcept(e){for(const t of this.players)t!==e&&t.pause()}removeViewable(e){const t=this.viewable.indexOf(e);t>=0&&this.viewable.splice(t,1)}top(e){return e.container.getBoundingClientRect().top}}const nt="default";class v{static _instance;groups=new Map;pausedByVisibility=new Set;visibilityBound=!1;static getInstance(){return v._instance||(v._instance=new v),v._instance}register(e){this.ensureVisibilityListener();const t=e.getGroupId();let i=this.groups.get(t);i||(i=new st,this.groups.set(t,i)),i.register(e)}unregister(e){this.pausedByVisibility.delete(e);const t=e.getGroupId(),i=this.groups.get(t);i&&(i.unregister(e),i.isEmpty()&&(i.destroy(),this.groups.delete(t)))}notifyPlaying(e){this.groups.get(e.getGroupId())?.notifyPlaying(e)}notifyPaused(e){this.groups.get(e.getGroupId())?.notifyPaused(e)}ensureVisibilityListener(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",()=>this.onVisibilityChange()),this.visibilityBound=!0)}onVisibilityChange(){if(document.hidden)for(const e of this.groups.values()){const t=e.getPlaying();t&&!t.isMuted()&&(this.pausedByVisibility.add(t),t.pause())}else{for(const e of this.pausedByVisibility)e.play();this.pausedByVisibility.clear()}}}function w(n,e,t){return new Promise(i=>{let s=!1;const r=c=>{s||(s=!0,i(c))},d=setTimeout(()=>r(t),e);try{n(c=>{clearTimeout(d),r(c)})}catch{clearTimeout(d),r(t)}})}function ot(n){const e=window.__tcfapi;return e?w(t=>e("getTCData",2,(i,s)=>{if(!s||!i){t({});return}const r=typeof i.gdprApplies=="number"?i.gdprApplies===1:i.gdprApplies??null;t({gdprApplies:r,tcfString:i.tcString??null})}),n,{}):Promise.resolve({})}function rt(n){const e=window.__uspapi;return e?w(t=>e("getUSPData",1,(i,s)=>{t(s&&i?{usPrivacy:i.uspString??null}:{})}),n,{}):Promise.resolve({})}function at(n){const e=window.__gpp;return e?w(t=>e("ping",(i,s)=>{if(!s||!i){t({});return}t({gpp:i.gppString??null,gppSid:i.applicableSections?.join(",")??null})}),n,{}):Promise.resolve({})}class dt{async read(e=400){const[t,i,s]=await Promise.all([ot(e),rt(e),at(e)]);return{gdprApplies:t.gdprApplies??null,tcfString:t.tcfString??null,usPrivacy:i.usPrivacy??null,gpp:s.gpp??null,gppSid:s.gppSid??null}}}
3class lt{pending;byVideo=new Map;setPending(e){this.pending=e}captureFor(e){const t=this.pending;if(t)for(const i of e)this.byVideo.set(i,t)}get(e){return e?this.byVideo.get(e):void 0}}const ct="Unfortunately, this video is no longer available.",ht="Videos cannot play due to a network issue. Please check your Internet connection and try again.",At="500-100",ut="400-100",pt='<svg viewBox="0 0 96 96" aria-hidden="true"><circle cx="48" cy="48" r="48" fill="#ffffff" opacity="0.06"/><polygon points="38,30 70,48 38,66" fill="#ffffff" opacity="0.12"/></svg>';function ft(n,e){P();const t=document.createElement("div");t.className="hermes-video__error-screen";const i=document.createElement("div");i.className="hermes-video__error-glyph",i.innerHTML=pt,t.appendChild(i);const s=document.createElement("div");s.className="hermes-video__error-message",s.textContent=e.message,t.appendChild(s);const r=document.createElement("div");r.className="hermes-video__error-footer";const d=document.createElement("span");d.textContent=`Error Code: ${e.errorCode}`;const c=document.createElement("span");return c.textContent=`Session Id: ${e.sessionId}`,r.append(d,c),t.appendChild(r),n.appendChild(t),t}const W=500,mt=1e3,gt=10,vt=".vjs-big-play-button, .vjs-play-control, .vjs-poster, .vjs-tech",yt=new Set([" ","Enter","k","K"]),_t="https://bats.video.yahoo.com/p";function Pt(n){const e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error(`HermesVideo: mount target not found: ${String(n)}`);return e}class z{container;ready;config;emitter=new D;api;sessionId=Re();manager=v.getInstance();groupId;started=!1;adViewed=!1;lazyObserver;bc;metrics;dock;adTimer;opss;errorScreen;apiPlayAt=0;lastUserGestureAt=0;adBreakActive=!1;pointerDownAt;onPointerDown=e=>{this.adBreakActive||(this.pointerDownAt={x:e.clientX,y:e.clientY})};onPointerUp=e=>{const t=this.pointerDownAt;if(this.pointerDownAt=void 0,!t||Math.hypot(e.clientX-t.x,e.clientY-t.y)>gt)return;const s=e.target;s instanceof Element&&s.closest(vt)&&this.recordPlayGesture()};onKeyDown=e=>{yt.has(e.key)&&this.recordPlayGesture()};recordPlayGesture(){this.adBreakActive||(this.lastUserGestureAt=Date.now())}session;consent;tagConsent=new lt;entries=[];playlistNextPage=1;playlistHasMore=!1;playlistFetching=!1;nextPlseqStart=1;constructor(e,t){if(this.container=Pt(e),this.config=Ze($(),t),!this.config.servingApiBase)throw new Error('HermesVideo: `servingApiBase` is required â supply it per-player or via the page-level <script id="hermes-video-config"> tag');this.container.classList.add("hermes-video-container"),this.api=new Le(this.config.servingApiBase),this.groupId=this.config.groupId??nt,this.manager.register(this),this.emitter.on(o.PLAYING,()=>{this.started=!0,this.manager.notifyPlaying(this)}),this.emitter.on(o.AD_STARTED,()=>{this.adViewed=!0,this.adBreakActive=!0,this.manager.notifyPlaying(this)});for(const i of[o.AD_COMPLETE,o.AD_SKIPPED,o.AD_ERROR])this.emitter.on(i,()=>{this.adBreakActive=!1});this.emitter.on(o.PAUSE,()=>this.manager.notifyPaused(this)),this.emitter.on(o.ENDED,()=>this.manager.notifyPaused(this)),this.container.addEventListener("pointerdown",this.onPointerDown,!0),this.container.addEventListener("pointerup",this.onPointerUp,!0),this.container.addEventListener("keydown",this.onKeyDown,!0),this.emitter.on(o.PLAY,()=>{const i=Date.now();i-this.apiPlayAt<mt?this.apiPlayAt=0:i-this.lastUserGestureAt<W&&this.session?.setPlayReason("ctrl")}),this.opss=new de({container:this.container,getConfig:()=>this.config}),this.ready=(this.config.lazy?this.initWhenNearViewport():this.init()).catch(i=>{throw this.showErrorScreen(ht,ut),i})}on(e,t){return this.emitter.on(e,t)}async play(){await this.ready,this.markApiPlay();try{await this.bc?.play()}catch(e){throw this.apiPlayAt=0,e}}markApiPlay(){if(Date.now()-this.lastUserGestureAt<W){this.session?.setPlayReason("ctrl");return}this.session?.setPlayReason("api"),this.apiPlayAt=Date.now()}async pause(){this.bc?.pause()}showErrorScreen(e,t){this.errorScreen||(this.errorScreen=ft(this.container,{message:e,errorCode:t,sessionId:this.sessionId}))}destroy(){this.container.removeEventListener("pointerdown",this.onPointerDown,!0),this.container.removeEventListener("pointerup",this.onPointerUp,!0),this.container.removeEventListener("keydown",this.onKeyDown,!0),this.errorScreen?.remove(),this.errorScreen=void 0,this.lazyObserver?.disconnect(),this.manager.unregister(this),this.dock?.destroy(),this.adTimer?.destroy(),this.opss.destroy(),this.metrics?.destroy(),this.bc?.destroy(),this.emitter.destroy()}getGroupId(){return this.groupId}
3isViewportManaged(){return this.config.autoplay==="viewport"}getPlayThreshold(){return K(this.config.playThreshold)}getPauseThreshold(){return K(this.config.pauseThreshold)}isFloatingEnabled(){return this.config.floating??!1}keepAliveOnScrollOut(){return this.config.adViewContinuous===!0&&this.adViewed}isMuted(){return this.bc?.isMuted()??this.config.muted??!1}async requestAutoplay(){await this.ready,this.markApiPlay(),this.metrics?.reportImpression(),this.started||this.bc?.setMuted(!0);try{await this.bc?.play("auto")}catch{this.apiPlayAt=0}}initWhenNearViewport(){return typeof IntersectionObserver>"u"?this.init():new Promise((e,t)=>{this.lazyObserver=new IntersectionObserver(i=>{i.some(s=>s.isIntersecting)&&(this.lazyObserver?.disconnect(),this.lazyObserver=void 0,this.init().then(e,t))},{rootMargin:"200px"}),this.lazyObserver.observe(this.container)})}async init(){const e=await this.collectFirstPageIds();this.consent=await new dt().read();const t=this.config.clientSideAdTag===!0;let i,s,r,d;if(t){const l=this.nextPlseqStart;this.nextPlseqStart+=e.length,this.entries=e.map((h,A)=>({hermesVideoId:h,adTagUrl:null,plseq:l+A,batchSize:e.length})),i=this.config.brightcove?.accountId||R,s=this.config.brightcove?.playerId||V,r={batsBase:this.config.batsBase??_t},d=e[0]}else{const l=this.buildAdContext(this.nextPlseqStart);this.nextPlseqStart+=e.length;const h=await this.api.getVideoPlaybackBatch(e,l);if(h.length===0)throw this.showErrorScreen(ct,At),new Error("HermesVideo: no playable videos for the given videoId/playlistId");this.tagConsent.captureFor(h.map(p=>p.id));const A=h[0];this.entries=h.map(p=>({hermesVideoId:p.id,adTagUrl:p.ads.vmapTagUrl,title:p.title,durationSeconds:p.durationSeconds})),i=A.brightcove.accountId||R,s=A.brightcove.playerId||V,r=A.tracking,d=A.id}this.bc=new te(this.container,{accountId:i,playerId:s,autoplay:this.config.autoplay===!0,muted:this.config.autoplay===!0||this.config.autoplay==="viewport"?!0:this.config.muted??!1,loop:this.config.loop??!1,startTime:this.config.startTime,continuousPlay:e.length>1||!!this.config.playlistId,isDocked:()=>this.dock?.isFloating()??!1,viewerId:this.config.viewerId,buildAdTag:t?l=>this.buildClientSideAdTag(l):void 0});for(const l of Object.values(o))this.bc.events.on(l,h=>this.emitter.emit(l,h));const c=this.container.getBoundingClientRect();this.session=new Ve({getVideoUuid:()=>this.currentEntry()?.hermesVideoId??d,getDurationSeconds:()=>this.currentDurationSeconds(),getExperienceMode:()=>this.experienceMode(),getViewablePercent:()=>this.viewablePercent(),getContinuousCount:()=>(this.bc?.currentIndex()??0)+1,getHasAdTag:()=>this.currentEntry()?.adTagUrl!=null,autoplay:this.config.autoplay??!1,getMuted:()=>this.bc?.isMuted()??this.config.muted??!1,width:Math.round(c.width)||640,height:Math.round(c.height)||360,playerVersion:"0.15.5",pageParams:this.config.pageParams,pageContext:this.config.pageContext,getAdTagConsent:()=>this.tagConsent.get(this.currentEntry()?.hermesVideoId)}),this.metrics=new Ne(this.emitter,this.session,r,{publisherId:this.config.comscorePublisherId??"",consent:this.consent,playerVersion:"0.15.5",getContent:()=>this.currentComscoreContent()}),this.metrics.start(),this.dock=new oe({container:this.container,events:this.emitter,enabled:this.config.floating??!1,onDismiss:()=>{this.pause(),this.manager.notifyPaused(this)}}),this.adTimer=new ne({container:this.container,events:this.emitter}),this.emitter.on(o.LOAD_START,()=>this.onItemChange()),await this.bc.init(),this.bc.setPlaylist(this.entries),this.config.autoplay===!0&&this.metrics.reportImpression()}async collectFirstPageIds(){const e=[];if(this.config.videoId&&e.push(this.config.videoId),this.config.playlistId){const i=await this.api.getPlaylistPage(this.config.playlistId,1);e.push(...i.videoIds),this.playlistNextPage=2,this.playlistHasMore=i.hasNextPage}this.config.playlist&&e.push(...this.config.playlist);const t=[...new Set(e)];if(t.length===0)throw new Error("HermesVideo: provide a videoId and/or playlistId");return t}currentEntry(){const e=this.bc?.currentHermesVideoId();if(e!=null){const t=this.entries.find(i=>i.hermesVideoId===e);if(t)return t}return this.entries[this.bc?.currentIndex()??0]}currentDurationSeconds(){return this.currentEntry()?.durationSeconds??null}experienceMode(){return document.fullscreenElement?"fullscreen":this.dock?.isFloating()?"docked":"na"}viewablePercent(){const e=this.container.getBoundingClientRect(),t=e.width*e.height;if(t<=0)return 0;const i=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight,r=Math.max(0,Math.min(e.right,i)-Math.max(e.left,0)),d=Math.max(0,Math.min(e.bottom,s)-Math.max(e.top,0));return r*d/t*100}currentComscoreContent(){const e=this.currentEntry(),t=this.container.getBoundingClientRect();return{id:e?.hermesVideoId,title:e?.title,durationMs:e?.durationSeconds?Math.round(e.durationSeconds*1e3):0,width:Math.round(t.width)||
3640,height:Math.round(t.height)||360}}onItemChange(){const e=this.bc?.currentIndex()??0,t=this.bc?.playlistLength()??this.entries.length;e>=t-1&&this.maybeFetchNextPage()}async maybeFetchNextPage(){if(!(!this.config.playlistId||!this.playlistHasMore||this.playlistFetching)){this.playlistFetching=!0;try{const e=await this.api.getPlaylistPage(this.config.playlistId,this.playlistNextPage);this.playlistNextPage+=1,this.playlistHasMore=e.hasNextPage;const t=new Set(this.entries.map(r=>r.hermesVideoId)),i=e.videoIds.filter(r=>!t.has(r));if(i.length===0)return;let s;if(this.config.clientSideAdTag===!0){const r=this.nextPlseqStart;this.nextPlseqStart+=i.length,s=i.map((d,c)=>({hermesVideoId:d,adTagUrl:null,plseq:r+c,batchSize:i.length}))}else{const r=this.buildAdContext(this.nextPlseqStart);this.nextPlseqStart+=i.length;const d=await this.api.getVideoPlaybackBatch(i,r);if(d.length===0)return;this.tagConsent.captureFor(d.map(c=>c.id)),s=d.map(c=>({hermesVideoId:c.id,adTagUrl:c.ads.vmapTagUrl,title:c.title,durationSeconds:c.durationSeconds}))}this.entries.push(...s),this.bc?.appendPlaylist(s)}catch(e){console.warn("HermesVideo: failed to fetch next playlist page",e)}finally{this.playlistFetching=!1}}}buildAdContext(e){const t=this.consent??{},i=this.config.adParams??{},s=this.config.pageContext??{},r=this.container.getBoundingClientRect(),d=Ce("gam");return this.tagConsent.setPending({limitedAds:i.limitedAds,nonPersonalizedAds:i.nonPersonalizedAds,hasPpid:d!=null,tcf:t.tcfString??void 0,usPrivacy:t.usPrivacy??void 0,gpp:t.gpp??void 0}),{gdpr:t.gdprApplies??void 0,tcf:t.tcfString??void 0,usp:t.usPrivacy??void 0,gpp:t.gpp??void 0,gpp_sid:t.gppSid??void 0,ppid:d??void 0,ad_pl:i.pl,ad_pd:i.pd,ad_pt:i.pt,ad_pct:i.pct,ad_pg_name:i.pgName,ad_ver:i.ver,ad_pubfamily:i.pubfamily,ad_limitedAds:i.limitedAds,ad_nonPersonalizedAds:i.nonPersonalizedAds,site:s.site,region:s.region,lang:s.lang,expb:s.expb,expn:s.expn,experience:s.experience,bckt:s.bckt,space_id:s.spaceId,device:s.device,os:s.os,width:Math.round(r.width)||640,height:Math.round(r.height)||360,autoplay:this.config.autoplay===!0,is_dockable:this.config.floating??!1,sid:this.sessionId,plseq_start:e,tb_host:i.tb_host,plid:i.plid}}buildClientSideAdTag(e){const t=this.config.thunderball?.bcid,i=this.config.thunderball?.pid;if(!t||!i||e==null)return null;const s=this.entries.find(d=>d.hermesVideoId===e);if(!s)return null;const r=this.buildAdContext(s.plseq??1);return this.tagConsent.captureFor([s.hermesVideoId]),Xe({bcid:t,pid:i,ctx:r,content:{id:s.hermesVideoId,title:s.title,durationSeconds:s.durationSeconds??null,licensorId:s.licensorId??null},plseq:s.plseq??null,batchSize:s.batchSize??1,referrer:document.referrer||location.href})}}function K(n){if(n!==void 0)return Math.min(Math.max(n/100,0),1)}const bt="0.15.5";function Et(n,e={}){return new z(n,e)}return m.HermesVideoPlayer=z,m.PAGE_CONFIG_SCRIPT_ID=q,m.PlayerEvent=o,m.PlayerManager=v,m.create=Et,m.readPageLevelConfig=$,m.version=bt,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m})({});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.