@flowplayer/player 3.17.0 → 3.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/core/events.d.ts +49 -0
  2. package/core/events.js +22 -2
  3. package/core.js +1 -1
  4. package/default.js +1 -1
  5. package/embed.js +2 -2
  6. package/index.d.ts +53 -1
  7. package/package.json +1 -1
  8. package/plugins/ads.d.ts +53 -1
  9. package/plugins/ads.js +1 -1
  10. package/plugins/airplay.d.ts +53 -1
  11. package/plugins/analytics.d.ts +53 -1
  12. package/plugins/analytics.js +1 -1
  13. package/plugins/asel.d.ts +53 -1
  14. package/plugins/audio.d.ts +53 -1
  15. package/plugins/chapters.d.ts +53 -1
  16. package/plugins/chromecast.d.ts +53 -1
  17. package/plugins/comscore.d.ts +53 -1
  18. package/plugins/consent.d.ts +53 -1
  19. package/plugins/context-menu.d.ts +53 -1
  20. package/plugins/cuepoints.d.ts +59 -7
  21. package/plugins/dash.d.ts +53 -1
  22. package/plugins/drm.d.ts +53 -1
  23. package/plugins/endscreen.d.ts +53 -1
  24. package/plugins/fas.d.ts +53 -1
  25. package/plugins/float-on-scroll.d.ts +53 -1
  26. package/plugins/ga4.d.ts +53 -1
  27. package/plugins/gemius.d.ts +53 -1
  28. package/plugins/google-analytics.d.ts +53 -1
  29. package/plugins/health.d.ts +53 -1
  30. package/plugins/health.js +1 -1
  31. package/plugins/hls.d.ts +53 -1
  32. package/plugins/id3.d.ts +53 -1
  33. package/plugins/iframe.d.ts +53 -1
  34. package/plugins/keyboard.d.ts +53 -1
  35. package/plugins/media-session.d.ts +53 -1
  36. package/plugins/message.d.ts +53 -1
  37. package/plugins/ovp.d.ts +53 -1
  38. package/plugins/playlist.d.ts +53 -1
  39. package/plugins/preview.d.ts +53 -1
  40. package/plugins/qsel.d.ts +53 -1
  41. package/plugins/qul.d.ts +53 -1
  42. package/plugins/rts.d.ts +53 -1
  43. package/plugins/share.d.ts +53 -1
  44. package/plugins/speed.d.ts +53 -1
  45. package/plugins/ssai.d.ts +53 -1
  46. package/plugins/ssai.js +1 -1
  47. package/plugins/subtitles.d.ts +53 -1
  48. package/plugins/thumbnails.d.ts +53 -1
  49. package/plugins/tizen.d.ts +53 -1
  50. package/plugins/vtsel.d.ts +53 -1
  51. package/plugins/webos.d.ts +53 -1
  52. package/util/loader.d.ts +53 -1
package/default.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=t()}(this,(function(){"use strict";const e=[],t=[];function n(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),o=/^((?!chrome|android).)*safari/i.test(t),i=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),s=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),a=/edg/i.test(t),l=/opr|opera/i.test(t),c=/SamsungBrowser/.test(t),u=c&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:o,edge:a,opera:l,chrome:i,firefox:s,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:c,samsung_tv:c&&u,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const r="retry",o="click",i="dblclick",s="mouseenter",a="mouseleave",l="mousemove",c="touchmove",u="fullscreenenter",d="fullscreenexit",p="loadedmetadata",f="loadeddata",h="progress",m="loadstart",y="pause",_="playing",v="waiting",g="canplay",E="ended",w="seeked",S="seeking",b="reap",T="landscape",O="portrait",A="recover",N="config",I="content:loadstart";var L=Object.freeze({__proto__:null,MOUNT:"mount",RETRY:r,ERROR:"error",CONTEXT_MENU:"contextmenu",CLICK:o,DBL_CLICK:i,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:s,MOUSE_LEAVE:a,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:l,TOUCH_START:"touchstart",TOUCH_MOVE:c,TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:u,FULLSCREEN_EXIT:d,FULLSCREEN_CHANGE:"fullscreenchange",METADATA:p,DATA:f,PROGRESS:h,TIME_UPDATE:"timeupdate",LOAD_START:m,VOLUME_CHANGE:"volumechange",PAUSE:y,PLAYING:_,PLAY:"play",WAITING:v,CAN_PLAY:g,ENDED:E,SEEKED:w,SEEKING:S,DURATION_CHANGE:"durationchange",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",REAP:b,QUALITIES:"qualities",VIDEO_TRACKS:"videoTracks",SET_QUALITY:"quality:set",VIDEO_TRACK_SELECT:"tracks:video:select",RECOMMENDATIONS_READY:"recommendationsready",LANDSCAPE:T,PORTRAIT:O,DVR:"dvr",LIVE:"live",RECOVER:A,SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange",WEBKIT_NEEDKEY:"webkitneedkey",RENDER_PLUGIN:"renderplugin",AUDIO_ONLY_SOURCE:"audioonlysource",NON_RECOVERABLE_ERROR:"error:fatal",CONFIG:N,STATE:"state",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",CONTENT_REAL_LOAD_START:I});const R="flowplayer-ui",k="flowplayer-logo",C="flowplayer-control",M="flowplayer-live-status",D="flowplayer-elapsed-time",P="flowplayer-timeline-bar",U="flowplayer-volume-bar",x="flowplayer-header",F="flowplayer-middle",W="flowplayer-middle-zone",G="flowplayer-wait",B="flowplayer-play-icon",H="flowplayer-pause-icon",j="flowplayer-rewind-icon",q="flowplayer-volume-icon";var z=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",VIDEO_MENU:"flowplayer-video-menu",UI:R,LOGO:k,CONTROL:C,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:M,ELAPSED:D,TIMELINE:P,CHAPTERS_TIMELINE:"flowplayer-chapters-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:U,HEADER:x,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:F,MIDDLE_ZONE:W,WAIT:G,MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:"flowplayer-small-play-icon",SMALL_PAUSE_ICON:"flowplayer-small-pause-icon",PLAY_ICON:B,PAUSE_ICON:H,FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:j,SHARE_ICON:"flowplayer-share-icon",SUBTITLES_MENU_ICON:"flowplayer-subs-menu-icon",MENU_BACK_ICON:"flowplayer-menu-back",VOLUME_ICON:q,MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:"flowplayer-live-countdown",PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue",SSAI_UI:"flowplayer-ssai-ui",SSAI_CONTROLS:"flowplayer-ssai-controls",SSAI_TIMELINE:"flowplayer-ssai-timeline",SSAI_INDICATOR:"flowplayer-ssai-indicator"});const V="is-playing",K="is-paused",Y="is-loaded",X="is-loading",Z="is-starting",Q="is-seeking",J="is-ended",$="is-live",ee="is-waiting",te="is-live-seeked",ne="no-timeline",re="will-play",oe="will-pause",ie="is-touched",se="is-in-viewport",ae="is-source-processing";var le=Object.freeze({__proto__:null,PLAYING:V,FULLSCREEN:"is-fullscreen",PAUSED:K,MUTED:"is-muted",LOADED:Y,LOADING:X,STARTING:Z,SEEKING:Q,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",TV:"is-tv",ENDED:J,LIVE:$,ERRORED:"is-error",WAITING:ee,AUTOPLAY:"is-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:te,NO_DVR:ne,HAS_POSTER:"has-poster",WILL_PLAY:re,WILL_PAUSE:oe,MENU_OPENED:"has-menu-opened",TOUCHED:ie,HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:se,NO_CONTROLS:"no-controls",DESTROYED:"is-destroyed",IS_SOURCE_PROCESSING:ae});function ce(e){this.message=e}ce.prototype=new Error,ce.prototype.name="InvalidCharacterError";var ue="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new ce("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,s="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?s+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};var de=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(ue(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return ue(t)}};function pe(e){this.message=e}pe.prototype=new Error,pe.prototype.name="InvalidTokenError";var fe=function(e,t){if("string"!=typeof e)throw new pe("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(de(e.split(".")[n]))}catch(e){throw new pe("Invalid token specified: "+e.message)}};fe.InvalidTokenError=pe;const he=new Map,me=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const r=window.customElements.get(t);if(!r)throw new Error(`no default flowplayer component with the name ${t} exists`);const o=window.customElements.get(n);return"function"!=typeof o?r:o})(e._customElements,t))(e),ye=(e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)};var _e,ve;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(_e||(_e={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(ve||(ve={}));const ge=e=>{return e.autoplay&&ve.AUDIO_REQUIRED&(!0===(t=e.autoplay)?ve.ON:!1===t?ve.OFF:t);var t};function Ee(e,t,n){const r="boolean"==typeof n;if("boolean"!=typeof n&&(n=!!e.hasState(oe)||e.paused),function(e,t,n){const r=e.poll(t?"beforeplay":"beforepause",{forced:n});return r&&r.defaultPrevented}(e,n,r))return Promise.resolve();if(!n)return e.hasState(re)?(e.setState(oe,!0),e.setState(re,!1),Promise.resolve()):Promise.resolve(e.pause());if(0==e.reaper)return Promise.resolve();const o=e.reaper.get("__pending_play");return e.paused||o?o?(o.src!==Se(e.original_src)&&we(e),o):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==Se(e.original_src)}(e)&&we(e),function(e){const t=e.hasState("is-autoplay"),n=t&&ge(e.opts);n&&(e.muted&&e.toggleMute(!1),0==e.volume&&(e.volume=1));t&&e.setState("is-autoplay",!1);return e.play().then(()=>{e.hasState(oe)&&e.togglePlay(!1)}).catch(r=>{if(console.warn(t?n?"[flowplayer/play] autoplay audio required\n%s":"[flowplayer/play] attempting muted autoplay\n%s":"",r.message,"\ninstance:",e),t&&!n)return e.muted=!0,e.play()})}(e)):(e.setState(oe,!1),!e.hasState(V)&&e.setState(re,!0),Promise.resolve())}function we(e){e.opts.is_native&&(e.hasState(Y)||(e.hasState(X)||e.emit(I),e.setState(X,!0),e.load()))}function Se(e){const t=document.createElement("a");return t.href=e,t.href}function be(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Te(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function Oe(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const Ae=e=>{var{src:t}=e,n=be(e,["src"]);return[Object.assign({src:t,type:t?Oe("video/"+Te(t)):""},n)]};function Ne(e){return Ae({src:e})}function Ie(e){var{src:t,type:n}=e,r=be(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:Ae(Object.assign({src:t},r))}var Le;function Re(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?Ne(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=Ne(t)),"object"!=typeof t||Array.isArray(t)||(t=Ie(t)),e.concat(t)}),[]):Ie(e)}(n);return function(e){[Q,oe,re,V,K,X,Y,te].forEach(t=>e.setState(t,!1)),e.setState(Z,!0)}(e),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(Le.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return e.setOpts({is_native:!r}),r?(r.onload(t,e.root,e,n),Le.Ok):Le.Err}(e,t,i)||Le.Ok==function(e,t,n,r={safari:!1}){var o;/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return Le.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return Le.Err;"string"==typeof n.src&&(e.preload=null!==(o=t.preload)&&void 0!==o?o:"auto",e.src=n.src);return Le.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Le||(Le={}));const ke=[b,S,"src","seek:cancel"];var Ce;function Me(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?De(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,De(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Ce.BACKWARD,t.offset<0),e.setState(Ce.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function De(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Ce.FORWARD,!1),e.setState(Ce.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Pe(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function Ue(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function xe(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Fe(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function We(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Ge(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+We(r)+":"+We(e)):t+We(r)+":"+We(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Ce||(Ce={}));const Be=navigator.languages||[navigator.language];function He(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return Be.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const je=[1e7]+""+-1e3+-4e3+-8e3+-1e11,qe=()=>"undefined"==typeof crypto?"":je.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let ze="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const Ve=["touchstart","touchmove"];function Ke(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Ye(e,t,n){const r=Ke(t,n);return e.dispatchEvent(r),e}function Xe(e,t,n){const r=Ke(t,n);return e.dispatchEvent(r),r}function Ze(e,t,n,r){Array.isArray(t)?t.forEach(t=>Qe(e,t,n,r)):Qe(e,t,n,r)}function Qe(e,t,n,r){if(o=t,!~Ve.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function Je(e,t,n,r){return Ze(e,t,n,Object.assign(r||{},{once:!0}))}class PlayerStorage{constructor(e,t){this.implementation=e,t&&t.keys().forEach(e=>{"string"==typeof t.implementation[e]&&this.implementation.setItem(e,t.implementation[e])})}keys(){var e;const t=[];for(var n=0;n<this.implementation.length;n++)(null===(e=this.implementation.key(n))||void 0===e?void 0:e.startsWith("flowplayer/"))&&t.push(this.implementation.key(n));return t}removeItem(e){try{this.implementation.removeItem("flowplayer/"+e)}catch(e){}}getItem(e){try{return this.implementation.getItem("flowplayer/"+e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem("flowplayer/"+e,t)}catch(e){}}clear(){try{this.keys().forEach(e=>this.implementation.removeItem(e))}catch(e){}}get length(){try{return this.keys().length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(e){var t;return(null===(t=this.pairs.find(t=>t[0]===e))||void 0===t?void 0:t[1])||null}key(e){return this.pairs[e][0]||null}removeItem(e){this.pairs=this.pairs.filter(t=>t[0]!==e)}setItem(e,t){this.removeItem(e),this.pairs.push([e,t])}}const $e={preload:"auto",rtl:!1,controls:!0},et=["loop","muted","preload"];function tt(e,r,o){let i;o.live_state={dvr_window:void 0,get dvr(){return i},set dvr(t){i=t;const n=!(!e.live||t);o.hasState(ne)!=n&&o.setState(ne,n)}},o._storage=new PlayerStorage(["localStorage","sessionStorage"].map(e=>{try{const t=window[e];return t.getItem(""),t}catch(t){return console.debug(`Access to window.${e} denied, trying next option`),null}}).find(e=>!!e)||new InMemoryStorage),o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return Re(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return o.playerState=n,Ye(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>me(this,e[n]))},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){!o.hasState(e)&&o.hasState(t)||(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.emit=(e,t)=>(Ye(o,e,t),o),o.on=(e,t)=>(Ze(o,e,t),o),o.once=(e,t)=>(Je(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>Xe(o,e,t),o.togglePlay=function(e){return Ee(o,0,e)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Ye(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),Ye(o,b),o.setState("is-destroyed",!0)}),0)},o.setAttrs=function(e){return et.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?Fe($e,t):n,Fe(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:Fe(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),e.live&&!o.hasState($)&&(o.setState(ne,!0),Ye(o,"live")),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted),"dvr"in e&&(o.live_state.dvr=o.opt("dvr")),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Ue();const t=e.getAttribute("dir");return t?"rtl"==t:Ue()}(r))),o.setState($,!!e.live),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),o.setState("no-controls",0==e.controls),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Ye(o,N,e)},o.renderPlugin=function(e){Xe(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const s={offset:0,timer:0};var a,l;l=s,(a=o).on(ke,(function(){De(a,l)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return Me(o,s,e)},o.deviceId=function(){return function(e){if(ze)return ze;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=qe();return e.setItem("flowplayer/uuid",n),n}catch(e){return ze=qe()}}(o._storage)}}function nt(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}var rt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ot(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}function it(){return"undefined"!=typeof window?window:void 0!==rt?rt:{}}const st=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function at(e,t){return!!~st.indexOf(e)||e.indexOf(t)===e.length-t.length}at.check_whitelist=function(e){return!!~st.indexOf(e)};const lt="production";function ct(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=fe(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&ct.validate(n),n}function ut(e){try{return ct.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var dt;function pt(e){return{grant:e,is_granted:t=>(e&t)===t}}function ft({root:e,video:t,data:n}){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const r=document.createElement("h2");r.textContent="Playback Error";const o=document.createElement("p");o.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://docs.flowplayer.com/troubleshooting/player#"+n.reason,i.textContent="Troubleshoot?";const s=document.createElement("img");s.src="https://flowplayer.com/user/pages/images/logo-white.png",e.append(r,o,i,s)}ct.validate=function(e){if("string"==typeof e&&(e=ct(e)),!e||!e.raw){if(at.check_whitelist(window.location.hostname)||"dev"===lt.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=at.bind(null,t);if("dev"!==lt.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==lt.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},ct.id=function(e){if(e)return"string"==typeof e&&(e=ct(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(dt||(dt={})),pt.of=pt,pt.from_token=function(e){const t=ct(e,{require_valid_token:!0});return pt.of(t.data.acl)},pt.permissions=dt;function ht(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function mt(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function yt(e,t){e.style.width="0",t.style.display="none"}function _t(e,t){const n=e.seekable;if("object"!=typeof e.opts||0==n.length)return{head:0,tail:0};const r=Et(e),o=t||e.live_state.dvr_window;return{head:r,tail:"number"!=typeof o||r-o<0?n.start(0):r-o}}function vt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function gt(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:_t(e).head}function Et(e){var t;const n=e.seekable;return n.length?e.hasState("is-chromecast-playing")||!(null===(t=e.hls)||void 0===t?void 0:t.liveSyncPosition)?n.end(n.length-1):e.hls.liveSyncPosition:0}function wt(e,t,n){if(!t.seekable||0==t.seekable.length)return;ht(n,e);const r=_t(t),o=(100-Math.max(0,Math.min(e,100)))/100*(r.head-r.tail);n.innerText="-"+Ge(o)}function St(e){e.currentTime=_t(e).tail}function bt(e){try{e.dvr_offset=0,e.currentTime=Et(e)}catch(e){console.warn("failed to seek to now: %j",e)}}function Tt(e,t){e/=100,t.currentTime=function(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const n=_t(e);return n.tail+t*(n.head-n.tail)}(t,e)}function Ot(e,t){e.style.width="0",t.style.display="none"}function At(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Nt(e,t,n){let r=!0;t.classList.add("flowplayer"),At(0,t),Ze(n,m,()=>{if(!n.hasState(X)&&!n.hasState(Y)&&e.is_native&&"none"!==e.preload)return"metadata"===e.preload?(n.setState(X,!0),n.emit(I)):void we(n)}),Ze(n,p,()=>{e.is_native&&"metadata"===e.preload&&n.paused&&n.emit(g)}),Ze(n,[m,"resize"],(function(){At(0,t)})),Ze(n,"state",(function(){Object.entries(n.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),Ze(n,"timeupdate",(function(){n.setState(ee,!n.hasState("is-casting")&&!n.hasState(Z)&&n.readyState<3)})),Ze(n,E,(function(t){setTimeout((function(){if(!t.defaultPrevented){if(e.rewind&&!n.loop){const e=n.src;n.setState(Q,!0),Je(n,w,(function(){e===n.src&&(n.setState(Q,!1),n.pause(),n.setState(Z,!0))})),n.currentTime=0}Je(n,"timeupdate",(function(){n.setState(J,!1)})),n.transitionState(J,V,e.loop||e.rewind?0:300)}}),0)})),Ze(n,[S,w],(function(e){n.setState(Q,e.type==S)})),Ze(n,"remotesession:ended",(function(e){setTimeout(()=>{e.defaultPrevented||(n.currentTime=e.detail.currentTime)},0)})),Ze(n,E,(function(){n.setState(V,!1),r=!0})),Ze(n,h,()=>{if(!n.opts.live||!n.opts.is_native)return;const e=n.seekable;0!=e.length&&n.emit("dvr/window",e.end(e.length-1)-e.start(0))}),Ze(n,f,(function(){var e,t;n.setState(Y,!0),n.setState(X,!1);const r=n;0===(null===(e=r.videoTracks)||void 0===e?void 0:e.length)&&(null===(t=r.audioTracks)||void 0===t?void 0:t.length)>0&&n.emit("audioonlysource")})),Ze(n,"play",()=>{n.setState(re,!0)}),Ze(n,[v,g,m],(function(t){if(!n.hasState(Q)&&(t.type!=g||e.autoplay||n.setState(ee,!1),t.type!=m||"none"!=n.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return Je(n,_,(function(){n.setState(ee,!1)}));t.type!=v||n.hasState(Y)||n.setState(X,!0),n.setState(J,!1),n.setState(ee,t.type==v)}})),Ze(n,[_,y],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const o=t.type==_,i=n.currentTime==n.duration,s=o&&r&&e.autoplay||n.hasState(ee);if(o&&(n.started=!0,r=!1),n.setState(ee,!1).setState(re,!1),!o&&n.setState(oe,!1),i)return;const a=o?V:K,l=o?K:V;n.transitionState(a,l,s?0:300),!n.hasState(Z)||n.root.classList.contains("ad-hide-first-frame")||n.root.classList.contains("preroll-ios")||function(e,t){if(!e.hasState($)||![void 0,0,-1].includes(t)||!e.seekable.length||e.hasState("has-casted"))return e.setState(Z,!1);e.once(w,()=>e.setState(Z,!1)),0===t?St(e):bt(e)}(n,e.start_time)}))}const It=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function Lt(e,t,n){if(!window.IntersectionObserver)return;const r={should_resume:!!e.autoplay,locked:!1};Ze(n,"play",(function(){r.locked||(r.should_resume=!0)}));const o=()=>{if(!e.autoplay)return;if(n.hasState(se)&&r.should_resume)return n.togglePlay(!0);const t=n.currentSrc;e.autopause||n.hasState(se)||!r.should_resume||Je(n,"viewenter",()=>{e.autoplay&&r.should_resume&&t===n.currentSrc&&n.togglePlay(!0)})},i=()=>{if(!e.autoplay)return;if(!e.is_native)return;if("auto"===e.preload)return;if(n.hasState(se))return we(n);const t=n.currentSrc;Je(n,"viewenter",()=>{t!==n.currentSrc||n.readyState>1||!n.paused||we(n)})};Ze(n,"src",(function(){r.should_resume=!!e.autoplay,n.off(m,i),n.once(m,i),n.off(g,o),n.once(g,o)})),Ze(n,y,(function(){r.locked||(r.should_resume=!1)}));const s=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,r=n.hasState(se);if(n.setState(se,t>=.2),n.emit("intersectionchange",{ratio:t}),r===n.hasState(se))return;const o=n.hasState(se)?"viewenter":"viewleave";n.emit(o)},0)})},{threshold:It});s.observe(t),n.on(b,()=>s.disconnect()),Ze(n,"viewenter",(function(){!r.should_resume||!e.autopause||Rt()||n.opts.autoplay&&!n.readyState||n.togglePlay(!0)})),Ze(n,"viewleave",(function(){if(!e.autopause||Rt())return;const t=!n.paused;r.locked=!0,n.pause(),setTimeout((function(){r.should_resume=t,r.locked=!1}),0)}))}function Rt(){return t.find(e=>e.hasState("is-casting"))}function kt(e,t){if(!window.ResizeObserver)return;const n=new ResizeObserver(e=>{const n=e[e.length-1];t.emit("resize",n)});n.observe(e),t.on(b,()=>n.disconnect())}function Ct(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function Mt(e,t,n){const r=!!e.ratio,o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let i=Ct(e.ratio||.5625);o.style.paddingTop=100*i+"%";const s=[f,p];n.on(s,(function(){if(r)return;const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(N,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,r=Ct((null==e?void 0:e.ratio)||t||.5625);i!==r&&(i=r,o.style.paddingTop=100*r+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(_,this.render),null===(t=this.player)||void 0===t||t.once(E,this.wireUp)}cleanUp(){var e,t,n,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(_,this.render),null===(r=this.player)||void 0===r||r.off(E,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const r=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!r)return;const o=this._logo=document.createElement("a");o.href="https://explorer.flowplayer.com",o.target="_blank",Object.entries(Dt).forEach(([e,t])=>{o.style.setProperty(e,t,"important")}),r.appendChild(o)}}const Dt={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Pt="flowplayer/"+_;function Ut(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(b,()=>document.removeEventListener(Pt,t)),document.addEventListener(Pt,t)}function xt(e,t){const n=[];e.addEventListener("contextmenu",r=>{const o=r.timeStamp;for(n.push(o);n.length>3;)n.shift();n.length>=3&&n.every(e=>e-o<3e3)&&(console.debug("flowplayer/debug rendering info"),function(e,t){var n;!function(e){const t=e.querySelector(".debug-info");null==t||t.remove()}(e);const r=document.createElement("div");r.classList.add("debug-info");const o=Ft("flowplayer.version","3.17.0");r.append(o);const i=null===(n=null==t?void 0:t.hls)||void 0===n?void 0:n.constructor;if(i&&i.version){const e=Ft("hls.version",i.version);r.append(e)}e.appendChild(r)}(e,t))})}const Ft=(e,t)=>{const n=document.createElement("div");n.classList.add("row",e);const r=document.createElement("span");r.classList.add("attr"),r.textContent=e;const o=document.createElement("span");return o.textContent=t,o.classList.add("value"),n.append(r,o),n};function Wt(e,t){const n=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),r=(r,...o)=>{try{const i=(null==t?void 0:t.debug)||n;i&&e.match(i)&&console.log(`flowplayer/${e} -- ${r}`,...o)}catch(e){console.warn(e)}};return r.log=r,r}const Gt=Wt("core/retry");function Bt(e,t){const n={pending:void 0,count:0};var o;e.on("error",o=>{t.retry&&void 0===n.pending&&(++n.count,n.pending=function(e,t){return setTimeout(()=>{e.hasState("is-destroyed")||(t.pending=void 0,[A,r].forEach(t=>e.emit(t)),Gt("%s try",t.count))},3e3*t.count)}(e,n))}),e.on(_,()=>{n.count=0}),e.on(["src",A],()=>{n.pending&&(clearTimeout(n.pending),n.pending=void 0)}),e.on(r,(o=t=>{t.defaultPrevented||e.load()},e=>{setTimeout((function(){if(!e.defaultPrevented)return o(e)}),0)}))}const Ht=function(){const e=it(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function jt(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),jt;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const s=ut(r.token);if(!s.success)return ft({root:o,data:{reason:"token",details:s.message}});const a=new Map,l=nt(r,o);l.reaper=a,l._customElements=he,Object.defineProperty(l,"token",{value:"string"==typeof r.token?ct.id(r.token):"",writable:!1}),l.addEventListener(b,()=>{a.clear(),l.reaper=0,delete l.root}),l.root=o,r.token&&pt.from_token(r.token).is_granted(pt.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),tt(r,o,l),l.setAttrs(r),l.plugins=jt.extensions.map(e=>new e(jt,l)),Nt(r,o,l),Lt(r,o,l),kt(o,l),Mt(r,o,l),Ut(l),xt(o,l),Bt(l,r),l.plugins.forEach(e=>{try{e.init(r,o,l)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),l.setOpts(r),l.opts=r,r.src&&l.setSrc(r.src);const c=l.readyState;return c>0&&l.currentSrc&&l.emit(p),c>2&&l.currentSrc&&l.emit(g),l.emit("mount"),l.on("error:fatal",(function(e){ft({root:o,video:l,data:e.data||{}})})),setTimeout(Ye,0,document,"flowplayer:player:created",l),l}Object.assign(jt,Ht),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.customElements=he,r.defaultElements=z,r.version="3.17.0",r.commit="166bb5cdc210ddfabb6e8b6f3a1c02cb3eceaa2c",r.instances=t,r.extensions=e,r.support=n,r.events=L,r.states=le,r.jwt=fe,r.autoplay=ve,r.quality=_e}(jt),"object"==typeof document&&setTimeout(Ye,0,document,"flowplayer:umd",jt);var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function zt(e){var t={exports:{}};return e(t,t.exports),t.exports}var Vt=zt((function(e,t){var n=qt&&qt.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return n(n({},e),t)}),{})},t.pluck=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(n,r){var o;return t.merge(n,((o={})[r]=e[r],o))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),Kt=zt((function(e,t){var n=qt&&qt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};t.__esModule=!0;var i=o(Vt),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],o=n[1],i=n[2];if(!(Date.now()<t.stats.ttl)){var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s)},s.onerror=function(n){e.handle_error(t,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--},s.open(o,r),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(i))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return i.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=s})),Yt=zt((function(e,t){var n=qt&&qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(Kt);t.default=r.default.of()})),Xt=zt((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),Zt=zt((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),Qt=zt((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),Jt=zt((function(e,t){var n=qt&&qt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=qt&&qt.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},s=qt&&qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=s(Yt),l=s(Kt),c=o(Xt),u=o(Vt),d=function(){function e(t,n){var r=this;void 0===n&&(n={});var o=this;if(this.emitter=t,this.url=n.url,this.log=Zt.Log.of(this.emitter),this.verb=n.verb,this.metadata=u.merge({},n.metadata||{}),this.rq=n.rq||a.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");e.TRACKERS.push(this),o.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var i=u.merge(o.metadata,{event_type:t},n.data||n),s=c.prepare_url(o,i),a=e.pluck_valid_keys(o,i),d=e.ensure_required_keys(o,a);if(d.length)return o.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(a,null,2));l.default.rpush(r.rq,[s,r.verb,a])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return u.pluck.apply(u,i([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,u.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,u.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=a.default,e.verb=Qt.Verb,e}();t.default=d})),$t=zt((function(e,t){var n=qt&&qt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=qt&&qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=i(Jt);t.Tracker=s.default;var a=o(Xt);t.API=a})),en="ping",tn="display",nn="view";const rn=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],on=["created","position"],sn=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function an(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function ln(e,t,n){if(!t.segment_duration&&!an(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:cn(e,t);return t.last_idx=o,o<=r?[]:t.breakpoints.slice(r,99==o?100:o).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(en,{position:r})}function cn(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}function un(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const dn="vod",pn="live",fn=[tn,en,nn];function hn(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(en,{position:60*t.ticks}))}(e,t);case"vod":return ln(e,t,"boolean"==typeof n&&n)}}function mn(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}const yn=ot(it(),class Analytics{init(e,t,n){if(!pt.from_token(e.token||"").is_granted(pt.permissions.ANALYTICS))return;if(n.hasState("consent-no-tracking"))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{hn(n,r.ticker)}};const i={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id,player_version:"3.17.0"},s=$t.Tracker.of(n,{verb:$t.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:fn,required_keys:rn,optional_keys:sn.concat(on).slice(0),metadata:i});n.on(b,(function(){s&&s.destroy()})),n.on(N,(function(t){if(!s)return;const o=Fe(t,"data.metadata",{});if(!o.media_id)return;const i=Fe(s,"metadata.media_id");if(i&&o.media_id==i)return;const a=Fe(e,"analytics",{});s.put(o),s.put(a);const l=Fe(e,"metadata.live_start_time",e.live)?pn:dn;s.put({video_type:l,source:e.source||un()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(tn)}));let a=0;n.on(_,(function(){if(!s)return;if(a||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(s,r))return;s.put({muted:n.muted});const e=mn(n);if(e)return a=Promise.resolve(e).then((function(){r.last_media_id=s.metadata.media_id,n.emit(nn),a=0})).catch((function(){a=0}));r.last_media_id=s.metadata.media_id,n.emit(nn)})),n.on("timeupdate",(function(){var t;s&&(a||mn(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&hn(n,r.ticker,!0),(t=o).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),n.on(w,(function(){s&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){an(e,t),t.last_idx=cn(e,t)}(n,r.ticker)})),n.on(E,(function(){s&&function(e,t){t.ended||(t.ended=!0,hn(e,t.ticker))}(n,r)}))}});var _n;function vn(e){switch(e){case _n.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case _n.MEDIA_ERR_NETWORK:return"a network error occurred";case _n.MEDIA_ERR_DECODE:return"unable to decode media content";case _n.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case _n.NO_INTERNET:return"no internet connection detected";case _n.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function gn(){}function En(e){try{return!!new URL(e)}catch(e){return!1}}"undefined"!=typeof window&&window.matchMedia&&[T,O].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(n){t.length&&t.forEach((function(t){n.matches&&t.emit(e)}))}))})),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(_n||(_n={}));function wn(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=t.code||-1,r=vn(n);return e.i18n("media_errors."+n,r)}const Sn=()=>!0===(navigator||{}).onLine;function bn(e){try{return"https:"===location.protocol&&"http:"==function(e){const t=document.createElement("a");return t.href=e,t}(e).protocol}catch(e){return!1}}function Tn(e,t,n){const r=n.togglePlay;n.on("error",(function(e){const t=e.data||n.error,o="Error: %s\n"+(null===(i=(new Error).stack)||void 0===i?void 0:i.split("\n").slice(2).join("\n"));var i;setTimeout((function(){const i=Pe(n,R);if(e.defaultPrevented||!i||n.root.querySelector("#qul_error"))return;if("AbortError"==t.name)return;n.setState("is-error",!0),n.togglePlay=gn;const s=function(e,t){return{code:"http:0"===t.code?An(e):t.code,message:wn(e,t)}}(n,t);console.error(o,s.message);let a=Pe(n,"flowplayer-error");a||(a=me(n,"flowplayer-error"),i.append(a)),Ye(a,"error",{data:t,formatted_data:s}),n.once(m,()=>{On(n,r)})}))})),n.on(A,()=>On(n,r))}function On(e,t){const n=Pe(e,"flowplayer-error");e.togglePlay=t,e.opt("retry")&&e.setState(ee,!0),e.setState("is-error",!1),null==n||n.remove()}function An(e){return bn(e.original_src)?{code:_n.MIXED_CONTENT}:Sn()?{code:_n.MEDIA_ERR_NETWORK}:Sn()?{code:_n.UNKNOWN}:{code:_n.NO_INTERNET}}var Nn=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384,LOGO_ON_BOTTOM:32768});function In(e,t,n){let r=()=>document.fullscreenElement,o="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),o="webkit"+o,r=()=>t.webkitCurrentFullScreenElement}const s=()=>n.getFullsceenTarget?n.getFullsceenTarget():t;n.toggleFullScreen=function(e,t){if(n.ios_fullscreen_disabled)return;if("boolean"!=typeof e&&(e=!n.hasState("is-fullscreen")),Ln(n)&&(e?function(e,t){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");t||e.webkitEnterFullScreen()}(n,t):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState(ie)||e.setState(ie,!0)}(n,t)),!document.fullscreenEnabled)return;const o=s();if(e)return o.requestFullscreen();r()===o&&document.exitFullscreen()},Ln(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on(["webkitendfullscreen","webkitbeginfullscreen"],e=>{const t="webkitbeginfullscreen"===e.type;n.setState("is-fullscreen",t).emit(t?u:d).toggleFullScreen(t,!0)})),setTimeout(()=>{const e=s();e.addEventListener(o,(function(){const t=r(),o=t===e||t==n;n.emit(o?u:d),n.setState("is-fullscreen",o)}))},0),!1!==e.doubleclick&&t.addEventListener(i,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function Ln(e){return!document.fullscreenEnabled&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Rn(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=me(n,R),i=me(n,k);t.append(i),r.append(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=xe("fp-footer");t.append(r),n.on(N,(function(e){var t,n;const o=null===(t=e.data)||void 0===t?void 0:t.description,i=null===(n=e.data)||void 0===n?void 0:n.title;if(r.innerHTML="","string"==typeof i){const e=xe("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=xe("fp-desc");for(t.innerText=e.join(" "),r.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,n),Tn(0,0,n),t.appendChild(r),[s,a].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==s),n.setState("is-accessibility",!1)}))}),In(e,t,n),n.on("volumechange",(function(){const e=0==n.volume||n.muted;n.muted=e,n.setState("is-muted",e),n._storage.setItem("mute",e.toString())})),"true"==n._storage.getItem("mute")&&(n.muted=!0,n.setState("is-muted",n.muted));const u=n._storage.getItem("volume");u&&!isNaN(Number(u))&&(n.volume=Number(u)),n.emit("volumechange"),n.on("dvr/window",t=>{e.live&&(n.live_state.dvr=n.seekable.length>0&&function(e,t,n){if(0==t)return!0;const r=_t(e,n);return r.head-r.tail>=t}(n,e.seconds_to_dvr||60,t.detail),n.live_state.dvr_window=t.detail)}),n.on("live",()=>{const e=setInterval(()=>{if(n.opts.live&&!n.hasState("is-error")&&0!=n.reaper||clearInterval(e),0==n.seekable.length)return;const t=function(e){const t=e.currentTime,n=_t(e);return{progress:Math.min(100,Math.max(0,(t-n.tail)/(n.head-n.tail)*100)),is_live:t-n.head>=-10}}(n);n.hasState(te)==t.is_live&&n.setState(te,!t.is_live),n.live_state.dvr&&n.emit("dvr",t.progress)},200)}),n.on(p,(function(){n.setOpts({live:vt(n)})})),n.on("durationchange",(function(e){const t=vt(n),r=t?gt(n):e.data||n.duration;isNaN(r)||n.setOpts({live:t,duration:r})})),n.on(["playlist/advance","src"],t=>{if(n.setState("is-autoplay",!!e.autoplay),n.root.classList.contains("is-livecountdown"))return kn(n,e);n.currentSrc&&("src"===t.type&&["is-playlist",ae].some(e=>n.root.classList.contains(e))||kn(n,e))}),n.on(N,(function(n){var r,o;e.seekable=void 0===(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.seekable)||n.data.seekable;const i=null===(o=n.data)||void 0===o?void 0:o.ui;if("number"!=typeof i)return;const s=t.classList;s.toggle("use-play-1",!(32&i||64&i)),s.toggle("use-play-2",(32&i)>0),s.toggle("use-play-3",(64&i)>0),s.toggle("use-thin-controlbar",(128&i)>0),s.toggle("no-title",(256&i)>0),s.toggle("no-description",(512&i)>0),s.toggle("logo-on-right",(8&i)>0),s.toggle("logo-on-bottom",(32768&i)>0),s.toggle("use-drag-handle",(16&i)>0),s.toggle("no-controls",(1024&i)>0),s.toggle("no-duration",(2048&i)>0),s.toggle("no-header",(4096&i)>0),s.toggle("no-mute",(4&i)>0),s.toggle("no-volume",(2&i)>0),s.toggle("no-fullscreen",(1&i)>0),s.toggle("no-touch-zones",(16384&i)>0)}));let d=null;[l,c].forEach(e=>o.addEventListener(e,(function(e){n.hasState("is-touch-device")&&e.type===l||("number"==typeof d&&clearTimeout(d),n.setState("is-hovered",!0),d=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3))})))}function kn(e,t){delete t.live_start_time,e.setOpts({live:!1}),e.live_state.dvr=void 0,e.live_state.dvr_window=void 0,delete t.live,delete t.poster,delete t.duration,delete t.title,delete t.description}function Cn(e,t,n){if(pt.from_token(e.token||"").is_granted(pt.permissions.NO_METERING))return;ct.id(e.token||"")&&n.once(_,async()=>await async function e(t,n){const r=ct.id(n||"");t.once("src",()=>{t.once(_,()=>e(t,n))}),function(e,t){if(!function(e){return pt.from_token(e).is_granted(pt.permissions.WOWZA_VIDEO)}(t))return;if(function(e){try{return new URL(e).hostname.endsWith(".wowza.com")}catch(e){return!1}}(e.original_src))return;e.emit("error:fatal",{reason:"token",details:"This token only allows wowza video sources"})}(t,n);if(401==(await fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:r,factor:1,rnd:Math.random().toString(36).substring(2)})})).status)return t.emit("error:fatal",{reason:"token",details:"The token online validation failed"})}(n,e.token||""))}var Mn={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class I18n{init(e,t,n){n.reaper&&n.reaper.set("translations",He(I18n,e,"en"))}}I18n.en=Mn;const Dn="rebuffer",Pn="rebuffer:ended",Un="insights:ttff",xn="insights:time_to_first_frag_loaded",Fn="insights:watched_interval";var Wn=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:Dn,REBUFFER_ENDED:Pn,DISPLAY:"display",TIME_TO_FIRST_FRAME:Un,TIME_TO_FIRST_FRAGMENT_LOADED:xn,WATCHED_INTERVAL:Fn});const Gn=[I,"error","src"];const Bn=navigator;function Hn(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=Bn.connection)||void 0===n?void 0:n.downlink)||-1}function jn(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}const qn=e=>{switch(e){case!0:return ve.ON;case!1:return ve.OFF;default:return e}},zn=[],Vn="https://ihi.flowplayer.com/v1/health/events";function Kn(e){if(e.suspended)return;const t=zn.slice(0);zn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),jn(function(){try{return"undefined"==typeof window?Vn:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:Vn}catch(e){return Vn}}(),t))}async function Yn(e,t,n){const r=await Zn();zn.push(Object.assign(t,r)),e.logger.log(":enqueue",t.event,t),zn.length<10&&!n||Kn(e)}const Xn=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},Zn=async()=>({client_time:Date.now()}),Qn=(e,t)=>Object.assign(e,{detail:t}),Jn=(e,{event:t,media_session_id:n,session_id:r,play_range_id:o})=>({event:t,media_session_id:n,session_id:r,play_range_id:o,device_id:e.deviceId(),version:"3.17.0",commit:"166bb5cdc210ddfabb6e8b6f3a1c02cb3eceaa2c",ima_sdk_version:Xn(),preload:e.opt("preload"),autoplay:qn(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:Hn(e),page_url:un(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),$n=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function er(e,t,n,r){const o=Jn(t,e.eventInfo(n)),{before:i,after:s}=r;Yn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,$n(i),$n(s)))}const tr=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}};var nr;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAdsAutoplay=2]="TimerStartedWithAdsAutoplay",e[e.TimerStartedWithContentAutoplay=3]="TimerStartedWithContentAutoplay",e[e.TimerStartedWithUserGesture=4]="TimerStartedWithUserGesture",e[e.MetricReported=5]="MetricReported"}(nr||(nr={}));class TimeToFirstFrame{constructor(e=nr.Starting,t=!1,n=!1){this.state=e,this.loadedAd=t,this.requiresUserGesture=n}reset(){this.state=nr.Starting,this.loadedAd=!1,this.elapsed=void 0}toJSON(){var e;return{ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round((null===(e=this.elapsed)||void 0===e?void 0:e.duration)||-1)}}startTimer(e){this.state==nr.ConfigFinalized&&(this.state=e,performance.mark("ttff:start"))}hasStarted(){return[nr.TimerStartedWithAdsAutoplay,nr.TimerStartedWithContentAutoplay,nr.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){if(this.hasStarted()){performance.mark("ttff:end");const t=this.elapsed=performance.measure("ttff","ttff:start","ttff:end");this.state=nr.MetricReported,e(t)}}}function rr(e){return Math.round(1e3*e)/1e3}class EWMA{constructor(e){this.tickInterval=e,this.ewma=0,this.startTime=Date.now()}decay(){const e=Date.now()-this.startTime;return Math.pow(2,-e/(4*this.tickInterval))}update(e){const t=this.decay();return this.ewma=t*this.ewma+(1-t)*e,this.ewma}toJSON(){return this.ewma}}class WatchedState{constructor(e){this.player=e,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0,this.ewmaTickWatched=new EWMA(WatchedState.AccuracyMilliseconds)}reset(){this.onNotWatching(),this.watchedSum=0,this.lastReportedSum=0,this.lastWatchedPoint=void 0}onNotWatching(){this.marchingInterval&&(this.updateWatched(),this.marchingInterval=clearInterval(this.marchingInterval))}onWatching(){this.marchingInterval||(this.lastWatchedPoint=this.createWatchedPoint(),this.marchingInterval=setInterval(()=>{this.updateWatched()},WatchedState.AccuracyMilliseconds))}createWatchedPoint(){return{currentTime:this.player.currentTime,paused:this.player.paused}}updateWatched(){const e=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,e),this.lastWatchedPoint=e}calculateTimeWatched(e,t){const n=t.currentTime-e.currentTime,r=this.ewmaTickWatched.update(n);if(!(n<0)&&!(1e3*n>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=n,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const e=rr(r),t={total_watched_seconds:rr(this.watchedSum),tick_watched_seconds:e,batch_watched_seconds:rr(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(Fn,t)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const or=qe();class Health{constructor(e,t){let n;this.session_id=or,this.suspended=!1,this.logger=Wt("health",t.opts),this.media_session_id=qe(),this.play_range_id=qe(),this.analyticsLoop=setInterval(()=>Kn(this),2e3),t.on(b,()=>clearInterval(this.analyticsLoop)),t.on(_,()=>{n!==this.media_session_id&&(n=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=qe()});let r=Date.now()-1e3;t.on("timeupdate",e=>{if(n!==this.media_session_id)return;const o=Date.now();if(o<r)return;r=Date.now()+5e3;const i=Jn(t,this.eventInfo(e.type)),s=Qn(i,{duration:(a=t.duration,Number.isFinite(a)?a:a===1/0?-1:void 0)});var a;this.first_playing_event_timestamp&&(Object.assign(s,{ms_since_first_playing:o-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),Yn(this,s)});const o=this;if(t.health={get media_session_id(){return o.media_session_id},set media_session_id(e){o.media_session_id=e},get session_id(){return o.session_id},set session_id(e){o.session_id=e},toggle(e){e?o.resume():o.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>Kn(this),2e3)}init(e,t,n){if(un().toString().startsWith("data:"))return this.suspend();!function(e){let t=null;const n=()=>{t=null};e.on(v,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e.emit(Dn))})),e.on(Dn,e=>{t=e}),e.on(g,r=>{if(t){const o=r.timeStamp-t.timeStamp;if(n(),o<31)return;if(o>3e5)return;e.emit(Pn,{rebuffer_duration:o/1e3})}}),Gn.forEach(t=>e.on(t,n))}(n),function(e){let t;[g,I].forEach(n=>{e.on(n,n=>{const r=Date.now();switch(n.type){case I:return t=r;case g:if(t)return e.emit(xn,{ms_since_loading_started:r-t}),t=null}})})}(n),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on("ovp:config:finalized",e=>{t.reset(),t.state=nr.ConfigFinalized,t.requiresUserGesture=!e.detail.autoplay}),e.on(I,()=>{e.root.classList.contains("ad-hide-first-frame")&&t.startTimer(nr.TimerStartedWithAdsAutoplay),e.opt("autoplay")&&t.startTimer(nr.TimerStartedWithContentAutoplay)}),e.on(o,()=>{e.opt("autoplay")||t.startTimer(nr.TimerStartedWithUserGesture)}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on("timeupdate",()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))switch(t.state){case nr.TimerStartedWithContentAutoplay:case nr.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Un,t.toJSON()))}}),e.on("ad-started",()=>{switch(t.state){case nr.TimerStartedWithAdsAutoplay:case nr.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Un,t.toJSON()))}})}(n),function(e){const t=new WatchedState(e);e.on(I,()=>t.reset()),e.on(_,()=>t.onWatching()),e.on(y,()=>t.onNotWatching()),e.on(S,()=>t.onNotWatching()),e.on(E,()=>t.updateWatched()),e.on("visibilitychange",()=>t.updateWatched())}(n),n.on("display",e=>{Yn(this,Jn(n,this.eventInfo(e.type)),!0)}),n.on("health:record",({detail:e})=>{const t=Jn(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),Yn(this,t)}),[m,p,f,h,v,Dn].forEach(e=>{n.on(e,e=>{Yn(this,Jn(n,this.eventInfo(e.type)))})}),[Pn,Un,xn,Fn].forEach(e=>{n.on(e,e=>{const t=Jn(n,this.eventInfo(e.type));Yn(this,Object.assign(t,e.detail))})}),[_,y,S,w,E,u,d,g,I].forEach(e=>{n.on(e,e=>{Yn(this,Jn(n,this.eventInfo(e.type)))})}),n.on("volumechange",tr(800,e=>{const t=Jn(n,this.eventInfo(e.type));Yn(this,Qn(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on("resize",tr(800,e=>{const r=Jn(n,this.eventInfo(e.type));Yn(this,Qn(r,{height:t.clientHeight,width:t.clientWidth}))})),n.on("hls/failover",e=>{const t=Jn(n,this.eventInfo(e.type)),r=e.detail,{reason:o,from:i}=r;Yn(this,Qn(t,{reason:o,from:i}))}),n.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return er(this,n,e,t)}}),n.addEventListener("error",e=>{const t=Jn(n,this.eventInfo(e.type)),r=e.error||n.error;if(!r)return Yn(this,t,!0);const o=r.code,i={error_message:r.message||vn(o),error_code:o,error_stack:r.stack||""};return Yn(this,Qn(t,i),!0)}),n.on("src",e=>{var t;const r=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof r)return;if(!En(n.original_src))return;if(!En(r))return;if(r==n.original_src)return;this.media_session_id=qe();Yn(this,Jn(n,this.eventInfo(e.type))),Kn(this)}),n.on("visibilitychange",e=>{Yn(this,Jn(n,this.eventInfo(e.type))),Kn(this)})}}Health.events=Wn,Health._UNLOAD_SUBSCRIBED=!1;var ir=ot(window,Health);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerLogo extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-logo");const t={logo:""};e.on(N,e=>{var n;const r=t.logo,o=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";r!=o&&(t.logo=o,this.set_logo(o,e.detail.logo_alt_text,e.detail.logo_href))})}set_logo(e,t,n){this.innerHTML="";const r=document.createElement("img");if(!e)return;if(r.src=e,t&&(r.alt=t),!n)return this.append(r);const o=document.createElement("a");o.href=n,o.append(r),this.append(o)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(N,e=>{var t;const n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN;this.innerText=isFinite(n)?Ge(n):""})}}const sr={name:"fp-fullscreen",translation_key:"core.fullscreen"},ar={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},lr={name:"fp-play",translation_key:"core.play"},cr={name:"fp-pause",translation_key:"core.pause"},ur={translation_key:"core.mute",name:"fp-volume-mute-unmute"},dr={translation_key:"core.play",name:"fp-small-play"},pr={translation_key:"core.pause",name:"fp-small-pause"},fr={name:"fp-fast-forward"},hr={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),t.translation_key&&this.setAttribute("aria-label",e.i18n(t.translation_key)),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(o,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{var t;const n=e.root.querySelector("details[open].fp-menu-container");n&&(n.open=!1,null===(t=n.querySelector("summary"))||void 0===t||t.removeAttribute("aria-expanded"),e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const mr={passive:!0};var yr;function _r(e,t){let n=0,r=-1,o=-1;const i=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=e.classList;e.id=i,s.remove(yr.GRABBING),s.remove(yr.TOUCHING);const a=t.onseek||gn,u=t.onstart||gn,d=t.onend||gn,p=t.onmouse||gn,f=t.ontouch||gn,h=t.ontouchend||gn;function m(t){!function(){const t=e.getBoundingClientRect();n=t.left,r=t.width}();let o=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-n;return o>r&&(o=r),o<0&&(o=0),o/r*100}function y(t){const n=m(t);n!=o&&(a(e,n),o=n)}return e.addEventListener("touchstart",(function(t){vr(e,t)&&(s.add(yr.TOUCHING),gr(e.parentElement)&&(s.add(yr.GRABBING),f(e,m(t)),u(e,m(t)),y(t)))}),mr),e.addEventListener(c,(function(t){y(t),p(e,m(t))}),mr),e.addEventListener("touchend",(function(t){setTimeout((function(){s.remove(yr.TOUCHING)}),500),vr(e,t)&&(s.remove(yr.GRABBING),h(e,m(t)),d(e,m(t)),r=0)}),mr),e.addEventListener("touchcancel",(function(){s.remove(yr.GRABBING,yr.TOUCHING),r=0}),mr),e.addEventListener("mousedown",(function(t){s.contains(yr.TOUCHING)||(document.addEventListener(l,y),s.add(yr.GRABBING),u(e,m(t)),t.preventDefault(),y(t))})),e.addEventListener(l,(function(t){s.contains(yr.TOUCHING)||p(e,m(t))})),document.addEventListener("mouseup",(function(t){s.contains(yr.TOUCHING)||(document.removeEventListener(l,y),s.contains(yr.GRABBING)&&(s.remove(yr.GRABBING),d(e,m(t)),r=0))})),e}function vr(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!gr(e.parentElement)||!e.classList.contains(yr.TOUCHING))}function gr(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(yr||(yr={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(e){super(e),this.className="fp-volume";const t=e.root.classList,n=t.contains("is-tiny")?6:t.contains("is-small")?8:10,r=Array.from({length:n}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});this.append(...r),_r(this,{onseek:(t,n)=>{n>0&&(e.muted=!1,e._storage.removeItem("mute")),e._storage.setItem("volume",(e.volume=n/100).toString()),this.adjustVolumeSlider(e.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",e.i18n("core.volume","volume")),e.on("volumechange",()=>{const t=0==e.volume||e.muted;t&&this.adjustVolumeSlider(0);const n=e.opt("ui");this.classList.contains(yr.GRABBING)||t&&"number"==typeof n&&(4&n)>0||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString()),this.setAttribute("aria-valuetext",Math.round(100*e)+"%");const t=Array.from(this.querySelectorAll(".fp-tick")),n=Math.round(e*t.length);t.forEach((e,t)=>{e.classList.toggle("fp-color",t<n)})}}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=xe("fp-buffer"),this.progress=xe("fp-progress","fp-color"),this.tooltipEle=xe("fp-timestamp"),this.proposedSeekBar=xe("fp-hover"),this.dragger=xe("fp-dragger","fp-color"),this.classList.add("fp-timeline","fp-bar"),this.tooltipEle.style.display="none",this.setAttribute("role","slider"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",e.i18n("core.timeline_aria_label","Seek slider")),this.setAttribute("aria-valuenow","0"),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);const n=requestAnimationFrame;let r=void 0;const o=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",r=void 0,e.paused||this.classList.contains(yr.GRABBING)||r||(r=setTimeout(o,200)))},i=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);_r(this,{onseek:(n,r)=>{if(i())switch(!!t.live){case!0:wt(r,e,this.tooltipEle);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,e,this.progress),ht(this.tooltipEle,r)}},onstart:()=>{i()&&(e.emit("timeline/gesture/start"),!e.hasState("is-casting")&&e.setState(Q,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(r,i){n(o),0!=t.seekable&&t.live&&Tt(i,e)},ontouchend:()=>{t.live?Ot(this.proposedSeekBar,this.tooltipEle):yt(this.proposedSeekBar,this.tooltipEle),setTimeout(()=>e.emit("timeline/gesture/end"),0)},onmouse:(n,r)=>{if(i()&&(e.emit("timeline/gesture/move",{percent:r}),!this.classList.contains(yr.GRABBING)))switch(!!t.live){case!0:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),wt(r,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),function(e,t,n){if(isNaN(e)||isNaN(t.duration))return;ht(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=Ge(e/100*t.duration),n.append(r)}(r,e,this.tooltipEle)}}}),e.on(N,(function(e){e.data&&(t=e.data)})),e.on(_,()=>n(o)),e.on(h,()=>{0==e.reaper||t.live||mt(e,this.bufferEle)}),e.on("dvr",e=>{this.progress.style.width=e.detail+"%"}),e.on("timeupdate",()=>{0!=e.reaper&&(n(o),this.setAttribute("aria-valuenow",e.currentTime+""),this.setAttribute("aria-valuetext",Math.round(e.currentTime)+" "+e.i18n("core.seconds","Seconds")),t.live||mt(e,this.bufferEle))}),e.on(p,()=>{0!=e.reaper&&(t.live||mt(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const n=vt(e)?gt(e):t.data||e.duration;isNaN(n)||(this.setAttribute("aria-valuemax",n+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(a,()=>{e.emit("timeline/gesture/end"),t.live?Ot(this.proposedSeekBar,this.tooltipEle):yt(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=xe("fp-live-text"),n=xe("fp-live-indicator","fp-color");t.textContent="live",this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.append(n,t),this.addEventListener(o,(function(){bt(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),this.setAttribute("aria-hidden","true"),e.on(N,n=>{if(0==e.reaper||!n.data)return;t=n.data;const r=vt(e)?NaN:n.data.duration||0;if(isNaN(r)||r>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Ge(r)}),e.on(p,()=>{var n,r;0==e.reaper||t.live||(r=this,(n=e).duration&&(r.innerText=Ge(n.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Ge(0),this.setAttribute("aria-hidden","true"),e.on(N,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var n;0!=e.reaper&&(t.live?(n=e,this.innerText=Ge(n.currentTime)):function(e,t){t.innerText=Ge(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=me(e,"flowplayer-small-pause-icon"),n=me(e,"flowplayer-small-play-icon");t.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){n.focus&&n.focus()}),100)})),n.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){t.focus&&t.focus()}),100)})),this.append(t,n)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add(t);const n=this.classList.contains("fp-left-zone")?-1:1,r=document.createElement("span"),o=me(e,this.classList.contains("fp-left-zone")?j:"flowplayer-fast-forward-icon");o.removeAttribute("tabindex"),r.classList.add("fp-zone-seconds"),this.append(r,o);e.on(w,()=>{r.innerText=""}),e.on("seek:queued",e=>{const t=e.data;if(!t)return;if("number"!=typeof t.offset)return;const n=t.offset;if(0==n)return this.reset_zone();n>0&&this.classList.contains("fp-right-zone")||n<0&&!this.classList.contains("fp-right-zone")?this.render_zone_state(n):this.reset_zone()}),e.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener("touchend",(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState(ne)||!e.hasState("will-seek")&&!e.hasState(ie)||e.enqueueSeek(5*n)&&(t.stopPropagation(),t.preventDefault())}))}reset_zone(){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText="")}render_zone_state(e){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText=Math.abs(e)+"")}}class FlowplayerError extends FlowplayerComponent{constructor(e){super(e),this.className="fp-error",this.message=document.createElement("p"),this.message.className="error-message",this.append(this.message),this.addEventListener("error",e=>{const t=e.detail;t&&(this.message.textContent=t.formatted_data.message)})}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...n){super(e),this.className=t;const r=e.createComponents(...n);this.append(...r),"fp-left"!==t&&r.forEach(t=>{t.addEventListener(o,()=>e.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-wait"),Array(...Array(4)).map((e,t)=>t).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle-zone");const t=e.createComponents(G,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[B,H].forEach(t=>{const n=me(e,t);n.removeAttribute("tabindex"),this.append(n)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=me(e,q);this.append(t),!n().ios&&this.append(me(e,U)),t instanceof FlowplayerIcon&&t.addEventListener(o,(function(){e.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-header"),this.append(...e.createComponents("flowplayer-header-left-zone","flowplayer-header-right-zone")),e.reaper&&e.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-controls","fp-togglable"),this.append(...e.createComponents("flowplayer-control-buttons",M,D,P,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button")}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",W,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),e.once("beforeplay",()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")})}handleClick(e){[o,i].forEach(t=>this.addEventListener(t,(function(n){if(!(n.defaultPrevented||e.root.classList.contains("is-endscreen")||t===i&&e.root.classList.contains("no-fullscreen")))return n.preventDefault(),e.emit(n.type),!1}))),e.on(o,(function(t){setTimeout((function(){t.defaultPrevented||e.togglePlay()}),0)})),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener("touchend",(function(t){t.cancelable&&!e.hasState("is-endscreen")&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on("touchend",(function(n){setTimeout((function(){if(n.defaultPrevented)return;if(e.ended)return e.togglePlay(!0);const r=e.hasState(Z);t&&clearTimeout(t),(r||e.hasState(ie))&&(e.hasState(ie)&&(e.setState(ie,!1),e.setState("is-hovered",!1)),e.togglePlay(),r)||(e.setState(ie,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState(ie,!1),e.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-ui"),this.append(...e.createComponents(x,F,C))}}return jt.extensions.unshift.apply(jt.extensions,[I18n,yn,ir,class Default{constructor(e){ye(e,R,FlowplayerUi),ye(e,"flowplayer-error",FlowplayerError),ye(e,C,FlowplayerControls),ye(e,M,FlowplayerLiveStatus),ye(e,"flowplayer-control-duration",FlowplayerDuration),ye(e,P,FlowplayerTimelineBar),ye(e,D,FlowplayerElapsedTime),ye(e,U,FlowplayerVolumeBar),ye(e,"flowplayer-volume-control",FlowplayerVolumeControl),ye(e,"flowplayer-control-buttons",FlowplayerControlButtons),ye(e,x,FlowplayerHeader),ye(e,k,FlowplayerLogo),ye(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ye(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left","flowplayer-header-duration")}}),ye(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ye(e,F,FlowplayerMiddle),ye(e,W,FlowplayerMiddleZone),ye(e,G,FlowplayerMiddleWait),ye(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ye(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ye(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ye(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,dr),this.setAttribute("role","button")}}),ye(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,pr),this.setAttribute("role","button")}}),ye(e,B,class extends FlowplayerIcon{constructor(e){super(e,lr),this.setAttribute("role","button")}}),ye(e,H,class extends FlowplayerIcon{constructor(e){super(e,cr),this.setAttribute("role","button")}}),ye(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,sr)}}),ye(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,ar)}}),ye(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,fr)}}),ye(e,j,class extends FlowplayerIcon{constructor(e){super(e,hr)}}),ye(e,q,class extends FlowplayerIcon{constructor(e){super(e,ur),this.classList.add("fp-volumebtn"),this.setAttribute("role","switch"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",e.i18n("core.muted","Muted")),this.setAttribute("aria-checked",t?"true":"false")})}})}init(e,t,n){var r;Cn(e,0,n),Rn(e,t,n),r=n,"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}}]),Object.assign(jt,{ui:Nn,i18n:I18n})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).flowplayer=t()}(this,(function(){"use strict";const e=[],t=[];function n(){const e="undefined"!=typeof document&&"undefined"!=typeof window,t=e?navigator.userAgent:"",n=/iP(hone|od)/i.test(t)&&!/iPad/.test(t)&&!/IEMobile/i.test(t),r=/Android/.test(t)&&!/Firefox/.test(t),o=/^((?!chrome|android).)*safari/i.test(t),i=/chrome|crios/i.test(t)&&!/opr|opera|chromium|edg|ucbrowser|googlebot/i.test(t),s=/firefox|fxios/i.test(t)&&!/seamonkey/i.test(t),a=/edg/i.test(t),l=/opr|opera/i.test(t),c=/SamsungBrowser/.test(t),u=c&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:r,iphone:n,safari:o,edge:a,opera:l,chrome:i,firefox:s,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:c,samsung_tv:c&&u,touch:"ontouchstart"in window,tizen:"tizen"in window,webOS:"webos"in window}}const r="retry",o="click",i="dblclick",s="mouseenter",a="mouseleave",l="mousemove",c="touchmove",u="fullscreenenter",d="fullscreenexit",p="loadedmetadata",f="loadeddata",h="progress",m="loadstart",y="pause",_="playing",v="waiting",g="canplay",E="ended",w="seeked",S="seeking",T="reap",b="landscape",O="portrait",A="recover",N="config",I="content:loadstart";var L=Object.freeze({__proto__:null,MOUNT:"mount",RETRY:r,ERROR:"error",CONTEXT_MENU:"contextmenu",CLICK:o,DBL_CLICK:i,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:s,MOUSE_LEAVE:a,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:l,TOUCH_START:"touchstart",TOUCH_MOVE:c,TOUCH_END:"touchend",TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:u,FULLSCREEN_EXIT:d,FULLSCREEN_CHANGE:"fullscreenchange",METADATA:p,DATA:f,PROGRESS:h,TIME_UPDATE:"timeupdate",LOAD_START:m,VOLUME_CHANGE:"volumechange",PAUSE:y,PLAYING:_,PLAY:"play",WAITING:v,CAN_PLAY:g,ENDED:E,SEEKED:w,SEEKING:S,DURATION_CHANGE:"durationchange",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",REAP:T,QUALITIES:"qualities",VIDEO_TRACKS:"videoTracks",SET_QUALITY:"quality:set",VIDEO_TRACK_SELECT:"tracks:video:select",RECOMMENDATIONS_READY:"recommendationsready",LANDSCAPE:b,PORTRAIT:O,DVR:"dvr",LIVE:"live",RECOVER:A,SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange",WEBKIT_NEEDKEY:"webkitneedkey",RENDER_PLUGIN:"renderplugin",AUDIO_ONLY_SOURCE:"audioonlysource",NON_RECOVERABLE_ERROR:"error:fatal",CONFIG:N,STATE:"state",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",CONTENT_REAL_LOAD_START:I,CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend"});const R="flowplayer-ui",k="flowplayer-logo",C="flowplayer-control",M="flowplayer-live-status",D="flowplayer-elapsed-time",P="flowplayer-timeline-bar",U="flowplayer-volume-bar",x="flowplayer-header",F="flowplayer-middle",W="flowplayer-middle-zone",G="flowplayer-wait",B="flowplayer-play-icon",H="flowplayer-pause-icon",j="flowplayer-rewind-icon",q="flowplayer-volume-icon";var z=Object.freeze({__proto__:null,SUBTITLES_MENU:"flowplayer-subtitles-menu",SHARE_MENU:"flowplayer-share-menu",SPEED_MENU:"flowplayer-speed-menu",QUALITY_MENU:"flowplayer-quality-menu",AUDIO_MENU:"flowplayer-audio-menu",VIDEO_MENU:"flowplayer-video-menu",UI:R,LOGO:k,CONTROL:C,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:M,ELAPSED:D,TIMELINE:P,CHAPTERS_TIMELINE:"flowplayer-chapters-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:U,HEADER:x,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:F,MIDDLE_ZONE:W,WAIT:G,MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",ENDSCREEN_INTERSTITIAL:"flowplayer-endscreen-interstitial",ENDSCREEN_UP_NEXT:"flowplayer-endscreen-up-next",ENDSCREEN_GRID:"flowplayer-endscreen-grid",PLAYLIST_INTERSTITIAL:"flowplayer-playlist-interstitial",AIRPLAY_ICON:"flowplayer-airplay-icon",CHROMECAST_ICON:"flowplayer-chromecast-icon",SMALL_PLAY_ICON:"flowplayer-small-play-icon",SMALL_PAUSE_ICON:"flowplayer-small-pause-icon",PLAY_ICON:B,PAUSE_ICON:H,FULLSCREEN_ENTER_ICON:"flowplayer-fullscreen-enter-icon",FULLSCREEN_EXIT_ICON:"flowplayer-fullscreen-exit-icon",SKIP_NEXT_ICON:"flowplayer-skip-next-icon",SKIP_PREVIOUS_ICON:"flowplayer-skip-previous-icon",FAST_FORWARD_ICON:"flowplayer-fast-forward-icon",REWIND_ICON:j,SHARE_ICON:"flowplayer-share-icon",SUBTITLES_MENU_ICON:"flowplayer-subs-menu-icon",MENU_BACK_ICON:"flowplayer-menu-back",VOLUME_ICON:q,MUTE_ICON:"flowplayer-mute-icon",UNMUTE_ICON:"flowplayer-unmute-icon",CLOSE_ICON:"flowplayer-close-icon",FACEBOOK_ICON:"flowplayer-facebook-icon",TWITTER_ICON:"flowplayer-twitter-icon",LINK_ICON:"flowplayer-link-icon",EMBED_ICON:"flowplayer-embed-icon",LIVE_COUNTDOWN:"flowplayer-live-countdown",PLAYLIST_CONTROLS:"flowplayer-playlist-controls",THUMBNAILS_CAROUSEL:"flowplayer-thumbnails-carousel",ERROR_COMPONENT:"flowplayer-error",TV_MENU:"flowplayer-tv-menu",CUE_COMPONENT:"flowplayer-cue",SSAI_UI:"flowplayer-ssai-ui",SSAI_CONTROLS:"flowplayer-ssai-controls",SSAI_TIMELINE:"flowplayer-ssai-timeline",SSAI_INDICATOR:"flowplayer-ssai-indicator"});const V="is-playing",K="is-paused",Y="is-loaded",X="is-loading",Z="is-starting",Q="is-seeking",J="is-ended",$="is-live",ee="is-waiting",te="is-live-seeked",ne="no-timeline",re="will-play",oe="will-pause",ie="is-touched",se="is-in-viewport",ae="is-source-processing";var le=Object.freeze({__proto__:null,PLAYING:V,FULLSCREEN:"is-fullscreen",PAUSED:K,MUTED:"is-muted",LOADED:Y,LOADING:X,STARTING:Z,SEEKING:Q,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",TV:"is-tv",ENDED:J,LIVE:$,ERRORED:"is-error",WAITING:ee,AUTOPLAY:"is-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:te,NO_DVR:ne,HAS_POSTER:"has-poster",WILL_PLAY:re,WILL_PAUSE:oe,MENU_OPENED:"has-menu-opened",TOUCHED:ie,HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:se,NO_CONTROLS:"no-controls",DESTROYED:"is-destroyed",IS_SOURCE_PROCESSING:ae});function ce(e){this.message=e}ce.prototype=new Error,ce.prototype.name="InvalidCharacterError";var ue="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new ce("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,s="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?s+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};var de=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(ue(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return ue(t)}};function pe(e){this.message=e}pe.prototype=new Error,pe.prototype.name="InvalidTokenError";var fe=function(e,t){if("string"!=typeof e)throw new pe("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(de(e.split(".")[n]))}catch(e){throw new pe("Invalid token specified: "+e.message)}};fe.InvalidTokenError=pe;const he=new Map,me=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const r=window.customElements.get(t);if(!r)throw new Error(`no default flowplayer component with the name ${t} exists`);const o=window.customElements.get(n);return"function"!=typeof o?r:o})(e._customElements,t))(e),ye=(e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)};var _e,ve;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(_e||(_e={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(ve||(ve={}));const ge=e=>{return e.autoplay&&ve.AUDIO_REQUIRED&(!0===(t=e.autoplay)?ve.ON:!1===t?ve.OFF:t);var t};function Ee(e,t,n){const r="boolean"==typeof n;if("boolean"!=typeof n&&(n=!!e.hasState(oe)||e.paused),function(e,t,n){const r=e.poll(t?"beforeplay":"beforepause",{forced:n});return r&&r.defaultPrevented}(e,n,r))return Promise.resolve();if(!n)return e.hasState(re)?(e.setState(oe,!0),e.setState(re,!1),Promise.resolve()):Promise.resolve(e.pause());if(0==e.reaper)return Promise.resolve();const o=e.reaper.get("__pending_play");return e.paused||o?o?(o.src!==Se(e.original_src)&&we(e),o):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==Se(e.original_src)}(e)&&we(e),function(e){const t=e.hasState("is-autoplay"),n=t&&ge(e.opts);n&&(e.muted&&e.toggleMute(!1),0==e.volume&&(e.volume=1));t&&e.setState("is-autoplay",!1);return e.play().then(()=>{e.hasState(oe)&&e.togglePlay(!1)}).catch(r=>{if(console.warn(t?n?"[flowplayer/play] autoplay audio required\n%s":"[flowplayer/play] attempting muted autoplay\n%s":"",r.message,"\ninstance:",e),t&&!n)return e.muted=!0,e.play()})}(e)):(e.setState(oe,!1),!e.hasState(V)&&e.setState(re,!0),Promise.resolve())}function we(e){e.opts.is_native&&(e.hasState(Y)||(e.hasState(X)||e.emit(I),e.setState(X,!0),e.load()))}function Se(e){const t=document.createElement("a");return t.href=e,t.href}function Te(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function be(e){const t=document.createElement("a");t.href=e;const n=t.pathname&&t.pathname.split(".");return n.length>1&&n[n.length-1]}function Oe(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const Ae=e=>{var{src:t}=e,n=Te(e,["src"]);return[Object.assign({src:t,type:t?Oe("video/"+be(t)):""},n)]};function Ne(e){return Ae({src:e})}function Ie(e){var{src:t,type:n}=e,r=Te(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:Ae(Object.assign({src:t},r))}var Le;function Re(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?Ne(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=Ne(t)),"object"!=typeof t||Array.isArray(t)||(t=Ie(t)),e.concat(t)}),[]):Ie(e)}(n);return function(e){[Q,oe,re,V,K,X,Y,te].forEach(t=>e.setState(t,!1)),e.setState(Z,!0)}(e),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(Le.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const r=function(e,t,n){return e.plugins.filter(e=>{return(t=e)&&"wants"in t;var t}).find(e=>e.wants(n.src||"",n,t))}(e,t,n);return e.setOpts({is_native:!r}),r?(r.onload(t,e.root,e,n),Le.Ok):Le.Err}(e,t,i)||Le.Ok==function(e,t,n,r={safari:!1}){var o;/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return Le.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return Le.Err;"string"==typeof n.src&&(e.preload=null!==(o=t.preload)&&void 0!==o?o:"auto",e.src=n.src);return Le.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Le||(Le={}));const ke=[T,S,"src","seek:cancel"];var Ce;function Me(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?De(e,t):(t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){0!=e.reaper&&(e.currentTime=function(e,t,n=0){return Math.max(Math.min(t,e),n)}(e.currentTime+t.offset,e.duration),t.timer=0,De(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Ce.BACKWARD,t.offset<0),e.setState(Ce.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function De(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Ce.FORWARD,!1),e.setState(Ce.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Pe(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function Ue(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function xe(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Fe(e,t,n){const r=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;r.length;){if(null==e)return n;const t=r.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}function We(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Ge(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const n=Math.floor(e/3600);let r=Math.floor(e/60);return e-=60*r,n>=1?(r-=60*n,t+n+":"+We(r)+":"+We(e)):t+We(r)+":"+We(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Ce||(Ce={}));const Be=navigator.languages||[navigator.language];function He(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return Be.reduce((e,t)=>~t.indexOf("-")?e.concat(t,t.split("-")[0]):e.concat(t),[])}catch(e){return[]}}().forEach((function(t){e[t]&&!r[t]&&(r[t]=e[t])})),Object.values(r)}const je=[1e7]+""+-1e3+-4e3+-8e3+-1e11,qe=()=>"undefined"==typeof crypto?"":je.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let ze="";!function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}}();const Ve=["touchstart","touchmove"];function Ke(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Ye(e,t,n){const r=Ke(t,n);return e.dispatchEvent(r),e}function Xe(e,t,n){const r=Ke(t,n);return e.dispatchEvent(r),r}function Ze(e,t,n,r){Array.isArray(t)?t.forEach(t=>Qe(e,t,n,r)):Qe(e,t,n,r)}function Qe(e,t,n,r){if(o=t,!~Ve.indexOf(o))return e.addEventListener(t,n,r),e;var o;const i=Object.assign(r||{},{passive:!0});return e.addEventListener(t,n,i),e}function Je(e,t,n,r){return Ze(e,t,n,Object.assign(r||{},{once:!0}))}class PlayerStorage{constructor(e,t){this.implementation=e,t&&t.keys().forEach(e=>{"string"==typeof t.implementation[e]&&this.implementation.setItem(e,t.implementation[e])})}keys(){var e;const t=[];for(var n=0;n<this.implementation.length;n++)(null===(e=this.implementation.key(n))||void 0===e?void 0:e.startsWith("flowplayer/"))&&t.push(this.implementation.key(n));return t}removeItem(e){try{this.implementation.removeItem("flowplayer/"+e)}catch(e){}}getItem(e){try{return this.implementation.getItem("flowplayer/"+e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem("flowplayer/"+e,t)}catch(e){}}clear(){try{this.keys().forEach(e=>this.implementation.removeItem(e))}catch(e){}}get length(){try{return this.keys().length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}class InMemoryStorage{constructor(){this.pairs=[]}get length(){return this.pairs.length}clear(){this.pairs=[]}getItem(e){var t;return(null===(t=this.pairs.find(t=>t[0]===e))||void 0===t?void 0:t[1])||null}key(e){return this.pairs[e][0]||null}removeItem(e){this.pairs=this.pairs.filter(t=>t[0]!==e)}setItem(e,t){this.removeItem(e),this.pairs.push([e,t])}}const $e={preload:"auto",rtl:!1,controls:!0},et=["loop","muted","preload"];function tt(e,r,o){let i;o.live_state={dvr_window:void 0,get dvr(){return i},set dvr(t){i=t;const n=!(!e.live||t);o.hasState(ne)!=n&&o.setState(ne,n)}},o._storage=new PlayerStorage(["localStorage","sessionStorage"].map(e=>{try{const t=window[e];return t.getItem(""),t}catch(t){return console.debug(`Access to window.${e} denied, trying next option`),null}}).find(e=>!!e)||new InMemoryStorage),o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return Re(o,e,t,n())},o.playerState=o.playerState||{},o.setState=function(e,t){if(o.playerState[e]===!!t)return o;const n=Object.assign({},o.playerState,{[e]:t});return o.playerState=n,Ye(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>me(this,e[n]))},o.hasState=function(e){return!!o.playerState[e]},o.transitionState=function(e,t,n){!o.hasState(e)&&o.hasState(t)||(n=0),n&&o.setState("is-toggling",!0),o.setState(t,!1),o.setState(e,!0),n&&setTimeout((function(){o.setState("is-toggling",!1)}),n)},o.emit=(e,t)=>(Ye(o,e,t),o),o.on=(e,t)=>(Ze(o,e,t),o),o.once=(e,t)=>(Je(o,e,t),o),o.off=(e,t)=>{var n,r;return n=e,r=t,o.removeEventListener(n,r),o},o.poll=(e,t)=>Xe(o,e,t),o.togglePlay=function(e){return Ee(o,0,e)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Ye(o,"volumechange")},o.toggleDisable=function(e){e=null==e?!o.disabled:!!e,o.setState("is-disabled",e),o.disabled=e},o.destroy=function(){o.pause();const e=t.indexOf(o);~e&&t.splice(e,1),setTimeout((function(){o.setSrc([]),o.reaper&&o.reaper.clear(),Ye(o,T),o.setState("is-destroyed",!0)}),0)},o.setAttrs=function(e){return et.forEach(t=>{if(!(t in e))return;const n=e[t];n?o.setAttribute(t,n.toString()):o.removeAttribute(t)}),o},o.opt=function(t,n){return n=void 0===n?Fe($e,t):n,Fe(e,t,n)},o.i18n=function(e,t){if(!o.reaper)return"";const n=o.reaper.get("translations");return n?function e(t,n,r,o){return(o=o||0)>=t.length?r:Fe(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),e.live&&!o.hasState($)&&(o.setState(ne,!0),Ye(o,"live")),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted),"dvr"in e&&(o.live_state.dvr=o.opt("dvr")),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Ue();const t=e.getAttribute("dir");return t?"rtl"==t:Ue()}(r))),o.setState($,!!e.live),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),o.setState("no-controls",0==e.controls),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Ye(o,N,e)},o.renderPlugin=function(e){Xe(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const s={offset:0,timer:0};var a,l;l=s,(a=o).on(ke,(function(){De(a,l)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return Me(o,s,e)},o.deviceId=function(){return function(e){if(ze)return ze;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=qe();return e.setItem("flowplayer/uuid",n),n}catch(e){return ze=qe()}}(o._storage)}}function nt(e,t){const n=t.querySelector("video"),r=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return r.classList.add("fp-engine"),r.playsInline=!0,n||t.append(r),r}var rt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function ot(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const n=e.flowplayer;return"function"==typeof n?(n(t),t):(Array.isArray(n.extensions)||(n.extensions=[]),~n.extensions.indexOf(t)||n.extensions.push(t),t)}function it(){return"undefined"!=typeof window?window:void 0!==rt?rt:{}}const st=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function at(e,t){return!!~st.indexOf(e)||e.indexOf(t)===e.length-t.length}at.check_whitelist=function(e){return!!~st.indexOf(e)};const lt="production";function ct(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=fe(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(r.c),n.exp=r.exp,t.require_valid_token&&ct.validate(n),n}function ut(e){try{return ct.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var dt;function pt(e){return{grant:e,is_granted:t=>(e&t)===t}}function ft({root:e,video:t,data:n}){t&&t.destroy(),console.error(new Error(n.details||n.reason)),e.innerHTML="",e.classList.remove("flowplayer"),e.classList.add("flowplayer-fatal"),e.style.removeProperty("background-image");const r=document.createElement("h2");r.textContent="Playback Error";const o=document.createElement("p");o.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://docs.flowplayer.com/troubleshooting/player#"+n.reason,i.textContent="Troubleshoot?";const s=document.createElement("img");s.src="https://flowplayer.com/user/pages/images/logo-white.png",e.append(r,o,i,s)}ct.validate=function(e){if("string"==typeof e&&(e=ct(e)),!e||!e.raw){if(at.check_whitelist(window.location.hostname)||"dev"===lt.toString())return!0;throw new Error("No token provided in configuration")}if(!e.valid_jwt)throw new Error("Invalid token provided");const t=window.location.hostname,n=at.bind(null,t);if("dev"!==lt.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==lt.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},ct.id=function(e){if(e)return"string"==typeof e&&(e=ct(e)),e.data.id},function(e){e[e.ADS=2]="ADS",e[e.ANALYTICS=4]="ANALYTICS",e[e.NO_METERING=8]="NO_METERING",e[e.DEVELOPER_PLAN=16]="DEVELOPER_PLAN",e[e.WOWZA_VIDEO=32]="WOWZA_VIDEO"}(dt||(dt={})),pt.of=pt,pt.from_token=function(e){const t=ct(e,{require_valid_token:!0});return pt.of(t.data.acl)},pt.permissions=dt;function ht(e,t){if(!e.parentElement)return;const n=e.clientWidth/e.parentElement.clientWidth*100/2;e.style.left=t-n+"%",e.style.display="block"}function mt(e,t){if(isNaN(e.duration))return;const n=e.buffered;n.length&&(t.style.width=Math.min(n.end(n.length-1)/e.duration*100,100)+"%")}function yt(e,t){e.style.width="0",t.style.display="none"}function _t(e,t){const n=e.seekable;if("object"!=typeof e.opts||0==n.length)return{head:0,tail:0};const r=Et(e),o=t||e.live_state.dvr_window;return{head:r,tail:"number"!=typeof o||r-o<0?n.start(0):r-o}}function vt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function gt(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:_t(e).head}function Et(e){var t;const n=e.seekable;return n.length?e.hasState("is-chromecast-playing")||!(null===(t=e.hls)||void 0===t?void 0:t.liveSyncPosition)?n.end(n.length-1):e.hls.liveSyncPosition:0}function wt(e,t,n){if(!t.seekable||0==t.seekable.length)return;ht(n,e);const r=_t(t),o=(100-Math.max(0,Math.min(e,100)))/100*(r.head-r.tail);n.innerText="-"+Ge(o)}function St(e){e.currentTime=_t(e).tail}function Tt(e){try{e.dvr_offset=0,e.currentTime=Et(e)}catch(e){console.warn("failed to seek to now: %j",e)}}function bt(e,t){e/=100,t.currentTime=function(e,t){if(t>1||t<0)return console.warn("cannot calculate a percent outside of range(0..1)"),0;const n=_t(e);return n.tail+t*(n.head-n.tail)}(t,e)}function Ot(e,t){e.style.width="0",t.style.display="none"}function At(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function Nt(e,t,n){let r=!0;t.classList.add("flowplayer"),At(0,t),Ze(n,m,()=>{if(!n.hasState(X)&&!n.hasState(Y)&&e.is_native&&"none"!==e.preload)return"metadata"===e.preload?(n.setState(X,!0),n.emit(I)):void we(n)}),Ze(n,p,()=>{e.is_native&&"metadata"===e.preload&&n.paused&&n.emit(g)}),Ze(n,[m,"resize"],(function(){At(0,t)})),Ze(n,"state",(function(){Object.entries(n.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),Ze(n,"timeupdate",(function(){n.setState(ee,!n.hasState("is-casting")&&!n.hasState(Z)&&n.readyState<3)})),Ze(n,E,(function(t){setTimeout((function(){if(!t.defaultPrevented){if(e.rewind&&!n.loop){const e=n.src;n.setState(Q,!0),Je(n,w,(function(){e===n.src&&(n.setState(Q,!1),n.pause(),n.setState(Z,!0))})),n.currentTime=0}Je(n,"timeupdate",(function(){n.setState(J,!1)})),n.transitionState(J,V,e.loop||e.rewind?0:300)}}),0)})),Ze(n,[S,w],(function(e){n.setState(Q,e.type==S)})),Ze(n,"remotesession:ended",(function(e){setTimeout(()=>{e.defaultPrevented||(n.currentTime=e.detail.currentTime)},0)})),Ze(n,E,(function(){n.setState(V,!1),r=!0})),Ze(n,h,()=>{if(!n.opts.live||!n.opts.is_native)return;const e=n.seekable;0!=e.length&&n.emit("dvr/window",e.end(e.length-1)-e.start(0))}),Ze(n,f,(function(){var e,t;n.setState(Y,!0),n.setState(X,!1);const r=n;0===(null===(e=r.videoTracks)||void 0===e?void 0:e.length)&&(null===(t=r.audioTracks)||void 0===t?void 0:t.length)>0&&n.emit("audioonlysource")})),Ze(n,"play",()=>{n.setState(re,!0)}),Ze(n,[v,g,m],(function(t){if(!n.hasState(Q)&&(t.type!=g||e.autoplay||n.setState(ee,!1),t.type!=m||"none"!=n.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return Je(n,_,(function(){n.setState(ee,!1)}));t.type!=v||n.hasState(Y)||n.setState(X,!0),n.setState(J,!1),n.setState(ee,t.type==v)}})),Ze(n,[_,y],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:n});document.dispatchEvent(e)},0);const o=t.type==_,i=n.currentTime==n.duration,s=o&&r&&e.autoplay||n.hasState(ee);if(o&&(n.started=!0,r=!1),n.setState(ee,!1).setState(re,!1),!o&&n.setState(oe,!1),i)return;const a=o?V:K,l=o?K:V;n.transitionState(a,l,s?0:300),!n.hasState(Z)||n.root.classList.contains("ad-hide-first-frame")||n.root.classList.contains("preroll-ios")||function(e,t){if(!e.hasState($)||![void 0,0,-1].includes(t)||!e.seekable.length||e.hasState("has-casted"))return e.setState(Z,!1);e.once(w,()=>e.setState(Z,!1)),0===t?St(e):Tt(e)}(n,e.start_time)}))}const It=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function Lt(e,t,n){if(!window.IntersectionObserver)return;const r={should_resume:!!e.autoplay,locked:!1};Ze(n,"play",(function(){r.locked||(r.should_resume=!0)}));const o=()=>{if(!e.autoplay)return;if(n.hasState(se)&&r.should_resume)return n.togglePlay(!0);const t=n.currentSrc;e.autopause||n.hasState(se)||!r.should_resume||Je(n,"viewenter",()=>{e.autoplay&&r.should_resume&&t===n.currentSrc&&n.togglePlay(!0)})},i=()=>{if(!e.autoplay)return;if(!e.is_native)return;if("auto"===e.preload)return;if(n.hasState(se))return we(n);const t=n.currentSrc;Je(n,"viewenter",()=>{t!==n.currentSrc||n.readyState>1||!n.paused||we(n)})};Ze(n,"src",(function(){r.should_resume=!!e.autoplay,n.off(m,i),n.once(m,i),n.off(g,o),n.once(g,o)})),Ze(n,y,(function(){r.locked||(r.should_resume=!1)}));const s=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,r=n.hasState(se);if(n.setState(se,t>=.2),n.emit("intersectionchange",{ratio:t}),r===n.hasState(se))return;const o=n.hasState(se)?"viewenter":"viewleave";n.emit(o)},0)})},{threshold:It});s.observe(t),n.on(T,()=>s.disconnect()),Ze(n,"viewenter",(function(){!r.should_resume||!e.autopause||Rt()||n.opts.autoplay&&!n.readyState||n.togglePlay(!0)})),Ze(n,"viewleave",(function(){if(!e.autopause||Rt())return;const t=!n.paused;r.locked=!0,n.pause(),setTimeout((function(){r.should_resume=t,r.locked=!1}),0)}))}function Rt(){return t.find(e=>e.hasState("is-casting"))}function kt(e,t){if(!window.ResizeObserver)return;const n=new ResizeObserver(e=>{const n=e[e.length-1];t.emit("resize",n)});n.observe(e),t.on(T,()=>n.disconnect())}function Ct(e){if("number"==typeof e&&!isNaN(e))return Number(e);if("string"==typeof e){const t=e.split(":");return Number(t[1])/Number(t[0])}return e}function Mt(e,t,n){const r=!!e.ratio,o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let i=Ct(e.ratio||.5625);o.style.paddingTop=100*i+"%";const s=[f,p];n.on(s,(function(){if(r)return;const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(N,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,r=Ct((null==e?void 0:e.ratio)||t||.5625);i!==r&&(i=r,o.style.paddingTop=100*r+"%")}))}class ExplorerPlan{constructor(){this.cleanUp=this.cleanUp.bind(this),this.render=this.render.bind(this),this.wireUp=this.wireUp.bind(this)}init(e,t,n){this.root=t,this.player=n,this.wireUp()}wireUp(){var e,t;this.cleanUp(),null===(e=this.player)||void 0===e||e.once(_,this.render),null===(t=this.player)||void 0===t||t.once(E,this.wireUp)}cleanUp(){var e,t,n,r;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo),null===(n=this.player)||void 0===n||n.off(_,this.render),null===(r=this.player)||void 0===r||r.off(E,this.wireUp)}render(){var e,t,n;null===(t=null===(e=this._logo)||void 0===e?void 0:e.parentElement)||void 0===t||t.removeChild(this._logo);const r=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!r)return;const o=this._logo=document.createElement("a");o.href="https://explorer.flowplayer.com",o.target="_blank",Object.entries(Dt).forEach(([e,t])=>{o.style.setProperty(e,t,"important")}),r.appendChild(o)}}const Dt={display:"block",opacity:"1",visibility:"visible",width:"33%","padding-top":"9%",position:"absolute","z-index":"9999",bottom:"25%",left:"10%","background-size":"cover","background-image":"url(https://static.flowplayer.com/explorer/explorer.svg)"},Pt="flowplayer/"+_;function Ut(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(T,()=>document.removeEventListener(Pt,t)),document.addEventListener(Pt,t)}function xt(e,t){const n=[];e.addEventListener("contextmenu",r=>{const o=r.timeStamp;for(n.push(o);n.length>3;)n.shift();n.length>=3&&n.every(e=>e-o<3e3)&&(console.debug("flowplayer/debug rendering info"),function(e,t){var n;!function(e){const t=e.querySelector(".debug-info");null==t||t.remove()}(e);const r=document.createElement("div");r.classList.add("debug-info");const o=Ft("flowplayer.version","3.17.1");r.append(o);const i=null===(n=null==t?void 0:t.hls)||void 0===n?void 0:n.constructor;if(i&&i.version){const e=Ft("hls.version",i.version);r.append(e)}e.appendChild(r)}(e,t))})}const Ft=(e,t)=>{const n=document.createElement("div");n.classList.add("row",e);const r=document.createElement("span");r.classList.add("attr"),r.textContent=e;const o=document.createElement("span");return o.textContent=t,o.classList.add("value"),n.append(r,o),n};function Wt(e,t){const n=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),r=(r,...o)=>{try{const i=(null==t?void 0:t.debug)||n;i&&e.match(i)&&console.log(`flowplayer/${e} -- ${r}`,...o)}catch(e){console.warn(e)}};return r.log=r,r}const Gt=Wt("core/retry");function Bt(e,t){const n={pending:void 0,count:0};var o;e.on("error",o=>{t.retry&&void 0===n.pending&&(++n.count,n.pending=function(e,t){return setTimeout(()=>{e.hasState("is-destroyed")||(t.pending=void 0,[A,r].forEach(t=>e.emit(t)),Gt("%s try",t.count))},3e3*t.count)}(e,n))}),e.on(_,()=>{n.count=0}),e.on(["src",A],()=>{n.pending&&(clearTimeout(n.pending),n.pending=void 0)}),e.on(r,(o=t=>{t.defaultPrevented||e.load()},e=>{setTimeout((function(){if(!e.defaultPrevented)return o(e)}),0)}))}const Ht=function(){const e=it(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function jt(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),jt;"string"==typeof r&&(r={src:r}),r||(r={}),r.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(r.token=window.__FLOWPLAYER_TOKEN);const o="string"==typeof n?document.querySelector(n):n;if(!o)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const i=o.querySelector("video.fp-engine");if(i)return i;const s=ut(r.token);if(!s.success)return ft({root:o,data:{reason:"token",details:s.message}});const a=new Map,l=nt(r,o);l.reaper=a,l._customElements=he,Object.defineProperty(l,"token",{value:"string"==typeof r.token?ct.id(r.token):"",writable:!1}),l.addEventListener(T,()=>{a.clear(),l.reaper=0,delete l.root}),l.root=o,r.token&&pt.from_token(r.token).is_granted(pt.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),tt(r,o,l),l.setAttrs(r),l.plugins=jt.extensions.map(e=>new e(jt,l)),Nt(r,o,l),Lt(r,o,l),kt(o,l),Mt(r,o,l),Ut(l),xt(o,l),Bt(l,r),l.plugins.forEach(e=>{try{e.init(r,o,l)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),l.setOpts(r),l.opts=r,r.src&&l.setSrc(r.src);const c=l.readyState;return c>0&&l.currentSrc&&l.emit(p),c>2&&l.currentSrc&&l.emit(g),l.emit("mount"),l.on("error:fatal",(function(e){ft({root:o,video:l,data:e.data||{}})})),setTimeout(Ye,0,document,"flowplayer:player:created",l),l}Object.assign(jt,Ht),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.customElements=he,r.defaultElements=z,r.version="3.17.1",r.commit="a470c80308623312bd4a81d3ff6897ca77b160a0",r.instances=t,r.extensions=e,r.support=n,r.events=L,r.states=le,r.jwt=fe,r.autoplay=ve,r.quality=_e}(jt),"object"==typeof document&&setTimeout(Ye,0,document,"flowplayer:umd",jt);var qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function zt(e){var t={exports:{}};return e(t,t.exports),t.exports}var Vt=zt((function(e,t){var n=qt&&qt.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.__esModule=!0,t.remove=t.downcase=t.pluck=t.merge=void 0,t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return n(n({},e),t)}),{})},t.pluck=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Object.keys(e).filter((function(e){return~n.indexOf(e)})).reduce((function(n,r){var o;return t.merge(n,((o={})[r]=e[r],o))}),{})},t.downcase=function(e){return(e||"").toString().toLowerCase()},t.remove=function(e,t){var n=e.lastIndexOf(t);return~n&&e.splice(n,1),e}})),Kt=zt((function(e,t){var n=qt&&qt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t};t.__esModule=!0;var i=o(Vt),s=function(){function e(){this.pending=[],this.open=[],this.stats={failures:0,ttl:0}}return e.of=function(){return new e},e.is_empty=function(e){return 0==e.pending.length},e.is_high_water=function(t){return t.open.length==e.MAX_OPEN_REQUESTS},e.maybe_spawn_req=function(t){if(e.is_empty(t))return t;if(e.is_high_water(t))return t;try{var n=e.lpop(t);n&&e.request(t,n)}catch(e){}},e.increment_failures=function(t){return t.stats.failures++,t.stats.failures>e.MAX_FAILURE_COUNT&&(t.stats.ttl=Date.now()+e.REQUEST_TTL_MS),t},e.handle_error=function(t,n){e.rm(t,n),e.increment_failures(t)},e.request=function(t,n){var r=n[0],o=n[1],i=n[2];if(!(Date.now()<t.stats.ttl)){var s=new XMLHttpRequest;t.open.push(s),s.timeout=e.REQUEST_TIMEOUT_MS,s.ontimeout=function(){e.handle_error(t,s)},s.onerror=function(n){e.handle_error(t,s)},s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&e.rm(t,s),Math.floor(s.status/100)},s.onload=function(){e.rm(t,s),t.stats.failures&&t.stats.failures--},s.open(o,r),s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");try{s.send(JSON.stringify(i))}catch(e){}}},e.rpush=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return n.forEach((function(n){t.pending.length>=e.MAX_PENDING||(t.pending.push(n),e.maybe_spawn_req(t))})),t},e.lpop=function(e){return e.pending.shift()},e.rm=function(e,t){return i.remove(e.open,t),e},e.MAX_OPEN_REQUESTS=3,e.MAX_PENDING=5,e.REQUEST_TIMEOUT_MS=4e3,e.REQUEST_TTL_MS=5e3,e.MAX_FAILURE_COUNT=3,e}();t.default=s})),Yt=zt((function(e,t){var n=qt&&qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(Kt);t.default=r.default.of()})),Xt=zt((function(e,t){t.__esModule=!0,t.prepare_url=t.URL_PARAM=void 0,t.URL_PARAM=/:([a-zA-Z_]+)/g,t.prepare_url=function(e,n){return e.url.replace(t.URL_PARAM,(function(t){if((t=t.slice(1,t.length))in n)return n[t].toString();e.log.error(new Error("\n preparing url["+e.url+"] failed\n \n parameter["+t+"] not detected in params:\n \n "+JSON.stringify(n,null,2)+"\n "))}))}})),Zt=zt((function(e,t){t.__esModule=!0,t.Log=void 0;var n=function(){function e(e){this.emitter=e}return e.prepare=function(e,t){var n=document.createEvent("Event");return n.initEvent(e,!1,!0),n.ns=e,n.data=t,n},e.of=function(t){return new e(t)},e.prototype.info=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.INFO,t))},e.prototype.error=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.ERROR,t))},e.prototype.warn=function(t){this.emitter.dispatchEvent(e.prepare(e.NAMESPACE.WARN,t))},e.NAMESPACE={INFO:"tracker:info",ERROR:"tracker:err",WARN:"tracker:warn"},e}();t.Log=n})),Qt=zt((function(e,t){var n;t.__esModule=!0,t.Verb=void 0,(n=t.Verb||(t.Verb={})).POST="POST",n.PUT="PUT",n.GET="GET"})),Jt=zt((function(e,t){var n=qt&&qt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=qt&&qt.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},s=qt&&qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=s(Yt),l=s(Kt),c=o(Xt),u=o(Vt),d=function(){function e(t,n){var r=this;void 0===n&&(n={});var o=this;if(this.emitter=t,this.url=n.url,this.log=Zt.Log.of(this.emitter),this.verb=n.verb,this.metadata=u.merge({},n.metadata||{}),this.rq=n.rq||a.default,this.events=n.events||[],this.required_keys=n.required_keys||[],this.optional_keys=n.optional_keys||[],this.listeners=[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),e.assert_emitter_api(this.emitter),void 0===e.verb[this.verb])throw new Error("invalid HTTP verb["+this.verb+"] passed");if("string"!=typeof this.url)throw new Error("invalid API url["+this.url+"] passed");e.TRACKERS.push(this),o.events.forEach((function(t){e.create_listener(r,t,(function(n){void 0===n&&(n={});var i=u.merge(o.metadata,{event_type:t},n.data||n),s=c.prepare_url(o,i),a=e.pluck_valid_keys(o,i),d=e.ensure_required_keys(o,a);if(d.length)return o.log.error("Tracker.validate_metadata() failed for \n Event["+t+"]\n missing keys: "+d+"\n payload:\n "+JSON.stringify(a,null,2));l.default.rpush(r.rq,[s,r.verb,a])}))}))}return e.of=function(t,n){return new e(t,n)},e.ensure_required_keys=function(e,t){return e.required_keys.filter((function(e){return!(e in t)}))},e.pluck_valid_keys=function(e,t){return u.pluck.apply(u,i([t],e.valid_keys))},e.merge_metadata=function(t,n){return void 0===n&&(n={}),t.metadata=e.pluck_valid_keys(t,u.merge(t.metadata,n)),t},e.assert_emitter_api=function(e){if("function"!=typeof(e||{}).addEventListener)throw new Error("Tracker() received an emitter that does not implement the addEventListener method");if("function"!=typeof(e||{}).removeEventListener)throw new Error("Tracker() received an emitter that does not implement the removeEventListener method")},e.create_listener=function(e,t,n){e.listeners.push([t,n]),e.emitter.addEventListener(t,n)},e.prototype.destroy=function(){var t=this;this.listeners.forEach((function(e){var n=e[0],r=e[1];return t.emitter.removeEventListener(n,r)})),delete this.rq,delete this.emitter,u.remove(e.TRACKERS,this)},e.prototype.put=function(t){return void 0===t&&(t={}),e.merge_metadata(this,t),this},e.TRACKERS=[],e.QUEUE=a.default,e.verb=Qt.Verb,e}();t.default=d})),$t=zt((function(e,t){var n=qt&&qt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.hasOwnProperty.call(e,o)&&n(t,e,o);return r(t,e),t},i=qt&&qt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=i(Jt);t.Tracker=s.default;var a=o(Xt);t.API=a})),en="ping",tn="display",nn="view";const rn=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],on=["created","position"],sn=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function an(e,t){return e.duration/1===e.duration&&Object.assign(t,function(e){const t=e/100;return{segment_duration:t,breakpoints:Array(...Array(100)).map((function(e,n){return Math.floor(n*t*1e3)/1e3}))}}(e.duration))}function ln(e,t,n){if(!t.segment_duration&&!an(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:cn(e,t);return t.last_idx=o,o<=r?[]:t.breakpoints.slice(r,99==o?100:o).map((function(e){return t.breakpoints.indexOf(e)}))}(e,t,n);0!=r.length&&e.emit(en,{position:r})}function cn(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}function un(){try{const e=window.location!==window.parent.location?document.referrer:document.location.href;return"string"==typeof e&&e.slice(0,200)}catch(e){return!1}}const dn="vod",pn="live",fn=[tn,en,nn];function hn(e,t,n){switch(null==t?void 0:t.kind){case"live":return function(e,t){const n=Date.now();n-t.last_tracked_ts<6e4||(t.last_tracked_ts=n,++t.ticks,e.emit(en,{position:60*t.ticks}))}(e,t);case"vod":return ln(e,t,"boolean"==typeof n&&n)}}function mn(e){const t=e.ads;return void 0!==t&&(void 0!==t.schedule&&("function"==typeof t.hasPreroll&&(t.currentRequests?t.currentRequests:!!t.adPlaying||!(!t.hasPreroll()||0!=t.nextIndex))))}const yn=ot(it(),class Analytics{init(e,t,n){if(!pt.from_token(e.token||"").is_granted(pt.permissions.ANALYTICS))return;if(n.hasState("consent-no-tracking"))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{hn(n,r.ticker)}};const i={session_id:n.deviceId(),autoplay:n.autoplay,muted:n.muted,player_id:e.player_id,customer_user_id:e.customer_user_id,player_version:"3.17.1"},s=$t.Tracker.of(n,{verb:$t.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:fn,required_keys:rn,optional_keys:sn.concat(on).slice(0),metadata:i});n.on(T,(function(){s&&s.destroy()})),n.on(N,(function(t){if(!s)return;const o=Fe(t,"data.metadata",{});if(!o.media_id)return;const i=Fe(s,"metadata.media_id");if(i&&o.media_id==i)return;const a=Fe(e,"analytics",{});s.put(o),s.put(a);const l=Fe(e,"metadata.live_start_time",e.live)?pn:dn;s.put({video_type:l,source:e.source||un()||""}),r.ticker=e.live?{ticks:0,last_tracked_ts:Date.now(),kind:"live"}:{last_idx:0,segment_duration:0,breakpoints:[],kind:"vod"},r.ended=!1,n.emit(tn)}));let a=0;n.on(_,(function(){if(!s)return;if(a||function(e,t){return e.metadata.media_id&&e.metadata.media_id==t.last_media_id}(s,r))return;s.put({muted:n.muted});const e=mn(n);if(e)return a=Promise.resolve(e).then((function(){r.last_media_id=s.metadata.media_id,n.emit(nn),a=0})).catch((function(){a=0}));r.last_media_id=s.metadata.media_id,n.emit(nn)})),n.on("timeupdate",(function(){var t;s&&(a||mn(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&hn(n,r.ticker,!0),(t=o).locked||(t.locked=setTimeout((function(){return t.task(),function(e){return e.locked=!1,e}(t)}),t.ttl))))})),n.on(w,(function(){s&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){an(e,t),t.last_idx=cn(e,t)}(n,r.ticker)})),n.on(E,(function(){s&&function(e,t){t.ended||(t.ended=!0,hn(e,t.ticker))}(n,r)}))}});var _n;function vn(e){switch(e){case _n.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case _n.MEDIA_ERR_NETWORK:return"a network error occurred";case _n.MEDIA_ERR_DECODE:return"unable to decode media content";case _n.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case _n.NO_INTERNET:return"no internet connection detected";case _n.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function gn(){}function En(e){try{return!!new URL(e)}catch(e){return!1}}"undefined"!=typeof window&&window.matchMedia&&[b,O].forEach((function(e){window.matchMedia("(orientation: "+e+")").addListener((function(n){t.length&&t.forEach((function(t){n.matches&&t.emit(e)}))}))})),function(e){e[e.UNKNOWN=-1]="UNKNOWN",e[e.MEDIA_PLAYBACK_ABORTED=1]="MEDIA_PLAYBACK_ABORTED",e[e.MEDIA_ERR_NETWORK=2]="MEDIA_ERR_NETWORK",e[e.MEDIA_ERR_DECODE=3]="MEDIA_ERR_DECODE",e[e.MEDIA_ERR_SRC_NOT_SUPPORTED=4]="MEDIA_ERR_SRC_NOT_SUPPORTED",e[e.MIXED_CONTENT=1001]="MIXED_CONTENT",e[e.NO_INTERNET=1002]="NO_INTERNET"}(_n||(_n={}));function wn(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=t.code||-1,r=vn(n);return e.i18n("media_errors."+n,r)}const Sn=()=>!0===(navigator||{}).onLine;function Tn(e){try{return"https:"===location.protocol&&"http:"==function(e){const t=document.createElement("a");return t.href=e,t}(e).protocol}catch(e){return!1}}function bn(e,t,n){const r=n.togglePlay;n.on("error",(function(e){const t=e.data||n.error,o="Error: %s\n"+(null===(i=(new Error).stack)||void 0===i?void 0:i.split("\n").slice(2).join("\n"));var i;setTimeout((function(){const i=Pe(n,R);if(e.defaultPrevented||!i||n.root.querySelector("#qul_error"))return;if("AbortError"==t.name)return;n.setState("is-error",!0),n.togglePlay=gn;const s=function(e,t){return{code:"http:0"===t.code?An(e):t.code,message:wn(e,t)}}(n,t);console.error(o,s.message);let a=Pe(n,"flowplayer-error");a||(a=me(n,"flowplayer-error"),i.append(a)),Ye(a,"error",{data:t,formatted_data:s}),n.once(m,()=>{On(n,r)})}))})),n.on(A,()=>On(n,r))}function On(e,t){const n=Pe(e,"flowplayer-error");e.togglePlay=t,e.opt("retry")&&e.setState(ee,!0),e.setState("is-error",!1),null==n||n.remove()}function An(e){return Tn(e.original_src)?{code:_n.MIXED_CONTENT}:Sn()?{code:_n.MEDIA_ERR_NETWORK}:Sn()?{code:_n.UNKNOWN}:{code:_n.NO_INTERNET}}var Nn=Object.freeze({__proto__:null,NO_FULLSCREEN:1,NO_VOLUME_CONTROL:2,NO_MUTE:4,LOGO_ON_RIGHT:8,USE_DRAG_HANDLE:16,USE_PLAY_2:32,USE_PLAY_3:64,USE_THIN_CONTROLBAR:128,NO_TITLE:256,NO_DESCRIPTION:512,NO_CONTROLS:1024,NO_DURATION:2048,NO_HEADER:4096,AUDIO_ONLY:8192,NO_TOUCH_ZONES:16384,LOGO_ON_BOTTOM:32768});function In(e,t,n){let r=()=>document.fullscreenElement,o="fullscreenchange";if(!Element.prototype.requestFullscreen){const e=Element.prototype,t=document;e.webkitRequestFullScreen&&(e.requestFullscreen=e.webkitRequestFullScreen,t.fullscreenEnabled=!0),t.webkitCancelFullScreen&&(document.exitFullscreen=t.webkitCancelFullScreen),o="webkit"+o,r=()=>t.webkitCurrentFullScreenElement}const s=()=>n.getFullsceenTarget?n.getFullsceenTarget():t;n.toggleFullScreen=function(e,t){if(n.ios_fullscreen_disabled)return;if("boolean"!=typeof e&&(e=!n.hasState("is-fullscreen")),Ln(n)&&(e?function(e,t){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");t||e.webkitEnterFullScreen()}(n,t):function(e,t){e.getAttribute("playsinline")||e.setAttribute("playsinline","");e.getAttribute("webkit-playsinline")||e.setAttribute("webkit-playsinline","");t||e.webkitExitFullScreen();e.togglePlay(!1),e.hasState(ie)||e.setState(ie,!0)}(n,t)),!document.fullscreenEnabled)return;const o=s();if(e)return o.requestFullscreen();r()===o&&document.exitFullscreen()},Ln(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on(["webkitendfullscreen","webkitbeginfullscreen"],e=>{const t="webkitbeginfullscreen"===e.type;n.setState("is-fullscreen",t).emit(t?u:d).toggleFullScreen(t,!0)})),setTimeout(()=>{const e=s();e.addEventListener(o,(function(){const t=r(),o=t===e||t==n;n.emit(o?u:d),n.setState("is-fullscreen",o)}))},0),!1!==e.doubleclick&&t.addEventListener(i,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function Ln(e){return!document.fullscreenEnabled&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Rn(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=me(n,R),i=me(n,k);t.append(i),r.append(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=xe("fp-footer");t.append(r),n.on(N,(function(e){var t,n;const o=null===(t=e.data)||void 0===t?void 0:t.description,i=null===(n=e.data)||void 0===n?void 0:n.title;if(r.innerHTML="","string"==typeof i){const e=xe("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=xe("fp-desc");for(t.innerText=e.join(" "),r.append(t);e.length>1&&t.scrollHeight>t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}}))}(0,t,n),bn(0,0,n),t.appendChild(r),[s,a].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==s),n.setState("is-accessibility",!1)}))}),In(e,t,n),n.on("volumechange",(function(){const e=0==n.volume||n.muted;n.muted=e,n.setState("is-muted",e),n._storage.setItem("mute",e.toString())})),"true"==n._storage.getItem("mute")&&(n.muted=!0,n.setState("is-muted",n.muted));const u=n._storage.getItem("volume");u&&!isNaN(Number(u))&&(n.volume=Number(u)),n.emit("volumechange"),n.on("dvr/window",t=>{e.live&&(n.live_state.dvr=n.seekable.length>0&&function(e,t,n){if(0==t)return!0;const r=_t(e,n);return r.head-r.tail>=t}(n,e.seconds_to_dvr||60,t.detail),n.live_state.dvr_window=t.detail)}),n.on("live",()=>{const e=setInterval(()=>{if(n.opts.live&&!n.hasState("is-error")&&0!=n.reaper||clearInterval(e),0==n.seekable.length)return;const t=function(e){const t=e.currentTime,n=_t(e);return{progress:Math.min(100,Math.max(0,(t-n.tail)/(n.head-n.tail)*100)),is_live:t-n.head>=-10}}(n);n.hasState(te)==t.is_live&&n.setState(te,!t.is_live),n.live_state.dvr&&n.emit("dvr",t.progress)},200)}),n.on(p,(function(){n.setOpts({live:vt(n)})})),n.on("durationchange",(function(e){const t=vt(n),r=t?gt(n):e.data||n.duration;isNaN(r)||n.setOpts({live:t,duration:r})})),n.on(["playlist/advance","src"],t=>{if(n.setState("is-autoplay",!!e.autoplay),n.root.classList.contains("is-livecountdown"))return kn(n,e);n.currentSrc&&("src"===t.type&&["is-playlist",ae].some(e=>n.root.classList.contains(e))||kn(n,e))}),n.on(N,(function(n){var r,o;e.seekable=void 0===(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.seekable)||n.data.seekable;const i=null===(o=n.data)||void 0===o?void 0:o.ui;if("number"!=typeof i)return;const s=t.classList;s.toggle("use-play-1",!(32&i||64&i)),s.toggle("use-play-2",(32&i)>0),s.toggle("use-play-3",(64&i)>0),s.toggle("use-thin-controlbar",(128&i)>0),s.toggle("no-title",(256&i)>0),s.toggle("no-description",(512&i)>0),s.toggle("logo-on-right",(8&i)>0),s.toggle("logo-on-bottom",(32768&i)>0),s.toggle("use-drag-handle",(16&i)>0),s.toggle("no-controls",(1024&i)>0),s.toggle("no-duration",(2048&i)>0),s.toggle("no-header",(4096&i)>0),s.toggle("no-mute",(4&i)>0),s.toggle("no-volume",(2&i)>0),s.toggle("no-fullscreen",(1&i)>0),s.toggle("no-touch-zones",(16384&i)>0)}));let d=null;[l,c].forEach(e=>o.addEventListener(e,(function(e){n.hasState("is-touch-device")&&e.type===l||("number"==typeof d&&clearTimeout(d),n.setState("is-hovered",!0),d=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3))})))}function kn(e,t){delete t.live_start_time,e.setOpts({live:!1}),e.live_state.dvr=void 0,e.live_state.dvr_window=void 0,delete t.live,delete t.poster,delete t.duration,delete t.title,delete t.description}function Cn(e,t,n){if(pt.from_token(e.token||"").is_granted(pt.permissions.NO_METERING))return;ct.id(e.token||"")&&n.once(_,async()=>await async function e(t,n){const r=ct.id(n||"");t.once("src",()=>{t.once(_,()=>e(t,n))}),function(e,t){if(!function(e){return pt.from_token(e).is_granted(pt.permissions.WOWZA_VIDEO)}(t))return;if(function(e){try{return new URL(e).hostname.endsWith(".wowza.com")}catch(e){return!1}}(e.original_src))return;e.emit("error:fatal",{reason:"token",details:"This token only allows wowza video sources"})}(t,n);if(401==(await fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:r,factor:1,rnd:Math.random().toString(36).substring(2)})})).status)return t.emit("error:fatal",{reason:"token",details:"The token online validation failed"})}(n,e.token||""))}var Mn={ads:{ad:"Ad",ads:"Ads",advertisement:"Advertisement"},audio:{button_txt:"Audio",menu_title:"Audio"},core:{exit_fullscreen:"Exit fullscreen",fullscreen:"Fullscreen",mute:"Mute",pause:"Pause",play:"Play",unmute:"Unmute",volume:"Volume"},ovp:{starting_in:"Countdown"},playlist:{cancel:"Cancel",up_next:"Up next"},qsel:{menu_title:"Quality"},share:{clipboard_failure:"Access to clipboard failed",clipboard_success:"The text is now on your clipboard",embed:"Embed",link:"Link",menu_title:"Share"},speed:{menu_title:"Speed"}};class I18n{init(e,t,n){n.reaper&&n.reaper.set("translations",He(I18n,e,"en"))}}I18n.en=Mn;const Dn="rebuffer",Pn="rebuffer:ended",Un="insights:ttff",xn="insights:time_to_first_frag_loaded",Fn="insights:watched_interval";var Wn=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:Dn,REBUFFER_ENDED:Pn,DISPLAY:"display",TIME_TO_FIRST_FRAME:Un,TIME_TO_FIRST_FRAGMENT_LOADED:xn,WATCHED_INTERVAL:Fn});const Gn=[I,"error","src"];const Bn=navigator;function Hn(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=Bn.connection)||void 0===n?void 0:n.downlink)||-1}function jn(e,t){return async function(e,t){try{await fetch(e,{body:t,method:"POST",mode:"no-cors"})}catch(e){}}(e,JSON.stringify({events:t}))}const qn=e=>{switch(e){case!0:return ve.ON;case!1:return ve.OFF;default:return e}},zn=[],Vn="https://ihi.flowplayer.com/v1/health/events";function Kn(e){if(e.suspended)return;const t=zn.slice(0);zn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),jn(function(){try{return"undefined"==typeof window?Vn:window.__FLOWPLAYER_INSIGHTS_URL?window.__FLOWPLAYER_INSIGHTS_URL:Vn}catch(e){return Vn}}(),t))}async function Yn(e,t,n){const r=await Zn();zn.push(Object.assign(t,r)),e.logger.log(":enqueue",t.event,t),zn.length<10&&!n||Kn(e)}const Xn=()=>{var e,t;try{const n=window;return null===(t=null===(e=null==n?void 0:n.google)||void 0===e?void 0:e.ima)||void 0===t?void 0:t.VERSION}catch(e){return}},Zn=async()=>({client_time:Date.now()}),Qn=(e,t)=>Object.assign(e,{detail:t}),Jn=(e,{event:t,media_session_id:n,session_id:r,play_range_id:o})=>({event:t,media_session_id:n,session_id:r,play_range_id:o,device_id:e.deviceId(),version:"3.17.1",commit:"a470c80308623312bd4a81d3ff6897ca77b160a0",ima_sdk_version:Xn(),preload:e.opt("preload"),autoplay:qn(e.opt("autoplay")),live:e.opt("live"),dvr:!!e.live_state.dvr,source:e.original_src,downlink_mbs:Hn(e),page_url:un(),player_id:e.opt("metadata.player_id"),media_id:e.opt("metadata.media_id"),site_id:e.opt("metadata.site_id"),category_id:e.opt("metadata.category_id"),sitegroup_id:e.opt("metadata.sitegroup_id"),token:e.token,plugins:e.plugins.map(e=>e.constructor.name).sort((e,t)=>e.localeCompare(t)),current_time:e.currentTime,external_media_id:e.opt("external_media_id")}),$n=e=>({bitrate:null==e?void 0:e.bitrate,resolution:null==e?void 0:e.attrs.RESOLUTION,frame_rate:null==e?void 0:e.attrs["FRAME-RATE"]});function er(e,t,n,r){const o=Jn(t,e.eventInfo(n)),{before:i,after:s}=r;Yn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,$n(i),$n(s)))}const tr=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}};var nr;!function(e){e[e.Starting=0]="Starting",e[e.ConfigFinalized=1]="ConfigFinalized",e[e.TimerStartedWithAdsAutoplay=2]="TimerStartedWithAdsAutoplay",e[e.TimerStartedWithContentAutoplay=3]="TimerStartedWithContentAutoplay",e[e.TimerStartedWithUserGesture=4]="TimerStartedWithUserGesture",e[e.MetricReported=5]="MetricReported"}(nr||(nr={}));class TimeToFirstFrame{constructor(e=nr.Starting,t=!1,n=!1){this.state=e,this.loadedAd=t,this.requiresUserGesture=n}reset(){this.state=nr.Starting,this.loadedAd=!1,this.elapsed=void 0}toJSON(){var e;return{ad_was_requested:this.loadedAd,ms_to_first_frame:Math.round((null===(e=this.elapsed)||void 0===e?void 0:e.duration)||-1)}}startTimer(e){this.state==nr.ConfigFinalized&&(this.state=e,performance.mark("ttff:start"))}hasStarted(){return[nr.TimerStartedWithAdsAutoplay,nr.TimerStartedWithContentAutoplay,nr.TimerStartedWithUserGesture].includes(this.state)}stopTimer(e){if(this.hasStarted()){performance.mark("ttff:end");const t=this.elapsed=performance.measure("ttff","ttff:start","ttff:end");this.state=nr.MetricReported,e(t)}}}function rr(e){return Math.round(1e3*e)/1e3}class EWMA{constructor(e){this.tickInterval=e,this.ewma=0,this.startTime=Date.now()}decay(){const e=Date.now()-this.startTime;return Math.pow(2,-e/(4*this.tickInterval))}update(e){const t=this.decay();return this.ewma=t*this.ewma+(1-t)*e,this.ewma}toJSON(){return this.ewma}}class WatchedState{constructor(e){this.player=e,this.marchingInterval=void 0,this.lastWatchedPoint=void 0,this.watchedSum=0,this.lastReportedSum=0,this.ewmaTickWatched=new EWMA(WatchedState.AccuracyMilliseconds)}reset(){this.onNotWatching(),this.watchedSum=0,this.lastReportedSum=0,this.lastWatchedPoint=void 0}onNotWatching(){this.marchingInterval&&(this.updateWatched(),this.marchingInterval=clearInterval(this.marchingInterval))}onWatching(){this.marchingInterval||(this.lastWatchedPoint=this.createWatchedPoint(),this.marchingInterval=setInterval(()=>{this.updateWatched()},WatchedState.AccuracyMilliseconds))}createWatchedPoint(){return{currentTime:this.player.currentTime,paused:this.player.paused}}updateWatched(){const e=this.createWatchedPoint();this.lastWatchedPoint&&this.calculateTimeWatched(this.lastWatchedPoint,e),this.lastWatchedPoint=e}calculateTimeWatched(e,t){const n=t.currentTime-e.currentTime,r=this.ewmaTickWatched.update(n);if(!(n<0)&&!(1e3*n>1.3*WatchedState.AccuracyMilliseconds)&&(this.watchedSum+=n,this.watchedSum!=this.lastReportedSum&&(this.watchedSum>this.lastReportedSum+WatchedState.ReportingIntervalSeconds||this.player.ended))){const e=rr(r),t={total_watched_seconds:rr(this.watchedSum),tick_watched_seconds:e,batch_watched_seconds:rr(this.watchedSum-this.lastReportedSum)};this.lastReportedSum=this.watchedSum,this.player.emit(Fn,t)}}}WatchedState.ReportingIntervalSeconds=5,WatchedState.AccuracyMilliseconds=160;const or=qe();class Health{constructor(e,t){let n;this.session_id=or,this.suspended=!1,this.logger=Wt("health",t.opts),this.media_session_id=qe(),this.play_range_id=qe(),this.analyticsLoop=setInterval(()=>Kn(this),2e3),t.on(T,()=>clearInterval(this.analyticsLoop)),t.on(_,()=>{n!==this.media_session_id&&(n=this.media_session_id,this.first_playing_event_timestamp=Date.now()),this.play_range_id=qe()});let r=Date.now()-1e3;t.on("timeupdate",e=>{if(n!==this.media_session_id)return;const o=Date.now();if(o<r)return;r=Date.now()+5e3;const i=Jn(t,this.eventInfo(e.type)),s=Qn(i,{duration:(a=t.duration,Number.isFinite(a)?a:a===1/0?-1:void 0)});var a;this.first_playing_event_timestamp&&(Object.assign(s,{ms_since_first_playing:o-this.first_playing_event_timestamp}),this.first_playing_event_timestamp=void 0),Yn(this,s)});const o=this;if(t.health={get media_session_id(){return o.media_session_id},set media_session_id(e){o.media_session_id=e},get session_id(){return o.session_id},set session_id(e){o.session_id=e},toggle(e){e?o.resume():o.suspend()}},!Health._UNLOAD_SUBSCRIBED){Health._UNLOAD_SUBSCRIBED=!0;const t=t=>e.instances.forEach(e=>e.emit(t.type));document.addEventListener("visibilitychange",e=>{"hidden"==document.visibilityState&&t(e)}),window.addEventListener("pagehide",t)}}eventInfo(e){return{event:e,media_session_id:this.media_session_id,session_id:this.session_id,play_range_id:this.play_range_id}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>Kn(this),2e3)}init(e,t,n){if(un().toString().startsWith("data:"))return this.suspend();!function(e){let t=null;const n=()=>{t=null};e.on(v,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e.emit(Dn))})),e.on(Dn,e=>{t=e}),e.on(g,r=>{if(t){const o=r.timeStamp-t.timeStamp;if(n(),o<31)return;if(o>3e5)return;e.emit(Pn,{rebuffer_duration:o/1e3})}}),Gn.forEach(t=>e.on(t,n))}(n),function(e){let t;[g,I].forEach(n=>{e.on(n,n=>{const r=Date.now();switch(n.type){case I:return t=r;case g:if(t)return e.emit(xn,{ms_since_loading_started:r-t}),t=null}})})}(n),function(e){if(void 0===window.performance)return;const t=new TimeToFirstFrame;e.on("ovp:config:finalized",e=>{t.reset(),t.state=nr.ConfigFinalized,t.requiresUserGesture=!e.detail.autoplay}),e.on(I,()=>{e.root.classList.contains("ad-hide-first-frame")&&t.startTimer(nr.TimerStartedWithAdsAutoplay),e.opt("autoplay")&&t.startTimer(nr.TimerStartedWithContentAutoplay)}),e.on(o,()=>{e.opt("autoplay")||t.startTimer(nr.TimerStartedWithUserGesture)}),e.on("ad-requested",()=>{t.loadedAd=!0}),e.on("timeupdate",()=>{if(!(e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))switch(t.state){case nr.TimerStartedWithContentAutoplay:case nr.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Un,t.toJSON()))}}),e.on("ad-started",()=>{switch(t.state){case nr.TimerStartedWithAdsAutoplay:case nr.TimerStartedWithUserGesture:return t.stopTimer(()=>e.emit(Un,t.toJSON()))}})}(n),function(e){const t=new WatchedState(e);e.on(I,()=>t.reset()),e.on(_,()=>t.onWatching()),e.on(y,()=>t.onNotWatching()),e.on(S,()=>t.onNotWatching()),e.on(E,()=>t.updateWatched()),e.on("visibilitychange",()=>t.updateWatched())}(n),n.on("display",e=>{Yn(this,Jn(n,this.eventInfo(e.type)),!0)}),n.on("health:record",({detail:e})=>{const t=Jn(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),Yn(this,t)}),[m,p,f,h,v,Dn].forEach(e=>{n.on(e,e=>{Yn(this,Jn(n,this.eventInfo(e.type)))})}),[Pn,Un,xn,Fn].forEach(e=>{n.on(e,e=>{const t=Jn(n,this.eventInfo(e.type));Yn(this,Object.assign(t,e.detail))})}),[_,y,S,w,E,u,d,g,I].forEach(e=>{n.on(e,e=>{Yn(this,Jn(n,this.eventInfo(e.type)))})}),n.on("volumechange",tr(800,e=>{const t=Jn(n,this.eventInfo(e.type));Yn(this,Qn(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on("resize",tr(800,e=>{const r=Jn(n,this.eventInfo(e.type));Yn(this,Qn(r,{height:t.clientHeight,width:t.clientWidth}))})),n.on("hls/failover",e=>{const t=Jn(n,this.eventInfo(e.type)),r=e.detail,{reason:o,from:i}=r;Yn(this,Qn(t,{reason:o,from:i}))}),n.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return er(this,n,e,t)}}),n.addEventListener("error",e=>{const t=Jn(n,this.eventInfo(e.type)),r=e.error||n.error;if(!r)return Yn(this,t,!0);const o=r.code,i={error_message:r.message||vn(o),error_code:o,error_stack:r.stack||""};return Yn(this,Qn(t,i),!0)}),n.on("src",e=>{var t;const r=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof r)return;if(!En(n.original_src))return;if(!En(r))return;if(r==n.original_src)return;this.media_session_id=qe();Yn(this,Jn(n,this.eventInfo(e.type))),Kn(this)}),n.on("visibilitychange",e=>{Yn(this,Jn(n,this.eventInfo(e.type))),Kn(this)})}}Health.events=Wn,Health._UNLOAD_SUBSCRIBED=!1;var ir=ot(window,Health);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerLogo extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-logo");const t={logo:""};e.on(N,e=>{var n;const r=t.logo,o=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";r!=o&&(t.logo=o,this.set_logo(o,e.detail.logo_alt_text,e.detail.logo_href))})}set_logo(e,t,n){this.innerHTML="";const r=document.createElement("img");if(!e)return;if(r.src=e,t&&(r.alt=t),!n)return this.append(r);const o=document.createElement("a");o.href=n,o.append(r),this.append(o)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(N,e=>{var t;const n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.duration)||NaN;this.innerText=isFinite(n)?Ge(n):""})}}const sr={name:"fp-fullscreen",translation_key:"core.fullscreen"},ar={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},lr={name:"fp-play",translation_key:"core.play"},cr={name:"fp-pause",translation_key:"core.pause"},ur={translation_key:"core.mute",name:"fp-volume-mute-unmute"},dr={translation_key:"core.play",name:"fp-small-play"},pr={translation_key:"core.pause",name:"fp-small-pause"},fr={name:"fp-fast-forward"},hr={name:"fp-rewind"};class FlowplayerIcon extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add("fp-icon",t.name),t.title&&this.setAttribute("title",t.title),t.title&&this.setAttribute("aria-label",t.title),t.translation_key&&this.setAttribute("aria-label",e.i18n(t.translation_key)),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(o,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{var t;const n=e.root.querySelector("details[open].fp-menu-container");n&&(n.open=!1,null===(t=n.querySelector("summary"))||void 0===t||t.removeAttribute("aria-expanded"),e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const mr={passive:!0};var yr;function _r(e,t){let n=0,r=-1,o=-1;const i=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5),s=e.classList;e.id=i,s.remove(yr.GRABBING),s.remove(yr.TOUCHING);const a=t.onseek||gn,u=t.onstart||gn,d=t.onend||gn,p=t.onmouse||gn,f=t.ontouch||gn,h=t.ontouchend||gn;function m(t){!function(){const t=e.getBoundingClientRect();n=t.left,r=t.width}();let o=(function(e){return"function"==typeof window.TouchEvent&&e instanceof TouchEvent}(t)?t.changedTouches[0].pageX:t.pageX)-n;return o>r&&(o=r),o<0&&(o=0),o/r*100}function y(t){const n=m(t);n!=o&&(a(e,n),o=n)}return e.addEventListener("touchstart",(function(t){vr(e,t)&&(s.add(yr.TOUCHING),gr(e.parentElement)&&(s.add(yr.GRABBING),f(e,m(t)),u(e,m(t)),y(t)))}),mr),e.addEventListener(c,(function(t){y(t),p(e,m(t))}),mr),e.addEventListener("touchend",(function(t){setTimeout((function(){s.remove(yr.TOUCHING)}),500),vr(e,t)&&(s.remove(yr.GRABBING),h(e,m(t)),d(e,m(t)),r=0)}),mr),e.addEventListener("touchcancel",(function(){s.remove(yr.GRABBING,yr.TOUCHING),r=0}),mr),e.addEventListener("mousedown",(function(t){s.contains(yr.TOUCHING)||(document.addEventListener(l,y),s.add(yr.GRABBING),u(e,m(t)),t.preventDefault(),y(t))})),e.addEventListener(l,(function(t){s.contains(yr.TOUCHING)||p(e,m(t))})),document.addEventListener("mouseup",(function(t){s.contains(yr.TOUCHING)||(document.removeEventListener(l,y),s.contains(yr.GRABBING)&&(s.remove(yr.GRABBING),d(e,m(t)),r=0))})),e}function vr(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!gr(e.parentElement)||!e.classList.contains(yr.TOUCHING))}function gr(e){if(!e)return!1;const t=window.getComputedStyle(e);return"0"!==t.width&&"0"!==t.height&&"0"!==t.opacity&&"none"!==t.display&&"hidden"!==t.visibility}!function(e){e.GRABBING="has-grab",e.TOUCHING="has-touch"}(yr||(yr={}));class FlowplayerVolumeBar extends FlowplayerComponent{constructor(e){super(e),this.className="fp-volume";const t=e.root.classList,n=t.contains("is-tiny")?6:t.contains("is-small")?8:10,r=Array.from({length:n}).map(()=>{const e=document.createElement("i");return e.className="fp-tick",e});this.append(...r),_r(this,{onseek:(t,n)=>{n>0&&(e.muted=!1,e._storage.removeItem("mute")),e._storage.setItem("volume",(e.volume=n/100).toString()),this.adjustVolumeSlider(e.volume)}}),this.setAttribute("tabindex","0"),this.setAttribute("role","slider"),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax","1"),this.setAttribute("aria-label",e.i18n("core.volume","volume")),e.on("volumechange",()=>{const t=0==e.volume||e.muted;t&&this.adjustVolumeSlider(0);const n=e.opt("ui");this.classList.contains(yr.GRABBING)||t&&"number"==typeof n&&(4&n)>0||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString()),this.setAttribute("aria-valuetext",Math.round(100*e)+"%");const t=Array.from(this.querySelectorAll(".fp-tick")),n=Math.round(e*t.length);t.forEach((e,t)=>{e.classList.toggle("fp-color",t<n)})}}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=xe("fp-buffer"),this.progress=xe("fp-progress","fp-color"),this.tooltipEle=xe("fp-timestamp"),this.proposedSeekBar=xe("fp-hover"),this.dragger=xe("fp-dragger","fp-color"),this.classList.add("fp-timeline","fp-bar"),this.tooltipEle.style.display="none",this.setAttribute("role","slider"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",e.i18n("core.timeline_aria_label","Seek slider")),this.setAttribute("aria-valuenow","0"),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);const n=requestAnimationFrame;let r=void 0;const o=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",r=void 0,e.paused||this.classList.contains(yr.GRABBING)||r||(r=setTimeout(o,200)))},i=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);_r(this,{onseek:(n,r)=>{if(i())switch(!!t.live){case!0:wt(r,e,this.tooltipEle);break;case!1:!function(e,t,n){const r=t.duration*(e/100);if(t.disabled&&r>t.currentTime)return!1;n.style.width=e+"%",t.currentTime=r}(r,e,this.progress),ht(this.tooltipEle,r)}},onstart:()=>{i()&&(e.emit("timeline/gesture/start"),!e.hasState("is-casting")&&e.setState(Q,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(r,i){n(o),0!=t.seekable&&t.live&&bt(i,e)},ontouchend:()=>{t.live?Ot(this.proposedSeekBar,this.tooltipEle):yt(this.proposedSeekBar,this.tooltipEle),setTimeout(()=>e.emit("timeline/gesture/end"),0)},onmouse:(n,r)=>{if(i()&&(e.emit("timeline/gesture/move",{percent:r}),!this.classList.contains(yr.GRABBING)))switch(!!t.live){case!0:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),wt(r,e,this.tooltipEle);break;case!1:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),function(e,t,n){if(isNaN(e)||isNaN(t.duration))return;ht(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=Ge(e/100*t.duration),n.append(r)}(r,e,this.tooltipEle)}}}),e.on(N,(function(e){e.data&&(t=e.data)})),e.on(_,()=>n(o)),e.on(h,()=>{0==e.reaper||t.live||mt(e,this.bufferEle)}),e.on("dvr",e=>{this.progress.style.width=e.detail+"%"}),e.on("timeupdate",()=>{0!=e.reaper&&(n(o),this.setAttribute("aria-valuenow",e.currentTime+""),this.setAttribute("aria-valuetext",Math.round(e.currentTime)+" "+e.i18n("core.seconds","Seconds")),t.live||mt(e,this.bufferEle))}),e.on(p,()=>{0!=e.reaper&&(t.live||mt(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const n=vt(e)?gt(e):t.data||e.duration;isNaN(n)||(this.setAttribute("aria-valuemax",n+""),this.setAttribute("aria-valuemin","0"))}),this.addEventListener(a,()=>{e.emit("timeline/gesture/end"),t.live?Ot(this.proposedSeekBar,this.tooltipEle):yt(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=xe("fp-live-text"),n=xe("fp-live-indicator","fp-color");t.textContent="live",this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.append(n,t),this.addEventListener(o,(function(){Tt(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),this.setAttribute("aria-hidden","true"),e.on(N,n=>{if(0==e.reaper||!n.data)return;t=n.data;const r=vt(e)?NaN:n.data.duration||0;if(isNaN(r)||r>=Number.MAX_SAFE_INTEGER)return this.style.display="none";this.style.display="inline-block",this.innerText=Ge(r)}),e.on(p,()=>{var n,r;0==e.reaper||t.live||(r=this,(n=e).duration&&(r.innerText=Ge(n.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Ge(0),this.setAttribute("aria-hidden","true"),e.on(N,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var n;0!=e.reaper&&(t.live?(n=e,this.innerText=Ge(n.currentTime)):function(e,t){t.innerText=Ge(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=me(e,"flowplayer-small-pause-icon"),n=me(e,"flowplayer-small-play-icon");t.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){n.focus&&n.focus()}),100)})),n.addEventListener("click",(function(){e.togglePlay(),setTimeout((function(){t.focus&&t.focus()}),100)})),this.append(t,n)}}class FlowplayerLeftRightZone extends FlowplayerComponent{constructor(e,t){super(e),this.classList.add(t);const n=this.classList.contains("fp-left-zone")?-1:1,r=document.createElement("span"),o=me(e,this.classList.contains("fp-left-zone")?j:"flowplayer-fast-forward-icon");o.removeAttribute("tabindex"),r.classList.add("fp-zone-seconds"),this.append(r,o);e.on(w,()=>{r.innerText=""}),e.on("seek:queued",e=>{const t=e.data;if(!t)return;if("number"!=typeof t.offset)return;const n=t.offset;if(0==n)return this.reset_zone();n>0&&this.classList.contains("fp-right-zone")||n<0&&!this.classList.contains("fp-right-zone")?this.render_zone_state(n):this.reset_zone()}),e.on("seek:cancel",()=>{this.reset_zone()}),this.reset_zone(),this.addEventListener("touchend",(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState(ne)||!e.hasState("will-seek")&&!e.hasState(ie)||e.enqueueSeek(5*n)&&(t.stopPropagation(),t.preventDefault())}))}reset_zone(){const e=this.querySelector(".fp-zone-seconds");e&&(e.innerText="")}render_zone_state(e){const t=this.querySelector(".fp-zone-seconds");t&&(t.innerText=Math.abs(e)+"")}}class FlowplayerError extends FlowplayerComponent{constructor(e){super(e),this.className="fp-error",this.message=document.createElement("p"),this.message.className="error-message",this.append(this.message),this.addEventListener("error",e=>{const t=e.detail;t&&(this.message.textContent=t.formatted_data.message)})}}class FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...n){super(e),this.className=t;const r=e.createComponents(...n);this.append(...r),"fp-left"!==t&&r.forEach(t=>{t.addEventListener(o,()=>e.toggleFullScreen())})}}class FlowplayerMiddleWait extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-wait"),Array(...Array(4)).map((e,t)=>t).forEach(()=>{this.append(document.createElement("b"))})}}class FlowplayerMiddleZone extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle-zone");const t=e.createComponents(G,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[B,H].forEach(t=>{const n=me(e,t);n.removeAttribute("tabindex"),this.append(n)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=me(e,q);this.append(t),!n().ios&&this.append(me(e,U)),t instanceof FlowplayerIcon&&t.addEventListener(o,(function(){e.toggleMute()}))}}class FlowplayerHeader extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-header"),this.append(...e.createComponents("flowplayer-header-left-zone","flowplayer-header-right-zone")),e.reaper&&e.reaper.set("header",this)}}class FlowplayerControls extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-controls","fp-togglable"),this.append(...e.createComponents("flowplayer-control-buttons",M,D,P,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button")}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",W,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),e.once("beforeplay",()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")})}handleClick(e){[o,i].forEach(t=>this.addEventListener(t,(function(n){if(!(n.defaultPrevented||e.root.classList.contains("is-endscreen")||t===i&&e.root.classList.contains("no-fullscreen")))return n.preventDefault(),e.emit(n.type),!1}))),e.on(o,(function(t){setTimeout((function(){t.defaultPrevented||e.togglePlay()}),0)})),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener("touchend",(function(t){t.cancelable&&!e.hasState("is-endscreen")&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on("touchend",(function(n){setTimeout((function(){if(n.defaultPrevented)return;if(e.ended)return e.togglePlay(!0);const r=e.hasState(Z);t&&clearTimeout(t),(r||e.hasState(ie))&&(e.hasState(ie)&&(e.setState(ie,!1),e.setState("is-hovered",!1)),e.togglePlay(),r)||(e.setState(ie,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState(ie,!1),e.setState("is-hovered",!1)}),2e3)))}),0)}))}}class FlowplayerUi extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-ui"),this.append(...e.createComponents(x,F,C))}}return jt.extensions.unshift.apply(jt.extensions,[I18n,yn,ir,class Default{constructor(e){ye(e,R,FlowplayerUi),ye(e,"flowplayer-error",FlowplayerError),ye(e,C,FlowplayerControls),ye(e,M,FlowplayerLiveStatus),ye(e,"flowplayer-control-duration",FlowplayerDuration),ye(e,P,FlowplayerTimelineBar),ye(e,D,FlowplayerElapsedTime),ye(e,U,FlowplayerVolumeBar),ye(e,"flowplayer-volume-control",FlowplayerVolumeControl),ye(e,"flowplayer-control-buttons",FlowplayerControlButtons),ye(e,x,FlowplayerHeader),ye(e,k,FlowplayerLogo),ye(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ye(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left","flowplayer-header-duration")}}),ye(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ye(e,F,FlowplayerMiddle),ye(e,W,FlowplayerMiddleZone),ye(e,G,FlowplayerMiddleWait),ye(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ye(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ye(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ye(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,dr),this.setAttribute("role","button")}}),ye(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,pr),this.setAttribute("role","button")}}),ye(e,B,class extends FlowplayerIcon{constructor(e){super(e,lr),this.setAttribute("role","button")}}),ye(e,H,class extends FlowplayerIcon{constructor(e){super(e,cr),this.setAttribute("role","button")}}),ye(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,sr)}}),ye(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,ar)}}),ye(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,fr)}}),ye(e,j,class extends FlowplayerIcon{constructor(e){super(e,hr)}}),ye(e,q,class extends FlowplayerIcon{constructor(e){super(e,ur),this.classList.add("fp-volumebtn"),this.setAttribute("role","switch"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",e.i18n("core.muted","Muted")),this.setAttribute("aria-checked",t?"true":"false")})}})}init(e,t,n){var r;Cn(e,0,n),Rn(e,t,n),r=n,"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}}]),Object.assign(jt,{ui:Nn,i18n:I18n})}));