@flowplayer/player 3.0.8 → 3.1.0-rc.2
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.
- package/core.js +2 -2
- package/default.js +2 -2
- package/embed.js +97 -93
- package/flowplayer.css +1 -1
- package/index.d.ts +3 -2
- package/package.json +1 -1
- package/plugins/ads.js +22 -3
- package/plugins/consent.js +1 -1
- package/plugins/dash.js +1 -1
- package/plugins/float-on-scroll.js +1 -1
- package/plugins/health.js +1 -16
- package/plugins/id3.js +1 -16
- package/plugins/ovp.js +1 -1
package/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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),o=/Android/.test(t)&&!/Firefox/.test(t),r=/^((?!chrome|android).)*safari/i.test(t),i=/SamsungBrowser/.test(t),a=i&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:o,iphone:n,safari:r,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:i,samsung_tv:i&&a,touch:!!("ontouchstart"in window)}}const o="click",r="touchend",i="loadedmetadata",a="loadeddata",s="reap";var l=Object.freeze({__proto__:null,MOUNT:"mount",ERROR:"error",CONTEXT_MENU:"contextmenu",CLICK:o,DBL_CLICK:"dblclick",KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:r,TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:"fullscreenenter",FULLSCREEN_EXIT:"fullscreenexit",FULLSCREEN_CHANGE:"fullscreenchange",WEBKIT_NEEDKEY:"webkitneedkey",METADATA:i,DATA:a,PROGRESS:"progress",TIME_UPDATE:"timeupdate",LOAD_START:"loadstart",VOLUME_CHANGE:"volumechange",PAUSE:"pause",PLAYING:"playing",PLAY:"play",WAITING:"waiting",CAN_PLAY:"canplay",ENDED:"ended",SEEKED:"seeked",SEEKING:"seeking",DURATION_CHANGE:"durationchange",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",STATE:"state",CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",RECOVER:"recover",REAP:s,CONFIG:"config",QUALITIES:"qualities",SET_QUALITY:"quality:set",NON_RECOVERABLE_ERROR:"error:fatal",RECOMMENDATIONS_READY:"recommendationsready",AUDIO_ONLY_SOURCE:"audioonlysource",LANDSCAPE:"landscape",PORTRAIT:"portrait",RENDER_PLUGIN:"renderplugin",DVR:"dvr",LIVE:"live",SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange"});var c=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",UI:"flowplayer-ui",CONTROL:"flowplayer-control",CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:"flowplayer-live-status",ELAPSED:"flowplayer-elapsed-time",TIMELINE:"flowplayer-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:"flowplayer-volume-bar",HEADER:"flowplayer-header",HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",PRIMARY:"flowplayer-primary",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:"flowplayer-middle",MIDDLE_ZONE:"flowplayer-middle-zone",WAIT:"flowplayer-wait",MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",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:"flowplayer-play-icon",PAUSE_ICON:"flowplayer-pause-icon",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:"flowplayer-rewind-icon",SHARE_ICON:"flowplayer-share-icon",VOLUME_ICON:"flowplayer-volume-icon",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"});const u="is-playing",d="is-paused",p="is-loaded",f="is-loading",
|
|
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),o=/Android/.test(t)&&!/Firefox/.test(t),r=/^((?!chrome|android).)*safari/i.test(t),i=/SamsungBrowser/.test(t),a=i&&/SMART-TV/.test(t);return{controls:!n,video:function(t){return e&&document.createElement("video").canPlayType(t)},lang:e&&window.navigator.language,android:o,iphone:n,safari:r,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:i,samsung_tv:i&&a,touch:!!("ontouchstart"in window)}}const o="click",r="touchend",i="loadedmetadata",a="loadeddata",s="reap";var l=Object.freeze({__proto__:null,MOUNT:"mount",ERROR:"error",CONTEXT_MENU:"contextmenu",CLICK:o,DBL_CLICK:"dblclick",KEYUP:"keyup",KEYDOWN:"keydown",LOAD:"load",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:r,TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:"fullscreenenter",FULLSCREEN_EXIT:"fullscreenexit",FULLSCREEN_CHANGE:"fullscreenchange",WEBKIT_NEEDKEY:"webkitneedkey",METADATA:i,DATA:a,PROGRESS:"progress",TIME_UPDATE:"timeupdate",LOAD_START:"loadstart",VOLUME_CHANGE:"volumechange",PAUSE:"pause",PLAYING:"playing",PLAY:"play",WAITING:"waiting",CAN_PLAY:"canplay",ENDED:"ended",SEEKED:"seeked",SEEKING:"seeking",DURATION_CHANGE:"durationchange",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",STATE:"state",CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:"src",RECOVER:"recover",REAP:s,CONFIG:"config",QUALITIES:"qualities",SET_QUALITY:"quality:set",NON_RECOVERABLE_ERROR:"error:fatal",RECOMMENDATIONS_READY:"recommendationsready",AUDIO_ONLY_SOURCE:"audioonlysource",LANDSCAPE:"landscape",PORTRAIT:"portrait",RENDER_PLUGIN:"renderplugin",DVR:"dvr",LIVE:"live",SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange"});var c=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",UI:"flowplayer-ui",CONTROL:"flowplayer-control",CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:"flowplayer-live-status",ELAPSED:"flowplayer-elapsed-time",TIMELINE:"flowplayer-timeline-bar",CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:"flowplayer-volume-bar",HEADER:"flowplayer-header",HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",PRIMARY:"flowplayer-primary",HEADER_DURATION:"flowplayer-header-duration",MIDDLE:"flowplayer-middle",MIDDLE_ZONE:"flowplayer-middle-zone",WAIT:"flowplayer-wait",MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",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:"flowplayer-play-icon",PAUSE_ICON:"flowplayer-pause-icon",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:"flowplayer-rewind-icon",SHARE_ICON:"flowplayer-share-icon",VOLUME_ICON:"flowplayer-volume-icon",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"});const u="is-playing",d="is-paused",p="is-loaded",f="is-loading",y="is-starting",m="is-seeking",E="is-ended",h="is-waiting",g="is-in-viewport";var w=Object.freeze({__proto__:null,PLAYING:u,FULLSCREEN:"is-fullscreen",PAUSED:d,MUTED:"is-muted",LOADED:p,LOADING:f,STARTING:y,SEEKING:m,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",ENDED:E,LIVE:"is-live",ERRORED:"is-error",WAITING:h,AUTOPLAY:"is-autoplay",NO_AUTOPLAY:"no-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:"is-live-seeked",NO_DVR:"no-timeline",HAS_POSTER:"has-poster",MENU_OPENED:"has-menu-opened",TOUCHED:"is-touched",HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:g});function _(e){this.message=e}_.prototype=new Error,_.prototype.name="InvalidCharacterError";var v="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new _("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,r=0,i=0,a="";o=t.charAt(i++);~o&&(n=r%4?64*n+o:o,r++%4)?a+=String.fromCharCode(255&n>>(-2*r&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return a};var S=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(v(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 v(t)}};function O(e){this.message=e}O.prototype=new Error,O.prototype.name="InvalidTokenError";var A=function(e,t){if("string"!=typeof e)throw new O("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(S(e.split(".")[n]))}catch(e){throw new O("Invalid token specified: "+e.message)}};A.InvalidTokenError=O;const N=new Map,I=(e,t)=>new(((e,t)=>{const n=e.get(t);if(!n)throw new Error(`no flowplayer component with the name ${t} exists`);const o=window.customElements.get(t);if(!o)throw new Error(`no default flowplayer component with the name ${t} exists`);const r=window.customElements.get(n);return"function"!=typeof r?o:r})(e._customElements,t))(e);var T,L;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(T||(T={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(L||(L={}));function b(e,t,n){const o="boolean"==typeof n;if("boolean"!=typeof n&&(n=e.paused),function(e,t,n){const o=e.poll(t?"beforeplay":"beforepause",{forced:n});return o&&o.defaultPrevented}(e,n,o))return;if(!n)return e.hasState("is-live")&&e.setState("is-live-seeked",!0),e.pause();if(0==e.reaper)return;const r=e.reaper.get("__pending_play");return 0!=e.paused||r?r?(r.src!==k(e.original_src)&&R(e),r):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==k(e.original_src)}(e)&&R(e),(e=>e.autoplay&&L.AUDIO_REQUIRED&e.autoplay)(t)?function(e){e.muted=!1,0==e.volume&&(e.volume=1);return e.play().catch(e=>{console.warn("[flowplayer/play] autoplay audio required\n%s",e.message)})}(e):(e.setState(y,!1),e.play().catch(t=>(console.warn("[flowplayer/play] attempting muted autoplay\n%s",t.message),e.muted=!0,e.volume=0,e.play())))):void 0}function R(e){e.currentSrc.match(/^blob:/)||e.load()}function k(e){const t=document.createElement("a");return t.href=e,t.href}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function U(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function D(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 k(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const P=e=>{var{src:t}=e,n=U(e,["src"]);return[Object.assign({src:t,type:t?k("video/"+D(t)):""},n)]};function M(e){return P({src:e})}function x(e){var{src:t,type:n}=e,o=U(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},o)]:n&&!t?[Object.assign({type:n},o)]:P(Object.assign({src:t},o))}var H;function j(e,t,n,o={safari:!1}){const r=function(e){return"string"==typeof e?M(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=M(t)),"object"!=typeof t||Array.isArray(t)||(t=x(t)),e.concat(t)}),[]):x(e)}(n);return e.currentSrc&&(e.innerHTML=""),[y,u,d,f,p].forEach(t=>e.setState(t,!1)),t.autoplay&&e.hasState(g)||e.setState(E,!0),Array(...Array(r.length)).map((e,t)=>t).some(n=>{const i=r[n];if(H.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const o=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 o?(o.onload(t,e.root,e,n),H.Ok):H.Err}(e,t,i)||H.Ok==function(e,t,n,o={safari:!1}){var r;/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return H.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!o.safari))return H.Err;"string"==typeof n.src&&(e.preload=t.autoplay?"auto":null!==(r=t.preload)&&void 0!==r?r:"auto",e.src=n.src,"none"!==e.preload&&e.setState(f,!0));return H.Ok}(e,t,i,o))return!0;n==r.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(H||(H={}));const W=[s,"seeking","src","seek:cancel"];var G;function V(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?F(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,F(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(G.BACKWARD,t.offset<0),e.setState(G.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function F(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(G.FORWARD,!1),e.setState(G.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Y(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function K(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(G||(G={}));const B=[1e7]+""+-1e3+-4e3+-8e3+-1e11,z=()=>"undefined"==typeof crypto?"":B.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let q="";!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 Q=["touchstart","touchmove"];function Z(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function X(e,t,n){const o=Z(t,n);return e.dispatchEvent(o),e}function J(e,t,n){const o=Z(t,n);return e.dispatchEvent(o),o}function $(e,t,n,o){Array.isArray(t)?t.forEach(t=>ee(e,t,n,o)):ee(e,t,n,o)}function ee(e,t,n,o){if(r=t,!~Q.indexOf(r))return e.addEventListener(t,n,o),e;var r;const i=Object.assign(o||{},{passive:!0});return e.addEventListener(t,n,i),e}function te(e,t,n,o){return $(e,t,n,Object.assign(o||{},{once:!0}))}class PlayerStorage{constructor(e){this.implementation=e}removeItem(e){try{this.implementation.removeItem(e)}catch(e){}}getItem(e){try{return this.implementation.getItem(e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem(e,t)}catch(e){}}clear(){try{this.implementation.clear()}catch(e){}}get length(){try{return this.implementation.length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}const ne={preload:"none",rtl:!1,controls:!0},oe=["loop","muted","preload"];function re(e,o,r){r._storage=new PlayerStorage(window.localStorage),r.toJSON=function(){return{duration:r.duration,volume:r.volume,currentTime:r.currentTime,states:r.root.className}},r.setSrc=function(t){return j(r,e,t,n())},r.playerState=r.playerState||{},r.setState=function(e,t){if(r.playerState[e]===!!t)return r;const n=Object.assign({},r.playerState,{[e]:t});return n[h]&&(n[u]=!1),r.playerState=n,X(r,"state",r.playerState),r},r.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>I(this,e[n]))},r.hasState=function(e){return!!r.playerState[e]},r.transitionState=function(e,t,n){!r.hasState(e)&&r.hasState(t)||(n=0),n&&r.setState("is-toggling",!0),r.setState(t,!1),r.setState(e,!0),n&&setTimeout((function(){r.setState("is-toggling",!1)}),n)},r.emit=(e,t)=>(X(r,e,t),r),r.on=(e,t)=>($(r,e,t),r),r.once=(e,t)=>(te(r,e,t),r),r.off=(e,t)=>{var n,o;return n=e,o=t,r.removeEventListener(n,o),r},r.poll=(e,t)=>J(r,e,t),r.togglePlay=function(t){return b(r,e,t)},r.toggleMute=function(e){e=null==e?!r.muted:!!e,r.muted=e,r.muted||r.volume||(r.volume=1),X(r,"volumechange")},r.toggleDisable=function(e){e=null==e?!r.disabled:!!e,r.setState("is-disabled",e),r.disabled=e},r.destroy=function(){r.pause();const e=t.indexOf(r);~e&&t.splice(e,1),setTimeout((function(){r.setSrc([]),r.reaper&&r.reaper.clear(),X(r,s)}),0)},r.setAttrs=function(e){return oe.forEach(t=>{if(!(t in e))return;const n=e[t];n?r.setAttribute(t,n.toString()):r.removeAttribute(t)}),r},r.opt=function(t,n){return n=void 0===n?K(ne,t):n,K(e,t,n)},r.i18n=function(e,t){if(!r.reaper)return"";const n=r.reaper.get("translations");return n?function e(t,n,o,r){return(r=r||0)>=t.length?o:K(t[r],n,e(t,n,o,r+1))}(n,e,t||""):t||""},r.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&r.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&r.toggleMute(t.muted);const n=!!e.autoplay&&!r.hasState("no-autoplay");r.setState("is-autoplay",n),r.setState("is-rtl",r.opt("rtl",function(e){if(!e)return Y();const t=e.getAttribute("dir");return t?"rtl"==t:Y()}(o))),r.setState("is-live",!!e.live),r.setState("no-timeline",!(!e.live||e.dvr)),r.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),r.setState("is-seekable",!!e.seekable),o.style.backgroundImage=r.hasState("has-poster")?"url('"+e.poster+"')":"",X(r,"config",e)},r.renderPlugin=function(e){J(r,"renderplugin",e).defaultPrevented||r.root.appendChild(e)};const i={offset:0,timer:0};var a,l;l=i,(a=r).on(W,(function(){F(a,l)})),r.enqueueSeek=function(e){if(0!=r.opts.seekable&&!(1==r.opts.disabled&&e>0))return V(r,i,e)},r.deviceId=function(){return function(e){if(q)return q;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=z();return e.setItem("flowplayer/uuid",n),n}catch(e){return q=z()}}(r._storage)}}function ie(e,t){const n=t.querySelector("video"),o=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return o.classList.add("fp-engine"),o.playsInline=!0,n||t.append(o),o}const ae=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function se(e,t){return!!~ae.indexOf(e)||e.indexOf(t)===e.length-t.length}se.check_whitelist=function(e){return!!~ae.indexOf(e)};const le="production";function ce(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let o={c:"{}",exp:0};t=t||{};try{o=A(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(o.c),n.exp=o.exp,t.require_valid_token&&ce.validate(n),n}function ue(e){try{return ce.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var de;function pe(e){return{grant:e,is_granted:t=>(e&t)===t}}function fe({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 o=document.createElement("h2");o.textContent="Playback Error";const r=document.createElement("p");r.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://flowplayer.com/help/developers/troubleshooting#"+n.reason,i.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",e.append(o,r,i,a)}function Ee(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function ye(e,t,o){let r=!0;t.classList.add("flowplayer"),Ee(0,t),$(o,["loadstart","resize"],(function(){Ee(0,t)})),$(o,"state",(function(){Object.entries(o.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),$(o,"timeupdate",(function(){o.setState(h,!1)})),$(o,"ended",(function(t){setTimeout((function(){if(!t.defaultPrevented){if(e.rewind&&!o.loop){const t=o.src;e.autoplay&&(e.autoplay=0,o.setState("is-autoplay",!1)),o.setState(y,!0),te(o,"seeked",(function(){t===o.src&&(o.setState(y,!1),o.pause(),o.setState(E,!0))})),o.currentTime=0}te(o,"timeupdate",(function(){o.setState(m,!1)})),o.transitionState(m,u,e.loop||e.rewind?0:300)}}),0)})),$(o,["seeking","seeked"],(function(e){o.setState(y,"seeking"==e.type),o.setState(d,o.paused),o.setState(u,!o.paused)})),$(o,"ended",(function(){o.setState(u,!1),r=!0})),$(o,n().ios?i:a,(function(){var e,t;o.setState(p,!0),o.setState(f,!1);const n=o;0===(null===(e=n.videoTracks)||void 0===e?void 0:e.length)&&(null===(t=n.audioTracks)||void 0===t?void 0:t.length)>0&&o.emit("audioonlysource")})),$(o,["waiting","canplay","loadstart"],(function(t){if(!o.hasState(y)&&("canplay"!=t.type||e.autoplay||o.setState(h,!1),"loadstart"!=t.type||"none"!=o.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return te(o,"playing",(function(){o.setState(h,!1)}));"waiting"==t.type&&([u,d,E].forEach((function(e){o.setState(e,!1)})),o.hasState(p)||o.setState(f,!0)),o.setState(m,!1),o.setState(h,"waiting"==t.type)}})),$(o,["playing","pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:o});document.dispatchEvent(e)},0);const n="playing"==t.type,i=o.currentTime==o.duration,a=n&&r&&e.autoplay||o.hasState(h);if(n&&(o.started=!0,r=!1),o.setState(h,!1).setState(E,!1),i||o.hasState(y))return;const s=n?u:d,l=n?d:u;o.transitionState(s,l,a?0:300),n&&o.setState("no-autoplay",!1)}))}ce.validate=function(e){if("string"==typeof e&&(e=ce(e)),!e||!e.raw){if(se.check_whitelist(window.location.hostname)||"dev"===le.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=se.bind(null,t);if("dev"!==le.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==le.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},ce.id=function(e){if(e)return"string"==typeof e&&(e=ce(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"}(de||(de={})),pe.of=pe,pe.from_token=function(e){const t=ce(e,{require_valid_token:!0});return pe.of(t.data.acl)},pe.permissions=de;const me=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function he(e,n,i){if(!window.IntersectionObserver)return;const a={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[r,o].forEach(e=>te(i,e,()=>a.has_user_gesture=!0)),$(i,"play",(function(){a.locked||(a.should_resume=!0)})),$(i,"src",(function(){a.should_resume=!!e.autoplay})),$(i,"pause",(function(){a.locked||(a.should_resume=!1)})),$(i,"canplay",(function(n){if(e.autoplay&&(!t.filter((function(e){return!e.paused})).length||e.multiplay))return i.hasState(g)&&a.should_resume?i.togglePlay(!0):void(e.autopause||i.hasState(g)||!a.should_resume||te(i,"viewenter",()=>{e.autoplay&&a.should_resume&&i.togglePlay(!0)}))}));const l=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,n=i.hasState(g);if(i.setState(g,t>=.2),i.emit("intersectionchange",{ratio:t}),n===i.hasState(g))return;const o=i.hasState(g)?"viewenter":"viewleave";i.emit(o)},0)})},{threshold:me});l.observe(n),i.on(s,()=>l.disconnect()),e.autopause&&($(i,"viewenter",(function(){a.should_resume&&e.autopause&&i.togglePlay(!0)})),$(i,"viewleave",(function(){if(!e.autopause)return;const t=!i.paused;a.locked=!0,i.pause(),setTimeout((function(){a.should_resume=t,a.locked=!1}),0)})))}function ge(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(s,()=>n.disconnect())}function we(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 Se(e,t,n){const o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let r=we(e.ratio||.5625);o.style.paddingTop=100*r+"%";const s=[a,i];n.on(s,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on("config",(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=we((null==e?void 0:e.ratio)||t||.5625);r!==i&&(r=i,o.style.paddingTop=100*i+"%")}))}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("playing",this.render),null===(t=this.player)||void 0===t||t.once("ended",this.wireUp)}cleanUp(){var e,t,n,o;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("playing",this.render),null===(o=this.player)||void 0===o||o.off("ended",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 o=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!o)return;const r=this._logo=document.createElement("a");r.href="https://explorer.flowplayer.com",r.target="_blank",Object.entries(ve).forEach(([e,t])=>{r.style.setProperty(e,t,"important")}),o.appendChild(r)}}const ve={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)"};function Oe(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on(s,()=>document.removeEventListener("flowplayer/playing",t)),document.addEventListener("flowplayer/playing",t)}const _e=function(){const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Ae(n,o){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Ae;"string"==typeof o&&(o={src:o}),o||(o={}),o.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(o.token=window.__FLOWPLAYER_TOKEN);const r="string"==typeof n?document.querySelector(n):n;if(!r)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const a=r.querySelector("video.fp-engine");if(a)return a;const l=ue(o.token);if(!l.success)return fe({root:r,data:{reason:"token",details:l.message}});const c=new Map,u=ie(o,r);u.reaper=c,u._customElements=N,Object.defineProperty(u,"token",{value:"string"==typeof o.token?ce.id(o.token):"",writable:!1}),u.addEventListener(s,()=>{c.clear(),u.reaper=0,delete u.root}),u.root=r,o.token&&pe.from_token(o.token).is_granted(pe.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(u)&&t.push(u),re(o,r,u),u.setAttrs(o),u.plugins=Ae.extensions.map(e=>new e(Ae,u)),ye(o,r,u),he(o,r,u),ge(r,u),Se(o,r,u),Oe(u),u.plugins.forEach(e=>{try{e.init(o,r,u)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),u.setOpts(o),u.opts=o,o.src&&u.setSrc(o.src);const d=u.readyState;return d>0&&u.currentSrc&&u.emit(i),d>2&&u.currentSrc&&u.emit("canplay"),u.emit("mount"),u.on("error:fatal",(function(e){fe({root:r,video:u,data:e.data||{}})})),u}return Object.assign(Ae,_e),function(o){Array.isArray(o.extensions)&&o.extensions.forEach(t=>e.push(t)),o.customElements=N,o.defaultElements=c,o.version="3.0.8",o.commit="c23496a4f8c940803c8c2853e8f12754b7e23298",o.instances=t,o.extensions=e,o.support=n,o.events=l,o.states=w,o.jwt=A,o.autoplay=L,o.quality=T}(Ae),"object"==typeof document&&setTimeout(X,0,document,"flowplayer:umd",Ae),Ae}));
|
|
15
|
+
***************************************************************************** */function C(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function U(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 D(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const P=e=>{var{src:t}=e,n=C(e,["src"]);return[Object.assign({src:t,type:t?D("video/"+U(t)):""},n)]};function M(e){return P({src:e})}function x(e){var{src:t,type:n}=e,o=C(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},o)]:n&&!t?[Object.assign({type:n},o)]:P(Object.assign({src:t},o))}var H;function K(e,t,n,o={safari:!1}){const r=function(e){return"string"==typeof e?M(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=M(t)),"object"!=typeof t||Array.isArray(t)||(t=x(t)),e.concat(t)}),[]):x(e)}(n);return e.currentSrc&&(e.innerHTML="",e.setOpts({live:!1,dvr_window:void 0}),delete e.opts.live,delete e.opts.dvr),[m,u,d,f,p].forEach(t=>e.setState(t,!1)),t.autoplay||e.setState(y,!0),Array(...Array(r.length)).map((e,t)=>t).some(n=>{const i=r[n];if(H.Ok==function(e,t,n){e.emit("src",n),"string"==typeof n.src&&(e.original_src=n.src);const o=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 o?(o.onload(t,e.root,e,n),H.Ok):H.Err}(e,t,i)||H.Ok==function(e,t,n,o={safari:!1}){var r;/^audio\//.test(n.type||"")&&e.emit("audioonlysource");t.start_time&&(n.src=n.src+"#t="+t.start_time);if(""==e.canPlayType(n.type||""))return H.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!o.safari))return H.Err;"string"==typeof n.src&&(e.preload=t.autoplay?"auto":null!==(r=t.preload)&&void 0!==r?r:"auto",e.src=n.src,"none"!==e.preload&&e.setState(f,!0));return H.Ok}(e,t,i,o))return!0;n==r.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(H||(H={}));const j=[s,"seeking","src","seek:cancel"];var W;function G(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?V(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,V(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(W.BACKWARD,t.offset<0),e.setState(W.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function V(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(W.FORWARD,!1),e.setState(W.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function F(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Y(e,t,n){const o=function(e){return Array.isArray(e)?e.slice(0):e.split(".")}(t);for(;o.length;){if(null==e)return n;const t=o.shift();if("string"!=typeof t)return n;e=e[t]}return null==e?n:e}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(W||(W={}));const B=[1e7]+""+-1e3+-4e3+-8e3+-1e11,z=()=>"undefined"==typeof crypto?"":B.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let q="";!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 Q=["touchstart","touchmove"];function Z(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function J(e,t,n){const o=Z(t,n);return e.dispatchEvent(o),e}function X(e,t,n){const o=Z(t,n);return e.dispatchEvent(o),o}function $(e,t,n,o){Array.isArray(t)?t.forEach(t=>ee(e,t,n,o)):ee(e,t,n,o)}function ee(e,t,n,o){if(r=t,!~Q.indexOf(r))return e.addEventListener(t,n,o),e;var r;const i=Object.assign(o||{},{passive:!0});return e.addEventListener(t,n,i),e}function te(e,t,n,o){return $(e,t,n,Object.assign(o||{},{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])}),this.implementation.__fp_storage_keys=t.implementation.__fp_storage_keys||"[]");try{this.keys=JSON.parse(this.implementation.__fp_storage_keys||"[]")}catch(e){this.keys=[]}}removeKey(e,t=!1){this.keys=this.keys.filter(t=>t!==e),t||this.storeKeys()}addKey(e){this.removeKey(e,!0),this.keys.push(e),this.storeKeys()}storeKeys(){this.implementation.__fp_storage_keys=JSON.stringify(this.keys)}removeItem(e){try{this.implementation.removeItem(e),this.removeKey(e)}catch(e){}}getItem(e){try{return this.implementation.getItem(e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem(e,t),this.addKey(e)}catch(e){}}clear(){try{this.keys.forEach(e=>this.implementation.removeItem(e)),this.keys=[],this.implementation.removeItem("__fp_storage_keys")}catch(e){}}get length(){try{return this.implementation.length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}const ne={preload:"none",rtl:!1,controls:!0},oe=["loop","muted","preload"];function re(e,o,r){r._storage=new PlayerStorage(window.localStorage),r.toJSON=function(){return{duration:r.duration,volume:r.volume,currentTime:r.currentTime,states:r.root.className}},r.setSrc=function(t){return K(r,e,t,n())},r.playerState=r.playerState||{},r.setState=function(e,t){if(r.playerState[e]===!!t)return r;const n=Object.assign({},r.playerState,{[e]:t});return n[h]&&(n[u]=!1),r.playerState=n,J(r,"state",r.playerState),r},r.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>I(this,e[n]))},r.hasState=function(e){return!!r.playerState[e]},r.transitionState=function(e,t,n){!r.hasState(e)&&r.hasState(t)||(n=0),n&&r.setState("is-toggling",!0),r.setState(t,!1),r.setState(e,!0),n&&setTimeout((function(){r.setState("is-toggling",!1)}),n)},r.emit=(e,t)=>(J(r,e,t),r),r.on=(e,t)=>($(r,e,t),r),r.once=(e,t)=>(te(r,e,t),r),r.off=(e,t)=>{var n,o;return n=e,o=t,r.removeEventListener(n,o),r},r.poll=(e,t)=>X(r,e,t),r.togglePlay=function(t){return b(r,e,t)},r.toggleMute=function(e){e=null==e?!r.muted:!!e,r.muted=e,r.muted||r.volume||(r.volume=1),J(r,"volumechange")},r.toggleDisable=function(e){e=null==e?!r.disabled:!!e,r.setState("is-disabled",e),r.disabled=e},r.destroy=function(){r.pause();const e=t.indexOf(r);~e&&t.splice(e,1),setTimeout((function(){r.setSrc([]),r.reaper&&r.reaper.clear(),J(r,s)}),0)},r.setAttrs=function(e){return oe.forEach(t=>{if(!(t in e))return;const n=e[t];n?r.setAttribute(t,n.toString()):r.removeAttribute(t)}),r},r.opt=function(t,n){return n=void 0===n?Y(ne,t):n,Y(e,t,n)},r.i18n=function(e,t){if(!r.reaper)return"";const n=r.reaper.get("translations");return n?function e(t,n,o,r){return(r=r||0)>=t.length?o:Y(t[r],n,e(t,n,o,r+1))}(n,e,t||""):t||""},r.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&r.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&r.toggleMute(t.muted);const n=!!e.autoplay&&!r.hasState("no-autoplay");r.setState("is-autoplay",n),r.setState("is-rtl",r.opt("rtl",function(e){if(!e)return F();const t=e.getAttribute("dir");return t?"rtl"==t:F()}(o))),r.setState("is-live",!!e.live),r.setState("no-timeline",!(!e.live||e.dvr)),r.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),r.setState("is-seekable",!!e.seekable),o.style.backgroundImage=r.hasState("has-poster")?"url('"+e.poster+"')":"",J(r,"config",e)},r.renderPlugin=function(e){X(r,"renderplugin",e).defaultPrevented||r.root.appendChild(e)};const i={offset:0,timer:0};var a,l;l=i,(a=r).on(j,(function(){V(a,l)})),r.enqueueSeek=function(e){if(0!=r.opts.seekable&&!(1==r.opts.disabled&&e>0))return G(r,i,e)},r.deviceId=function(){return function(e){if(q)return q;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=z();return e.setItem("flowplayer/uuid",n),n}catch(e){return q=z()}}(r._storage)}}function ie(e,t){const n=t.querySelector("video"),o=n||(e._video_element_callback?e._video_element_callback(e):document.createElement("video"));return o.classList.add("fp-engine"),o.playsInline=!0,n||t.append(o),o}const ae=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function se(e,t){return!!~ae.indexOf(e)||e.indexOf(t)===e.length-t.length}se.check_whitelist=function(e){return!!~ae.indexOf(e)};const le="production";function ce(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let o={c:"{}",exp:0};t=t||{};try{o=A(e),n.valid_jwt=!0}catch(e){}return n.raw=e,n.data=JSON.parse(o.c),n.exp=o.exp,t.require_valid_token&&ce.validate(n),n}function ue(e){try{return ce.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var de;function pe(e){return{grant:e,is_granted:t=>(e&t)===t}}function fe({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 o=document.createElement("h2");o.textContent="Playback Error";const r=document.createElement("p");r.textContent="Are you the site owner?";const i=document.createElement("a");i.classList.add("troubleshoot"),i.target="_blank",i.href="https://flowplayer.com/help/developers/troubleshooting#"+n.reason,i.textContent="Troubleshoot?";const a=document.createElement("img");a.src="https://flowplayer.com/user/pages/images/logo-white.png",e.append(o,r,i,a)}function ye(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function me(e,t,o){let r=!0;t.classList.add("flowplayer"),ye(0,t),$(o,["loadstart","resize"],(function(){ye(0,t)})),$(o,"state",(function(){Object.entries(o.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),$(o,"timeupdate",(function(){o.setState(h,o.readyState<3)})),$(o,"ended",(function(t){setTimeout((function(){if(!t.defaultPrevented){if(e.rewind&&!o.loop){const t=o.src;e.autoplay&&(e.autoplay=0,o.setState("is-autoplay",!1)),o.setState(m,!0),te(o,"seeked",(function(){t===o.src&&(o.setState(m,!1),o.pause(),o.setState(y,!0))})),o.currentTime=0}te(o,"timeupdate",(function(){o.setState(E,!1)})),o.transitionState(E,u,e.loop||e.rewind?0:300)}}),0)})),$(o,["seeking","seeked"],(function(e){o.setState(m,"seeking"==e.type),o.setState(d,o.paused),o.setState(u,!o.paused)})),$(o,"ended",(function(){o.setState(u,!1),r=!0})),$(o,n().ios?i:a,(function(){var e,t;o.setState(p,!0),o.setState(f,!1);const n=o;0===(null===(e=n.videoTracks)||void 0===e?void 0:e.length)&&(null===(t=n.audioTracks)||void 0===t?void 0:t.length)>0&&o.emit("audioonlysource")})),$(o,["waiting","canplay","loadstart"],(function(t){if(!o.hasState(m)&&("canplay"!=t.type||e.autoplay||o.setState(h,!1),"loadstart"!=t.type||"none"!=o.opt("preload")||e.autoplay)){if("loadstart"==t.type&&e.autoplay)return te(o,"playing",(function(){o.setState(h,!1)}));"waiting"==t.type&&([u,d,y].forEach((function(e){o.setState(e,!1)})),o.hasState(p)||o.setState(f,!0)),o.setState(E,!1),o.setState(h,"waiting"==t.type)}})),$(o,["playing","pause"],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:o});document.dispatchEvent(e)},0);const n="playing"==t.type,i=o.currentTime==o.duration,a=n&&r&&e.autoplay||o.hasState(h);if(n&&(o.started=!0,r=!1),o.setState(h,!1).setState(y,!1),i||o.hasState(m))return;const s=n?u:d,l=n?d:u;o.transitionState(s,l,a?0:300),n&&o.setState("no-autoplay",!1)}))}ce.validate=function(e){if("string"==typeof e&&(e=ce(e)),!e||!e.raw){if(se.check_whitelist(window.location.hostname)||"dev"===le.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=se.bind(null,t);if("dev"!==le.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==le.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},ce.id=function(e){if(e)return"string"==typeof e&&(e=ce(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"}(de||(de={})),pe.of=pe,pe.from_token=function(e){const t=ce(e,{require_valid_token:!0});return pe.of(t.data.acl)},pe.permissions=de;const Ee=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function he(e,t,n){if(!window.IntersectionObserver)return;const i={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[r,o].forEach(e=>te(n,e,()=>i.has_user_gesture=!0)),$(n,"play",(function(){i.locked||(i.should_resume=!0)})),$(n,"src",(function(){i.should_resume=!!e.autoplay})),$(n,"pause",(function(){i.locked||(i.should_resume=!1)})),$(n,"canplay",(function(t){if(e.autoplay)return n.hasState(g)&&i.should_resume?n.togglePlay(!0):void(e.autopause||n.hasState(g)||!i.should_resume||te(n,"viewenter",()=>{e.autoplay&&i.should_resume&&n.togglePlay(!0)}))}));const a=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,o=n.hasState(g);if(n.setState(g,t>=.2),n.emit("intersectionchange",{ratio:t}),o===n.hasState(g))return;const r=n.hasState(g)?"viewenter":"viewleave";n.emit(r)},0)})},{threshold:Ee});a.observe(t),n.on(s,()=>a.disconnect()),e.autopause&&($(n,"viewenter",(function(){i.should_resume&&e.autopause&&n.togglePlay(!0)})),$(n,"viewleave",(function(){if(!e.autopause)return;const t=!n.paused;i.locked=!0,n.pause(),setTimeout((function(){i.should_resume=t,i.locked=!1}),0)})))}function ge(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(s,()=>n.disconnect())}function we(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 _e(e,t,n){const o=document.createElement("div");o.classList.add("fp-ratio"),t.append(o);let r=we(e.ratio||.5625);o.style.paddingTop=100*r+"%";const s=[a,i];n.on(s,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on("config",(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=we((null==e?void 0:e.ratio)||t||.5625);r!==i&&(r=i,o.style.paddingTop=100*i+"%")}))}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("playing",this.render),null===(t=this.player)||void 0===t||t.once("ended",this.wireUp)}cleanUp(){var e,t,n,o;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("playing",this.render),null===(o=this.player)||void 0===o||o.off("ended",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 o=(null===(n=this.root)||void 0===n?void 0:n.querySelector(".fp-ui"))||this.root;if(!o)return;const r=this._logo=document.createElement("a");r.href="https://explorer.flowplayer.com",r.target="_blank",Object.entries(ve).forEach(([e,t])=>{r.style.setProperty(e,t,"important")}),o.appendChild(r)}}const ve={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)"};function Se(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(s,()=>document.removeEventListener("flowplayer/playing",t)),document.addEventListener("flowplayer/playing",t)}const Oe=function(){const e="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function Ae(n,o){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),Ae;"string"==typeof o&&(o={src:o}),o||(o={}),o.token||"string"!=typeof window.__FLOWPLAYER_TOKEN||(o.token=window.__FLOWPLAYER_TOKEN);const r="string"==typeof n?document.querySelector(n):n;if(!r)return console.error(new Error("Flowplayer: '"+n.toString()+"' not found"));const a=r.querySelector("video.fp-engine");if(a)return a;const l=ue(o.token);if(!l.success)return fe({root:r,data:{reason:"token",details:l.message}});const c=new Map,u=ie(o,r);u.reaper=c,u._customElements=N,Object.defineProperty(u,"token",{value:"string"==typeof o.token?ce.id(o.token):"",writable:!1}),u.addEventListener(s,()=>{c.clear(),u.reaper=0,delete u.root}),u.root=r,o.token&&pe.from_token(o.token).is_granted(pe.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(u)&&t.push(u),re(o,r,u),u.setAttrs(o),u.plugins=Ae.extensions.map(e=>new e(Ae,u)),me(o,r,u),he(o,r,u),ge(r,u),_e(o,r,u),Se(u),u.plugins.forEach(e=>{try{e.init(o,r,u)}catch(t){console.log("Error(plugin/%s)",e.constructor.name,t)}}),u.setOpts(o),u.opts=o,o.src&&u.setSrc(o.src);const d=u.readyState;return d>0&&u.currentSrc&&u.emit(i),d>2&&u.currentSrc&&u.emit("canplay"),u.emit("mount"),u.on("error:fatal",(function(e){fe({root:r,video:u,data:e.data||{}})})),u}return Object.assign(Ae,Oe),function(o){Array.isArray(o.extensions)&&o.extensions.forEach(t=>e.push(t)),o.customElements=N,o.defaultElements=c,o.version="3.1.0-rc.2",o.commit="f1b2a64310ddd065f3012d9728939b5d0b1bed26",o.instances=t,o.extensions=e,o.support=n,o.events=l,o.states=w,o.jwt=A,o.autoplay=L,o.quality=T}(Ae),"object"==typeof document&&setTimeout(J,0,document,"flowplayer:umd",Ae),Ae}));
|
package/default.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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=/SamsungBrowser/.test(t),s=i&&/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,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:i,samsung_tv:i&&s,touch:!!("ontouchstart"in window)}}const r="
|
|
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=/SamsungBrowser/.test(t),s=i&&/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,ios:e&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,samsung:i,samsung_tv:i&&s,touch:!!("ontouchstart"in window)}}const r="error",o="click",i="dblclick",s="load",a="mouseenter",l="mouseleave",c="touchend",u="fullscreenenter",d="fullscreenexit",p="loadedmetadata",f="loadeddata",h="progress",m="loadstart",y="pause",_="playing",v="waiting",g="canplay",E="ended",w="seeked",b="seeking",S="src",A="reap",O="config",T="landscape",N="portrait";var k=Object.freeze({__proto__:null,MOUNT:"mount",ERROR:r,CONTEXT_MENU:"contextmenu",CLICK:o,DBL_CLICK:i,KEYUP:"keyup",KEYDOWN:"keydown",LOAD:s,MOUSE_ENTER:a,MOUSE_LEAVE:l,MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:c,TOUCH_CANCEL:"touchcancel",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_ENTER:u,FULLSCREEN_EXIT:d,FULLSCREEN_CHANGE:"fullscreenchange",WEBKIT_NEEDKEY:"webkitneedkey",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:b,DURATION_CHANGE:"durationchange",BEFORE_PLAY:"beforeplay",BEFORE_PAUSE:"beforepause",STATE:"state",CUEPOINTS:"cuepoints",CUEPOINT_START:"cuepointstart",CUEPOINT_END:"cuepointend",VIEW_ENTER:"viewenter",VIEW_LEAVE:"viewleave",SOURCE:S,RECOVER:"recover",REAP:A,CONFIG:O,QUALITIES:"qualities",SET_QUALITY:"quality:set",NON_RECOVERABLE_ERROR:"error:fatal",RECOMMENDATIONS_READY:"recommendationsready",AUDIO_ONLY_SOURCE:"audioonlysource",LANDSCAPE:T,PORTRAIT:N,RENDER_PLUGIN:"renderplugin",DVR:"dvr",LIVE:"live",SEEK_QUEUED:"seek:queued",SEEK_CANCEL:"seek:cancel",PLUGIN_REGISTERED:"plugin:registered",REMOTE_SESSION_STARTED:"remotesession:started",REMOTE_SESSION_ENDED:"remotesession:ended",INTERSECTIONCHANGE:"intersectionchange"});const I="flowplayer-ui",L="flowplayer-control",R="flowplayer-live-status",C="flowplayer-elapsed-time",D="flowplayer-timeline-bar",x="flowplayer-volume-bar",M="flowplayer-header",U="flowplayer-primary",P="flowplayer-middle",F="flowplayer-middle-zone",B="flowplayer-wait",j="flowplayer-play-icon",H="flowplayer-pause-icon",G="flowplayer-rewind-icon",q="flowplayer-volume-icon";var V=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",UI:I,CONTROL:L,CONTROL_BUTTONS:"flowplayer-control-buttons",LIVE_STATUS:R,ELAPSED:C,TIMELINE:D,CONTROL_DURATION:"flowplayer-control-duration",VOLUME_CONTROL:"flowplayer-volume-control",VOLUME_BAR:x,HEADER:M,HEADER_LEFT_ZONE:"flowplayer-header-left-zone",HEADER_RIGHT_ZONE:"flowplayer-header-right-zone",PRIMARY:U,HEADER_DURATION:"flowplayer-header-duration",MIDDLE:P,MIDDLE_ZONE:F,WAIT:B,MIDDLE_BUTTONS:"flowplayer-middle-buttons",MIDDLE_LEFT_ZONE:"flowplayer-middle-left-zone",MIDDLE_RIGHT_ZONE:"flowplayer-middle-right-zone",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:j,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:G,SHARE_ICON:"flowplayer-share-icon",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"});const z="is-playing",K="is-paused",W="is-loaded",Y="is-loading",X="is-starting",Q="is-seeking",Z="is-ended",J="is-live",$="is-waiting",ee="no-timeline",te="is-touched",ne="is-in-viewport";var re=Object.freeze({__proto__:null,PLAYING:z,FULLSCREEN:"is-fullscreen",PAUSED:K,MUTED:"is-muted",LOADED:W,LOADING:Y,STARTING:X,SEEKING:Q,GRABBING:"is-grabbing",DISABLED:"is-disabled",SMALL:"is-small",TINY:"is-tiny",RTL:"is-rtl",ENDED:Z,LIVE:J,ERRORED:"is-error",WAITING:$,AUTOPLAY:"is-autoplay",NO_AUTOPLAY:"no-autoplay",SEAMLESS:"is-seamless",TOGGLING:"is-toggling",LIVE_SEEKED:"is-live-seeked",NO_DVR:ee,HAS_POSTER:"has-poster",MENU_OPENED:"has-menu-opened",TOUCHED:te,HOVERED:"is-hovered",TOUCH_DEVICE:"is-touch-device",WILL_SEEK:"will-seek",SEEKABLE:"is-seekable",IN_VIEWPORT:ne});function oe(e){this.message=e}oe.prototype=new Error,oe.prototype.name="InvalidCharacterError";var ie="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new oe("'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 se=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(ie(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 ie(t)}};function ae(e){this.message=e}ae.prototype=new Error,ae.prototype.name="InvalidTokenError";var le=function(e,t){if("string"!=typeof e)throw new ae("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(se(e.split(".")[n]))}catch(e){throw new ae("Invalid token specified: "+e.message)}};le.InvalidTokenError=ae;const ce=new Map,ue=(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),de=(e,t,n)=>{window.customElements.get(t)||window.customElements.define(t,n),e.customElements.get(t)||e.customElements.set(t,t)};var pe,fe;!function(e){e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=4]="HIGH"}(pe||(pe={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON",e[e.AUDIO_REQUIRED=2]="AUDIO_REQUIRED"}(fe||(fe={}));function he(e,t,n){const r="boolean"==typeof n;if("boolean"!=typeof n&&(n=e.paused),function(e,t,n){const r=e.poll(t?"beforeplay":"beforepause",{forced:n});return r&&r.defaultPrevented}(e,n,r))return;if(!n)return e.hasState(J)&&e.setState("is-live-seeked",!0),e.pause();if(0==e.reaper)return;const o=e.reaper.get("__pending_play");return 0!=e.paused||o?o?(o.src!==ye(e.original_src)&&me(e),o):(function(e){return(0==e.networkState||0==e.readyState)&&e.currentSrc==ye(e.original_src)}(e)&&me(e),(e=>e.autoplay&&fe.AUDIO_REQUIRED&e.autoplay)(t)?function(e){e.muted=!1,0==e.volume&&(e.volume=1);return e.play().catch(e=>{console.warn("[flowplayer/play] autoplay audio required\n%s",e.message)})}(e):(e.setState(X,!1),e.play().catch(t=>(console.warn("[flowplayer/play] attempting muted autoplay\n%s",t.message),e.muted=!0,e.volume=0,e.play())))):void 0}function me(e){e.currentSrc.match(/^blob:/)||e.load()}function ye(e){const t=document.createElement("a");return t.href=e,t.href}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function fe(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 he(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function me(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 ye(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const _e=e=>{var{src:t}=e,n=fe(e,["src"]);return[Object.assign({src:t,type:t?ye("video/"+me(t)):""},n)]};function ve(e){return _e({src:e})}function ge(e){var{src:t,type:n}=e,r=fe(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:_e(Object.assign({src:t},r))}var Ee;function we(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?ve(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=ve(t)),"object"!=typeof t||Array.isArray(t)||(t=ge(t)),e.concat(t)}),[]):ge(e)}(n);return e.currentSrc&&(e.innerHTML=""),[Y,q,V,W,z].forEach(t=>e.setState(t,!1)),t.autoplay&&e.hasState(J)||e.setState(K,!0),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(Ee.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 r?(r.onload(t,e.root,e,n),Ee.Ok):Ee.Err}(e,t,i)||Ee.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 Ee.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return Ee.Err;"string"==typeof n.src&&(e.preload=t.autoplay?"auto":null!==(o=t.preload)&&void 0!==o?o:"auto",e.src=n.src,"none"!==e.preload&&e.setState(W,!0));return Ee.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Ee||(Ee={}));const be=[b,w,"src","seek:cancel"];var Se;function Ae(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?Oe(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,Oe(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Se.BACKWARD,t.offset<0),e.setState(Se.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function Oe(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Se.FORWARD,!1),e.setState(Se.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Te(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function Ne(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function ke(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Le(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 Ie(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function Re(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+":"+Ie(r)+":"+Ie(e)):t+Ie(r)+":"+Ie(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Se||(Se={}));const Ce=navigator.languages||[navigator.language];function De(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return Ce.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 xe=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Me=()=>"undefined"==typeof crypto?"":xe.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Ue="";!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 Pe=["touchstart","touchmove"];function Fe(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Be(e,t,n){const r=Fe(t,n);return e.dispatchEvent(r),e}function je(e,t,n){const r=Fe(t,n);return e.dispatchEvent(r),r}function He(e,t,n,r){Array.isArray(t)?t.forEach(t=>Ge(e,t,n,r)):Ge(e,t,n,r)}function Ge(e,t,n,r){if(o=t,!~Pe.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 qe(e,t,n,r){return He(e,t,n,Object.assign(r||{},{once:!0}))}class PlayerStorage{constructor(e){this.implementation=e}removeItem(e){try{this.implementation.removeItem(e)}catch(e){}}getItem(e){try{return this.implementation.getItem(e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem(e,t)}catch(e){}}clear(){try{this.implementation.clear()}catch(e){}}get length(){try{return this.implementation.length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}const Ve={preload:"none",rtl:!1,controls:!0},ze=["loop","muted","preload"];function We(e,r,o){o._storage=new PlayerStorage(window.localStorage),o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return we(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 n[Q]&&(n[q]=!1),o.playerState=n,Be(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>se(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)=>(Be(o,e,t),o),o.on=(e,t)=>(He(o,e,t),o),o.once=(e,t)=>(qe(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)=>je(o,e,t),o.togglePlay=function(t){return ue(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Be(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(),Be(o,b)}),0)},o.setAttrs=function(e){return ze.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?Le(Ve,t):n,Le(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:Le(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Ne();const t=e.getAttribute("dir");return t?"rtl"==t:Ne()}(r))),o.setState("is-live",!!e.live),o.setState("no-timeline",!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Be(o,S,e)},o.renderPlugin=function(e){je(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var s,a;a=i,(s=o).on(be,(function(){Oe(s,a)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return Ae(o,i,e)},o.deviceId=function(){return function(e){if(Ue)return Ue;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=Me();return e.setItem("flowplayer/uuid",n),n}catch(e){return Ue=Me()}}(o._storage)}}function Ke(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}function Ye(e,t){if("object"==typeof exports&&"undefined"!=typeof module)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 Xe(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const Qe=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function Ze(e,t){return!!~Qe.indexOf(e)||e.indexOf(t)===e.length-t.length}Ze.check_whitelist=function(e){return!!~Qe.indexOf(e)};const Je="production";function $e(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=oe(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&&$e.validate(n),n}function et(e){try{return $e.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var tt;function nt(e){return{grant:e,is_granted:t=>(e&t)===t}}function rt({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://flowplayer.com/help/developers/troubleshooting#"+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)}function ot(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function it(e,t,r){let o=!0;t.classList.add("flowplayer"),ot(0,t),He(r,[h,"resize"],(function(){ot(0,t)})),He(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),He(r,"timeupdate",(function(){r.setState(Q,!1)})),He(r,g,(function(t){setTimeout((function(){if(!t.defaultPrevented){if(e.rewind&&!r.loop){const t=r.src;e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(Y,!0),qe(r,E,(function(){t===r.src&&(r.setState(Y,!1),r.pause(),r.setState(K,!0))})),r.currentTime=0}qe(r,"timeupdate",(function(){r.setState(X,!1)})),r.transitionState(X,q,e.loop||e.rewind?0:300)}}),0)})),He(r,[w,E],(function(e){r.setState(Y,e.type==w),r.setState(V,r.paused),r.setState(q,!r.paused)})),He(r,g,(function(){r.setState(q,!1),o=!0})),He(r,n().ios?d:p,(function(){var e,t;r.setState(z,!0),r.setState(W,!1);const n=r;0===(null===(e=n.videoTracks)||void 0===e?void 0:e.length)&&(null===(t=n.audioTracks)||void 0===t?void 0:t.length)>0&&r.emit("audioonlysource")})),He(r,[_,v,h],(function(t){if(!r.hasState(Y)&&(t.type!=v||e.autoplay||r.setState(Q,!1),t.type!=h||"none"!=r.opt("preload")||e.autoplay)){if(t.type==h&&e.autoplay)return qe(r,y,(function(){r.setState(Q,!1)}));t.type==_&&([q,V,K].forEach((function(e){r.setState(e,!1)})),r.hasState(z)||r.setState(W,!0)),r.setState(X,!1),r.setState(Q,t.type==_)}})),He(r,[y,m],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n=t.type==y,i=r.currentTime==r.duration,s=n&&o&&e.autoplay||r.hasState(Q);if(n&&(r.started=!0,o=!1),r.setState(Q,!1).setState(K,!1),i||r.hasState(Y))return;const a=n?q:V,l=n?V:q;r.transitionState(a,l,s?0:300),n&&r.setState("no-autoplay",!1)}))}$e.validate=function(e){if("string"==typeof e&&(e=$e(e)),!e||!e.raw){if(Ze.check_whitelist(window.location.hostname)||"dev"===Je.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=Ze.bind(null,t);if("dev"!==Je.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==Je.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},$e.id=function(e){if(e)return"string"==typeof e&&(e=$e(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"}(tt||(tt={})),nt.of=nt,nt.from_token=function(e){const t=$e(e,{require_valid_token:!0});return nt.of(t.data.acl)},nt.permissions=tt;const st=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function at(e,n,o){if(!window.IntersectionObserver)return;const i={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[l,r].forEach(e=>qe(o,e,()=>i.has_user_gesture=!0)),He(o,"play",(function(){i.locked||(i.should_resume=!0)})),He(o,"src",(function(){i.should_resume=!!e.autoplay})),He(o,m,(function(){i.locked||(i.should_resume=!1)})),He(o,v,(function(n){if(e.autoplay&&(!t.filter((function(e){return!e.paused})).length||e.multiplay))return o.hasState(J)&&i.should_resume?o.togglePlay(!0):void(e.autopause||o.hasState(J)||!i.should_resume||qe(o,"viewenter",()=>{e.autoplay&&i.should_resume&&o.togglePlay(!0)}))}));const s=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,n=o.hasState(J);if(o.setState(J,t>=.2),o.emit("intersectionchange",{ratio:t}),n===o.hasState(J))return;const r=o.hasState(J)?"viewenter":"viewleave";o.emit(r)},0)})},{threshold:st});s.observe(n),o.on(b,()=>s.disconnect()),e.autopause&&(He(o,"viewenter",(function(){i.should_resume&&e.autopause&&o.togglePlay(!0)})),He(o,"viewleave",(function(){if(!e.autopause)return;const t=!o.paused;i.locked=!0,o.pause(),setTimeout((function(){i.should_resume=t,i.locked=!1}),0)})))}function lt(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 ut(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=ct(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[p,d];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(S,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=ct((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.style.paddingTop=100*i+"%")}))}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(y,this.render),null===(t=this.player)||void 0===t||t.once(g,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(y,this.render),null===(r=this.player)||void 0===r||r.off(g,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/"+y;function ft(e){const t=t=>{t.detail!==e&&!e.opt("multiplay")&&e.pause()};e.on(b,()=>document.removeEventListener(pt,t)),document.addEventListener(pt,t)}const ht=function(){const e=Xe(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function mt(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),mt;"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=et(r.token);if(!s.success)return rt({root:o,data:{reason:"token",details:s.message}});const a=new Map,l=Ke(r,o);l.reaper=a,l._customElements=ie,Object.defineProperty(l,"token",{value:"string"==typeof r.token?$e.id(r.token):"",writable:!1}),l.addEventListener(b,()=>{a.clear(),l.reaper=0,delete l.root}),l.root=o,r.token&&nt.from_token(r.token).is_granted(nt.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),We(r,o,l),l.setAttrs(r),l.plugins=mt.extensions.map(e=>new e(mt,l)),it(r,o,l),at(r,o,l),lt(o,l),ut(r,o,l),ft(l),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(d),c>2&&l.currentSrc&&l.emit(v),l.emit("mount"),l.on("error:fatal",(function(e){rt({root:o,video:l,data:e.data||{}})})),l}Object.assign(mt,ht),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.customElements=ie,r.defaultElements=G,r.version="3.0.8",r.commit="c23496a4f8c940803c8c2853e8f12754b7e23298",r.instances=t,r.extensions=e,r.support=n,r.events=T,r.states=$,r.jwt=oe,r.autoplay=ce,r.quality=le}(mt),"object"==typeof document&&setTimeout(Be,0,document,"flowplayer:umd",mt);var yt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _t(e){var t={exports:{}};return e(t,t.exports),t.exports}var vt=_t((function(e,t){var n=yt&&yt.__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}})),gt=_t((function(e,t){var n=yt&&yt.__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=yt&&yt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=yt&&yt.__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})),Et=_t((function(e,t){var n=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(gt);t.default=r.default.of()})),wt=_t((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 "))}))}})),bt=_t((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})),St=_t((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"})),At=_t((function(e,t){var n=yt&&yt.__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=yt&&yt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=yt&&yt.__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=yt&&yt.__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=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=s(Et),l=s(gt),c=o(wt),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=bt.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=St.Verb,e}();t.default=d})),Ot=_t((function(e,t){var n=yt&&yt.__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=yt&&yt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=yt&&yt.__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=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=i(At);t.Tracker=s.default;var a=o(wt);t.API=a})),Tt="ping",Nt="display",kt="view";const Lt=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],It=["created","position"],Rt=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function Ct(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 Dt(e,t,n){if(!t.segment_duration&&!Ct(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:xt(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(Tt,{position:r})}function xt(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const Mt="vod",Ut="live",Pt=[Nt,Tt,kt];function Ft(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(Tt,{position:60*t.ticks}))}(e,t);case"vod":return Dt(e,t,"boolean"==typeof n&&n)}}function Bt(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))))}function jt(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class Analytics{init(e,t,n){if(!nt.from_token(e.token||"").is_granted(nt.permissions.ANALYTICS))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{Ft(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},s=Ot.Tracker.of(n,{verb:Ot.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:Pt,required_keys:Lt,optional_keys:Rt.concat(It).slice(0),metadata:i});n.on(b,(function(){s&&s.destroy()})),n.on(S,(function(t){if(!s)return;const o=Le(t,"data.metadata",{});if(!o.media_id)return;const i=Le(s,"metadata.media_id");if(i&&o.media_id==i)return;const a=Le(e,"analytics",{});s.put(o),s.put(a);const l=Le(e,"metadata.live_start_time",e.live)?Ut:Mt;s.put({video_type:l,source:e.source||jt()||""}),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(Nt)}));let a=0;n.on(y,(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=Bt(n);if(e)return a=Promise.resolve(e).then((function(){r.last_media_id=s.metadata.media_id,n.emit(kt),a=0})).catch((function(){a=0}));r.last_media_id=s.metadata.media_id,n.emit(kt)})),n.on("timeupdate",(function(){var t;s&&(a||Bt(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&Ft(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(E,(function(){s&&r.ticker&&"vod"==r.ticker.kind&&function(e,t){Ct(e,t),t.last_idx=xt(e,t)}(n,r.ticker)})),n.on(g,(function(){s&&function(e,t){t.ended||(t.ended=!0,Ft(e,t.ticker))}(n,r)}))}}var Ht;function Gt(e){switch(e){case Ht.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case Ht.MEDIA_ERR_NETWORK:return"a network error occurred";case Ht.MEDIA_ERR_DECODE:return"unable to decode media content";case Ht.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case Ht.NO_INTERNET:return"no internet connection detected";case Ht.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function qt(){}function Vt(e){try{return!!new URL(e)}catch(e){return!1}}Ye(Xe(),Analytics),"undefined"!=typeof window&&window.matchMedia&&[A,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"}(Ht||(Ht={}));const zt=()=>!0===(navigator||{}).onLine;function Wt(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 Kt(e,t,n){n.on("error",(function(e){const t=e.data||n.error||new Error,r=e.code||t.code,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(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;n.setState("is-error",!0),8===r||t.fatal||function(e){const t=e.togglePlay,n=e.root;e.togglePlay=qt,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const r=n.querySelector(".fp-error");r&&r.remove()}))}(n);const i=function(e,t,n){switch(t){case"http:0":return function(e){return Wt(e.original_src)?{code:Ht.MIXED_CONTENT}:zt()?{code:Ht.MEDIA_ERR_NETWORK}:zt()?{code:Ht.UNKNOWN}:{code:Ht.NO_INTERNET}}(e);case Ht.MEDIA_ERR_SRC_NOT_SUPPORTED:return e.once(h,(function(){e.emit("recover")})),n;default:return n}}(n,r,t),s=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=t.code||-1,r=Gt(n);return e.i18n("media_errors."+n,r)}(n,i);console.error(o,s);const a=n.reaper&&n.reaper.get("ui");return a&&function(e,t,n,r){if(!e)return;const o=document.createElement("div");if(o.classList.add("fp-error"),o.innerText=t,r){const t=e.querySelector("#"+r);t&&e.removeChild(t),o.id=r}if(e.append(o),n){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=n,o.append(e)}}(a,s,t.details)}))}))}var Yt=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});function Xt(e,t,n){let r=()=>document.fullscreenElement,i="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),i="webkit"+i,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")),Qt(n)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(n):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(Z)||e.setState(Z,!0)}(n,t)),!document.fullscreenEnabled)return;const r=s();e?r.requestFullscreen():document.exitFullscreen()},Qt(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on("webkitendfullscreen",(function(){n.toggleFullScreen(!1,!0)}))),setTimeout(()=>{const e=s();e.addEventListener(i,(function(){const t=r(),o=t===e||t==n;n.emit(o?c:u),n.setState("is-fullscreen",o)}))},0),!1!==e.doubleclick&&t.addEventListener(o,(function(e){var t;e.target&&(null===(t=e.target)||void 0===t?void 0:t.classList.contains("fp-ui"))&&n.toggleFullScreen()}))}function Qt(e){return n().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function Zt(e,t){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const n=e.seekable.end(e.seekable.length-1);return{head:n,tail:Math.max(e.seekable.start(0),n-t)}}function Jt(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function $t(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:e.seekable.end(0)}function en(e){return function(e,t){return Zt(e,t).head}(e,0)-.5}function tn(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=se(n,N);r.appendChild(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=ke("fp-footer");t.append(r),n.on(S,(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=ke("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=ke("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),Kt(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)}))}),Xt(e,t,n),n.on("volumechange",(function(){const e=0==n.volume||n.muted;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 i=n._storage.getItem("volume");i&&!isNaN(Number(i))&&(n.volume=Number(i)),n.emit("volumechange"),n.on("dvr/window",t=>{var r;e.live&&(!("dvr"in(r=e))||1==r.dvr)&&function(e,t,n){if(0==t)return!0;const r=Zt(e,n);return r.head-r.tail>=t}(n,e.seconds_to_dvr||60,t.detail)&&n.setOpts({dvr:n.seekable.length>0})}),n.on("live",(function(){n.setState("is-live-seeked",!1)})),n.on("seeking",(function(){if(!Jt(n))return;if(0==n.seekable.length||0==n.played.length)return;if(0==$t(n))return;const e=en(n),t=n.currentTime>=e?"live":"dvr";if("live"===t)return n.emit(t);const r=$t(n),o=n.seekable.end(0)-n.seekable.start(0),i=(r-n.currentTime)/o*100,s=Math.round(i);n.setState("is-live-seeked",s>0),n.emit(t,{offset:s})})),n.on(d,(function(){n.setOpts({live:Jt(n)})})),n.on("durationchange",(function(e){const t=Jt(n),r=t?$t(n):e.data||n.duration;isNaN(r)||n.setOpts({live:t,duration:r})})),n.on(S,(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("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 l=null;o.addEventListener("mousemove",(function(){"number"==typeof l&&clearTimeout(l),n.setState("is-hovered",!0),l=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3)}))}function nn(e,t,n){if(nt.from_token(e.token||"").is_granted(nt.permissions.NO_METERING))return;const r=$e.id(e.token||"");r&&n.once(y,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(n,r))}var rn={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",De(I18n,e,"en"))}}I18n.en=rn;const on="rebuffer";var sn=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:on});const an=navigator;function ln(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=an.connection)||void 0===n?void 0:n.downlink)||-1}function cn(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const un="https://ljsp.lwcdn.com".concat("/web/public/countdown/time.json"),dn=window,pn=dn._flowplayerTimekeeper||(dn._flowplayerTimekeeper={});const fn=e=>{switch(e){case!0:return ce.ON;case!1:return ce.OFF;default:return e}},hn=[];function mn(e){if(e.suspended)return;const t=hn.slice(0);hn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),cn("https://health.flowplayer.com/v1/health/events",t))}function yn(e,t,n){return he(this,void 0,void 0,(function*(){const r=yield vn();hn.push(Object.assign(t,r)),e.logger.log(":enqueue",t.event,t),hn.length<10&&!n||mn(e)}))}const _n=()=>{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}},vn=()=>he(void 0,void 0,void 0,(function*(){try{const e=yield function(){return he(this,void 0,void 0,(function*(){const e=pn.cachedServerOffset;if(e)return e;const t=pn.pendingRequest||(pn.pendingRequest=fetch(un)),n=yield t,r=parseInt(n.headers.get("age")||"0"),o=yield n.json(),i=Date.now()-o.millisUtc-1e3*r;return pn.cachedServerOffset=i,pn.cachedServerOffset}))}();return{timestamp:Date.now()-e,adjustedTimestamp:!0}}catch(e){return{timestamp:Date.now(),adjustedTimestamp:!1}}})),gn=(e,t)=>Object.assign(e,{detail:t}),En=(e,{event:t,media_session_id:n,session_id:r})=>({event:t,media_session_id:n,session_id:r,device_id:e.deviceId(),version:"3.0.8",commit:"c23496a4f8c940803c8c2853e8f12754b7e23298",ima_sdk_version:_n(),preload:e.opt("preload"),autoplay:fn(e.opt("autoplay")),live:e.opt("live"),dvr:e.opt("dvr"),source:e.original_src,downlink_mbs:ln(e),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")}),wn=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 bn(e,t,n,r){const o=En(t,e.eventInfo(n)),{before:i,after:s}=r;yn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,wn(i),wn(s)))}const Sn=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}},An=Me();class Health{constructor(e,t){this.session_id=An,this.suspended=!1,this.logger=function(e,t){return{log:(...n)=>{const r=e.opt("debug");r&&t.match(r)&&console.log(t,...n)}}}(t,"health"),this.media_session_id=Me(),this.analyticsLoop=setInterval(()=>mn(this),2e3),t.on(b,()=>clearInterval(this.analyticsLoop));const n=this;if(t.health={get media_session_id(){return n.media_session_id},set media_session_id(e){n.media_session_id=e},get session_id(){return n.session_id},set session_id(e){n.session_id=e},toggle(e){e?n.resume():n.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}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>mn(this),2e3)}init(e,t,n){!function(e){e.on(_,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit(on)}))}(n),n.on("health:record",({detail:e})=>{const t=En(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),yn(this,t)}),[v,h,i,d,p,f,_,on].forEach(e=>{n.on(e,e=>{yn(this,En(n,this.eventInfo(e.type)))})}),[y,m,w,E,g,c,u].forEach(e=>{n.on(e,e=>{yn(this,En(n,this.eventInfo(e.type)))})}),n.on("volumechange",Sn(800,e=>{const t=En(n,this.eventInfo(e.type));yn(this,gn(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on("resize",Sn(800,e=>{const r=En(n,this.eventInfo(e.type));yn(this,gn(r,{height:t.clientHeight,width:t.clientWidth}))})),n.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return bn(this,n,e,t)}});let r=Date.now()+5e3;n.on("timeupdate",e=>{if(Date.now()<r)return;r=Date.now()+5e3;const t=En(n,this.eventInfo(e.type));var o;yn(this,gn(t,{duration:(o=n.duration,Number.isFinite(o)?o:o===1/0?-1:void 0)}))}),n.addEventListener("error",e=>{const t=En(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||Gt(o),error_code:o,error_stack:r.stack||""};return yn(this,gn(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(!Vt(n.original_src))return;if(!Vt(r))return;if(r==n.original_src)return;this.media_session_id=Me();yn(this,En(n,this.eventInfo(e.type))),mn(this)}),n.on("visibilitychange",e=>{yn(this,En(n,this.eventInfo(e.type))),mn(this)})}}var On;function Tn(e,t){if(function(e){return Object.values(On).includes(e)}(t=t||On.Anonymous))return e instanceof HTMLVideoElement&&(e.poster="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),"crossOrigin"in e?e.crossOrigin=t:e.setAttribute("crossorigin",t),e}function Nn(e){const t=document.createElement("a");return t.href=e,t.origin}function kn(e,t){const n=document.createElement("track");n.className="fp-track renderable",n.kind=t.kind||"captions",n.id=["fp",t.lang].join("-");const r=n.track;return"string"!=typeof t.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),Nn(e.src)!==Nn(t)}catch(e){return console.error(e),!0}}(e,t.src)&&(Tn(e),t.crossorigin=e.getAttribute("crossorigin")),"crossorigin"in t&&Tn(e,t.crossorigin),Object.keys(t).forEach(e=>{"default"!==e&&(n[e]=t[e])}),r.mode=t.default?"hidden":"disabled",n.onload=function(){},r.oncuechange=function(t){e.emit(t.type,{track:t.target})},e.appendChild(n),n}Health.events=sn,Health._UNLOAD_SUBSCRIBED=!1,Ye(window,Health),function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(On||(On={}));var Ln=Object.freeze({__proto__:null,CHAPTER_CHANGED:"chapter:changed",CHAPTERS_NEW:"chapters:new"});class Chapters{constructor(){this._track_added_handler=qt,this._cue_changed_handler=qt,this.chapters=[],this.render=this.render.bind(this)}init(e,t,n){this._root=t,this._player=n,this._timeline=Te(n,R),this._track_added_handler=this.track_added.bind(this,n),this._cue_changed_handler=this.cue_changed.bind(this,n),n.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(n,e),n.chapters=this,n.on(S,e=>{e.data&&this.wireup(n,e.data)}),n.on(b,()=>{this.wiredown(n),n.textTracks.removeEventListener("addtrack",this._track_added_handler),n.off("durationchange",this.render)}),n.on("durationchange",this.render)}track_added(e,t){}cue_changed(e,t){var n;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&Be(this._timeline,"chapter:changed",null===(n=this.current_cue)||void 0===n?void 0:n.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(Be(this._timeline,"chapters:new",this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const n=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;n&&n.src!==this._current_chapters_src&&(this.wiredown(e),this._current_chapters_track=kn(e,Object.assign(Object.assign({},n),{kind:"chapters",default:!0})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=n.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track))}}Chapters.events=Ln,Ye(window,Chapters);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerPrimary extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-primary");const t={logo:""};e.on(S,e=>{var n,r;const o=t.logo,i=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";o!=i&&(t.logo=i,this.set_logo(i,null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo_href))})}set_logo(e,t){if(this.innerHTML="",!e)return;const n=document.createElement("img");if(n.classList.add("fp-logo"),n.src=e,!t)return this.append(n);const r=document.createElement("a");r.href=t,r.append(n),this.append(r)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(S,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)?Re(n):""})}}const In={name:"fp-fullscreen",translation_key:"core.fullscreen"},Rn={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},Cn={name:"fp-play",translation_key:"core.play"},Dn={name:"fp-pause",translation_key:"core.pause"},xn={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Mn={translation_key:"core.play",name:"fp-small-play"},Un={translation_key:"core.pause",name:"fp-small-pause"},Pn={name:"fp-fast-forward"},Fn={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),this.setAttribute("tabindex","0"),this.setAttribute("focusable","true")}}document.addEventListener(r,(function(e){this.active_menu&&!e.composedPath().includes(this.active_menu)&&(Array.from(document.querySelectorAll(".fp-engine")).forEach(e=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Bn={passive:!0};var jn;function Hn(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(jn.GRABBING),s.remove(jn.TOUCHING);const a=t.onseek||qt,c=t.onstart||qt,u=t.onend||qt,d=t.onmouse||qt,p=t.ontouch||qt,f=t.ontouchend||qt;function h(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 m(t){const n=h(t);n!=o&&(a(e,n),o=n)}return e.addEventListener("touchstart",(function(t){Gn(e,t)&&(s.add(jn.TOUCHING),qn(e.parentElement)&&(t.preventDefault(),s.add(jn.GRABBING),p(e,h(t)),c(e,h(t)),m(t)))}),Bn),e.addEventListener("touchmove",(function(t){t.preventDefault(),m(t),d(e,h(t))}),Bn),e.addEventListener(l,(function(t){setTimeout((function(){s.remove(jn.TOUCHING)}),500),Gn(e,t)&&(t.preventDefault(),s.remove(jn.GRABBING),f(e,h(t)),u(e,h(t)),r=0)}),Bn),e.addEventListener("touchcancel",(function(){s.remove(jn.GRABBING,jn.TOUCHING),r=0}),Bn),e.addEventListener("mousedown",(function(t){s.contains(jn.TOUCHING)||(document.addEventListener("mousemove",m),s.add(jn.GRABBING),c(e,h(t)),t.preventDefault(),m(t))})),e.addEventListener("mousemove",(function(t){s.contains(jn.TOUCHING)||d(e,h(t))})),document.addEventListener("mouseup",(function(t){s.contains(jn.TOUCHING)||(document.removeEventListener("mousemove",m),s.contains(jn.GRABBING)&&(s.remove(jn.GRABBING),u(e,h(t)),r=0))})),e}function Gn(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!qn(e.parentElement)||!e.classList.contains(jn.TOUCHING))}function qn(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"}(jn||(jn={}));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),Hn(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",()=>{(0==e.volume||e.muted)&&this.adjustVolumeSlider(0),this.classList.contains(jn.GRABBING)||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString());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)})}}function Vn(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 zn(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 Wn(e,t){e.style.width="0",t.style.display="none"}function Kn(e,t,n){if(t.seeking||!t.seekable||0==t.seekable.length)return;Vn(n,e);const r=t.seekable.end(t.seekable.length-1)-t.seekable.start(0),o=(100-Math.max(0,Math.min(e,100)))/100*r;n.innerText="-"+Re(o)}function Yn(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;if(isFinite(e.duration))return $t(e)*t;const n=e.seekable.start(0);return n+t*(e.seekable.end(0)-n)}(t,e)}function Xn(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=ke("fp-buffer"),this.progress=ke("fp-progress","fp-color"),this.tooltipEle=ke("fp-timestamp"),this.proposedSeekBar=ke("fp-hover"),this.dragger=ke("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("timeline","Timeline")),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);let n=!1;const r=requestAnimationFrame;let o=void 0;const i=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",o=void 0,e.paused||this.classList.contains(jn.GRABBING)||o||(o=setTimeout(i,200)))},s=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);Hn(this,{onseek:(n,r)=>{if(s())switch(!!t.live){case!0:Kn(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),Vn(this.tooltipEle,r)}},onstart:()=>{s()&&(e.emit("timeline/gesture/start"),e.setState(Y,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(n,o){r(i),0!=t.seekable&&(e.setState(Y,!1),t.live&&Yn(o,e))},ontouch:function(){e.paused||(n=!0,e.pause())},ontouchend:()=>{n&&(n=!1,e.play()),t.live?Xn(this.proposedSeekBar,this.tooltipEle):Wn(this.proposedSeekBar,this.tooltipEle)},onmouse:(n,r)=>{if(s()&&!this.classList.contains(jn.GRABBING))switch(e.emit("timeline/gesture/move",{percent:r}),!!t.live){case!0:!function(e,t){t.style.width=function(e){return 100-e}(e)+"%"}(r,this.proposedSeekBar),Kn(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;Vn(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=Re(e/100*t.duration),n.append(r)}(r,e,this.tooltipEle)}}}),e.on(S,(function(e){e.data&&(t=e.data)})),e.on(y,()=>r(i)),e.on("live",()=>{this.progress.style.width="0%"}),e.on(f,()=>{0==e.reaper||t.live||zn(e,this.bufferEle)}),e.on("dvr",e=>{e.detail&&(this.progress.style.width=e.detail.offset+"%")}),e.on("timeupdate",()=>{0!=e.reaper&&(r(i),this.setAttribute("aria-valuenow",e.currentTime+""),t.live||zn(e,this.bufferEle))}),e.on(d,()=>{0!=e.reaper&&(t.live||zn(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const n=Jt(e)?$t(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?Xn(this.proposedSeekBar,this.tooltipEle):Wn(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let n;this.addEventListener("chapters:new",e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const r=document.createElement("div");r.className="fp-chapter",r.style.left=e.left,r.style.bottom=r.style.top="0",r.style.width=e.width,r.title=e.title,r.onmouseover=()=>{t.innerText=e.title},r.onmouseleave=()=>{t.innerText=n||""},this.appendChild(r)})}),this.addEventListener("chapter:changed",r=>{var o;const i=r.data;i&&(t.parentNode||(null===(o=Te(e,k))||void 0===o||o.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),n=i,t.innerText=i)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=ke("fp-live-text"),n=ke("fp-live-indicator","fp-color");t.textContent="live",this.append(n,t),this.addEventListener(r,(function(){!function(e){try{if(!e.hasState("is-live-seeked"))return;e.emit("live"),e.dvr_offset=0,e.currentTime=en(e)}catch(e){console.warn("failed to seek to now: %j",e)}}(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),e.on(S,n=>{if(0==e.reaper||!n.data)return;t=n.data;const r=Jt(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=Re(r)}),e.on(d,()=>{var n,r;0==e.reaper||t.live||(r=this,(n=e).duration&&(r.innerText=Re(n.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=Re(0),e.on(S,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var n;0!=e.reaper&&(t.live?(n=e,this.innerText=Re(n.currentTime)):function(e,t){t.innerText=Re(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=se(e,"flowplayer-small-pause-icon"),n=se(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=se(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(E,()=>{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(l,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState("no-timeline")||!e.hasState("will-seek")&&!e.hasState(Z)||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 FlowplayerHeaderLeftRight extends FlowplayerComponent{constructor(e,t,...n){super(e),this.className=t;const o=e.createComponents(...n);this.append(...o),"fp-left"!==t&&o.forEach(t=>{t.addEventListener(r,()=>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(P,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[F,B].forEach(t=>{const n=se(e,t);n.removeAttribute("tabindex"),this.append(n)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=se(e,H);this.append(t),!n().ios&&this.append(se(e,C)),t instanceof FlowplayerIcon&&t.addEventListener(r,(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",L,I,R,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n(t==In?"core.fullscreen":"core.fullscreen_exit"))}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",U,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n("core.play")),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),[y,E].forEach(t=>e.once(t,()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")}))}handleClick(e){[r,o].forEach(t=>this.addEventListener(t,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(r,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState(Q)||e.togglePlay()}),0)})),e.on(o,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener(l,(function(t){0!=t.cancelable&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on(l,(function(n){setTimeout((function(){if(n.defaultPrevented)return;if(e.hasState(Q))return;if(e.ended)return e.togglePlay(!0);const r=e.hasState(K);t&&clearTimeout(t),(r||e.hasState(Z)||e.hasState("no-autoplay"))&&(e.hasState(Z)&&(e.setState(Z,!1),e.setState("is-hovered",!1)),e.togglePlay(),r)||(e.setState(Z,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState(Z,!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(D,M,k))}}return mt.extensions.unshift.apply(mt.extensions,[I18n,Analytics,Health,class Default{constructor(e){ae(e,N,FlowplayerUi),ae(e,k,FlowplayerControls),ae(e,L,FlowplayerLiveStatus),ae(e,"flowplayer-control-duration",FlowplayerDuration),ae(e,R,e.extensions.find(e=>e.name===Chapters.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),ae(e,I,FlowplayerElapsedTime),ae(e,C,FlowplayerVolumeBar),ae(e,"flowplayer-volume-control",FlowplayerVolumeControl),ae(e,"flowplayer-control-buttons",FlowplayerControlButtons),ae(e,D,FlowplayerHeader),ae(e,x,FlowplayerPrimary),ae(e,"flowplayer-header-duration",FlowplayerHeaderDuration),ae(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left",x,"flowplayer-header-duration")}}),ae(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),ae(e,M,FlowplayerMiddle),ae(e,U,FlowplayerMiddleZone),ae(e,P,FlowplayerMiddleWait),ae(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),ae(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),ae(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),ae(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,Mn),this.setAttribute("role","button")}}),ae(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,Un),this.setAttribute("role","button")}}),ae(e,F,class extends FlowplayerIcon{constructor(e){super(e,Cn)}}),ae(e,B,class extends FlowplayerIcon{constructor(e){super(e,Dn)}}),ae(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,In)}}),ae(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,Rn)}}),ae(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,Pn)}}),ae(e,j,class extends FlowplayerIcon{constructor(e){super(e,Fn)}}),ae(e,H,class extends FlowplayerIcon{constructor(e){super(e,xn),this.classList.add("fp-volumebtn"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute"))})}})}init(e,t,n){var r;nn(e,0,n),tn(e,t,n),r=n,"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}}]),Object.assign(mt,{ui:Yt,i18n:I18n})}));
|
|
15
|
+
***************************************************************************** */function _e(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 ve(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 ge(e){switch(e){case"video/mpd":return"application/dash+xml";case"video/m3u8":return"application/x-mpegurl";default:return e}}const Ee=e=>{var{src:t}=e,n=_e(e,["src"]);return[Object.assign({src:t,type:t?ge("video/"+ve(t)):""},n)]};function we(e){return Ee({src:e})}function be(e){var{src:t,type:n}=e,r=_e(e,["src","type"]);return t&&n?[Object.assign({src:t,type:n},r)]:n&&!t?[Object.assign({type:n},r)]:Ee(Object.assign({src:t},r))}var Se;function Ae(e,t,n,r={safari:!1}){const o=function(e){return"string"==typeof e?we(e):Array.isArray(e)||"object"!=typeof e?e.reduce((function(e,t){return"string"==typeof t&&(t=we(t)),"object"!=typeof t||Array.isArray(t)||(t=be(t)),e.concat(t)}),[]):be(e)}(n);return e.currentSrc&&(e.innerHTML="",e.setOpts({live:!1,dvr_window:void 0}),delete e.opts.live,delete e.opts.dvr),[Q,z,K,Y,W].forEach(t=>e.setState(t,!1)),t.autoplay||e.setState(X,!0),Array(...Array(o.length)).map((e,t)=>t).some(n=>{const i=o[n];if(Se.Ok==function(e,t,n){e.emit(S,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 r?(r.onload(t,e.root,e,n),Se.Ok):Se.Err}(e,t,i)||Se.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 Se.Err;if(n.drm&&(!n.drm["com.apple.fps.1_0"]||!r.safari))return Se.Err;"string"==typeof n.src&&(e.preload=t.autoplay?"auto":null!==(o=t.preload)&&void 0!==o?o:"auto",e.src=n.src,"none"!==e.preload&&e.setState(Y,!0));return Se.Ok}(e,t,i,r))return!0;n==o.length-1&&"string"==typeof i.src&&(e.src=i.src)}),function(e,t){!function(e,t){if(!e.currentSrc)return;if("none"==e.opt("preload"))return;if(t.autoplay&&t.autoplay>0)return;e.load()}(e,t)}(e,t),e}!function(e){e[e.Err=0]="Err",e[e.Ok=1]="Ok"}(Se||(Se={}));const Oe=[A,b,S,"seek:cancel"];var Te;function Ne(e,t,n){return isNaN(e.duration)||isNaN(e.currentTime)?{}:(t.offset+=n,0==t.offset?ke(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,ke(e,t))}),1e3),function(e,t){e.setState("will-seek",!0),e.setState(Te.BACKWARD,t.offset<0),e.setState(Te.FORWARD,t.offset>0)}(e,t),e.emit("seek:queued",t),t))}function ke(e,t){t.timer&&clearTimeout(t.timer),t.timer=t.offset=0,function(e){e.setState(Te.FORWARD,!1),e.setState(Te.BACKWARD,!1),e.setState("will-seek",!1)}(e)}function Ie(e,t){const n=e._customElements.get(t);return n&&e.root.querySelector(n)||void 0}function Le(){if("undefined"==typeof document)return!1;const e=document.documentElement;return e&&"rtl"==e.getAttribute("dir")}function Re(...e){const t=document.createElement("div");return 0==e.length||t.classList.add(...e),t}function Ce(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 De(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}function xe(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+":"+De(r)+":"+De(e)):t+De(r)+":"+De(e)}!function(e){e.FORWARD="forward",e.BACKWARD="backward"}(Te||(Te={}));const Me=navigator.languages||[navigator.language];function Ue(e,t,n){const r={};return n=t.lang||n,e[n]&&(r[n]=e[n]),function(){try{return Me.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 Pe=[1e7]+""+-1e3+-4e3+-8e3+-1e11,Fe=()=>"undefined"==typeof crypto?"":Pe.replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16));let Be="";!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 je=["touchstart","touchmove"];function He(e,t){const n=new CustomEvent(e,{detail:t,cancelable:!0});return t&&Object.defineProperty(n,"data",{get:()=>t}),n}function Ge(e,t,n){const r=He(t,n);return e.dispatchEvent(r),e}function qe(e,t,n){const r=He(t,n);return e.dispatchEvent(r),r}function Ve(e,t,n,r){Array.isArray(t)?t.forEach(t=>ze(e,t,n,r)):ze(e,t,n,r)}function ze(e,t,n,r){if(o=t,!~je.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 Ke(e,t,n,r){return Ve(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])}),this.implementation.__fp_storage_keys=t.implementation.__fp_storage_keys||"[]");try{this.keys=JSON.parse(this.implementation.__fp_storage_keys||"[]")}catch(e){this.keys=[]}}removeKey(e,t=!1){this.keys=this.keys.filter(t=>t!==e),t||this.storeKeys()}addKey(e){this.removeKey(e,!0),this.keys.push(e),this.storeKeys()}storeKeys(){this.implementation.__fp_storage_keys=JSON.stringify(this.keys)}removeItem(e){try{this.implementation.removeItem(e),this.removeKey(e)}catch(e){}}getItem(e){try{return this.implementation.getItem(e)}catch(e){return null}}setItem(e,t){try{this.implementation.setItem(e,t),this.addKey(e)}catch(e){}}clear(){try{this.keys.forEach(e=>this.implementation.removeItem(e)),this.keys=[],this.implementation.removeItem("__fp_storage_keys")}catch(e){}}get length(){try{return this.implementation.length}catch(e){return 0}}key(e){try{return this.implementation.key(e)}catch(e){return null}}}const We={preload:"none",rtl:!1,controls:!0},Ye=["loop","muted","preload"];function Xe(e,r,o){o._storage=new PlayerStorage(window.localStorage),o.toJSON=function(){return{duration:o.duration,volume:o.volume,currentTime:o.currentTime,states:o.root.className}},o.setSrc=function(t){return Ae(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 n[$]&&(n[z]=!1),o.playerState=n,Ge(o,"state",o.playerState),o},o.createComponents=function(...e){return Array.from({length:e.length}).map((t,n)=>ue(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)=>(Ge(o,e,t),o),o.on=(e,t)=>(Ve(o,e,t),o),o.once=(e,t)=>(Ke(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)=>qe(o,e,t),o.togglePlay=function(t){return he(o,e,t)},o.toggleMute=function(e){e=null==e?!o.muted:!!e,o.muted=e,o.muted||o.volume||(o.volume=1),Ge(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(),Ge(o,A)}),0)},o.setAttrs=function(e){return Ye.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?Ce(We,t):n,Ce(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:Ce(t[o],n,e(t,n,r,o+1))}(n,e,t||""):t||""},o.setOpts=function(t){Object.assign(e,t),"disabled"in t&&void 0!==t.disabled&&o.toggleDisable(t.disabled),"muted"in t&&void 0!==t.muted&&o.toggleMute(t.muted);const n=!!e.autoplay&&!o.hasState("no-autoplay");o.setState("is-autoplay",n),o.setState("is-rtl",o.opt("rtl",function(e){if(!e)return Le();const t=e.getAttribute("dir");return t?"rtl"==t:Le()}(r))),o.setState(J,!!e.live),o.setState(ee,!(!e.live||e.dvr)),o.setState("has-poster","string"==typeof e.poster&&e.poster.length>0),o.setState("is-seekable",!!e.seekable),r.style.backgroundImage=o.hasState("has-poster")?"url('"+e.poster+"')":"",Ge(o,O,e)},o.renderPlugin=function(e){qe(o,"renderplugin",e).defaultPrevented||o.root.appendChild(e)};const i={offset:0,timer:0};var s,a;a=i,(s=o).on(Oe,(function(){ke(s,a)})),o.enqueueSeek=function(e){if(0!=o.opts.seekable&&!(1==o.opts.disabled&&e>0))return Ne(o,i,e)},o.deviceId=function(){return function(e){if(Be)return Be;try{const t=e.getItem("flowplayer/uuid");if(t)return t;const n=Fe();return e.setItem("flowplayer/uuid",n),n}catch(e){return Be=Fe()}}(o._storage)}}function Qe(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}function Ze(e,t){if("object"==typeof exports&&"undefined"!=typeof module)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 Je(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}}const $e=["localhost","127.0.0.1","0.0.0.0","s.codepen.io","cdpn.io","try.flowplayer.com"];function et(e,t){return!!~$e.indexOf(e)||e.indexOf(t)===e.length-t.length}et.check_whitelist=function(e){return!!~$e.indexOf(e)};const tt="production";function nt(e,t){const n={valid_jwt:!1,raw:"",data:{acl:0},exp:0};let r={c:"{}",exp:0};t=t||{};try{r=le(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&&nt.validate(n),n}function rt(e){try{return nt.validate(e),{success:!0,message:""}}catch(e){return{success:!1,message:e.message}}}var ot;function it(e){return{grant:e,is_granted:t=>(e&t)===t}}function st({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://flowplayer.com/help/developers/troubleshooting#"+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)}function at(e,t){const n=t.clientWidth;t.classList.toggle("is-small",n<600),t.classList.toggle("is-tiny",n<400)}function lt(e,t,r){let o=!0;t.classList.add("flowplayer"),at(0,t),Ve(r,[m,"resize"],(function(){at(0,t)})),Ve(r,"state",(function(){Object.entries(r.playerState).forEach((function([e,n]){t.classList.toggle(e,n)}))})),Ve(r,"timeupdate",(function(){r.setState($,r.readyState<3)})),Ve(r,E,(function(t){setTimeout((function(){if(!t.defaultPrevented){if(e.rewind&&!r.loop){const t=r.src;e.autoplay&&(e.autoplay=0,r.setState("is-autoplay",!1)),r.setState(Q,!0),Ke(r,w,(function(){t===r.src&&(r.setState(Q,!1),r.pause(),r.setState(X,!0))})),r.currentTime=0}Ke(r,"timeupdate",(function(){r.setState(Z,!1)})),r.transitionState(Z,z,e.loop||e.rewind?0:300)}}),0)})),Ve(r,[b,w],(function(e){r.setState(Q,e.type==b),r.setState(K,r.paused),r.setState(z,!r.paused)})),Ve(r,E,(function(){r.setState(z,!1),o=!0})),Ve(r,n().ios?p:f,(function(){var e,t;r.setState(W,!0),r.setState(Y,!1);const n=r;0===(null===(e=n.videoTracks)||void 0===e?void 0:e.length)&&(null===(t=n.audioTracks)||void 0===t?void 0:t.length)>0&&r.emit("audioonlysource")})),Ve(r,[v,g,m],(function(t){if(!r.hasState(Q)&&(t.type!=g||e.autoplay||r.setState($,!1),t.type!=m||"none"!=r.opt("preload")||e.autoplay)){if(t.type==m&&e.autoplay)return Ke(r,_,(function(){r.setState($,!1)}));t.type==v&&([z,K,X].forEach((function(e){r.setState(e,!1)})),r.hasState(W)||r.setState(Y,!0)),r.setState(Z,!1),r.setState($,t.type==v)}})),Ve(r,[_,y],(function(t){setTimeout(()=>{const e=new CustomEvent("flowplayer/"+t.type,{detail:r});document.dispatchEvent(e)},0);const n=t.type==_,i=r.currentTime==r.duration,s=n&&o&&e.autoplay||r.hasState($);if(n&&(r.started=!0,o=!1),r.setState($,!1).setState(X,!1),i||r.hasState(Q))return;const a=n?z:K,l=n?K:z;r.transitionState(a,l,s?0:300),n&&r.setState("no-autoplay",!1)}))}nt.validate=function(e){if("string"==typeof e&&(e=nt(e)),!e||!e.raw){if(et.check_whitelist(window.location.hostname)||"dev"===tt.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=et.bind(null,t);if("dev"!==tt.toString()&&e.data.domain&&e.data.domain.length&&!e.data.domain.some(n))throw new Error("Domain not allowed");if("dev"!==tt.toString()&&1e3*e.exp-Date.now()<0)throw new Error("Expired token");return!0},nt.id=function(e){if(e)return"string"==typeof e&&(e=nt(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"}(ot||(ot={})),it.of=it,it.from_token=function(e){const t=nt(e,{require_valid_token:!0});return it.of(t.data.acl)},it.permissions=ot;const ct=[0].concat(Array.from({length:100}).map((e,t)=>(t+1)/100));function ut(e,t,n){if(!window.IntersectionObserver)return;const r={should_resume:!!e.autoplay,has_user_gesture:!1,locked:!1};[c,o].forEach(e=>Ke(n,e,()=>r.has_user_gesture=!0)),Ve(n,"play",(function(){r.locked||(r.should_resume=!0)})),Ve(n,S,(function(){r.should_resume=!!e.autoplay})),Ve(n,y,(function(){r.locked||(r.should_resume=!1)})),Ve(n,g,(function(t){if(e.autoplay)return n.hasState(ne)&&r.should_resume?n.togglePlay(!0):void(e.autopause||n.hasState(ne)||!r.should_resume||Ke(n,"viewenter",()=>{e.autoplay&&r.should_resume&&n.togglePlay(!0)}))}));const i=new IntersectionObserver(e=>{e.forEach(e=>{setTimeout(()=>{const t=e.intersectionRatio,r=n.hasState(ne);if(n.setState(ne,t>=.2),n.emit("intersectionchange",{ratio:t}),r===n.hasState(ne))return;const o=n.hasState(ne)?"viewenter":"viewleave";n.emit(o)},0)})},{threshold:ct});i.observe(t),n.on(A,()=>i.disconnect()),e.autopause&&(Ve(n,"viewenter",(function(){r.should_resume&&e.autopause&&n.togglePlay(!0)})),Ve(n,"viewleave",(function(){if(!e.autopause)return;const t=!n.paused;r.locked=!0,n.pause(),setTimeout((function(){r.should_resume=t,r.locked=!1}),0)})))}function dt(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(A,()=>n.disconnect())}function pt(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 ft(e,t,n){const r=document.createElement("div");r.classList.add("fp-ratio"),t.append(r);let o=pt(e.ratio||.5625);r.style.paddingTop=100*o+"%";const i=[f,p];n.on(i,(function(){const e=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth;e&&n.setOpts({ratio:e})})),n.on(O,(function(){const t=n.videoHeight&&n.videoWidth&&n.videoHeight/n.videoWidth,i=pt((null==e?void 0:e.ratio)||t||.5625);o!==i&&(o=i,r.style.paddingTop=100*i+"%")}))}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(ht).forEach(([e,t])=>{o.style.setProperty(e,t,"important")}),r.appendChild(o)}}const ht={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)"},mt="flowplayer/"+_;function yt(e){const t=t=>{t.detail!==e&&!1===e.opt("multiplay")&&e.togglePlay(!1)};e.on(A,()=>document.removeEventListener(mt,t)),document.addEventListener(mt,t)}const _t=function(){const e=Je(),t=e.flowplayer?e.flowplayer:{extensions:[]};return Array.isArray(t.extensions)||(t.extensions=[]),t}();function vt(n,r){if("function"==typeof n)return e.push(...[...arguments].filter(e=>"function"==typeof e)),vt;"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=rt(r.token);if(!s.success)return st({root:o,data:{reason:"token",details:s.message}});const a=new Map,l=Qe(r,o);l.reaper=a,l._customElements=ce,Object.defineProperty(l,"token",{value:"string"==typeof r.token?nt.id(r.token):"",writable:!1}),l.addEventListener(A,()=>{a.clear(),l.reaper=0,delete l.root}),l.root=o,r.token&&it.from_token(r.token).is_granted(it.permissions.DEVELOPER_PLAN)&&e.push(ExplorerPlan),!~t.indexOf(l)&&t.push(l),Xe(r,o,l),l.setAttrs(r),l.plugins=vt.extensions.map(e=>new e(vt,l)),lt(r,o,l),ut(r,o,l),dt(o,l),ft(r,o,l),yt(l),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){st({root:o,video:l,data:e.data||{}})})),l}Object.assign(vt,_t),function(r){Array.isArray(r.extensions)&&r.extensions.forEach(t=>e.push(t)),r.customElements=ce,r.defaultElements=V,r.version="3.1.0-rc.2",r.commit="f1b2a64310ddd065f3012d9728939b5d0b1bed26",r.instances=t,r.extensions=e,r.support=n,r.events=k,r.states=re,r.jwt=le,r.autoplay=fe,r.quality=pe}(vt),"object"==typeof document&&setTimeout(Ge,0,document,"flowplayer:umd",vt);var gt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Et(e){var t={exports:{}};return e(t,t.exports),t.exports}var wt=Et((function(e,t){var n=gt&>.__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}})),bt=Et((function(e,t){var n=gt&>.__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=gt&>.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=gt&>.__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(wt),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})),St=Et((function(e,t){var n=gt&>.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var r=n(bt);t.default=r.default.of()})),At=Et((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 "))}))}})),Ot=Et((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})),Tt=Et((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"})),Nt=Et((function(e,t){var n=gt&>.__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=gt&>.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=gt&>.__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=gt&>.__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=gt&>.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var a=s(St),l=s(bt),c=o(At),u=o(wt),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=Ot.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=Tt.Verb,e}();t.default=d})),kt=Et((function(e,t){var n=gt&>.__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=gt&>.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=gt&>.__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=gt&>.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0,t.API=t.Tracker=void 0;var s=i(Nt);t.Tracker=s.default;var a=o(At);t.API=a})),It="ping",Lt="display",Rt="view";const Ct=["sitegroup_id","session_id","media_id","site_id","player_id","video_type"],Dt=["created","position"],xt=["player_version","created","source","category","category_id","autoplay","muted","customer_user_id"];function Mt(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 Ut(e,t,n){if(!t.segment_duration&&!Mt(e,t))return;const r=function(e,t,n){const r=t.last_idx,o=n?99:Pt(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(It,{position:r})}function Pt(e,t){return Math.min(Math.floor(e.currentTime/t.segment_duration),99)}const Ft="vod",Bt="live",jt=[Lt,It,Rt];function Ht(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(It,{position:60*t.ticks}))}(e,t);case"vod":return Ut(e,t,"boolean"==typeof n&&n)}}function Gt(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))))}function qt(){try{return window.location!==window.parent.location?document.referrer:document.location.href}catch(e){return!1}}class Analytics{init(e,t,n){if(!it.from_token(e.token||"").is_granted(it.permissions.ANALYTICS))return;if(n.analytics)return;const r=n.analytics={ticker:void 0,last_media_id:"",ended:!1},o={locked:!1,ttl:6e3,task:()=>{Ht(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},s=kt.Tracker.of(n,{verb:kt.Tracker.verb.POST,url:"https://ptm.flowplayer.com/:video_type/:sitegroup_id/:event_type",events:jt,required_keys:Ct,optional_keys:xt.concat(Dt).slice(0),metadata:i});n.on(A,(function(){s&&s.destroy()})),n.on(O,(function(t){if(!s)return;const o=Ce(t,"data.metadata",{});if(!o.media_id)return;const i=Ce(s,"metadata.media_id");if(i&&o.media_id==i)return;const a=Ce(e,"analytics",{});s.put(o),s.put(a);const l=Ce(e,"metadata.live_start_time",e.live)?Bt:Ft;s.put({video_type:l,source:e.source||qt()||""}),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(Lt)}));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=Gt(n);if(e)return a=Promise.resolve(e).then((function(){r.last_media_id=s.metadata.media_id,n.emit(Rt),a=0})).catch((function(){a=0}));r.last_media_id=s.metadata.media_id,n.emit(Rt)})),n.on("timeupdate",(function(){var t;s&&(a||Gt(n)||r.ended||(!e.live&&n.currentTime+.25>=n.duration&&Ht(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){Mt(e,t),t.last_idx=Pt(e,t)}(n,r.ticker)})),n.on(E,(function(){s&&function(e,t){t.ended||(t.ended=!0,Ht(e,t.ticker))}(n,r)}))}}var Vt;function zt(e){switch(e){case Vt.MEDIA_PLAYBACK_ABORTED:return"media playback was aborted";case Vt.MEDIA_ERR_NETWORK:return"a network error occurred";case Vt.MEDIA_ERR_DECODE:return"unable to decode media content";case Vt.MEDIA_ERR_SRC_NOT_SUPPORTED:return"unsupported media type";case Vt.NO_INTERNET:return"no internet connection detected";case Vt.MIXED_CONTENT:return"cannot load insecure content in a secure context";default:return"an unknown error occurred"}}function Kt(){}function Wt(e){try{return!!new URL(e)}catch(e){return!1}}Ze(Je(),Analytics),"undefined"!=typeof window&&window.matchMedia&&[T,N].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"}(Vt||(Vt={}));const Yt=()=>!0===(navigator||{}).onLine;function Xt(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 Qt(e,t,n){n.on(r,(function(e){const t=e.data||n.error||new Error,r=e.code||t.code,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(){if(e.defaultPrevented)return;if("AbortError"==t.name)return;n.setState("is-error",!0),8===r||t.fatal||function(e){const t=e.togglePlay,n=e.root;e.togglePlay=Kt,e.once("recover",(function(){e.togglePlay=t,e.setState("is-error",!1);const r=n.querySelector(".fp-error");r&&r.remove()}))}(n);const i=function(e,t,n){switch(t){case"http:0":return function(e){return Xt(e.original_src)?{code:Vt.MIXED_CONTENT}:Yt()?{code:Vt.MEDIA_ERR_NETWORK}:Yt()?{code:Vt.UNKNOWN}:{code:Vt.NO_INTERNET}}(e);case Vt.MEDIA_ERR_SRC_NOT_SUPPORTED:return e.once(m,(function(){e.emit("recover")})),n;default:return n}}(n,r,t),s=function(e,t){if(t.message)return t.message;if(t.stack)return t.stack;const n=t.code||-1,r=zt(n);return e.i18n("media_errors."+n,r)}(n,i);console.error(o,s);const a=n.reaper&&n.reaper.get("ui");return a&&function(e,t,n,r){if(!e)return;const o=document.createElement("div");if(o.classList.add("fp-error"),o.innerText=t,r){const t=e.querySelector("#"+r);t&&e.removeChild(t),o.id=r}if(e.append(o),n){const e=document.createElement("div");e.classList.add("fp-error-details"),e.innerText=n,o.append(e)}}(a,s,t.details)}))}))}var Zt=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});function Jt(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")),$t(n)&&(e?function(e){e.getAttribute("playsinline")&&e.removeAttribute("playsinline");e.getAttribute("webkit-playsinline")&&e.removeAttribute("webkit-playsinline");e.webkitEnterFullScreen()}(n):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(te)||e.setState(te,!0)}(n,t)),!document.fullscreenEnabled)return;const r=s();e?r.requestFullscreen():document.exitFullscreen()},$t(n)&&(n.ios_fullscreen_disabled=!0,n.once("beforeplay",(function(){n.ios_fullscreen_disabled=!1})),n.on("webkitendfullscreen",(function(){n.toggleFullScreen(!1,!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 $t(e){return n().ios&&"function"==typeof e.webkitEnterFullScreen&&"function"==typeof e.webkitExitFullScreen}function en(e,t){if("object"!=typeof e.opts)return{head:0,tail:0};if(0==e.seekable.length)return{head:0,tail:0};const n=t||e.opts.dvr_window,r=e.seekable.end(e.seekable.length-1);return{head:r,tail:n?r-n:e.seekable.start(0)}}function tn(e){return e.opt("live",!1)||e.duration>=Number.MAX_SAFE_INTEGER}function nn(e){return isFinite(e.duration)?e.duration:0==e.seekable.length?0:en(e).head}function rn(e){return sn(e)-.5}function on(e){return en(e).tail}function sn(e){return en(e).head}function an(e){return Math.min(100,Math.max(0,(e.currentTime-on(e))/(sn(e)-on(e))*100))}function ln(e,t,n){if(!n.reaper)return;const r=document.createDocumentFragment(),o=ue(n,I);r.appendChild(o),n.reaper.set("ui",o),~t.className.indexOf("use-play-")||t.classList.add("use-play-1"),function(e,t,n){const r=Re("fp-footer");t.append(r),n.on(O,(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=Re("fp-title");e.innerText=i,r.append(e)}if("string"==typeof o){const e=o.split(" "),t=Re("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),Qt(0,0,n),t.appendChild(r),[a,l].forEach(e=>{t.addEventListener(e,(function(e){n.setState("is-hovered",e.type==a),n.setState("is-accessibility",!1)}))}),Jt(e,t,n),n.on("volumechange",(function(){const e=0==n.volume||n.muted;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 i=n._storage.getItem("volume");i&&!isNaN(Number(i))&&(n.volume=Number(i)),n.emit("volumechange"),n.on("dvr/window",t=>{var r;e.live&&(!("dvr"in(r=e))||1==r.dvr)&&function(e,t,n){if(0==t)return!0;const r=en(e,n);return r.head-r.tail>=t}(n,e.seconds_to_dvr||60,t.detail)&&(n.setOpts({dvr:n.seekable.length>0}),n.seekable.length>0&&n.setOpts({dvr_window:t.detail}))}),n.on("live",(function(){n.setState("is-live-seeked",!1)})),n.on("seeking",(function(){if(!tn(n))return;if(0==n.seekable.length)return;if(0==nn(n))return;const e=rn(n),t=n.currentTime>=e?"live":"dvr";if("live"===t)return n.emit(t);const r=nn(n),o=en(n),i=(r-n.currentTime)/(o.head-o.tail)*100,s=Math.round(i);n.setState("is-live-seeked",s>0),n.emit(t,{offset:s})})),n.on(p,(function(){n.setOpts({live:tn(n)})})),n.on("durationchange",(function(e){const t=tn(n),r=t?nn(n):e.data||n.duration;isNaN(r)||n.setOpts({live:t,duration:r})})),n.on(O,(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("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 s=null;o.addEventListener("mousemove",(function(){"number"==typeof s&&clearTimeout(s),n.setState("is-hovered",!0),s=0==n.paused&&setTimeout((function(){n.setState("is-hovered",!1)}),2e3)}))}function cn(e,t,n){if(it.from_token(e.token||"").is_granted(it.permissions.NO_METERING))return;const r=nt.id(e.token||"");r&&n.once(_,()=>function(e,t){fetch("https://pmi.flowplayer.com/in",{method:"POST",body:JSON.stringify({token_id:t,factor:1,rnd:Math.random().toString(36).substring(2)})}).then(t=>{401==t.status&&e.emit("error:fatal",{reason:"token",details:"The token online validation failed"})})}(n,r))}var un={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",Ue(I18n,e,"en"))}}I18n.en=un;const dn="rebuffer";var pn=Object.freeze({__proto__:null,RECORD:"health:record",REBUFFER:dn});function fn(e,t){const n=function(){try{return localStorage.getItem("flowplayer/debug")}catch(e){return""}}(),r=(...r)=>{const o=(null==t?void 0:t.debug)||n;o&&e.match(o)&&console.log(e,...r)};return r.log=r,r}const hn=navigator;function mn(e){var t,n;const r=null===(t=e.hls)||void 0===t?void 0:t.bandwidthEstimate;return r?1e-6*r:(null===(n=hn.connection)||void 0===n?void 0:n.downlink)||-1}function yn(e,t){return function(e,t){return"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(e,t)}(e,JSON.stringify({events:t}))}const _n="https://ljsp.lwcdn.com".concat("/web/public/countdown/time.json"),vn=window,gn=vn._flowplayerTimekeeper||(vn._flowplayerTimekeeper={});const En=e=>{switch(e){case!0:return fe.ON;case!1:return fe.OFF;default:return e}},wn=[];function bn(e){if(e.suspended)return;const t=wn.slice(0);wn.length=0,0!=t.length&&(e.logger.log(`:dispatch events={${t.length}}`),yn("https://health.flowplayer.com/v1/health/events",t))}async function Sn(e,t,n){const r=await On();wn.push(Object.assign(t,r)),e.logger.log(":enqueue",t.event,t),wn.length<10&&!n||bn(e)}const An=()=>{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}},On=async()=>{try{const e=await async function(){const e=gn.cachedServerOffset;if(e)return e;const t=gn.pendingRequest||(gn.pendingRequest=fetch(_n)),n=await t,r=parseInt(n.headers.get("age")||"0"),o=await n.json(),i=Date.now()-o.millisUtc-1e3*r;return gn.cachedServerOffset=i,gn.cachedServerOffset}();return{timestamp:Date.now()-e,adjustedTimestamp:!0}}catch(e){return{timestamp:Date.now(),adjustedTimestamp:!1}}},Tn=(e,t)=>Object.assign(e,{detail:t}),Nn=(e,{event:t,media_session_id:n,session_id:r})=>({event:t,media_session_id:n,session_id:r,device_id:e.deviceId(),version:"3.1.0-rc.2",commit:"f1b2a64310ddd065f3012d9728939b5d0b1bed26",ima_sdk_version:An(),preload:e.opt("preload"),autoplay:En(e.opt("autoplay")),live:e.opt("live"),dvr:e.opt("dvr"),source:e.original_src,downlink_mbs:mn(e),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")}),kn=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 In(e,t,n,r){const o=Nn(t,e.eventInfo(n)),{before:i,after:s}=r;Sn(e,((e,t,n)=>Object.assign(e,{state:{before:t,after:n}}))(o,kn(i),kn(s)))}const Ln=(e,t)=>{let n=null;return(...r)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>t(...r),e)}},Rn=Fe();class Health{constructor(e,t){this.session_id=Rn,this.suspended=!1,this.logger=fn("health",t.opts),this.media_session_id=Fe(),this.analyticsLoop=setInterval(()=>bn(this),2e3),t.on(A,()=>clearInterval(this.analyticsLoop));const n=this;if(t.health={get media_session_id(){return n.media_session_id},set media_session_id(e){n.media_session_id=e},get session_id(){return n.session_id},set session_id(e){n.session_id=e},toggle(e){e?n.resume():n.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}}suspend(){this.suspended=!0,clearInterval(this.analyticsLoop)}resume(){this.suspended=!1,this.analyticsLoop=setInterval(()=>bn(this),2e3)}init(e,t,n){!function(e){e.on(v,(function(t){e.seeking||e.networkState===e.NETWORK_LOADING&&e.readyState!==e.HAVE_NOTHING&&e.emit(dn)}))}(n),n.on("health:record",({detail:e})=>{const t=Nn(n,this.eventInfo(e.event));Object.assign(t,e.detail||{}),Sn(this,t)}),[g,m,s,p,f,h,v,dn].forEach(e=>{n.on(e,e=>{Sn(this,Nn(n,this.eventInfo(e.type)))})}),[_,y,b,w,E,u,d].forEach(e=>{n.on(e,e=>{Sn(this,Nn(n,this.eventInfo(e.type)))})}),n.on("volumechange",Ln(800,e=>{const t=Nn(n,this.eventInfo(e.type));Sn(this,Tn(t,{volume:parseFloat(n.volume.toFixed(2)),muted:n.muted}))})),n.on("resize",Ln(800,e=>{const r=Nn(n,this.eventInfo(e.type));Sn(this,Tn(r,{height:t.clientHeight,width:t.clientWidth}))})),n.on("qualitychange",({type:e,detail:t})=>{switch(t.kind){case"hls":return In(this,n,e,t)}});let o=Date.now()+5e3;n.on("timeupdate",e=>{if(Date.now()<o)return;o=Date.now()+5e3;const t=Nn(n,this.eventInfo(e.type));var r;Sn(this,Tn(t,{duration:(r=n.duration,Number.isFinite(r)?r:r===1/0?-1:void 0)}))}),n.addEventListener(r,e=>{const t=Nn(n,this.eventInfo(e.type)),r=e.error||n.error;if(!r)return Sn(this,t,!0);const o=r.code,i={error_message:r.message||zt(o),error_code:o,error_stack:r.stack||""};return Sn(this,Tn(t,i),!0)}),n.on(S,e=>{var t;const r=null===(t=e.detail)||void 0===t?void 0:t.src;if("string"!=typeof r)return;if(!Wt(n.original_src))return;if(!Wt(r))return;if(r==n.original_src)return;this.media_session_id=Fe();Sn(this,Nn(n,this.eventInfo(e.type))),bn(this)}),n.on("visibilitychange",e=>{Sn(this,Nn(n,this.eventInfo(e.type))),bn(this)})}}var Cn;function Dn(e,t){if(function(e){return Object.values(Cn).includes(e)}(t=t||Cn.Anonymous))return e instanceof HTMLVideoElement&&(e.poster="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),"crossOrigin"in e?e.crossOrigin=t:e.setAttribute("crossorigin",t),e}function xn(e){const t=document.createElement("a");return t.href=e,t.origin}function Mn(e,t){const n=document.createElement("track");n.className="fp-track renderable",n.kind=t.kind||"captions",n.id=["fp",t.lang].join("-");const r=n.track;return"string"!=typeof t.crossorigin&&function(e,t){try{return e.src.startsWith("blob:"),xn(e.src)!==xn(t)}catch(e){return console.error(e),!0}}(e,t.src)&&(Dn(e),t.crossorigin=e.getAttribute("crossorigin")),"crossorigin"in t&&Dn(e,t.crossorigin),Object.keys(t).forEach(e=>{"default"!==e&&(n[e]=t[e])}),r.mode=t.default?"hidden":"disabled",n.onload=function(){},r.oncuechange=function(t){e.emit(t.type,{track:t.target})},e.appendChild(n),n}Health.events=pn,Health._UNLOAD_SUBSCRIBED=!1,Ze(window,Health),function(e){e.Anonymous="anonymous",e.UseCredentials="use-credentials",e.Empty=""}(Cn||(Cn={}));var Un=Object.freeze({__proto__:null,CHAPTER_CHANGED:"chapter:changed",CHAPTERS_NEW:"chapters:new"});class Chapters{constructor(){this._track_added_handler=Kt,this._cue_changed_handler=Kt,this.chapters=[],this.render=this.render.bind(this)}init(e,t,n){this._root=t,this._player=n,this._timeline=Ie(n,D),this._track_added_handler=this.track_added.bind(this,n),this._cue_changed_handler=this.cue_changed.bind(this,n),n.textTracks.addEventListener("addtrack",this._track_added_handler),this.wireup(n,e),n.chapters=this,n.on(O,e=>{e.data&&this.wireup(n,e.data)}),n.on(A,()=>{this.wiredown(n),n.textTracks.removeEventListener("addtrack",this._track_added_handler),n.off("durationchange",this.render)}),n.on("durationchange",this.render)}track_added(e,t){}cue_changed(e,t){var n;this._current_chapters_track&&(this.current_cue=this._current_chapters_track.track.activeCues?this._current_chapters_track.track.activeCues[0]:void 0,this._timeline&&Ge(this._timeline,"chapter:changed",null===(n=this.current_cue)||void 0===n?void 0:n.text))}set_chapters(e){this.chapters=e,this.render()}jump(e){this._player&&this.chapters[e]&&(this._player.currentTime=this.chapters[e].start)}current(){if(this.current_cue)return this.chapters.find(e=>e.cue==this.current_cue)}render(){if(!this._root||!this._player||!this._timeline)return;const e=this._player.duration;isFinite(e)&&(Ge(this._timeline,"chapters:new",this.chapters.map(t=>({title:t.label,left:t.start/e*100+"%",width:(t.end-t.start)/e*100+"%"}))),this._root.classList.toggle("has-chapters",!!this.chapters.length))}wireup(e,t){const n=Array.isArray(t.chapters)?t.chapters[0]:t.chapters;n&&n.src!==this._current_chapters_src&&(this.wiredown(e),this._current_chapters_track=Mn(e,Object.assign(Object.assign({},n),{kind:"chapters",default:!0})),this._current_chapters_track.onload=()=>{var e;(null===(e=this._current_chapters_track)||void 0===e?void 0:e.track.cues)&&this.set_chapters(Array.from(this._current_chapters_track.track.cues).filter(e=>e instanceof VTTCue).map(e=>{const t=e;return{start:e.startTime,end:e.endTime,cue:t,label:t.text}}))},this._current_chapters_src=n.src,this._current_chapters_track.addEventListener("cuechange",this._cue_changed_handler))}wiredown(e){this.set_chapters([]),this._current_chapters_track&&(this._current_chapters_track.removeEventListener("cuechange",this._cue_changed_handler),e.removeChild(this._current_chapters_track))}}Chapters.events=Un,Ze(window,Chapters);class FlowplayerComponent extends HTMLElement{constructor(e){super(),this.player=e}}class FlowplayerPrimary extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-primary");const t={logo:""};e.on(O,e=>{var n,r;const o=t.logo,i=(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)||"";o!=i&&(t.logo=i,this.set_logo(i,null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.logo_href))})}set_logo(e,t){if(this.innerHTML="",!e)return;const n=document.createElement("img");if(n.classList.add("fp-logo"),n.src=e,!t)return this.append(n);const r=document.createElement("a");r.href=t,r.append(n),this.append(r)}}class FlowplayerHeaderDuration extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-duration"),e.on(O,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)?xe(n):""})}}const Pn={name:"fp-fullscreen",translation_key:"core.fullscreen"},Fn={name:"fp-fullscreen-exit",translation_key:"core.exit_fullscreen"},Bn={name:"fp-play",translation_key:"core.play"},jn={name:"fp-pause",translation_key:"core.pause"},Hn={translation_key:"core.mute",name:"fp-volume-mute-unmute"},Gn={translation_key:"core.play",name:"fp-small-play"},qn={translation_key:"core.pause",name:"fp-small-pause"},Vn={name:"fp-fast-forward"},zn={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),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=>{const t=e.root.querySelector("details[open].fp-menu-container");t&&(t.open=!1,e.root.classList.toggle("has-menu-opened",!1))}),this.active_menu=void 0)}));const Kn={passive:!0};var Wn;function Yn(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(Wn.GRABBING),s.remove(Wn.TOUCHING);const a=t.onseek||Kt,l=t.onstart||Kt,u=t.onend||Kt,d=t.onmouse||Kt,p=t.ontouch||Kt,f=t.ontouchend||Kt;function h(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 m(t){const n=h(t);n!=o&&(a(e,n),o=n)}return e.addEventListener("touchstart",(function(t){Xn(e,t)&&(s.add(Wn.TOUCHING),Qn(e.parentElement)&&(s.add(Wn.GRABBING),p(e,h(t)),l(e,h(t)),m(t)))}),Kn),e.addEventListener("touchmove",(function(t){m(t),d(e,h(t))}),Kn),e.addEventListener(c,(function(t){setTimeout((function(){s.remove(Wn.TOUCHING)}),500),Xn(e,t)&&(s.remove(Wn.GRABBING),f(e,h(t)),u(e,h(t)),r=0)}),Kn),e.addEventListener("touchcancel",(function(){s.remove(Wn.GRABBING,Wn.TOUCHING),r=0}),Kn),e.addEventListener("mousedown",(function(t){s.contains(Wn.TOUCHING)||(document.addEventListener("mousemove",m),s.add(Wn.GRABBING),l(e,h(t)),t.preventDefault(),m(t))})),e.addEventListener("mousemove",(function(t){s.contains(Wn.TOUCHING)||d(e,h(t))})),document.addEventListener("mouseup",(function(t){s.contains(Wn.TOUCHING)||(document.removeEventListener("mousemove",m),s.contains(Wn.GRABBING)&&(s.remove(Wn.GRABBING),u(e,h(t)),r=0))})),e}function Xn(e,t){const n=t.target;return!!n&&(n&&!n.closest(e.id)||!Qn(e.parentElement)||!e.classList.contains(Wn.TOUCHING))}function Qn(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"}(Wn||(Wn={}));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),Yn(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(Wn.GRABBING)||t&&"number"==typeof n&&(4&n)>0||this.adjustVolumeSlider(e.volume)})}adjustVolumeSlider(e){this.setAttribute("aria-valuenow",e.toString());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)})}}function Zn(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 Jn(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 $n(e,t){e.style.width="0",t.style.display="none"}function er(e,t,n){if(!t.seekable||0==t.seekable.length)return;Zn(n,e);const r=en(t),o=(100-Math.max(0,Math.min(e,100)))/100*(r.head-r.tail);n.innerText="-"+xe(o)}function tr(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=en(e);return n.tail+t*(n.head-n.tail)}(t,e)}function nr(e,t){e.style.width="0",t.style.display="none"}class FlowplayerTimelineBar extends FlowplayerComponent{constructor(e){let t;super(e),this.bufferEle=Re("fp-buffer"),this.progress=Re("fp-progress","fp-color"),this.tooltipEle=Re("fp-timestamp"),this.proposedSeekBar=Re("fp-hover"),this.dragger=Re("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("timeline","Timeline")),this.progress.append(this.dragger),this.append(this.bufferEle,this.progress,this.proposedSeekBar,this.tooltipEle);let n=!1;const o=requestAnimationFrame;let i=void 0;const s=()=>{var n;0==e.reaper||t.live||(n=e,this.progress.style.width=n.currentTime/n.duration*100+"%",i=void 0,e.paused||this.classList.contains(Wn.GRABBING)||i||(i=setTimeout(s,200)))},a=()=>!!this.player.opt("seekable",!0)&&!isNaN(this.player.duration);Yn(this,{onseek:(n,r)=>{if(a())switch(!!t.live){case!0:er(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),Zn(this.tooltipEle,r)}},onstart:()=>{a()&&(e.emit("timeline/gesture/start"),e.setState(Q,!0),t.live||function(e){e.style.display="block"}(this.tooltipEle))},onend:function(n,r){o(s),0!=t.seekable&&t.live&&tr(r,e)},ontouch:function(){e.paused||(n=!0,e.pause())},ontouchend:()=>{n&&(n=!1,e.play()),t.live?nr(this.proposedSeekBar,this.tooltipEle):$n(this.proposedSeekBar,this.tooltipEle)},onmouse:(n,r)=>{if(a()&&!this.classList.contains(Wn.GRABBING))switch(e.emit("timeline/gesture/move",{percent:r}),!!t.live){case!0:!function(e,t){t.style.width=e+"%"}(r,this.proposedSeekBar),er(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;Zn(n,e),n.innerHTML="";const r=document.createElement("span");r.innerText=xe(e/100*t.duration),n.append(r)}(r,e,this.tooltipEle)}}}),e.on(O,(function(e){e.data&&(t=e.data)})),e.on(_,()=>o(s)),e.on("live",()=>{this.progress.style.width="100%"}),e.on(h,()=>{0==e.reaper||t.live||Jn(e,this.bufferEle)}),e.on("dvr",e=>{e.detail&&(this.progress.style.width=100-e.detail.offset+"%")}),e.on("timeupdate",()=>{0!=e.reaper&&(o(s),this.setAttribute("aria-valuenow",e.currentTime+""),t.live||Jn(e,this.bufferEle))}),e.on(p,()=>{0!=e.reaper&&(t.live||Jn(e,this.bufferEle))}),e.on("durationchange",t=>{if(0==e.reaper)return;const n=tn(e)?nn(e):t.data||e.duration;isNaN(n)||(this.setAttribute("aria-valuemax",n+""),this.setAttribute("aria-valuemin","0"))}),e.on(S,()=>{e.once("beforeplay",()=>{e.hasState(J)&&!e.hasState(ee)&&(this.progress.style.width=an(e)+"%")})}),e.on(y,()=>{if(!e.hasState(J)||e.hasState(ee))return;const t=setInterval(()=>{if(e.hasState(ee))return n();this.progress.style.width=an(e)+"%"},1e4);function n(){clearInterval(t),[_,r,S,A].forEach(t=>{e.removeEventListener(t,n)})}e.on([_,r,S,A],n)}),this.addEventListener(l,()=>{e.emit("timeline/gesture/end"),t.live?nr(this.proposedSeekBar,this.tooltipEle):$n(this.proposedSeekBar,this.tooltipEle)})}}class FlowplayerChaptersTimelineBar extends FlowplayerTimelineBar{constructor(e){super(e),this.handleChapters(e)}handleChapters(e){const t=document.createElement("div");let n;this.addEventListener("chapters:new",e=>{t.innerText="",this.querySelectorAll(".fp-chapter").forEach(e=>this.removeChild(e)),e.data&&e.data.forEach(e=>{const r=document.createElement("div");r.className="fp-chapter",r.style.left=e.left,r.style.bottom=r.style.top="0",r.style.width=e.width,r.title=e.title,r.onmouseover=()=>{t.innerText=e.title},r.onmouseleave=()=>{t.innerText=n||""},this.appendChild(r)})}),this.addEventListener("chapter:changed",r=>{var o;const i=r.data;i&&(t.parentNode||(null===(o=Ie(e,L))||void 0===o||o.insertAdjacentElement("beforebegin",t),t.classList.toggle("fp-togglable",!0),t.classList.toggle("fp-chapter-info",!0)),n=i,t.innerText=i)})}}class FlowplayerLiveStatus extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-live-status");const t=Re("fp-live-text"),n=Re("fp-live-indicator","fp-color");t.textContent="live",this.append(n,t),this.addEventListener(o,(function(){!function(e){try{if(!e.hasState("is-live-seeked"))return;e.emit("live"),e.dvr_offset=0,e.currentTime=rn(e)}catch(e){console.warn("failed to seek to now: %j",e)}}(e)}))}}class FlowplayerDuration extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-duration"),e.on(O,n=>{if(0==e.reaper||!n.data)return;t=n.data;const r=tn(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=xe(r)}),e.on(p,()=>{var n,r;0==e.reaper||t.live||(r=this,(n=e).duration&&(r.innerText=xe(n.duration)))})}}class FlowplayerElapsedTime extends FlowplayerComponent{constructor(e){let t;super(e),this.classList.add("fp-elapsed"),this.innerText=xe(0),e.on(O,e=>{e.data&&(t=e.data)}),e.on("timeupdate",()=>{var n;0!=e.reaper&&(t.live?(n=e,this.innerText=xe(n.currentTime)):function(e,t){t.innerText=xe(e.currentTime)}(e,this))})}}class FlowplayerControlButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-btns","fp-small-switch");const t=ue(e,"flowplayer-small-pause-icon"),n=ue(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=ue(e,this.classList.contains("fp-left-zone")?G:"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(c,(function(t){isNaN(e.duration)||isNaN(e.currentTime)||16384&e.opt("ui")||e.hasState(ee)||!e.hasState("will-seek")&&!e.hasState(te)||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 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(B,"flowplayer-middle-buttons");this.append(...t)}}class FlowplayerMiddleButtons extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-switch"),[j,H].forEach(t=>{const n=ue(e,t);n.removeAttribute("tabindex"),this.append(n)})}}class FlowplayerVolumeControl extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-volume-control");const t=ue(e,q);this.append(t),!n().ios&&this.append(ue(e,x)),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",R,C,D,"flowplayer-control-duration","flowplayer-volume-control"))}}class FullscreenIcon extends FlowplayerIcon{constructor(e,t){super(e,t),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n(t==Pn?"core.fullscreen":"core.fullscreen_exit"))}}class FlowplayerMiddle extends FlowplayerComponent{constructor(e){super(e),this.classList.add("fp-middle"),this.append(...e.createComponents("flowplayer-middle-left-zone",F,"flowplayer-middle-right-zone")),this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setAttribute("aria-label",e.i18n("core.play")),e.reaper&&e.reaper.set("middle",this),this.handleClick(e),this.handleTouch(e),[_,w].forEach(t=>e.once(t,()=>{this.removeAttribute("tabindex"),this.removeAttribute("role"),this.removeAttribute("aria-label")}))}handleClick(e){[o,i].forEach(t=>this.addEventListener(t,(function(t){if(!t.defaultPrevented)return t.preventDefault(),e.emit(t.type),!1}))),e.on(o,(function(t){setTimeout((function(){t.defaultPrevented||e.hasState($)||e.togglePlay()}),0)})),e.on(i,(function(t){setTimeout((function(){t.defaultPrevented||e.toggleFullScreen()}),0)}))}handleTouch(e){let t=!1;this.addEventListener(c,(function(t){0!=t.cancelable&&(t.preventDefault(),e.emit(t.type,{source:t}))})),e.on(c,(function(n){setTimeout((function(){if(n.defaultPrevented)return;if(e.hasState($))return;if(e.ended)return e.togglePlay(!0);const r=e.hasState(X);t&&clearTimeout(t),(r||e.hasState(te)||e.hasState("no-autoplay"))&&(e.hasState(te)&&(e.setState(te,!1),e.setState("is-hovered",!1)),e.togglePlay(),r)||(e.setState(te,!0),e.paused||(t=setTimeout((function(){t=!1,e.setState(te,!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(M,P,L))}}return vt.extensions.unshift.apply(vt.extensions,[I18n,Analytics,Health,class Default{constructor(e){de(e,I,FlowplayerUi),de(e,L,FlowplayerControls),de(e,R,FlowplayerLiveStatus),de(e,"flowplayer-control-duration",FlowplayerDuration),de(e,D,e.extensions.find(e=>e.name===Chapters.name)?FlowplayerChaptersTimelineBar:FlowplayerTimelineBar),de(e,C,FlowplayerElapsedTime),de(e,x,FlowplayerVolumeBar),de(e,"flowplayer-volume-control",FlowplayerVolumeControl),de(e,"flowplayer-control-buttons",FlowplayerControlButtons),de(e,M,FlowplayerHeader),de(e,U,FlowplayerPrimary),de(e,"flowplayer-header-duration",FlowplayerHeaderDuration),de(e,"flowplayer-header-left-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-left",U,"flowplayer-header-duration")}}),de(e,"flowplayer-header-right-zone",class extends FlowplayerHeaderLeftRight{constructor(e){super(e,"fp-right fp-togglable","flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon")}}),de(e,P,FlowplayerMiddle),de(e,F,FlowplayerMiddleZone),de(e,B,FlowplayerMiddleWait),de(e,"flowplayer-middle-buttons",FlowplayerMiddleButtons),de(e,"flowplayer-middle-right-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-right-zone")}}),de(e,"flowplayer-middle-left-zone",class extends FlowplayerLeftRightZone{constructor(e){super(e,"fp-left-zone")}}),de(e,"flowplayer-small-play-icon",class extends FlowplayerIcon{constructor(e){super(e,Gn),this.setAttribute("role","button")}}),de(e,"flowplayer-small-pause-icon",class extends FlowplayerIcon{constructor(e){super(e,qn),this.setAttribute("role","button")}}),de(e,j,class extends FlowplayerIcon{constructor(e){super(e,Bn)}}),de(e,H,class extends FlowplayerIcon{constructor(e){super(e,jn)}}),de(e,"flowplayer-fullscreen-enter-icon",class extends FullscreenIcon{constructor(e){super(e,Pn)}}),de(e,"flowplayer-fullscreen-exit-icon",class extends FullscreenIcon{constructor(e){super(e,Fn)}}),de(e,"flowplayer-fast-forward-icon",class extends FlowplayerIcon{constructor(e){super(e,Vn)}}),de(e,G,class extends FlowplayerIcon{constructor(e){super(e,zn)}}),de(e,q,class extends FlowplayerIcon{constructor(e){super(e,Hn),this.classList.add("fp-volumebtn"),e.on("volumechange",()=>{const t=0==e.volume||e.muted;this.setAttribute("aria-label",t?e.i18n("unmute","unmute"):e.i18n("mute","mute"))})}})}init(e,t,n){var r;cn(e,0,n),ln(e,t,n),r=n,"undefined"!=typeof window&&"ontouchstart"in window&&r.setState("is-touch-device",!0),r.setState("is-accessibility",!1)}}]),Object.assign(vt,{ui:Zt,i18n:I18n})}));
|