@flowplayer/player 3.15.0 → 3.16.0-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/core/events.d.ts +22 -2
  2. package/core/events.js +50 -50
  3. package/core.js +1 -1
  4. package/default.js +1 -1
  5. package/embed.js +2 -2
  6. package/flowplayer.css +1 -1
  7. package/index.d.ts +78 -35
  8. package/package.json +1 -1
  9. package/plugins/ads.d.ts +76 -33
  10. package/plugins/ads.js +1 -1
  11. package/plugins/airplay.d.ts +77 -52
  12. package/plugins/analytics.d.ts +76 -33
  13. package/plugins/analytics.js +1 -1
  14. package/plugins/asel.d.ts +221 -36
  15. package/plugins/asel.js +1 -1
  16. package/plugins/audio.d.ts +76 -33
  17. package/plugins/chapters.d.ts +76 -33
  18. package/plugins/chromecast.d.ts +76 -33
  19. package/plugins/chromecast.js +1 -1
  20. package/plugins/comscore.d.ts +76 -33
  21. package/plugins/consent.d.ts +76 -33
  22. package/plugins/context-menu.d.ts +76 -33
  23. package/plugins/cuepoints.d.ts +76 -33
  24. package/plugins/dash.d.ts +77 -45
  25. package/plugins/dash.js +1 -1
  26. package/plugins/drm.d.ts +76 -33
  27. package/plugins/endscreen.d.ts +76 -33
  28. package/plugins/fas.d.ts +76 -33
  29. package/plugins/float-on-scroll.d.ts +76 -33
  30. package/plugins/ga4.d.ts +76 -33
  31. package/plugins/gemius.d.ts +76 -33
  32. package/plugins/google-analytics.d.ts +76 -33
  33. package/plugins/health.d.ts +76 -33
  34. package/plugins/health.js +1 -1
  35. package/plugins/hls.d.ts +76 -33
  36. package/plugins/hls.js +1 -1
  37. package/plugins/id3.d.ts +76 -33
  38. package/plugins/iframe.d.ts +76 -33
  39. package/plugins/keyboard.d.ts +76 -33
  40. package/plugins/media-session.d.ts +76 -33
  41. package/plugins/message.d.ts +76 -33
  42. package/plugins/ovp.d.ts +76 -33
  43. package/plugins/playlist.d.ts +107 -33
  44. package/plugins/playlist.js +1 -1
  45. package/plugins/preview.d.ts +76 -33
  46. package/plugins/qsel.d.ts +76 -33
  47. package/plugins/qul.d.ts +76 -33
  48. package/plugins/rts.d.ts +76 -33
  49. package/plugins/share.d.ts +76 -33
  50. package/plugins/speed.d.ts +76 -33
  51. package/plugins/ssai.d.ts +76 -33
  52. package/plugins/ssai.js +1 -1
  53. package/plugins/subtitles.d.ts +76 -33
  54. package/plugins/thumbnails.d.ts +76 -33
  55. package/plugins/tizen.d.ts +76 -33
  56. package/plugins/vtsel.d.ts +76 -33
  57. package/plugins/webos.d.ts +76 -33
  58. package/util/loader.d.ts +76 -33
package/plugins/ads.d.ts CHANGED
@@ -938,6 +938,7 @@ declare class EventBus {
938
938
  declare namespace events {
939
939
  export {
940
940
  MOUNT,
941
+ RETRY,
941
942
  ERROR,
942
943
  CONTEXT_MENU,
943
944
  CLICK,
@@ -989,7 +990,8 @@ declare namespace events {
989
990
  LANDSCAPE,
990
991
  PORTRAIT,
991
992
  DVR,
992
- LIVE_2 as LIVE
993
+ LIVE,
994
+ RECOVER
993
995
  }
994
996
  }
995
997
 
@@ -2715,8 +2717,6 @@ declare type Listener<T = any> = {
2715
2717
  (e: FPEvent<T>): void;
2716
2718
  };
2717
2719
 
2718
- declare const LIVE = "is-live";
2719
-
2720
2720
  /**
2721
2721
  * @public
2722
2722
  * when src is a livestream
@@ -2728,7 +2728,9 @@ declare const /**
2728
2728
  * @public
2729
2729
  * when src is a livestream
2730
2730
  */
2731
- LIVE_2 = "live";
2731
+ LIVE = "live";
2732
+
2733
+ declare const LIVE_2 = "is-live";
2732
2734
 
2733
2735
  declare const LIVE_SEEKED = "is-live-seeked";
2734
2736
 
@@ -3064,33 +3066,27 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
3064
3066
 
3065
3067
  declare type PlayerCustomEventName = keyof PlayerCustomEventsDetailMap;
3066
3068
 
3067
- declare type PlayerCustomEventsDetailMap = {
3068
- [MOUNT]: MountEventDetail;
3069
- [ERROR]: ErrorEventDetail;
3070
- [CONTEXT_MENU]: ContextMenuEventDetail;
3071
- /* Excluded from this release type: beforeplay */
3072
- /* Excluded from this release type: beforepause */
3073
- /* Excluded from this release type: state */
3069
+ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap & {
3070
+ [REAP]: ReapEventDetail;
3071
+ [SOURCE]: SourceEventDetail;
3074
3072
  [CUEPOINT_START]: CuePointStartEventDetail;
3075
3073
  [CUEPOINT_END]: CuePointEndEventDetail;
3076
- [VIEW_ENTER]: ViewEnterEventDetail;
3077
- [VIEW_LEAVE]: ViewLeaveEventDetail;
3078
- [SOURCE]: SourceEventDetail;
3079
- /* Excluded from this release type: recover */
3080
- [REAP]: ReapEventDetail;
3081
- /* Excluded from this release type: config */
3082
- [QUALITIES]: QualitiesEventDetail;
3083
- /* Excluded from this release type: "error:fatal" */
3084
- [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
3074
+ [MOUNT]: MountEventDetail;
3075
+ [LIVE]: LiveEventDetail;
3076
+ [DVR]: DvrEventDetail;
3077
+ [RETRY]: RetryEventDetail;
3078
+ [RECOVER]: RecoverEventDetail;
3085
3079
  /* Excluded from this release type: audioonlysource */
3086
3080
  /* Excluded from this release type: renderplugin */
3087
- [DVR]: DvrEventDetail;
3088
- [LIVE_2]: LiveEventDetail;
3089
3081
  /* Excluded from this release type: "seek:queued" */
3090
3082
  /* Excluded from this release type: "seek:cancel" */
3091
3083
  /* Excluded from this release type: "plugin:registered" */
3092
3084
  /* Excluded from this release type: intersectionchange */
3093
- /* Excluded from this release type: retry */
3085
+ /* Excluded from this release type: beforeplay */
3086
+ /* Excluded from this release type: beforepause */
3087
+ /* Excluded from this release type: state */
3088
+ /* Excluded from this release type: config */
3089
+ /* Excluded from this release type: "error:fatal" */
3094
3090
  };
3095
3091
 
3096
3092
  declare type PlayerCustomEventsOverloads = {
@@ -3129,11 +3125,18 @@ declare type PlayerCustomEventsOverloads = {
3129
3125
  * Sent right before the player src attribute is set. This allows you to change the video URL before playback.
3130
3126
  */
3131
3127
  on(event: typeof SOURCE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof SOURCE]>) => void): Player;
3132
- /* Excluded from this release type: on */
3128
+ /**
3129
+ * Emitted when an Error recovery is attempted
3130
+ */
3131
+ on(event: typeof RECOVER, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RECOVER]>) => void): Player;
3133
3132
  /**
3134
3133
  * Sent when a flowplayer instance is about to be removed from the DOM, and any unsafe references are about to be reaped, which allows Single Page Applications to perform the necessary resource cleanups. This is important when working with front-end frameworks like React. This event should never be emitted directly, only listened to.
3135
3134
  */
3136
3135
  on(event: typeof REAP, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof REAP]>) => void): Player;
3136
+ /**
3137
+ * Emitted when a player will retry to reload
3138
+ */
3139
+ on(event: typeof RETRY, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RETRY]>) => void): Player;
3137
3140
  /* Excluded from this release type: on */
3138
3141
  /**
3139
3142
  * Emitted when the set of underlying qualities has changed.
@@ -3153,8 +3156,7 @@ declare type PlayerCustomEventsOverloads = {
3153
3156
  /**
3154
3157
  * when src is a livestream
3155
3158
  */
3156
- on(event: typeof LIVE_2, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE_2]>) => void): Player;
3157
- /* Excluded from this release type: on */
3159
+ on(event: typeof LIVE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE]>) => void): Player;
3158
3160
  /* Excluded from this release type: on */
3159
3161
  /* Excluded from this release type: on */
3160
3162
  /* Excluded from this release type: on */
@@ -3183,11 +3185,26 @@ declare type PlayerCustomEventsOverloads = {
3183
3185
  */
3184
3186
  off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
3185
3187
  /* Excluded from this release type: poll */
3186
- emit<T extends PlayerCustomEventName>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
3187
3188
  /* Excluded from this release type: emit */
3188
- emit<T, X extends string = string>(event: X & (X extends PlayerCustomEventName ? "Incorrect event detail type" : X), data?: T): Player;
3189
+ /* Excluded from this release type: emit */
3190
+ emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
3191
+ /* Excluded from this release type: emit */
3192
+ };
3193
+
3194
+ declare type PlayerEmittableCustomEventsDetailMap = {
3195
+ [ERROR]: ErrorEventDetail;
3196
+ [CONTEXT_MENU]: ContextMenuEventDetail;
3197
+ [VIEW_ENTER]: ViewEnterEventDetail;
3198
+ [VIEW_LEAVE]: ViewLeaveEventDetail;
3199
+ [QUALITIES]: QualitiesEventDetail;
3200
+ [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
3189
3201
  };
3190
3202
 
3203
+ declare type PlayerEmittableEventNames = keyof PlayerEmittableCustomEventsDetailMap;
3204
+
3205
+ /**
3206
+ * @public
3207
+ */
3191
3208
  declare type PlayerEventOverloads = PlayerNativeEventsOverloads & PlayerCustomEventsOverloads;
3192
3209
 
3193
3210
  declare type PlayerHeight = number;
@@ -3464,9 +3481,23 @@ declare type RecommendationsReadyEventDetail = {
3464
3481
  playlist: RecommendationItem[];
3465
3482
  };
3466
3483
 
3467
- /* Excluded from this release type: RECOVER */
3484
+ /**
3485
+ * @public
3486
+ * emitted when an Error recovery is attempted
3487
+ */
3488
+ declare const /**
3489
+ @public
3490
+ * when a new player is inserted into the HTML
3491
+ */ /**
3492
+ * @public
3493
+ * emitted when an Error recovery is attempted
3494
+ */
3495
+ RECOVER = "recover";
3468
3496
 
3469
- /* Excluded from this release type: RecoverEventDetail */
3497
+ /**
3498
+ * @public
3499
+ */
3500
+ declare type RecoverEventDetail = null;
3470
3501
 
3471
3502
  declare const RELOAD_AD_REQUESTED = "reload-ad-requested";
3472
3503
 
@@ -3537,9 +3568,21 @@ declare type ResizeInfo = {
3537
3568
  resize_non_linear: boolean;
3538
3569
  };
3539
3570
 
3540
- /* Excluded from this release type: RETRY */
3571
+ /**
3572
+ * @public
3573
+ */
3574
+ declare const /**
3575
+ @public
3576
+ * when a new player is inserted into the HTML
3577
+ */ /**
3578
+ * @public
3579
+ */
3580
+ RETRY = "retry";
3541
3581
 
3542
- /* Excluded from this release type: RetryEventDetail */
3582
+ /**
3583
+ * @public
3584
+ */
3585
+ declare type RetryEventDetail = null;
3543
3586
 
3544
3587
  declare const RTL = "is-rtl";
3545
3588
 
@@ -3674,7 +3717,7 @@ declare namespace states {
3674
3717
  RTL,
3675
3718
  TV,
3676
3719
  ENDED,
3677
- LIVE,
3720
+ LIVE_2 as LIVE,
3678
3721
  ERRORED,
3679
3722
  WAITING,
3680
3723
  AUTOPLAY,
package/plugins/ads.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * https://github.com/lancedikson/bowser
5
5
  * MIT License | (c) Dustin Diaz 2012-2015
6
6
  * MIT License | (c) Denis Demchenko 2015-2019
7
- */const ge=class Bowser{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Parser(e,t)}static parse(e){return new Parser(e).getResult()}static get BROWSER_MAP(){return ae}static get ENGINE_MAP(){return de}static get OS_MAP(){return oe}static get PLATFORMS_MAP(){return ne}}.parse(window.navigator.userAgent),{platform:me,os:_e,browser:fe}=ge,ve=e=>e&&e.toLowerCase();var ye={rnd:Math.random().toString(36).substr(2,32),os:ve(_e.name+(_e.versionName?" "+_e.versionName:"")),device:ve(me.type),browser:ve(fe.name),browser_version:(fe&&fe.version?fe.version:"unknown").split(".").shift(),plugin_version:"3.15.0"};const Ae="https://fp-eu-w1-aai.flowplayer.com/in",be="POST",we=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],Ee=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],Se=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],Le=v("ads/analytics"),Te=RequestQueue.of(),Oe=(...e)=>Object.assign({},...e);class Analytics{constructor(e,t={}){this.emitter=e,this.metadata=Oe(ye,t.metadata||{}),this.emitter=e,this.events=t.events||[],this.required_keys=t.required_keys||[],this.optional_keys=t.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),Le(this),this.wireup()}static of(e,t){return new Analytics(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(e,t){return((e,...t)=>Object.keys(e).filter(e=>~t.indexOf(e)).reduce((t,s)=>Object.assign(t,{[s]:e[s]}),{}))(t,...e.valid_keys)}static mergeMetadata(e,t={}){return e.metadata=Analytics.pluck_valid_keys(e,Oe(e.metadata,t,{player_version:"3.15.0"})),e}wireup(){this.events.forEach(e=>{this.emitter.on(e,t=>{const s=t.detail,i=Oe(this.metadata,{event_type:e},s),r=Analytics.pluck_valid_keys(this,i),a=Analytics.ensure_required_keys(this,r);if(Le(`Event[${e}]`,{payload:r,observation:s}),a.length)return Le(`Analytics.validate_metadata() failed for\n Event[${e}]\n missing keys: ${a}`,r);RequestQueue.rpush(Te,[Ae,be,r])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}const Re=v("ads/controller"),Me={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends class EventBus{constructor(e=document.createElement("div"),t=[]){this._bus=e,this._listeners=t}removeAllListeners(){this._listeners.length=0,this._bus=document.createElement("div")}emit(e,t){const s=new CustomEvent(e,{detail:t||{}});this._bus.dispatchEvent(s)}on(e,t){this._listeners.push([e,t]),this._bus.addEventListener(e,t,{passive:!0})}once(e,t){this._bus.addEventListener(e,t,{once:!0})}removeListener(e,t){this._bus.removeEventListener(e,t)}}{constructor(e={}){var t;super(),this.adapter=function(e,t){return e.adapter?new e.adapter(t):new IMA(t)}(e,this),this.opts=Object.assign(Object.assign({},Me),e),this.analytics=(t=this,Analytics.of(t,{required_keys:Ee,optional_keys:Se,events:we})),this._state=AdsState.of(),this._schedule=void 0,this._lastAd=void 0,this._macros=new Macros(e.parameters||{}),this.wireup(),this.content_processing_src=!1}reset(){return this.removeAllListeners(),this.wireup(),this.analytics&&this.analytics.wireup(),this._state.reset(),this.adapter.reset(),this}destroy(){this.removeAllListeners(),this.analytics&&this.analytics.destroy(),this.adapter&&this.adapter.destroy();this.analytics=void 0,this.opts=void 0,this.adapter=void 0,this._state=void 0,this._schedule=void 0,this._lastAd=void 0,this._macros=void 0}stop(){this.adapter&&this.adapter.stop()}onContentNewSrc(){this._state.reset(),this.adapter.destroyManager(),this.adapter.contentComplete()}wireup(){const e=()=>{var e,t;null===(e=this.videoTag)||void 0===e||e.setState("ad-paused",!1),null===(t=this.videoTag)||void 0===t||t.setState("ad-playing",!0),this._state.toggleState(te.PLAYING,!0)};this.on("ad-play-requested",e),this.on("ad-started",e),this.on("ad-resumed",e);const t=e=>{var t,s;null===(t=this.videoTag)||void 0===t||t.setState("ad-paused","ad-paused"===(null==e?void 0:e.type)),null===(s=this.videoTag)||void 0===s||s.setState("ad-playing",!1),this.adPlaying&&this._state.toggleState(te.PLAYING,!1)};this.on("ad-break-completed",t),this.on("ad-teardown",t),this.on("ad-playback-error",t),this.on("ad-request-error",t),this.on("ad-paused",t),this.on("ad-skipped",t),this.on("ad-completed",t),this.on("ad-break-completed",()=>{requestAnimationFrame(()=>{this._state.toggleState(te.BREAK_ACTIVE,!1)})}),this.on("ad-adapter-init-failed",()=>{console.error("Adapter init failed"),t(),this._state.toggleState(te.FATAL_ERROR,!0)}),this.on("reload-ad-requested",async e=>{if(Re("Ads.on(RELOAD_AD_REQUESTED)",e),this._schedule){if(t(),e)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(te.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(te.AD_AVAILABLE,!1))}})}async initialize(e,t={},s){return Re("Ads.initialize():",e,t,s),this._state.toggleState(te.INITIALIZING,!0),Object.assign(this.opts,t),Array.isArray(e)&&this.setSchedule(e),await this.adapter.init(this.opts),this._macros=this._macros.fork(Object.assign({},t.parameters||{},{autoplay:t.autoplay,muted:t.muted})),this.adapter.isReady()&&await this.adapterInitialized(s),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(e){Re("Ads.setVideoTag():",e),await this.adapter.setVideoTag(e),this.trigger("ad-videotag-attached",e),this.adapter.isReady()&&await this.adapterInitialized(),e.on("request/ad/pause",()=>this.adapter.pause()),e.on("request/ad/play",()=>this.adapter.resume()),e.on("request/ad/muteunmute",()=>e.toggleMute()),e.on("volumechange",()=>{this.adapter.volume(e.muted?0:0==e.volume?.1:e.volume)}),e.on("src",()=>e.hasState("ad-playing")||e.hasState("ad-paused")?(this.stop(),this.adapter.isLinearAd()?(this.setIsContentProcessingNewSrc(!0),void this.once("ad-break-completed",()=>{setTimeout(()=>{this.setIsContentProcessingNewSrc(!1),this.onContentNewSrc()},0)})):this.onContentNewSrc()):this.onContentNewSrc())}waitForVideoTag(){return new Promise(e=>{const t=this.adapter.getVideoTag();if(t)return e(t);this.on("ad-videotag-attached",t=>{this.once(g,()=>e(t))})})}async adapterInitialized(e){Re("Ads.adapterInitialized()"),this._state.toggleState(te.INITIALIZING,!1),this._state.toggleState(te.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,e),this.checkIfBreakComplete(),this.adapter.isAdPod()||e&&!this.opts.autoplay||this.trigger("ad-teardown")}async fetchNextAd(e,t=0){var s,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(t>50)throw this._state.toggleState(te.FATAL_ERROR,!0),this._state.toggleState(te.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const r=(null===(s=this._schedule)||void 0===s?void 0:s.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!r||this.adapter.canDismissNonLinear()||-1===e)if(this._schedule.waitForLoad(e,r,this.opts.preload_ads))this._state.toggleState(te.FETCHING_AD,!1);else if(r===this._schedule.getPostroll()&&this._schedule.setPostrollActive(),this._schedule.isDrained()||this._schedule.increment(),r){Re("Ads.fetchNextAd",r),this._state.toggleState(te.FETCHING_AD,!0);try{return await this.requestAd(r),this._state.toggleState(te.AD_AVAILABLE,!0),void this._state.toggleState(te.FETCHING_AD,!1)}catch(s){if(Re("Ads.fetchNextAd(err: %o, ad: %o)",s,r),this.setLastAd(r),r!==this._schedule.getPostroll())return await this.fetchNextAd(e,++t)}}else this._state.toggleState(te.FETCHING_AD,!1)}skipAdsOnSeek(e){if(!this._schedule)return;let t=this._schedule.getNextAd();for(;t&&t.time<e;)this._schedule.increment(),t=this._schedule.getNextAd()}async setCurrentTime(e,t=!1,s=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(te.FETCHING_AD))return;if(this._state.hasAny(te.PLAYING)&&this.adapter.isLinearAd())return;const i=0===e&&0===this._schedule.getNextIndex();try{if(s&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(e),this._state.hasAny(te.AD_AVAILABLE)||await this.fetchNextAd(e),!this._state.hasAny(te.AD_AVAILABLE)||!this.shallPlayAd(e)||t)return;await this.playAd(),await this.setCurrentTime(e),this.checkIfBreakComplete()}catch(e){Re("setCurrentTime: Error(from: setCurrentTime, message: %s)",e.message)}finally{i&&this.trigger("ad-preroll-finished")}}async playAd(){var e;if(!this._state.hasAny(te.AD_AVAILABLE))return;this._state.toggleState(te.AD_AVAILABLE,!1),this._state.toggleState(te.BREAK_ACTIVE,!0);const t=null===(e=this._schedule)||void 0===e?void 0:e.getCurrentAd();try{await this.adapter.playAd()}catch(e){console.error("Ads.playAd: error",e)}finally{t&&this.setLastAd(t)}}checkIfBreakComplete(){if(!this._state.hasAny(te.BREAK_ACTIVE))return Re("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());Re("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(te.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger("ad-break-completed")}resetScheduleCounter(){this._schedule&&this._schedule.resetCounter()}setSchedule(e,t){if(t&&!isNaN(t)&&this._schedule&&this._schedule.updateContentDuration(t),this._schedule&&this._schedule.getNextIndex()>0)return this._schedule.setAds(e);this._schedule=new Schedule(e,{preload_advance:this.opts.preload_advance,content_duration:t?0:t})}toJSON(){return this._schedule?this._schedule.toJSON():[]}trigger(e,t={}){var s;if(!this.adapter.getVideoTag())return;if(!this._state)return;if("ad-break-completed"===e&&this._state.hasAny(te.BREAK_ACTIVE)&&!this.adapter.isAdPod())return Re("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=t)||"object"!=typeof i||X(i)!==J)return this.dispatch(e,t);var i;const r=Object.assign({},this.adapter.getOpts()||{},(null===(s=this._schedule)||void 0===s?void 0:s.getCurrentAd())||{},{ad_type:this.ad_type},t);return this.dispatch(e,r)}dispatch(e,t){const s=this.adapter.getVideoTag();if(s){Re(":dispatch",e,t);try{const i={event:"ads/"+e,detail:{outstream:t.outstream,ad_type:t.ad_type,ad_break_time:t.time,ad_remaining_seconds:t.remaining,ad_muted:t.muted,ad_duration_seconds:t.duration,ad_error_reason:t.reason,ad_vast_error:t.vast_error,ad_vast_error_type:t.vast_error_type,ad_request_load_type:t.request_load_time}};s.dispatchEvent(new CustomEvent("health:record",{detail:i}))}catch(e){Re(":error",e)}se(s,e,t),this.emit(e,t)}}get ad_type(){return this._schedule&&this._schedule.getCurrentType()}shouldRestartContent(){if(this.getIsContentProcessingNewSrc())return!1;if(this.adapter.isAdPod())return!0;const e=this.getLastAd();return!e||!e.outstream&&!1!==e.restart}async finished(e){if(this._schedule&&(Re("Ads.finished"),!(this.adapter.isCustomPlaybackEnabled()&&this._state.hasAny(te.PLAYING)&&this.adapter.isLinearAd()))){Re("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return Re("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(te.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(e){Re("Ads.finished: postroll failed:",e)}finally{this.trigger("ad-postroll-finished"),this.checkIfBreakComplete(),"function"==typeof e&&e()}}}hasPreroll(){return this._schedule&&Schedule.hasPreroll(this._schedule.getAds())}shallPlayAd(e){var t;return(!this.adapter||!this.adapter.isAdPod())&&(!(!this._state||this._state.hasAny(te.FATAL_ERROR))&&!!(null===(t=this._schedule)||void 0===t?void 0:t.shallPlayAd(e)))}setLastAd(e){return this._lastAd=e,this}setIsContentProcessingNewSrc(e){this.content_processing_src=e}getLastAd(){return this._lastAd}getIsContentProcessingNewSrc(){return this.content_processing_src}mergeMacros(e={}){return this._macros=this._macros.fork(Object.assign({},e)),this}get paused(){return this.adapter&&this.adapter.isPaused()}pause(){this.adapter&&this.adapter.pause()}resume(){this.adapter&&this.adapter.resume()}resize(e){this.adapter&&this.adapter.onResize(e)}async requestAd(e,t=0,s=this.opts.timeout){if(!this._state)return;Re("Ads.requestAd(ad: %o)",{ad:e,timeout:s,idx:t});const i=await async function e(t){if("function"==typeof t)return[await Z(t)];if("string"==typeof t)return[await Z(t)];if(Array.isArray(t)){const e=t;return await Promise.all(e.map(Z))}if("object"==typeof t&&t&&t.adTag)return await e(t.adTag);throw new Error(`\n unhandled ads type ${typeof t}:\n ${JSON.stringify(t)}\n can be:\n | Array<string>\n | string\n | function\n | {adTag: Array<string>|string|function}\n `)}(e);if(void 0===i[t])return Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[t])return await this.requestAd(i,t+1,s);this.trigger("ad-requested",e);const r=this._macros.compile(i[t],K(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(r,s)}catch(e){return Re(`Ads.requestAd(:fallback, idx: ${t}, length: ${i.length}, adTag: ${i[t]})\nError `,{adTag:i,err:e}),this.requestAd(i,t+1,s)}}resetSchedule(e){this._schedule&&this._schedule.reset(e)}get adPlaying(){return this._state&&this._state.hasAny(te.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(te.BREAK_ACTIVE)}get adRequesting(){return this._state.hasAny(te.FETCHING_AD)}get adLinear(){return this.adBreak&&this.adapter.isLinearAd()}}var ke=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),De=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function Pe(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function Ie(e,t){var s=e.muted,i=e.timeout,r=e.inline,a=t(),n=a.element,o=a.source,d=void 0,l=void 0,c=void 0;return n.muted=s,!0===s&&n.setAttribute("muted","muted"),!0===r&&n.setAttribute("playsinline","playsinline"),n.src=o,new Promise((function(e){d=n.play(),l=setTimeout((function(){c(!1,new Error("Timeout "+i+" ms has been reached"))}),i),c=function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.remove(),n.srcObject=null,clearTimeout(l),e({result:t,error:s})},void 0!==d?d.then((function(){return c(!0)})).catch((function(e){return c(!1,e)})):c(!0)}))}var Ne={audio:function(e){return Ie(e=Pe(e),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(ke)}}))},video:function(e){return Ie(e=Pe(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(De)}}))}};let Ce=void 0;async function Ue(e=!0){return Ce||(Ce=await Ne.video({timeout:500,muted:e}),Ce)}const xe=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});var Fe=Object.freeze({__proto__:null,STICKY_CONTROLS:1,NO_FULLSCREEN:2,NO_AD_INDICATOR:4,AD_ATTRIBUTION:8,AD_CHOICES:16,REMAINING_TIME:32,VOLUME_BAR:64});const Be=["progress","duration","remaining"];class AdUI extends HTMLElement{constructor(e){super(),this.player=e,this.className="fp-ad-ui",this.append(...e.createComponents("flowplayer-ad-controls","flowplayer-ad-countdown")),e.on("ad/set-ui-flags",e=>{let{ui_flags:t}=e.detail;if(t=t||0,(8&t)>0){const e=document.createElement("div");e.classList.add("ad-attribution"),e.textContent=this.player.i18n("ads.advertisement","Advertisement"),this.append(e)}})}static get observedAttributes(){return Be}}const qe=v("fpads:native:outstream"),je={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var He,ze;!function(e){e.OUTSTREAM_VISIBLE="ads-outstream-visible",e.OUTSTREAM_VIEWPORT_UPDATE="ads-outstream-viewport-update",e.OUTSTREAM_TEARDOWN="ads-outstream-teardown",e.OUTSTREAM_ENDSCREEN_READY="ads-outstream-endscreen-ready"}(He||(He={})),function(e){e[e.None=0]="None",e[e.Booting=1]="Booting",e[e.Ready=2]="Ready",e[e.Disposed=3]="Disposed"}(ze||(ze={}));class Outstream{constructor({ads:e,root:t,content:s,ima:i}){this.state=ze.None,qe("creating Outstream instance"),this.content=s,this.ads=e,this.root=t,this.ima=i,this.aspectRatio=s.videoHeight/s.videoWidth,this.dimensions=function(e){if(e.clientWidth>0||e.clientHeight)return h(e);const t={height:e.style.height};p(e,"opacity",0),p(e,"display","absolute"),p(e,"display","inline-block"),p(e,"height","auto");const s=h(e);return p(e,"height",t.height),p(e,"opacity",1),s}(this.root),this.adUi=new AdUI(s),this.initialVolumeState={},t.classList.add(je.OUTSTREAM),t.append(this.adUi),this.hide(),this.ads.on("ad-pause-content",e=>{var t;if(this.state==ze.Disposed)return;const s=!!(null===(t=e.detail)||void 0===t?void 0:t.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:s}))}),s.on("resize",e=>{if(this.state==ze.Disposed)return;const t=e.detail;t&&(this.dimensions={width:t.contentRect.width,height:t.contentRect.height},this.ads.resize(this.dimensions))});let r=1,a=!0;s.on("intersectionchange",e=>{if(this.state==ze.Disposed)return;const t=e.detail;if(t)switch(this.state){case ze.Booting:return qe(":boot skipping intersectionchange");case ze.None:return this.state=ze.Booting,this.begin_life_cycle();case ze.Ready:if(r=t.ratio,t.ratio>=.5&&this.ads.adPlaying)return;t.ratio>=.5&&a&&this.ads.resume(),t.ratio<.5&&this.ads.pause()}}),this.content.on("ad-paused",()=>a=r<.5),this.setup(),setTimeout(()=>(this.state=ze.Booting,this.begin_life_cycle()),0)}hide(){return this}restore_aspect_ratio(){return qe(`Outstream.restore_aspect_ratio(${this.aspectRatio})`),this.content.setOpts({ratio:this.aspectRatio}),this}show(){this.root.classList.remove(Outstream.CLASS.HIDDEN),this.root.classList.add(Outstream.CLASS.SHOWING),this.content.setState("ad-linear",!0)}async begin_life_cycle(){var e;this.state=ze.Ready;const{error:t,result:s}=await Ue(!1),{result:i}=await Ue(!0);this.content.emit("ad/set-ui-flags",{ui_flags:null===(e=this.content.opts.ads)||void 0===e?void 0:e.ui}),this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!s&&!i),muted:!s},qe("Outstream.show() :autoplay >> sound="+s),t&&this.content&&!s&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await L({ads:this.ads,content:this.content,adContainer:this.adUi,ima:this.ima,state:{listening:!1},config:this.content.opts}),k({content:this.content,ads:this.ads}),this.state=ze.Ready}attach_ad_listeners(){this.ads.once("ad-pause-content",()=>{this.show(),this.ads.adPlaying&&this.ads.pause()});const e=()=>{E.forEach(t=>this.ads.removeListener(t,e));const t=new CustomEvent(He.OUTSTREAM_TEARDOWN);qe("Outstream(:teardown)",t),this.content.dispatchEvent(t)};E.forEach(t=>this.ads.once(t,e)),this.content.once(He.OUTSTREAM_TEARDOWN,e=>{setTimeout(()=>{if(e.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),R({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adUi,ima:this.ima,content:this.content,root:this.content.root,state:{started:!0,listening:!1},initial:{muted:!0,volume:1}})}empty_src(){this.content.setSrc({type:"video/mp4",src:URL.createObjectURL(xe)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.content.setState("ad-linear",!1),this.empty_src()}reset_ui(){const e=this.root;e.classList.remove(Outstream.CLASS.SHOWING),e.classList.remove(Outstream.CLASS.OUTSTREAM)}dispose(){if(this.state==ze.Disposed)return;const e=this.root,t=this.content;this.reset_ui(),e.classList.add(Outstream.CLASS.OUTSTREAM),e.classList.add(Outstream.CLASS.DONE);this.video=this.container=this.ads=0,this.state=ze.Disposed,t.destroy(),e.innerHTML=""}}function Ve(e){return e&&"number"==typeof e.time}function Ge(e){return e&&"number"==typeof e.percentage&&"number"!=typeof e.time}Outstream.CLASS=je;const We=v("ads/ima/sdk");var Qe,$e;async function Ke(e,t){var s;const i=null===(s=null===window||void 0===window?void 0:window.google)||void 0===s?void 0:s.ima;if(t?null==i?void 0:i.dai:i)return void We(":noop");const r=t?"https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js":e._storage.getItem("ima/debug")?"https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"https://imasdk.googleapis.com/js/sdkloader/ima3.js";try{return await async function(e){return new Promise((t,s)=>{let i=document.querySelector(`script[src='${e}']`);if(i)return Ye(i,t,s);i=document.createElement("script"),i.setAttribute("state",Qe.LOADING),Ye(i,t,s),i.src=e,document.head.appendChild(i)})}(r),void We(":loaded")}catch(e){We(":error "+e.message,e)}}function Ye(e,t,s){const i=e.getAttribute("state");if(i&&[Qe.ERROR,Qe.LOADED].includes(i))return t(void 0);e.addEventListener("load",()=>{e.setAttribute("state",Qe.LOADED),t(void 0)},{once:!0}),["error","abort"].forEach(t=>{e.addEventListener(t,()=>{e.setAttribute("state",Qe.ERROR),s("script failed to load")},{once:!0})})}!function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(Qe||(Qe={})),function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}($e||($e={}));const Ze=v("ads/ima/sdk"),Je="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js";async function Xe(e){var t;const s=e._storage.getItem("prebid/debug")?Je:"https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js";if(null===(t=null===window||void 0===window?void 0:window.pbjs)||void 0===t?void 0:t.version)Ze(":noop");else if(!document.querySelector(`script[src='${s}']`))try{return await async function(e){return new Promise((t,s)=>{let i=document.querySelector(`script[src='${e}']`);i||(i=document.createElement("script")),i.setAttribute("state",$e.LOADING);const r=i.getAttribute("state");if(r&&[$e.ERROR,$e.LOADED].includes(r))return t(void 0);i.addEventListener("load",()=>{i.setAttribute("state",$e.LOADED),t(void 0)},{once:!0}),["error","abort"].forEach(e=>{i.addEventListener(e,()=>{i.setAttribute("state",$e.ERROR),s("script failed to load")},{once:!0})}),i.src=e,document.head.appendChild(i)})}(s),void Ze(":loaded")}catch(e){console.warn(":error / failed to load prebid.js / "+e.message,e)}}const et=window.pbjs=window.pbjs||{};et.que=et.que||[];class PrebidAdController{constructor(e,t){this.player=e,this.config=t,this.player=e,this.bestOffer="",et.que.push(()=>{var s,i;const r=this.createAdUnit();et.addAdUnits(r);const a=(null===(i=null===(s=t.ads)||void 0===s?void 0:s.prebid)||void 0===i?void 0:i.pbjs)||{};et.setConfig(Object.assign({enableSendAllBids:!0},a)),e.emit("ad/pbjs",{pbjs:et}),et.requestBids({bidsBackHandler:e=>{var s,i,a,n,o;const d=null===(s=e[this.prebidCode()])||void 0===s?void 0:s.bids;if(!d)return;if(0==d.length)return;const l=d[0];if(l&&l.vastUrl)return this.bestOffer=l.vastUrl;const c=et.adServers.dfp.buildVideoUrl({adUnit:r,params:{iu:null===(a=null===(i=t.ads)||void 0===i?void 0:i.prebid)||void 0===a?void 0:a.iu,cust_params:null===(o=null===(n=t.ads)||void 0===n?void 0:n.prebid)||void 0===o?void 0:o.custom_params,output:"vast"}});this.bestOffer=c}})})}prebidCode(){var e,t;return(null===(t=null===(e=this.config.ads)||void 0===e?void 0:e.prebid)||void 0===t?void 0:t.code)||this.player.root.id}videoInfo(){var e,t;return(null===(t=null===(e=this.config.ads)||void 0===e?void 0:e.prebid)||void 0===t?void 0:t.video)||{context:"instream",playerSize:[[this.player.videoWidth||640,this.player.videoHeight||480]]}}createAdUnit(){var e,t;return{code:this.prebidCode(),mediaTypes:{video:this.videoInfo()},bids:null===(t=null===(e=this.config.ads)||void 0===e?void 0:e.prebid)||void 0===t?void 0:t.bidders}}vastGenerator(){return async()=>this.bestOffer}}function tt(e,t){var s,i;const r=null===(s=t.ads)||void 0===s?void 0:s.prebid;if(!r)return;if((null===(i=e.prebidController)||void 0===i?void 0:i.config)===t)return;e.prebidController||(e.prebidController=new PrebidAdController(e,t),Xe(e));const a=e.prebidController;if(a){const t=r.breaks.map(e=>({adTag:a.vastGenerator(),time:e}));e.setOpts({ima:{ads:t}})}}const st=v("ads/index");async function it(e,t,s){var i;let r;if(s.on("config",()=>{var t,i,a;void 0===r&&e.autoplay&&!s.currentSrc&&(a=e.autoplay,r=!0===a?f.ON:!1===a?f.OFF:a,e.autoplay=0),(null===(t=e.ads)||void 0===t?void 0:t.prebid)&&tt(s,e),Array.isArray(null===(i=null==e?void 0:e.ima)||void 0===i?void 0:i.ads)&&x(s)&&Object.assign(e,{hls:{native:!0}}),s.ads&&d()}),s.once("loadstart",()=>{setTimeout(()=>{var t;if(!Array.isArray(null===(t=null==e?void 0:e.ima)||void 0===t?void 0:t.ads)&&void 0!==r){if(e.autoplay=r,s.setState("is-autoplay",!0),!s.hasState(_))return s.once("viewenter",()=>s.togglePlay(!0));s.togglePlay(!0)}},0)}),await Ke(s),!("google"in window))return console.warn("google.ima unavailable");let a=!1;const n=s.ads=new AdsController,o=n.analytics;function d(){const i=e.ima;if(!i||!Array.isArray(i.ads))return;const d=e.duration||s.duration;if(i.ads=function(e,t){return Array.isArray(e)?e.filter(e=>Ve(e)||Ge(e)).reduce((e,s)=>{if(Ve(s))return e.push(s),e;if(s.lazy)return e.push(s),e;if(Ge(s)){const i=Object.assign({},s),r=s.percentage?s.percentage*t:0;return isNaN(r)||(i.time=r<0||r===t?-1:r),e.push(i),e}return e},[]):(console.warn("AdSchedule was not an Array"),[])}(i.ads,d),n.setSchedule(i.ads,d),e.metadata&&Analytics.mergeMetadata(o,e.metadata),e.metadata&&n.mergeMacros(e.metadata),e.metadata&&i.parameters&&(i.parameters=Object.assign(Object.assign({},i.parameters),e.metadata)),Analytics.mergeMetadata(o,{muted:e.muted||!1,autoplay:e.autoplay||!1}),!a){if(a=!0,e.lang&&!i.Locale&&(i.Locale=e.lang),Schedule.isOutstream(i.ads))return st("is outstream, returning"),new Outstream({root:t,content:s,ads:n,ima:i});S({config:Object.assign(Object.assign({},e),{autoplay:r}),root:t,content:s,ads:n,ima:i})}}n.resize(h(t)),n.on("ad-postroll-finished",()=>{n.adapter.isCustomPlaybackEnabled()&&n.once("ad-break-completed",()=>{s.src=s.original_src,s.once("canplay",()=>{s.togglePlay(!1)}),s.webkitExitFullscreen()})}),s.on("reap",(function(){n&&n.destroy()})),(null===(i=e.ads)||void 0===i?void 0:i.prebid)&&tt(s,e),d()}function rt(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}class AdControls extends HTMLElement{constructor(e){super(),this.player=e,this.classList.add("fp-ad-controls"),this.append(this.adRemainingTime(),y(this.player,"flowplayer-ad-indicator"),this.playbackButtons(),this.volumeBtn(),y(this.player,"flowplayer-volume-bar"),...this.fullscreenIcons(),this.adChoices()),e.on("ad/set-ui-flags",this.applyStyleFlags.bind(this))}fullscreenIcons(){return this.player.createComponents("flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon").map(e=>(e.onclick=()=>this.player.toggleFullScreen(),e))}volumeBtn(){const e=y(this.player,"flowplayer-volume-icon");return e.onclick=()=>this.player.emit("request/ad/muteunmute"),e}playbackButtons(){const e=document.createElement("div");e.classList.add("ad-playback-controls");const t=y(this.player,"flowplayer-small-play-icon"),s=y(this.player,"flowplayer-small-pause-icon");return t.addEventListener("click",()=>{this.player.emit("request/ad/play"),setTimeout((function(){s.focus&&s.focus()}),100)}),s.addEventListener("click",()=>{this.player.emit("request/ad/pause"),setTimeout((function(){t.focus&&t.focus()}),100)}),e.append(t,s),e}adChoices(){const e=document.createElement("div");return e.classList.add("fp-ad-choices"),e.textContent=this.player.i18n("ads.adchoices","AdChoices"),e.addEventListener("click",e=>{e.preventDefault(),this.player.togglePlay(!1),window.open("https://adssettings.google.com","_blank")}),e}adRemainingTime(){const e=document.createElement("div");return e.classList.add("fp-ad-remaining","fp-color-text"),this.prepend(e),this.player.on("ad-progress",t=>{const s=t.detail.remaining;e.textContent=function(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const s=Math.floor(e/3600);let i=Math.floor(e/60);return e-=60*i,s>=1?(i-=60*s,t+s+":"+rt(i)+":"+rt(e)):t+rt(i)+":"+rt(e)}(parseFloat(s+""))}),e}applyStyleFlags(e){var t;const s=null!==(t=e.detail.ui_flags)&&void 0!==t?t:0;this.classList.toggle("is-ad-controls-sticky",(1&s)>0),this.classList.toggle("no-indicator",(4&s)>0),this.classList.toggle("is-ad-choices",(16&s)>0),this.classList.toggle("no-volume-bar",0==(64&s)),this.classList.toggle("is-ad-remaining",(32&s)>0),this.classList.toggle("no-fullscreen",(2&s)>0)}}class AdCountdown extends HTMLElement{constructor(e){super(),this.player=e,this.className="fp-ad-countdown",e.on("ad-progress",e=>{const{duration:t,remaining:s}=e.detail;this.setAttribute("duration",t+""),this.setAttribute("remaining",s+"")}),e.on("ad-started",e=>{e.detail.linear&&(this.style.setProperty("--ad-percent-previous","0"),this.style.setProperty("--ad-percent-complete","0"))}),this.addEventListener("animationend",()=>{const e=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",e)})}static get observedAttributes(){return["remaining"]}attributeChangedCallback(e,t,s){switch(e){case"remaining":return this.onRemaining(s)}}onRemaining(e){const t=parseFloat(this.getAttribute("duration")||"0");e||(e=t+"");const s=parseFloat(e),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const r=((t-s)/t*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",r),this.classList.add("go")})}}class AdIndicator extends HTMLElement{constructor(e){super(),this.player=e,this.render(),e.on("ad-started",e=>{const{position:t,totals:s}=e.detail.ad;this.setAttribute("position",t+""),this.setAttribute("totals",s+"")})}static get observedAttributes(){return["position","totals"]}attributeChangedCallback(e,t){switch(e){case"position":case"totals":return this.updateText()}}updateText(){if(!this.element)return;const e=parseFloat(this.getAttribute("position")||"0"),t=parseFloat(this.getAttribute("totals")||"0");this.element.textContent=`${this.player.i18n("ads.indicator","ADS")} ${e} / ${t}`}render(){this.element=document.createElement("div"),this.element.classList.add("ad-indicator","fp-color-text"),this.element.textContent=this.player.i18n("ads.indicator","ADS"),this.append(this.element)}}var at,nt=Object.freeze({__proto__:null,SINGlE_INLINE_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_SKIPPABLE_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirectlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_ERROR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_BROKEN:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&nofb=1&correlator=",SINGLE_VPAID_20_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinearvpaid2js&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_VPAID_20_NON_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dnonlinearvpaid2js&ciu_szs=728x90%2C300x250&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_NON_LINEAR_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/nonlinear_ad_samples&sz=480x70&cust_params=sample_ct%3Dnonlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_SESSION_AD_RULE_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sar%3Da0f2&ciu_szs=300x250&ad_rule=1&gdfp_req=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonly&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator="});const{samsung_tv:ot}=u(),dt=((at=class Ads{constructor(e){this.umd=e,A(e,b,AdUI),A(e,"flowplayer-ad-controls",AdControls),A(e,"flowplayer-ad-countdown",AdCountdown),A(e,"flowplayer-ad-indicator",AdIndicator)}init(e,t,s){if(c.from_token(e.token||"").is_granted(c.permissions.ADS)&&!ot)return it(e,t,s)}}).events=m,at.ui=Fe,at.tags=nt,at);return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const s=e.flowplayer;return"function"==typeof s?(s(t),t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t),t)}(window,dt)}));
7
+ */const ge=class Bowser{static getParser(e,t=!1){if("string"!=typeof e)throw new Error("UserAgent should be a string");return new Parser(e,t)}static parse(e){return new Parser(e).getResult()}static get BROWSER_MAP(){return ae}static get ENGINE_MAP(){return de}static get OS_MAP(){return oe}static get PLATFORMS_MAP(){return ne}}.parse(window.navigator.userAgent),{platform:me,os:_e,browser:fe}=ge,ve=e=>e&&e.toLowerCase();var ye={rnd:Math.random().toString(36).substr(2,32),os:ve(_e.name+(_e.versionName?" "+_e.versionName:"")),device:ve(me.type),browser:ve(fe.name),browser_version:(fe&&fe.version?fe.version:"unknown").split(".").shift(),plugin_version:"3.16.0-rc"};const Ae="https://fp-eu-w1-aai.flowplayer.com/in",be="POST",we=["ad-requested","ad-request-error","ad-request-completed","ad-completed","ad-started","ad-error","ad-skipped"],Ee=["event_type","ad_tag_id","media_id","player_id","site_id","sitegroup_id","rnd","os","device","browser","browser_version","plugin_version","player_version"],Se=["vast_error","reason","request_load_time","ad_type","vast_ad_id"],Le=v("ads/analytics"),Te=RequestQueue.of(),Oe=(...e)=>Object.assign({},...e);class Analytics{constructor(e,t={}){this.emitter=e,this.metadata=Oe(ye,t.metadata||{}),this.emitter=e,this.events=t.events||[],this.required_keys=t.required_keys||[],this.optional_keys=t.optional_keys||[],this.valid_keys=this.required_keys.slice(0).concat(this.optional_keys),Le(this),this.wireup()}static of(e,t){return new Analytics(e,t)}static ensure_required_keys(e,t){return e.required_keys.filter(e=>!(e in t))}static pluck_valid_keys(e,t){return((e,...t)=>Object.keys(e).filter(e=>~t.indexOf(e)).reduce((t,s)=>Object.assign(t,{[s]:e[s]}),{}))(t,...e.valid_keys)}static mergeMetadata(e,t={}){return e.metadata=Analytics.pluck_valid_keys(e,Oe(e.metadata,t,{player_version:"3.16.0-rc"})),e}wireup(){this.events.forEach(e=>{this.emitter.on(e,t=>{const s=t.detail,i=Oe(this.metadata,{event_type:e},s),r=Analytics.pluck_valid_keys(this,i),a=Analytics.ensure_required_keys(this,r);if(Le(`Event[${e}]`,{payload:r,observation:s}),a.length)return Le(`Analytics.validate_metadata() failed for\n Event[${e}]\n missing keys: ${a}`,r);RequestQueue.rpush(Te,[Ae,be,r])})})}destroy(){this.emitter=this.metadata=this.events=this.required_keys=this.optional_keys=this.valid_keys=void 0}}const Re=v("ads/controller"),Me={show_all_ads_on_seek:!1,timeout:5e3,preload_advance:10};class AdsController extends class EventBus{constructor(e=document.createElement("div"),t=[]){this._bus=e,this._listeners=t}removeAllListeners(){this._listeners.length=0,this._bus=document.createElement("div")}emit(e,t){const s=new CustomEvent(e,{detail:t||{}});this._bus.dispatchEvent(s)}on(e,t){this._listeners.push([e,t]),this._bus.addEventListener(e,t,{passive:!0})}once(e,t){this._bus.addEventListener(e,t,{once:!0})}removeListener(e,t){this._bus.removeEventListener(e,t)}}{constructor(e={}){var t;super(),this.adapter=function(e,t){return e.adapter?new e.adapter(t):new IMA(t)}(e,this),this.opts=Object.assign(Object.assign({},Me),e),this.analytics=(t=this,Analytics.of(t,{required_keys:Ee,optional_keys:Se,events:we})),this._state=AdsState.of(),this._schedule=void 0,this._lastAd=void 0,this._macros=new Macros(e.parameters||{}),this.wireup(),this.content_processing_src=!1}reset(){return this.removeAllListeners(),this.wireup(),this.analytics&&this.analytics.wireup(),this._state.reset(),this.adapter.reset(),this}destroy(){this.removeAllListeners(),this.analytics&&this.analytics.destroy(),this.adapter&&this.adapter.destroy();this.analytics=void 0,this.opts=void 0,this.adapter=void 0,this._state=void 0,this._schedule=void 0,this._lastAd=void 0,this._macros=void 0}stop(){this.adapter&&this.adapter.stop()}onContentNewSrc(){this._state.reset(),this.adapter.destroyManager(),this.adapter.contentComplete()}wireup(){const e=()=>{var e,t;null===(e=this.videoTag)||void 0===e||e.setState("ad-paused",!1),null===(t=this.videoTag)||void 0===t||t.setState("ad-playing",!0),this._state.toggleState(te.PLAYING,!0)};this.on("ad-play-requested",e),this.on("ad-started",e),this.on("ad-resumed",e);const t=e=>{var t,s;null===(t=this.videoTag)||void 0===t||t.setState("ad-paused","ad-paused"===(null==e?void 0:e.type)),null===(s=this.videoTag)||void 0===s||s.setState("ad-playing",!1),this.adPlaying&&this._state.toggleState(te.PLAYING,!1)};this.on("ad-break-completed",t),this.on("ad-teardown",t),this.on("ad-playback-error",t),this.on("ad-request-error",t),this.on("ad-paused",t),this.on("ad-skipped",t),this.on("ad-completed",t),this.on("ad-break-completed",()=>{requestAnimationFrame(()=>{this._state.toggleState(te.BREAK_ACTIVE,!1)})}),this.on("ad-adapter-init-failed",()=>{console.error("Adapter init failed"),t(),this._state.toggleState(te.FATAL_ERROR,!0)}),this.on("reload-ad-requested",async e=>{if(Re("Ads.on(RELOAD_AD_REQUESTED)",e),this._schedule){if(t(),e)return this._schedule.reset(this._schedule.getAds());this._state.hasAny(te.AD_AVAILABLE)&&(this._schedule.decrement(),this._state.toggleState(te.AD_AVAILABLE,!1))}})}async initialize(e,t={},s){return Re("Ads.initialize():",e,t,s),this._state.toggleState(te.INITIALIZING,!0),Object.assign(this.opts,t),Array.isArray(e)&&this.setSchedule(e),await this.adapter.init(this.opts),this._macros=this._macros.fork(Object.assign({},t.parameters||{},{autoplay:t.autoplay,muted:t.muted})),this.adapter.isReady()&&await this.adapterInitialized(s),this}get videoTag(){return this.adapter.getVideoTag()}get adInfo(){return this.adapter.getAdInfo()}async setVideoTag(e){Re("Ads.setVideoTag():",e),await this.adapter.setVideoTag(e),this.trigger("ad-videotag-attached",e),this.adapter.isReady()&&await this.adapterInitialized(),e.on("request/ad/pause",()=>this.adapter.pause()),e.on("request/ad/play",()=>this.adapter.resume()),e.on("request/ad/muteunmute",()=>e.toggleMute()),e.on("volumechange",()=>{this.adapter.volume(e.muted?0:0==e.volume?.1:e.volume)}),e.on("src",()=>e.hasState("ad-playing")||e.hasState("ad-paused")?(this.stop(),this.adapter.isLinearAd()?(this.setIsContentProcessingNewSrc(!0),void this.once("ad-break-completed",()=>{setTimeout(()=>{this.setIsContentProcessingNewSrc(!1),this.onContentNewSrc()},0)})):this.onContentNewSrc()):this.onContentNewSrc())}waitForVideoTag(){return new Promise(e=>{const t=this.adapter.getVideoTag();if(t)return e(t);this.on("ad-videotag-attached",t=>{this.once(g,()=>e(t))})})}async adapterInitialized(e){Re("Ads.adapterInitialized()"),this._state.toggleState(te.INITIALIZING,!1),this._state.toggleState(te.BREAK_ACTIVE,!!this.hasPreroll()),await this.setCurrentTime(0,e),this.checkIfBreakComplete(),this.adapter.isAdPod()||e&&!this.opts.autoplay||this.trigger("ad-teardown")}async fetchNextAd(e,t=0){var s,i;if(!this._schedule)return;if(!this.adapter.isReady())return;if(t>50)throw this._state.toggleState(te.FATAL_ERROR,!0),this._state.toggleState(te.FETCHING_AD,!1),new Error("Ads.fetchNextAd() :max_recursion_depth");const r=(null===(s=this._schedule)||void 0===s?void 0:s.getNextAd())||(null===(i=this._schedule)||void 0===i?void 0:i.getPostroll());if(!r||this.adapter.canDismissNonLinear()||-1===e)if(this._schedule.waitForLoad(e,r,this.opts.preload_ads))this._state.toggleState(te.FETCHING_AD,!1);else if(r===this._schedule.getPostroll()&&this._schedule.setPostrollActive(),this._schedule.isDrained()||this._schedule.increment(),r){Re("Ads.fetchNextAd",r),this._state.toggleState(te.FETCHING_AD,!0);try{return await this.requestAd(r),this._state.toggleState(te.AD_AVAILABLE,!0),void this._state.toggleState(te.FETCHING_AD,!1)}catch(s){if(Re("Ads.fetchNextAd(err: %o, ad: %o)",s,r),this.setLastAd(r),r!==this._schedule.getPostroll())return await this.fetchNextAd(e,++t)}}else this._state.toggleState(te.FETCHING_AD,!1)}skipAdsOnSeek(e){if(!this._schedule)return;let t=this._schedule.getNextAd();for(;t&&t.time<e;)this._schedule.increment(),t=this._schedule.getNextAd()}async setCurrentTime(e,t=!1,s=!1){if(!this._schedule)return;if(!this.adapter.isReady())return;if(this._state.hasAny(te.FETCHING_AD))return;if(this._state.hasAny(te.PLAYING)&&this.adapter.isLinearAd())return;const i=0===e&&0===this._schedule.getNextIndex();try{if(s&&!this.opts.show_all_ads_on_seek&&this.skipAdsOnSeek(e),this._state.hasAny(te.AD_AVAILABLE)||await this.fetchNextAd(e),!this._state.hasAny(te.AD_AVAILABLE)||!this.shallPlayAd(e)||t)return;await this.playAd(),await this.setCurrentTime(e),this.checkIfBreakComplete()}catch(e){Re("setCurrentTime: Error(from: setCurrentTime, message: %s)",e.message)}finally{i&&this.trigger("ad-preroll-finished")}}async playAd(){var e;if(!this._state.hasAny(te.AD_AVAILABLE))return;this._state.toggleState(te.AD_AVAILABLE,!1),this._state.toggleState(te.BREAK_ACTIVE,!0);const t=null===(e=this._schedule)||void 0===e?void 0:e.getCurrentAd();try{await this.adapter.playAd()}catch(e){console.error("Ads.playAd: error",e)}finally{t&&this.setLastAd(t)}}checkIfBreakComplete(){if(!this._state.hasAny(te.BREAK_ACTIVE))return Re("Ads.checkIfBreakComplete(:bail, ad: %o)",this.getLastAd());Re("Ads.checkIfBreakComplete(:run, ad: %o)",this.getLastAd()),this._state.toggleState(te.BREAK_ACTIVE,!1),this.adapter.isAdPod()||this.trigger("ad-break-completed")}resetScheduleCounter(){this._schedule&&this._schedule.resetCounter()}setSchedule(e,t){if(t&&!isNaN(t)&&this._schedule&&this._schedule.updateContentDuration(t),this._schedule&&this._schedule.getNextIndex()>0)return this._schedule.setAds(e);this._schedule=new Schedule(e,{preload_advance:this.opts.preload_advance,content_duration:t?0:t})}toJSON(){return this._schedule?this._schedule.toJSON():[]}trigger(e,t={}){var s;if(!this.adapter.getVideoTag())return;if(!this._state)return;if("ad-break-completed"===e&&this._state.hasAny(te.BREAK_ACTIVE)&&!this.adapter.isAdPod())return Re("skipping AD_BREAK_COMPLETE reason: %s pod=%s",this._state.toString(),this.adapter.isAdPod());if(null===(i=t)||"object"!=typeof i||X(i)!==J)return this.dispatch(e,t);var i;const r=Object.assign({},this.adapter.getOpts()||{},(null===(s=this._schedule)||void 0===s?void 0:s.getCurrentAd())||{},{ad_type:this.ad_type},t);return this.dispatch(e,r)}dispatch(e,t){const s=this.adapter.getVideoTag();if(s){Re(":dispatch",e,t);try{const i={event:"ads/"+e,detail:{outstream:t.outstream,ad_type:t.ad_type,ad_break_time:t.time,ad_remaining_seconds:t.remaining,ad_muted:t.muted,ad_duration_seconds:t.duration,ad_error_reason:t.reason,ad_vast_error:t.vast_error,ad_vast_error_type:t.vast_error_type,ad_request_load_type:t.request_load_time}};s.dispatchEvent(new CustomEvent("health:record",{detail:i}))}catch(e){Re(":error",e)}se(s,e,t),this.emit(e,t)}}get ad_type(){return this._schedule&&this._schedule.getCurrentType()}shouldRestartContent(){if(this.getIsContentProcessingNewSrc())return!1;if(this.adapter.isAdPod())return!0;const e=this.getLastAd();return!e||!e.outstream&&!1!==e.restart}async finished(e){if(this._schedule&&(Re("Ads.finished"),!(this.adapter.isCustomPlaybackEnabled()&&this._state.hasAny(te.PLAYING)&&this.adapter.isLinearAd()))){Re("Ads.finished: trying to play postroll");try{if(!this._schedule.getPostroll())return Re("Ads.finished: no postroll found"),await this.adapter.contentComplete();this._state.hasAny(te.AD_AVAILABLE)||await this.fetchNextAd(-1),await this.playAd(),this.adapter.contentComplete()}catch(e){Re("Ads.finished: postroll failed:",e)}finally{this.trigger("ad-postroll-finished"),this.checkIfBreakComplete(),"function"==typeof e&&e()}}}hasPreroll(){return this._schedule&&Schedule.hasPreroll(this._schedule.getAds())}shallPlayAd(e){var t;return(!this.adapter||!this.adapter.isAdPod())&&(!(!this._state||this._state.hasAny(te.FATAL_ERROR))&&!!(null===(t=this._schedule)||void 0===t?void 0:t.shallPlayAd(e)))}setLastAd(e){return this._lastAd=e,this}setIsContentProcessingNewSrc(e){this.content_processing_src=e}getLastAd(){return this._lastAd}getIsContentProcessingNewSrc(){return this.content_processing_src}mergeMacros(e={}){return this._macros=this._macros.fork(Object.assign({},e)),this}get paused(){return this.adapter&&this.adapter.isPaused()}pause(){this.adapter&&this.adapter.pause()}resume(){this.adapter&&this.adapter.resume()}resize(e){this.adapter&&this.adapter.onResize(e)}async requestAd(e,t=0,s=this.opts.timeout){if(!this._state)return;Re("Ads.requestAd(ad: %o)",{ad:e,timeout:s,idx:t});const i=await async function e(t){if("function"==typeof t)return[await Z(t)];if("string"==typeof t)return[await Z(t)];if(Array.isArray(t)){const e=t;return await Promise.all(e.map(Z))}if("object"==typeof t&&t&&t.adTag)return await e(t.adTag);throw new Error(`\n unhandled ads type ${typeof t}:\n ${JSON.stringify(t)}\n can be:\n | Array<string>\n | string\n | function\n | {adTag: Array<string>|string|function}\n `)}(e);if(void 0===i[t])return Promise.reject(new Error("Ad failed, no fallbacks left"));if(!i[t])return await this.requestAd(i,t+1,s);this.trigger("ad-requested",e);const r=this._macros.compile(i[t],K(this.opts,this.adapter.getDimensions()));try{return void await this.adapter.initAd(r,s)}catch(e){return Re(`Ads.requestAd(:fallback, idx: ${t}, length: ${i.length}, adTag: ${i[t]})\nError `,{adTag:i,err:e}),this.requestAd(i,t+1,s)}}resetSchedule(e){this._schedule&&this._schedule.reset(e)}get adPlaying(){return this._state&&this._state.hasAny(te.PLAYING)}get adBreak(){return this._state&&this._state.hasAny(te.BREAK_ACTIVE)}get adRequesting(){return this._state.hasAny(te.FETCHING_AD)}get adLinear(){return this.adBreak&&this.adapter.isLinearAd()}}var ke=new Blob([new Uint8Array([255,227,24,196,0,0,0,3,72,1,64,0,0,4,132,16,31,227,192,225,76,255,67,12,255,221,27,255,228,97,73,63,255,195,131,69,192,232,223,255,255,207,102,239,255,255,255,101,158,206,70,20,59,255,254,95,70,149,66,4,16,128,0,2,2,32,240,138,255,36,106,183,255,227,24,196,59,11,34,62,80,49,135,40,0,253,29,191,209,200,141,71,7,255,252,152,74,15,130,33,185,6,63,255,252,195,70,203,86,53,15,255,255,247,103,76,121,64,32,47,255,34,227,194,209,138,76,65,77,69,51,46,57,55,170,170,170,170,170,170,170,170,170,170,255,227,24,196,73,13,153,210,100,81,135,56,0,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170])],{type:"audio/mpeg"}),De=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});function Pe(e){return Object.assign({muted:!1,timeout:250,inline:!1},e)}function Ie(e,t){var s=e.muted,i=e.timeout,r=e.inline,a=t(),n=a.element,o=a.source,d=void 0,l=void 0,c=void 0;return n.muted=s,!0===s&&n.setAttribute("muted","muted"),!0===r&&n.setAttribute("playsinline","playsinline"),n.src=o,new Promise((function(e){d=n.play(),l=setTimeout((function(){c(!1,new Error("Timeout "+i+" ms has been reached"))}),i),c=function(t){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n.remove(),n.srcObject=null,clearTimeout(l),e({result:t,error:s})},void 0!==d?d.then((function(){return c(!0)})).catch((function(e){return c(!1,e)})):c(!0)}))}var Ne={audio:function(e){return Ie(e=Pe(e),(function(){return{element:document.createElement("audio"),source:URL.createObjectURL(ke)}}))},video:function(e){return Ie(e=Pe(e),(function(){return{element:document.createElement("video"),source:URL.createObjectURL(De)}}))}};let Ce=void 0;async function Ue(e=!0){return Ce||(Ce=await Ne.video({timeout:500,muted:e}),Ce)}const xe=new Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,167,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});var Fe=Object.freeze({__proto__:null,STICKY_CONTROLS:1,NO_FULLSCREEN:2,NO_AD_INDICATOR:4,AD_ATTRIBUTION:8,AD_CHOICES:16,REMAINING_TIME:32,VOLUME_BAR:64});const Be=["progress","duration","remaining"];class AdUI extends HTMLElement{constructor(e){super(),this.player=e,this.className="fp-ad-ui",this.append(...e.createComponents("flowplayer-ad-controls","flowplayer-ad-countdown")),e.on("ad/set-ui-flags",e=>{let{ui_flags:t}=e.detail;if(t=t||0,(8&t)>0){const e=document.createElement("div");e.classList.add("ad-attribution"),e.textContent=this.player.i18n("ads.advertisement","Advertisement"),this.append(e)}})}static get observedAttributes(){return Be}}const qe=v("fpads:native:outstream"),je={OUTSTREAM:"is-outstream",HIDDEN:"is-outstream-hidden",SHOWING:"is-outstream-visible",DONE:"is-outstream-done"};var He,ze;!function(e){e.OUTSTREAM_VISIBLE="ads-outstream-visible",e.OUTSTREAM_VIEWPORT_UPDATE="ads-outstream-viewport-update",e.OUTSTREAM_TEARDOWN="ads-outstream-teardown",e.OUTSTREAM_ENDSCREEN_READY="ads-outstream-endscreen-ready"}(He||(He={})),function(e){e[e.None=0]="None",e[e.Booting=1]="Booting",e[e.Ready=2]="Ready",e[e.Disposed=3]="Disposed"}(ze||(ze={}));class Outstream{constructor({ads:e,root:t,content:s,ima:i}){this.state=ze.None,qe("creating Outstream instance"),this.content=s,this.ads=e,this.root=t,this.ima=i,this.aspectRatio=s.videoHeight/s.videoWidth,this.dimensions=function(e){if(e.clientWidth>0||e.clientHeight)return h(e);const t={height:e.style.height};p(e,"opacity",0),p(e,"display","absolute"),p(e,"display","inline-block"),p(e,"height","auto");const s=h(e);return p(e,"height",t.height),p(e,"opacity",1),s}(this.root),this.adUi=new AdUI(s),this.initialVolumeState={},t.classList.add(je.OUTSTREAM),t.append(this.adUi),this.hide(),this.ads.on("ad-pause-content",e=>{var t;if(this.state==ze.Disposed)return;const s=!!(null===(t=e.detail)||void 0===t?void 0:t.linear);this.ads.resize(Object.assign(Object.assign({},this.dimensions),{linear:s}))}),s.on("resize",e=>{if(this.state==ze.Disposed)return;const t=e.detail;t&&(this.dimensions={width:t.contentRect.width,height:t.contentRect.height},this.ads.resize(this.dimensions))});let r=1,a=!0;s.on("intersectionchange",e=>{if(this.state==ze.Disposed)return;const t=e.detail;if(t)switch(this.state){case ze.Booting:return qe(":boot skipping intersectionchange");case ze.None:return this.state=ze.Booting,this.begin_life_cycle();case ze.Ready:if(r=t.ratio,t.ratio>=.5&&this.ads.adPlaying)return;t.ratio>=.5&&a&&this.ads.resume(),t.ratio<.5&&this.ads.pause()}}),this.content.on("ad-paused",()=>a=r<.5),this.setup(),setTimeout(()=>(this.state=ze.Booting,this.begin_life_cycle()),0)}hide(){return this}restore_aspect_ratio(){return qe(`Outstream.restore_aspect_ratio(${this.aspectRatio})`),this.content.setOpts({ratio:this.aspectRatio}),this}show(){this.root.classList.remove(Outstream.CLASS.HIDDEN),this.root.classList.add(Outstream.CLASS.SHOWING),this.content.setState("ad-linear",!0)}async begin_life_cycle(){var e;this.state=ze.Ready;const{error:t,result:s}=await Ue(!1),{result:i}=await Ue(!0);this.content.emit("ad/set-ui-flags",{ui_flags:null===(e=this.content.opts.ads)||void 0===e?void 0:e.ui}),this.attach_ad_listeners(),this.initialVolumeState={can_autoplay:!(!s&&!i),muted:!s},qe("Outstream.show() :autoplay >> sound="+s),t&&this.content&&!s&&(this.content.muted=!0,this.content.volume=0),await this.ads.setVideoTag(this.content),await L({ads:this.ads,content:this.content,adContainer:this.adUi,ima:this.ima,state:{listening:!1},config:this.content.opts}),k({content:this.content,ads:this.ads}),this.state=ze.Ready}attach_ad_listeners(){this.ads.once("ad-pause-content",()=>{this.show(),this.ads.adPlaying&&this.ads.pause()});const e=()=>{E.forEach(t=>this.ads.removeListener(t,e));const t=new CustomEvent(He.OUTSTREAM_TEARDOWN);qe("Outstream(:teardown)",t),this.content.dispatchEvent(t)};E.forEach(t=>this.ads.once(t,e)),this.content.once(He.OUTSTREAM_TEARDOWN,e=>{setTimeout(()=>{if(e.defaultPrevented)return this.handle_endscreen();this.dispose()},0)})}handle_endscreen(){this.reset_ui(),this.ads.reset(),R({config:this.content.opts,ui:this.adUi,ads:this.ads,adContainer:this.adUi,ima:this.ima,content:this.content,root:this.content.root,state:{started:!0,listening:!1},initial:{muted:!0,volume:1}})}empty_src(){this.content.setSrc({type:"video/mp4",src:URL.createObjectURL(xe)})}setup(){this.root.classList.add(Outstream.CLASS.OUTSTREAM),this.root.classList.add(Outstream.CLASS.HIDDEN),this.content.setState("ad-linear",!1),this.empty_src()}reset_ui(){const e=this.root;e.classList.remove(Outstream.CLASS.SHOWING),e.classList.remove(Outstream.CLASS.OUTSTREAM)}dispose(){if(this.state==ze.Disposed)return;const e=this.root,t=this.content;this.reset_ui(),e.classList.add(Outstream.CLASS.OUTSTREAM),e.classList.add(Outstream.CLASS.DONE);this.video=this.container=this.ads=0,this.state=ze.Disposed,t.destroy(),e.innerHTML=""}}function Ve(e){return e&&"number"==typeof e.time}function Ge(e){return e&&"number"==typeof e.percentage&&"number"!=typeof e.time}Outstream.CLASS=je;const We=v("ads/ima/sdk");var Qe,$e;async function Ke(e,t){var s;const i=null===(s=null===window||void 0===window?void 0:window.google)||void 0===s?void 0:s.ima;if(t?null==i?void 0:i.dai:i)return void We(":noop");const r=t?"https://imasdk.googleapis.com/js/sdkloader/ima3_dai.js":e._storage.getItem("ima/debug")?"https://imasdk.googleapis.com/js/sdkloader/ima3_debug.js":"https://imasdk.googleapis.com/js/sdkloader/ima3.js";try{return await async function(e){return new Promise((t,s)=>{let i=document.querySelector(`script[src='${e}']`);if(i)return Ye(i,t,s);i=document.createElement("script"),i.setAttribute("state",Qe.LOADING),Ye(i,t,s),i.src=e,document.head.appendChild(i)})}(r),void We(":loaded")}catch(e){We(":error "+e.message,e)}}function Ye(e,t,s){const i=e.getAttribute("state");if(i&&[Qe.ERROR,Qe.LOADED].includes(i))return t(void 0);e.addEventListener("load",()=>{e.setAttribute("state",Qe.LOADED),t(void 0)},{once:!0}),["error","abort"].forEach(t=>{e.addEventListener(t,()=>{e.setAttribute("state",Qe.ERROR),s("script failed to load")},{once:!0})})}!function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}(Qe||(Qe={})),function(e){e.LOADING="loading",e.LOADED="loaded",e.ERROR="error"}($e||($e={}));const Ze=v("ads/ima/sdk"),Je="https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js";async function Xe(e){var t;const s=e._storage.getItem("prebid/debug")?Je:"https://cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js";if(null===(t=null===window||void 0===window?void 0:window.pbjs)||void 0===t?void 0:t.version)Ze(":noop");else if(!document.querySelector(`script[src='${s}']`))try{return await async function(e){return new Promise((t,s)=>{let i=document.querySelector(`script[src='${e}']`);i||(i=document.createElement("script")),i.setAttribute("state",$e.LOADING);const r=i.getAttribute("state");if(r&&[$e.ERROR,$e.LOADED].includes(r))return t(void 0);i.addEventListener("load",()=>{i.setAttribute("state",$e.LOADED),t(void 0)},{once:!0}),["error","abort"].forEach(e=>{i.addEventListener(e,()=>{i.setAttribute("state",$e.ERROR),s("script failed to load")},{once:!0})}),i.src=e,document.head.appendChild(i)})}(s),void Ze(":loaded")}catch(e){console.warn(":error / failed to load prebid.js / "+e.message,e)}}const et=window.pbjs=window.pbjs||{};et.que=et.que||[];class PrebidAdController{constructor(e,t){this.player=e,this.config=t,this.player=e,this.bestOffer="",et.que.push(()=>{var s,i;const r=this.createAdUnit();et.addAdUnits(r);const a=(null===(i=null===(s=t.ads)||void 0===s?void 0:s.prebid)||void 0===i?void 0:i.pbjs)||{};et.setConfig(Object.assign({enableSendAllBids:!0},a)),e.emit("ad/pbjs",{pbjs:et}),et.requestBids({bidsBackHandler:e=>{var s,i,a,n,o;const d=null===(s=e[this.prebidCode()])||void 0===s?void 0:s.bids;if(!d)return;if(0==d.length)return;const l=d[0];if(l&&l.vastUrl)return this.bestOffer=l.vastUrl;const c=et.adServers.dfp.buildVideoUrl({adUnit:r,params:{iu:null===(a=null===(i=t.ads)||void 0===i?void 0:i.prebid)||void 0===a?void 0:a.iu,cust_params:null===(o=null===(n=t.ads)||void 0===n?void 0:n.prebid)||void 0===o?void 0:o.custom_params,output:"vast"}});this.bestOffer=c}})})}prebidCode(){var e,t;return(null===(t=null===(e=this.config.ads)||void 0===e?void 0:e.prebid)||void 0===t?void 0:t.code)||this.player.root.id}videoInfo(){var e,t;return(null===(t=null===(e=this.config.ads)||void 0===e?void 0:e.prebid)||void 0===t?void 0:t.video)||{context:"instream",playerSize:[[this.player.videoWidth||640,this.player.videoHeight||480]]}}createAdUnit(){var e,t;return{code:this.prebidCode(),mediaTypes:{video:this.videoInfo()},bids:null===(t=null===(e=this.config.ads)||void 0===e?void 0:e.prebid)||void 0===t?void 0:t.bidders}}vastGenerator(){return async()=>this.bestOffer}}function tt(e,t){var s,i;const r=null===(s=t.ads)||void 0===s?void 0:s.prebid;if(!r)return;if((null===(i=e.prebidController)||void 0===i?void 0:i.config)===t)return;e.prebidController||(e.prebidController=new PrebidAdController(e,t),Xe(e));const a=e.prebidController;if(a){const t=r.breaks.map(e=>({adTag:a.vastGenerator(),time:e}));e.setOpts({ima:{ads:t}})}}const st=v("ads/index");async function it(e,t,s){var i;let r;if(s.on("config",()=>{var t,i,a;void 0===r&&e.autoplay&&!s.currentSrc&&(a=e.autoplay,r=!0===a?f.ON:!1===a?f.OFF:a,e.autoplay=0),(null===(t=e.ads)||void 0===t?void 0:t.prebid)&&tt(s,e),Array.isArray(null===(i=null==e?void 0:e.ima)||void 0===i?void 0:i.ads)&&x(s)&&Object.assign(e,{hls:{native:!0}}),s.ads&&d()}),s.once("loadstart",()=>{setTimeout(()=>{var t;if(!Array.isArray(null===(t=null==e?void 0:e.ima)||void 0===t?void 0:t.ads)&&void 0!==r){if(e.autoplay=r,s.setState("is-autoplay",!0),!s.hasState(_))return s.once("viewenter",()=>s.togglePlay(!0));s.togglePlay(!0)}},0)}),await Ke(s),!("google"in window))return console.warn("google.ima unavailable");let a=!1;const n=s.ads=new AdsController,o=n.analytics;function d(){const i=e.ima;if(!i||!Array.isArray(i.ads))return;const d=e.duration||s.duration;if(i.ads=function(e,t){return Array.isArray(e)?e.filter(e=>Ve(e)||Ge(e)).reduce((e,s)=>{if(Ve(s))return e.push(s),e;if(s.lazy)return e.push(s),e;if(Ge(s)){const i=Object.assign({},s),r=s.percentage?s.percentage*t:0;return isNaN(r)||(i.time=r<0||r===t?-1:r),e.push(i),e}return e},[]):(console.warn("AdSchedule was not an Array"),[])}(i.ads,d),n.setSchedule(i.ads,d),e.metadata&&Analytics.mergeMetadata(o,e.metadata),e.metadata&&n.mergeMacros(e.metadata),e.metadata&&i.parameters&&(i.parameters=Object.assign(Object.assign({},i.parameters),e.metadata)),Analytics.mergeMetadata(o,{muted:e.muted||!1,autoplay:e.autoplay||!1}),!a){if(a=!0,e.lang&&!i.Locale&&(i.Locale=e.lang),Schedule.isOutstream(i.ads))return st("is outstream, returning"),new Outstream({root:t,content:s,ads:n,ima:i});S({config:Object.assign(Object.assign({},e),{autoplay:r}),root:t,content:s,ads:n,ima:i})}}n.resize(h(t)),n.on("ad-postroll-finished",()=>{n.adapter.isCustomPlaybackEnabled()&&n.once("ad-break-completed",()=>{s.src=s.original_src,s.once("canplay",()=>{s.togglePlay(!1)}),s.webkitExitFullscreen()})}),s.on("reap",(function(){n&&n.destroy()})),(null===(i=e.ads)||void 0===i?void 0:i.prebid)&&tt(s,e),d()}function rt(e){const t="number"==typeof e?e:parseInt(e,10);return(t>9?"":"0")+t}class AdControls extends HTMLElement{constructor(e){super(),this.player=e,this.classList.add("fp-ad-controls"),this.append(this.adRemainingTime(),y(this.player,"flowplayer-ad-indicator"),this.playbackButtons(),this.volumeBtn(),y(this.player,"flowplayer-volume-bar"),...this.fullscreenIcons(),this.adChoices()),e.on("ad/set-ui-flags",this.applyStyleFlags.bind(this))}fullscreenIcons(){return this.player.createComponents("flowplayer-fullscreen-enter-icon","flowplayer-fullscreen-exit-icon").map(e=>(e.onclick=()=>this.player.toggleFullScreen(),e))}volumeBtn(){const e=y(this.player,"flowplayer-volume-icon");return e.onclick=()=>this.player.emit("request/ad/muteunmute"),e}playbackButtons(){const e=document.createElement("div");e.classList.add("ad-playback-controls");const t=y(this.player,"flowplayer-small-play-icon"),s=y(this.player,"flowplayer-small-pause-icon");return t.addEventListener("click",()=>{this.player.emit("request/ad/play"),setTimeout((function(){s.focus&&s.focus()}),100)}),s.addEventListener("click",()=>{this.player.emit("request/ad/pause"),setTimeout((function(){t.focus&&t.focus()}),100)}),e.append(t,s),e}adChoices(){const e=document.createElement("div");return e.classList.add("fp-ad-choices"),e.textContent=this.player.i18n("ads.adchoices","AdChoices"),e.addEventListener("click",e=>{e.preventDefault(),this.player.togglePlay(!1),window.open("https://adssettings.google.com","_blank")}),e}adRemainingTime(){const e=document.createElement("div");return e.classList.add("fp-ad-remaining","fp-color-text"),this.prepend(e),this.player.on("ad-progress",t=>{const s=t.detail.remaining;e.textContent=function(e){if(isNaN(e)||e>=Number.MAX_SAFE_INTEGER)return"";const t=e<0?"-":"";e=Math.round(Math.abs(e));const s=Math.floor(e/3600);let i=Math.floor(e/60);return e-=60*i,s>=1?(i-=60*s,t+s+":"+rt(i)+":"+rt(e)):t+rt(i)+":"+rt(e)}(parseFloat(s+""))}),e}applyStyleFlags(e){var t;const s=null!==(t=e.detail.ui_flags)&&void 0!==t?t:0;this.classList.toggle("is-ad-controls-sticky",(1&s)>0),this.classList.toggle("no-indicator",(4&s)>0),this.classList.toggle("is-ad-choices",(16&s)>0),this.classList.toggle("no-volume-bar",0==(64&s)),this.classList.toggle("is-ad-remaining",(32&s)>0),this.classList.toggle("no-fullscreen",(2&s)>0)}}class AdCountdown extends HTMLElement{constructor(e){super(),this.player=e,this.className="fp-ad-countdown",e.on("ad-progress",e=>{const{duration:t,remaining:s}=e.detail;this.setAttribute("duration",t+""),this.setAttribute("remaining",s+"")}),e.on("ad-started",e=>{e.detail.linear&&(this.style.setProperty("--ad-percent-previous","0"),this.style.setProperty("--ad-percent-complete","0"))}),this.addEventListener("animationend",()=>{const e=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",e)})}static get observedAttributes(){return["remaining"]}attributeChangedCallback(e,t,s){switch(e){case"remaining":return this.onRemaining(s)}}onRemaining(e){const t=parseFloat(this.getAttribute("duration")||"0");e||(e=t+"");const s=parseFloat(e),i=this.style.getPropertyValue("--ad-percent-complete")||"0";this.style.setProperty("--ad-percent-previous",i),this.classList.remove("go");const r=((t-s)/t*100).toFixed(3);requestAnimationFrame(()=>{this.style.setProperty("--ad-percent-complete",r),this.classList.add("go")})}}class AdIndicator extends HTMLElement{constructor(e){super(),this.player=e,this.render(),e.on("ad-started",e=>{const{position:t,totals:s}=e.detail.ad;this.setAttribute("position",t+""),this.setAttribute("totals",s+"")})}static get observedAttributes(){return["position","totals"]}attributeChangedCallback(e,t){switch(e){case"position":case"totals":return this.updateText()}}updateText(){if(!this.element)return;const e=parseFloat(this.getAttribute("position")||"0"),t=parseFloat(this.getAttribute("totals")||"0");this.element.textContent=`${this.player.i18n("ads.indicator","ADS")} ${e} / ${t}`}render(){this.element=document.createElement("div"),this.element.classList.add("ad-indicator","fp-color-text"),this.element.textContent=this.player.i18n("ads.indicator","ADS"),this.append(this.element)}}var at,nt=Object.freeze({__proto__:null,SINGlE_INLINE_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_SKIPPABLE_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirectlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_ERROR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_REDIRECT_BROKEN:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dredirecterror&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&nofb=1&correlator=",SINGLE_VPAID_20_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinearvpaid2js&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_VPAID_20_NON_LINEAR:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dnonlinearvpaid2js&ciu_szs=728x90%2C300x250&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",SINGLE_NON_LINEAR_INLINE:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/nonlinear_ad_samples&sz=480x70&cust_params=sample_ct%3Dnonlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_SESSION_AD_RULE_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sar%3Da0f2&ciu_szs=300x250&ad_rule=1&gdfp_req=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_PREROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonly&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",VMAP_POSTROLL_BUMPER:"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonlybumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator="});const{samsung_tv:ot}=u(),dt=((at=class Ads{constructor(e){this.umd=e,A(e,b,AdUI),A(e,"flowplayer-ad-controls",AdControls),A(e,"flowplayer-ad-countdown",AdCountdown),A(e,"flowplayer-ad-indicator",AdIndicator)}init(e,t,s){if(c.from_token(e.token||"").is_granted(c.permissions.ADS)&&!ot)return it(e,t,s)}}).events=m,at.ui=Fe,at.tags=nt,at);return function(e,t){if("object"==typeof exports&&"undefined"!=typeof module)return t;if(null===document.currentScript)return t;"flowplayer"in e||(e.flowplayer={extensions:[]});const s=e.flowplayer;return"function"==typeof s?(s(t),t):(Array.isArray(s.extensions)||(s.extensions=[]),~s.extensions.indexOf(t)||s.extensions.push(t),t)}(window,dt)}));
@@ -8,29 +8,11 @@ import type { MediaKeyFunc } from 'hls.js';
8
8
  * Airplay plugin for Safari and AppleTV
9
9
  * @public
10
10
  */
11
- declare const Airplay: PluginCtor<AirplayConfig, AirplayPlayer>;
11
+ declare const Airplay: PluginCtor<Config, Player>;
12
12
  export default Airplay;
13
13
 
14
- /**
15
- * @public
16
- * This type is used to extend the Player configuration with the Airplay plugin configuration.
17
- */
18
- export declare type AirplayConfig = ConfigWith<{
19
- /**
20
- * The Airplay plugin does not have any configuration options.
21
- */
22
- airplay?: never;
23
- }>;
24
-
25
14
  /* Excluded from this release type: _AirplayConfig */
26
15
 
27
- /**
28
- * @public
29
- */
30
- export declare type AirplayPlayer = PlayerWith<{
31
- airplay?: never;
32
- }>;
33
-
34
16
  /* Excluded from this release type: AnyLoader */
35
17
 
36
18
  declare type ArrayToIntersection<T extends Array<unknown>> = T extends [
@@ -372,6 +354,7 @@ declare type ErrorEventDetail = {
372
354
  declare namespace events {
373
355
  export {
374
356
  MOUNT,
357
+ RETRY,
375
358
  ERROR,
376
359
  CONTEXT_MENU,
377
360
  CLICK,
@@ -423,7 +406,8 @@ declare namespace events {
423
406
  LANDSCAPE,
424
407
  PORTRAIT,
425
408
  DVR,
426
- LIVE_2 as LIVE
409
+ LIVE,
410
+ RECOVER
427
411
  }
428
412
  }
429
413
 
@@ -624,8 +608,6 @@ declare const /**
624
608
  */
625
609
  LANDSCAPE = "landscape";
626
610
 
627
- declare const LIVE = "is-live";
628
-
629
611
  /**
630
612
  * @public
631
613
  * when src is a livestream
@@ -637,7 +619,9 @@ declare const /**
637
619
  * @public
638
620
  * when src is a livestream
639
621
  */
640
- LIVE_2 = "live";
622
+ LIVE = "live";
623
+
624
+ declare const LIVE_2 = "is-live";
641
625
 
642
626
  declare const LIVE_SEEKED = "is-live-seeked";
643
627
 
@@ -937,33 +921,27 @@ declare type Player = HTMLVideoElement & PlayerEventOverloads & {
937
921
 
938
922
  declare type PlayerCustomEventName = keyof PlayerCustomEventsDetailMap;
939
923
 
940
- declare type PlayerCustomEventsDetailMap = {
941
- [MOUNT]: MountEventDetail;
942
- [ERROR]: ErrorEventDetail;
943
- [CONTEXT_MENU]: ContextMenuEventDetail;
944
- /* Excluded from this release type: beforeplay */
945
- /* Excluded from this release type: beforepause */
946
- /* Excluded from this release type: state */
924
+ declare type PlayerCustomEventsDetailMap = PlayerEmittableCustomEventsDetailMap & {
925
+ [REAP]: ReapEventDetail;
926
+ [SOURCE]: SourceEventDetail;
947
927
  [CUEPOINT_START]: CuePointStartEventDetail;
948
928
  [CUEPOINT_END]: CuePointEndEventDetail;
949
- [VIEW_ENTER]: ViewEnterEventDetail;
950
- [VIEW_LEAVE]: ViewLeaveEventDetail;
951
- [SOURCE]: SourceEventDetail;
952
- /* Excluded from this release type: recover */
953
- [REAP]: ReapEventDetail;
954
- /* Excluded from this release type: config */
955
- [QUALITIES]: QualitiesEventDetail;
956
- /* Excluded from this release type: "error:fatal" */
957
- [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
929
+ [MOUNT]: MountEventDetail;
930
+ [LIVE]: LiveEventDetail;
931
+ [DVR]: DvrEventDetail;
932
+ [RETRY]: RetryEventDetail;
933
+ [RECOVER]: RecoverEventDetail;
958
934
  /* Excluded from this release type: audioonlysource */
959
935
  /* Excluded from this release type: renderplugin */
960
- [DVR]: DvrEventDetail;
961
- [LIVE_2]: LiveEventDetail;
962
936
  /* Excluded from this release type: "seek:queued" */
963
937
  /* Excluded from this release type: "seek:cancel" */
964
938
  /* Excluded from this release type: "plugin:registered" */
965
939
  /* Excluded from this release type: intersectionchange */
966
- /* Excluded from this release type: retry */
940
+ /* Excluded from this release type: beforeplay */
941
+ /* Excluded from this release type: beforepause */
942
+ /* Excluded from this release type: state */
943
+ /* Excluded from this release type: config */
944
+ /* Excluded from this release type: "error:fatal" */
967
945
  };
968
946
 
969
947
  declare type PlayerCustomEventsOverloads = {
@@ -1002,11 +980,18 @@ declare type PlayerCustomEventsOverloads = {
1002
980
  * Sent right before the player src attribute is set. This allows you to change the video URL before playback.
1003
981
  */
1004
982
  on(event: typeof SOURCE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof SOURCE]>) => void): Player;
1005
- /* Excluded from this release type: on */
983
+ /**
984
+ * Emitted when an Error recovery is attempted
985
+ */
986
+ on(event: typeof RECOVER, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RECOVER]>) => void): Player;
1006
987
  /**
1007
988
  * Sent when a flowplayer instance is about to be removed from the DOM, and any unsafe references are about to be reaped, which allows Single Page Applications to perform the necessary resource cleanups. This is important when working with front-end frameworks like React. This event should never be emitted directly, only listened to.
1008
989
  */
1009
990
  on(event: typeof REAP, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof REAP]>) => void): Player;
991
+ /**
992
+ * Emitted when a player will retry to reload
993
+ */
994
+ on(event: typeof RETRY, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof RETRY]>) => void): Player;
1010
995
  /* Excluded from this release type: on */
1011
996
  /**
1012
997
  * Emitted when the set of underlying qualities has changed.
@@ -1026,8 +1011,7 @@ declare type PlayerCustomEventsOverloads = {
1026
1011
  /**
1027
1012
  * when src is a livestream
1028
1013
  */
1029
- on(event: typeof LIVE_2, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE_2]>) => void): Player;
1030
- /* Excluded from this release type: on */
1014
+ on(event: typeof LIVE, handler: (e: FPEvent<PlayerCustomEventsDetailMap[typeof LIVE]>) => void): Player;
1031
1015
  /* Excluded from this release type: on */
1032
1016
  /* Excluded from this release type: on */
1033
1017
  /* Excluded from this release type: on */
@@ -1056,11 +1040,26 @@ declare type PlayerCustomEventsOverloads = {
1056
1040
  */
1057
1041
  off<T>(event: string, handler: (e: FPEvent<T>) => void): Player;
1058
1042
  /* Excluded from this release type: poll */
1059
- emit<T extends PlayerCustomEventName>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
1060
1043
  /* Excluded from this release type: emit */
1061
- emit<T, X extends string = string>(event: X & (X extends PlayerCustomEventName ? "Incorrect event detail type" : X), data?: T): Player;
1044
+ /* Excluded from this release type: emit */
1045
+ emit<T extends PlayerEmittableEventNames>(event: T, data?: PlayerCustomEventsDetailMap[T]): Player;
1046
+ /* Excluded from this release type: emit */
1062
1047
  };
1063
1048
 
1049
+ declare type PlayerEmittableCustomEventsDetailMap = {
1050
+ [ERROR]: ErrorEventDetail;
1051
+ [CONTEXT_MENU]: ContextMenuEventDetail;
1052
+ [VIEW_ENTER]: ViewEnterEventDetail;
1053
+ [VIEW_LEAVE]: ViewLeaveEventDetail;
1054
+ [QUALITIES]: QualitiesEventDetail;
1055
+ [RECOMMENDATIONS_READY]: RecommendationsReadyEventDetail;
1056
+ };
1057
+
1058
+ declare type PlayerEmittableEventNames = keyof PlayerEmittableCustomEventsDetailMap;
1059
+
1060
+ /**
1061
+ * @public
1062
+ */
1064
1063
  declare type PlayerEventOverloads = PlayerNativeEventsOverloads & PlayerCustomEventsOverloads;
1065
1064
 
1066
1065
  declare type PlayerNativeEventName = keyof PlayerNativeEventsDetailMap;
@@ -1254,9 +1253,23 @@ declare type RecommendationsReadyEventDetail = {
1254
1253
  playlist: RecommendationItem[];
1255
1254
  };
1256
1255
 
1257
- /* Excluded from this release type: RECOVER */
1256
+ /**
1257
+ * @public
1258
+ * emitted when an Error recovery is attempted
1259
+ */
1260
+ declare const /**
1261
+ @public
1262
+ * when a new player is inserted into the HTML
1263
+ */ /**
1264
+ * @public
1265
+ * emitted when an Error recovery is attempted
1266
+ */
1267
+ RECOVER = "recover";
1258
1268
 
1259
- /* Excluded from this release type: RecoverEventDetail */
1269
+ /**
1270
+ * @public
1271
+ */
1272
+ declare type RecoverEventDetail = null;
1260
1273
 
1261
1274
  /* Excluded from this release type: REMOTE_SESSION_ENDED */
1262
1275
 
@@ -1280,9 +1293,21 @@ declare const /**
1280
1293
  */
1281
1294
  RESIZE = "resize";
1282
1295
 
1283
- /* Excluded from this release type: RETRY */
1296
+ /**
1297
+ * @public
1298
+ */
1299
+ declare const /**
1300
+ @public
1301
+ * when a new player is inserted into the HTML
1302
+ */ /**
1303
+ * @public
1304
+ */
1305
+ RETRY = "retry";
1284
1306
 
1285
- /* Excluded from this release type: RetryEventDetail */
1307
+ /**
1308
+ * @public
1309
+ */
1310
+ declare type RetryEventDetail = null;
1286
1311
 
1287
1312
  declare const RTL = "is-rtl";
1288
1313
 
@@ -1417,7 +1442,7 @@ declare namespace states {
1417
1442
  RTL,
1418
1443
  TV,
1419
1444
  ENDED,
1420
- LIVE,
1445
+ LIVE_2 as LIVE,
1421
1446
  ERRORED,
1422
1447
  WAITING,
1423
1448
  AUTOPLAY,