@internetarchive/dweb-archive-dist
Version:
Internet Archive offline UI distribution for use by dweb-mirror
95 lines (62 loc) • 276 kB
JavaScript
/*!
JW Player version 8.8.2
Copyright (c) 2019, JW Player, All Rights Reserved
https://github.com/jwplayer/jwplayer/blob/v8.8.2/README.md
This source code and its use and distribution is subject to the terms and conditions of the applicable license agreement.
https://www.jwplayer.com/tos/
This product includes portions of other software. For the full text of licenses, see below:
JW Player Third Party Software Notices and/or Additional Terms and Conditions
**************************************************************************************************
The following software is used under Apache License 2.0
**************************************************************************************************
vtt.js v0.13.0
Copyright (c) 2019 Mozilla (http://mozilla.org)
https://github.com/mozilla/vtt.js/blob/v0.13.0/LICENSE
* * *
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************************************
The following software is used under MIT license
**************************************************************************************************
Underscore.js v1.6.0
Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative
https://github.com/jashkenas/underscore/blob/1.6.0/LICENSE
Backbone backbone.events.js v1.1.2
Copyright (c) 2010-2014 Jeremy Ashkenas, DocumentCloud
https://github.com/jashkenas/backbone/blob/1.1.2/LICENSE
Promise Polyfill v7.1.1
Copyright (c) 2014 Taylor Hakes and Forbes Lindesay
https://github.com/taylorhakes/promise-polyfill/blob/v7.1.1/LICENSE
can-autoplay.js v3.0.0
Copyright (c) 2017 video-dev
https://github.com/video-dev/can-autoplay/blob/v3.0.0/LICENSE
* * *
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************************************
The following software is used under W3C license
**************************************************************************************************
Intersection Observer v0.5.0
Copyright (c) 2016 Google Inc. (http://google.com)
https://github.com/w3c/IntersectionObserver/blob/v0.5.0/LICENSE.md
* * *
W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE
Status: This license takes effect 13 May, 2015.
This work is being provided by the copyright holders under the following license.
License
By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications:
The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included.
Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)."
Disclaimers
THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT.
The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders.
*/
(window.webpackJsonpjwplayer=window.webpackJsonpjwplayer||[]).push([[4,1,2,3,9],[,,,,,,,,,,,,,,,,function(e,t,i){"use strict";i.r(t);var n,o=i(9),a=i(3),r=i(6),s=i(41),l=i(7),c=i(14),u=i(39);function d(e){return n||(n=new DOMParser),Object(l.q)(Object(l.r)(n.parseFromString(e,"image/svg+xml").documentElement))}var p=function(e,t,i,n){var o=document.createElement("div");o.className="jw-icon jw-icon-inline jw-button-color jw-reset "+e,o.setAttribute("role","button"),o.setAttribute("tabindex","0"),i&&o.setAttribute("aria-label",i),o.style.display="none";var a=new u.a(o).on("click tap enter",t||function(){});return n&&Array.prototype.forEach.call(n,function(e){"string"==typeof e?o.appendChild(d(e)):o.appendChild(e)}),{ui:a,element:function(){return o},toggle:function(e){e?this.show():this.hide()},show:function(){o.style.display=""},hide:function(){o.style.display="none"}}},f=i(0),h=i(62),w=i.n(h),g=i(63),j=i.n(g),m=i(64),b=i.n(m),v=i(65),y=i.n(v),k=i(66),x=i.n(k),O=i(67),T=i.n(O),C=i(68),_=i.n(C),S=i(69),M=i.n(S),E=i(70),z=i.n(E),A=i(71),L=i.n(A),P=i(72),I=i.n(P),B=i(73),R=i.n(B),V=i(74),H=i.n(V),N=i(75),F=i.n(N),D=i(76),q=i.n(D),U=i(77),W=i.n(U),Q=i(78),Y=i.n(Q),K=i(79),X=i.n(K),Z=i(80),J=i.n(Z),G=i(81),$=i.n(G),ee=i(82),te=i.n(ee),ie=i(83),ne=i.n(ie),oe=i(84),ae=i.n(oe),re=null;function se(e){var t=de().querySelector(ce(e));if(t)return ue(t);throw new Error("Icon not found "+e)}function le(e){var t=de().querySelectorAll(e.split(",").map(ce).join(","));if(!t.length)throw new Error("Icons not found "+e);return Array.prototype.map.call(t,function(e){return ue(e)})}function ce(e){return".jw-svg-icon-".concat(e)}function ue(e){return e.cloneNode(!0)}function de(){return re||(re=d("<xml>"+w.a+j.a+b.a+y.a+x.a+T.a+_.a+M.a+z.a+L.a+I.a+R.a+H.a+F.a+q.a+W.a+Y.a+X.a+J.a+$.a+te.a+ne.a+ae.a+"</xml>")),re}var pe=i(19);function fe(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var he={};var we=function(){function e(t,i,n,o,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r,s=document.createElement("div");s.className="jw-icon jw-icon-inline jw-button-color jw-reset ".concat(a||""),s.setAttribute("button",o),s.setAttribute("role","button"),s.setAttribute("tabindex","0"),i&&s.setAttribute("aria-label",i),t&&"<svg"===t.substring(0,4)?r=function(e){if(!he[e]){var t=Object.keys(he);t.length>10&&delete he[t[0]];var i=d(e);he[e]=i}return he[e].cloneNode(!0)}(t):((r=document.createElement("div")).className="jw-icon jw-button-image jw-button-color jw-reset",t&&Object(pe.d)(r,{backgroundImage:"url(".concat(t,")")})),s.appendChild(r),new u.a(s).on("click tap enter",n,this),s.addEventListener("mousedown",function(e){e.preventDefault()}),this.id=o,this.buttonElement=s}var t,i,n;return t=e,(i=[{key:"element",value:function(){return this.buttonElement}},{key:"toggle",value:function(e){e?this.show():this.hide()}},{key:"show",value:function(){this.buttonElement.style.display=""}},{key:"hide",value:function(){this.buttonElement.style.display="none"}}])&&fe(t.prototype,i),n&&fe(t,n),e}(),ge=i(10);function je(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var me=function(e){var t=Object(l.c)(e),i=window.pageXOffset;return i&&o.OS.android&&document.body.parentElement.getBoundingClientRect().left>=0&&(t.left-=i,t.right-=i),t},be=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object(f.h)(this,r.a),this.className=t+" jw-background-color jw-reset",this.orientation=i}var t,i,n;return t=e,(i=[{key:"setup",value:function(){this.el=Object(l.e)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return'<div class="'.concat(e," ").concat(t,' jw-reset" aria-hidden="true">')+'<div class="jw-slider-container jw-reset"><div class="jw-rail jw-reset"></div><div class="jw-buffer jw-reset"></div><div class="jw-progress jw-reset"></div><div class="jw-knob jw-reset"></div></div></div>'}(this.className,"jw-slider-"+this.orientation)),this.elementRail=this.el.getElementsByClassName("jw-slider-container")[0],this.elementBuffer=this.el.getElementsByClassName("jw-buffer")[0],this.elementProgress=this.el.getElementsByClassName("jw-progress")[0],this.elementThumb=this.el.getElementsByClassName("jw-knob")[0],this.ui=new u.a(this.element(),{preventScrolling:!0}).on("dragStart",this.dragStart,this).on("drag",this.dragMove,this).on("dragEnd",this.dragEnd,this).on("click tap",this.tap,this)}},{key:"dragStart",value:function(){this.trigger("dragStart"),this.railBounds=me(this.elementRail)}},{key:"dragEnd",value:function(e){this.dragMove(e),this.trigger("dragEnd")}},{key:"dragMove",value:function(e){var t,i,n=this.railBounds=this.railBounds?this.railBounds:me(this.elementRail);return i="horizontal"===this.orientation?(t=e.pageX)<n.left?0:t>n.right?100:100*Object(s.a)((t-n.left)/n.width,0,1):(t=e.pageY)>=n.bottom?0:t<=n.top?100:100*Object(s.a)((n.height-(t-n.top))/n.height,0,1),this.render(i),this.update(i),!1}},{key:"tap",value:function(e){this.railBounds=me(this.elementRail),this.dragMove(e)}},{key:"limit",value:function(e){return e}},{key:"update",value:function(e){this.trigger("update",{percentage:e})}},{key:"render",value:function(e){e=Math.max(0,Math.min(e,100)),"horizontal"===this.orientation?(this.elementThumb.style.left=e+"%",this.elementProgress.style.width=e+"%"):(this.elementThumb.style.bottom=e+"%",this.elementProgress.style.height=e+"%")}},{key:"updateBuffer",value:function(e){this.elementBuffer.style.width=e+"%"}},{key:"element",value:function(){return this.el}}])&&je(t.prototype,i),n&&je(t,n),e}(),ve=function(e,t){e&&t&&(e.setAttribute("aria-label",t),e.setAttribute("role","button"),e.setAttribute("tabindex","0"))};function ye(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ke=function(){function e(t,i,n,o){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object(f.h)(this,r.a),this.el=document.createElement("div");var s="jw-icon jw-icon-tooltip "+t+" jw-button-color jw-reset";n||(s+=" jw-hidden"),ve(this.el,i),this.el.className=s,this.tooltip=document.createElement("div"),this.tooltip.className="jw-overlay jw-reset",this.openClass="jw-open",this.componentType="tooltip",this.el.appendChild(this.tooltip),o&&o.length>0&&Array.prototype.forEach.call(o,function(e){"string"==typeof e?a.el.appendChild(d(e)):a.el.appendChild(e)})}var t,i,n;return t=e,(i=[{key:"addContent",value:function(e){this.content&&this.removeContent(),this.content=e,this.tooltip.appendChild(e)}},{key:"removeContent",value:function(){this.content&&(this.tooltip.removeChild(this.content),this.content=null)}},{key:"hasContent",value:function(){return!!this.content}},{key:"element",value:function(){return this.el}},{key:"openTooltip",value:function(e){this.isOpen||(this.trigger("open-"+this.componentType,e,{isOpen:!0}),this.isOpen=!0,Object(l.u)(this.el,this.openClass,this.isOpen))}},{key:"closeTooltip",value:function(e){this.isOpen&&(this.trigger("close-"+this.componentType,e,{isOpen:!1}),this.isOpen=!1,Object(l.u)(this.el,this.openClass,this.isOpen))}},{key:"toggleOpenState",value:function(e){this.isOpen?this.closeTooltip(e):this.openTooltip(e)}}])&&ye(t.prototype,i),n&&ye(t,n),e}(),xe=i(22),Oe=i(51);function Te(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ce=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=t,this.text=i,this.el=document.createElement("div"),this.el.className="jw-cue jw-reset"}var t,i,n;return t=e,(i=[{key:"align",value:function(e){if("%"===this.time.toString().slice(-1))this.pct=this.time;else{var t=this.time/e*100;this.pct=t+"%"}this.el.style.left=this.pct}}])&&Te(t.prototype,i),n&&Te(t,n),e}(),_e={loadChapters:function(e){Object(xe.a)(e,this.chaptersLoaded.bind(this),this.chaptersFailed,{plainText:!0})},chaptersLoaded:function(e){var t=Object(Oe.a)(e.responseText);if(Array.isArray(t)){var i=this._model.get("cues").concat(t);this._model.set("cues",i)}},chaptersFailed:function(){},addCue:function(e){this.cues.push(new Ce(e.begin,e.text))},drawCues:function(){var e=this,t=this._model.get("duration");!t||t<=0||this.cues.forEach(function(i){i.align(t),i.el.addEventListener("mouseover",function(){e.activeCue=i}),i.el.addEventListener("mouseout",function(){e.activeCue=null}),e.elementRail.appendChild(i.el)})},resetCues:function(){this.cues.forEach(function(e){e.el.parentNode&&e.el.parentNode.removeChild(e.el)}),this.cues=[]}};function Se(e){this.begin=e.begin,this.end=e.end,this.img=e.text}var Me={loadThumbnails:function(e){e&&(this.vttPath=e.split("?")[0].split("/").slice(0,-1).join("/"),this.individualImage=null,Object(xe.a)(e,this.thumbnailsLoaded.bind(this),this.thumbnailsFailed.bind(this),{plainText:!0}))},thumbnailsLoaded:function(e){var t=Object(Oe.a)(e.responseText);Array.isArray(t)&&(t.forEach(function(e){this.thumbnails.push(new Se(e))},this),this.drawCues())},thumbnailsFailed:function(){},chooseThumbnail:function(e){var t=Object(f.C)(this.thumbnails,{end:e},Object(f.A)("end"));t>=this.thumbnails.length&&(t=this.thumbnails.length-1);var i=this.thumbnails[t].img;return i.indexOf("://")<0&&(i=this.vttPath?this.vttPath+"/"+i:i),i},loadThumbnail:function(e){var t=this.chooseThumbnail(e),i={margin:"0 auto",backgroundPosition:"0 0"};if(t.indexOf("#xywh")>0)try{var n=/(.+)#xywh=(\d+),(\d+),(\d+),(\d+)/.exec(t);t=n[1],i.backgroundPosition=-1*n[2]+"px "+-1*n[3]+"px",i.width=n[4],this.timeTip.setWidth(+i.width),i.height=n[5]}catch(e){return}else this.individualImage||(this.individualImage=new Image,this.individualImage.onload=Object(f.b)(function(){this.individualImage.onload=null,this.timeTip.image({width:this.individualImage.width,height:this.individualImage.height}),this.timeTip.setWidth(this.individualImage.width)},this),this.individualImage.src=t);return i.backgroundImage='url("'+t+'")',i},showThumbnail:function(e){this._model.get("containerWidth")<=420||this.thumbnails.length<1||this.timeTip.image(this.loadThumbnail(e))},resetThumbnails:function(){this.timeTip.image({backgroundImage:"",width:0,height:0}),this.thumbnails=[]}};function Ee(e,t,i){return(Ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Be(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i):o.value}})(e,t,i||e)}function ze(e){return(ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Le(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pe(e,t,i){return t&&Le(e.prototype,t),i&&Le(e,i),e}function Ie(e,t){return!t||"object"!==ze(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Be(e){return(Be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ve(e,t)}function Ve(e,t){return(Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var He=function(e){function t(){return Ae(this,t),Ie(this,Be(t).apply(this,arguments))}return Re(t,ke),Pe(t,[{key:"setup",value:function(){this.text=document.createElement("span"),this.text.className="jw-text jw-reset",this.img=document.createElement("div"),this.img.className="jw-time-thumb jw-reset",this.containerWidth=0,this.textLength=0,this.dragJustReleased=!1;var e=document.createElement("div");e.className="jw-time-tip jw-reset",e.appendChild(this.img),e.appendChild(this.text),this.addContent(e)}},{key:"image",value:function(e){Object(pe.d)(this.img,e)}},{key:"update",value:function(e){this.text.textContent=e}},{key:"getWidth",value:function(){return this.containerWidth||this.setWidth(),this.containerWidth}},{key:"setWidth",value:function(e){e?this.containerWidth=e+16:this.tooltip&&(this.containerWidth=Object(l.c)(this.container).width+16)}},{key:"resetWidth",value:function(){this.containerWidth=0}}]),t}();var Ne=function(e){function t(e,i,n){var o;return Ae(this,t),(o=Ie(this,Be(t).call(this,"jw-slider-time","horizontal")))._model=e,o._api=i,o.timeUpdateKeeper=n,o.timeTip=new He("jw-tooltip-time",null,!0),o.timeTip.setup(),o.cues=[],o.seekThrottled=Object(f.D)(o.performSeek,400),o.mobileHoverDistance=5,o.setup(),o}return Re(t,be),Pe(t,[{key:"setup",value:function(){var e=this;Ee(Be(t.prototype),"setup",this).apply(this,arguments),this._model.on("change:duration",this.onDuration,this).on("change:cues",this.updateCues,this).on("seeked",function(){e._model.get("scrubbing")||e.updateAriaText()}).change("position",this.onPosition,this).change("buffer",this.onBuffer,this).change("streamType",this.onStreamType,this),this._model.player.change("playlistItem",this.onPlaylistItem,this);var i=this.el;Object(l.s)(i,"tabindex","0"),Object(l.s)(i,"role","slider"),Object(l.s)(i,"aria-label",this._model.get("localization").slider),i.removeAttribute("aria-hidden"),this.elementRail.appendChild(this.timeTip.element()),this.ui=(this.ui||new u.a(i)).on("move drag",this.showTimeTooltip,this).on("dragEnd out",this.hideTimeTooltip,this).on("click",function(){return i.focus()}).on("focus",this.updateAriaText,this)}},{key:"update",value:function(e){this.seekTo=e,this.seekThrottled(),Ee(Be(t.prototype),"update",this).apply(this,arguments)}},{key:"dragStart",value:function(){this._model.set("scrubbing",!0),Ee(Be(t.prototype),"dragStart",this).apply(this,arguments)}},{key:"dragEnd",value:function(){Ee(Be(t.prototype),"dragEnd",this).apply(this,arguments),this._model.set("scrubbing",!1)}},{key:"onBuffer",value:function(e,t){this.updateBuffer(t)}},{key:"onPosition",value:function(e,t){this.updateTime(t,e.get("duration"))}},{key:"onDuration",value:function(e,t){this.updateTime(e.get("position"),t),Object(l.s)(this.el,"aria-valuemin",0),Object(l.s)(this.el,"aria-valuemax",t),this.drawCues()}},{key:"onStreamType",value:function(e,t){this.streamType=t}},{key:"updateTime",value:function(e,t){var i=0;if(t)if("DVR"===this.streamType){var n=this._model.get("dvrSeekLimit"),o=t+n;i=(o-(e+n))/o*100}else"VOD"!==this.streamType&&this.streamType||(i=e/t*100);this.render(i)}},{key:"onPlaylistItem",value:function(e,t){this.reset();var i=t.tracks;Object(f.g)(i,function(e){e&&e.kind&&"thumbnails"===e.kind.toLowerCase()?this.loadThumbnails(e.file):e&&e.kind&&"chapters"===e.kind.toLowerCase()&&this.loadChapters(e.file)},this)}},{key:"performSeek",value:function(){var e,t=this.seekTo,i=this._model.get("duration");if(0===i)this._api.play({reason:"interaction"});else if("DVR"===this.streamType){var n=this._model.get("seekRange")||{start:0},o=this._model.get("dvrSeekLimit");e=n.start+(-i-o)*t/100,this._api.seek(e,{reason:"interaction"})}else e=t/100*i,this._api.seek(Math.min(e,i-.25),{reason:"interaction"})}},{key:"showTimeTooltip",value:function(e){var t=this,i=this._model.get("duration");if(0!==i){var n,o=this._model.get("containerWidth"),a=Object(l.c)(this.elementRail),r=e.pageX?e.pageX-a.left:e.x,c=(r=Object(s.a)(r,0,a.width))/a.width,u=i*c;if(i<0)u=(i+=this._model.get("dvrSeekLimit"))-(u=i*c);if("touch"===e.pointerType&&(this.activeCue=this.cues.reduce(function(e,i){return Math.abs(r-parseInt(i.pct)/100*a.width)<t.mobileHoverDistance?i:e},void 0)),this.activeCue)n=this.activeCue.text;else{n=Object(ge.timeFormat)(u,!0),i<0&&u>-1&&(n="Live")}var d=this.timeTip;d.update(n),this.textLength!==n.length&&(this.textLength=n.length,d.resetWidth()),this.showThumbnail(u),Object(l.a)(d.el,"jw-open");var p=d.getWidth(),f=a.width/100,h=o-a.width,w=0;p>h&&(w=(p-h)/(200*f));var g=100*Math.min(1-w,Math.max(w,c)).toFixed(3);Object(pe.d)(d.el,{left:g+"%"})}}},{key:"hideTimeTooltip",value:function(){Object(l.n)(this.timeTip.el,"jw-open")}},{key:"updateCues",value:function(e,t){var i=this;this.resetCues(),t&&t.length&&(t.forEach(function(e){i.addCue(e)}),this.drawCues())}},{key:"updateAriaText",value:function(){var e=this._model;if(!e.get("seeking")){var t=e.get("position"),i=e.get("duration"),n=Object(ge.timeFormat)(t);"DVR"!==this.streamType&&(n+=" of ".concat(Object(ge.timeFormat)(i)));var o=this.el;document.activeElement!==o&&(this.timeUpdateKeeper.textContent=n),Object(l.s)(o,"aria-valuenow",t),Object(l.s)(o,"aria-valuetext",n)}}},{key:"reset",value:function(){this.resetThumbnails(),this.timeTip.resetWidth(),this.textLength=0}}]),t}();Object(f.h)(Ne.prototype,_e,Me);var Fe=Ne;function De(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qe(e,t,i){return(qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ke(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i):o.value}})(e,t,i||e)}function Ue(e){return(Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function We(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qe(e,t){return!t||"object"!==Ue(t)&&"function"!=typeof t?Ye(e):t}function Ye(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ke(e){return(Ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ze(e,t)}function Ze(e,t){return(Ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Je=function(e){function t(e,i,n){var o;We(this,t);var a="jw-slider-volume";return"vertical"===e&&(a+=" jw-volume-tip"),(o=Qe(this,Ke(t).call(this,a,e))).setup(),o.element().classList.remove("jw-background-color"),Object(l.s)(n,"tabindex","0"),Object(l.s)(n,"aria-label",i),Object(l.s)(n,"aria-orientation",e),Object(l.s)(n,"aria-valuemin",0),Object(l.s)(n,"aria-valuemax",100),Object(l.s)(n,"role","slider"),o.uiOver=new u.a(n).on("click",function(){}),o}return Xe(t,be),t}(),Ge=function(e){function t(e,i,n,o,a){var r;We(this,t),(r=Qe(this,Ke(t).call(this,i,n,!0,o)))._model=e,r.horizontalContainer=a;var s=e.get("localization").volumeSlider;return r.horizontalSlider=new Je("horizontal",s,a,Ye(Ye(r))),r.verticalSlider=new Je("vertical",s,r.tooltip,Ye(Ye(r))),a.appendChild(r.horizontalSlider.element()),r.addContent(r.verticalSlider.element()),r.verticalSlider.on("update",function(e){this.trigger("update",e)},Ye(Ye(r))),r.horizontalSlider.on("update",function(e){this.trigger("update",e)},Ye(Ye(r))),r.horizontalSlider.uiOver.on("keydown",function(e){var t=e.sourceEvent;switch(t.keyCode){case 37:t.stopPropagation(),r.trigger("adjustVolume",-10);break;case 39:t.stopPropagation(),r.trigger("adjustVolume",10)}}),r.ui=new u.a(r.el,{directSelect:!0}).on("click enter",r.toggleValue,Ye(Ye(r))).on("tap",r.toggleOpenState,Ye(Ye(r))),r.addSliderHandlers(r.ui),r.addSliderHandlers(r.horizontalSlider.uiOver),r.addSliderHandlers(r.verticalSlider.uiOver),r.onAudioMode(null,e.get("audioMode")),r._model.on("change:audioMode",r.onAudioMode,Ye(Ye(r))),r._model.on("change:volume",r.onVolume,Ye(Ye(r))),r}var i,n,o;return Xe(t,ke),i=t,(n=[{key:"onAudioMode",value:function(e,t){var i=t?0:-1;Object(l.s)(this.horizontalContainer,"tabindex",i)}},{key:"addSliderHandlers",value:function(e){var t=this.openSlider,i=this.closeSlider;e.on("over",t,this).on("out",i,this).on("focus",t,this).on("blur",i,this)}},{key:"openSlider",value:function(e){qe(Ke(t.prototype),"openTooltip",this).call(this,e),Object(l.u)(this.horizontalContainer,this.openClass,!0)}},{key:"closeSlider",value:function(e){qe(Ke(t.prototype),"closeTooltip",this).call(this,e),Object(l.u)(this.horizontalContainer,this.openClass,!1),this.horizontalContainer.blur()}},{key:"toggleValue",value:function(){this.trigger("toggleValue")}},{key:"destroy",value:function(){this.horizontalSlider.uiOver.destroy(),this.verticalSlider.uiOver.destroy(),this.ui.destroy()}}])&&De(i.prototype,n),o&&De(i,o),t}();function $e(e,t,i,n,o){var a=document.createElement("div");a.className="jw-reset-text jw-tooltip jw-tooltip-".concat(t),a.setAttribute("dir","auto");var r=document.createElement("div");r.className="jw-text",a.appendChild(r),e.appendChild(a);var s={dirty:!!i,opened:!1,text:i,open:function(){s.touchEvent||(c(!0),n&&n())},close:function(){s.touchEvent||(c(!1),o&&o())},setText:function(e){e!==s.text&&(s.text=e,s.dirty=!0),s.opened&&c(!0)}},c=function(e){e&&s.dirty&&(Object(l.p)(r,s.text),s.dirty=!1),s.opened=e,Object(l.u)(a,"jw-open",e)};return e.addEventListener("mouseover",s.open),e.addEventListener("focus",s.open),e.addEventListener("blur",s.close),e.addEventListener("mouseout",s.close),e.addEventListener("touchstart",function(){s.touchEvent=!0},{passive:!0}),s}var et=12;function tt(){try{var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return e.getRandomValues(new Uint32Array(1))[0].toString(36)}catch(e){}return Math.random().toString(36).slice(2,9)}function it(e){for(var t="";t.length<e;)t+=tt();return t.slice(0,e)}function nt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ot(e,t){var i=document.createElement("div");return i.className="jw-icon jw-icon-inline jw-text jw-reset "+e,t&&Object(l.s)(i,"role",t),i}function at(e){var t=document.createElement("div");return t.className="jw-reset ".concat(e),t}function rt(e,t){if(o.Browser.safari){var i=p("jw-icon-airplay jw-off",e,t.airplay,le("airplay-off,airplay-on"));return $e(i.element(),"airplay",t.airplay),i}if(o.Browser.chrome&&!o.OS.iOS){var n=document.createElement("google-cast-launcher");Object(l.s)(n,"tabindex","-1"),n.className+=" jw-reset";var a=document.createElement("div");return a.className="jw-reset jw-icon jw-icon-inline jw-icon-cast jw-button-color",a.style.display="none",a.style.cursor="pointer",a.appendChild(n),ve(a,t.cast),$e(a,"chromecast",t.cast),{element:function(){return a},toggle:function(e){e?this.show():this.hide()},show:function(){a.style.display=""},hide:function(){a.style.display="none"},button:n}}}function st(e,t){return e.filter(function(e){return!t.some(function(t){return t.id+t.btnClass===e.id+e.btnClass&&e.callback===t.callback})})}var lt=function(e,t){t.forEach(function(t){t.element&&(t=t.element()),e.appendChild(t)})},ct=function(){function e(t,i,n){var s=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object(f.h)(this,r.a),this._api=t,this._model=i,this._isMobile=o.OS.mobile,this._volumeAnnouncer=n.querySelector(".jw-volume-update");var c,d,h,w=i.get("localization"),g=new Fe(i,t,n.querySelector(".jw-time-update")),j=this.menus=[];this.ui=[];var m="",b=w.volume;if(this._isMobile){if(!(i.get("sdkplatform")||o.OS.iOS&&o.OS.version.major<10)){var v=le("volume-0,volume-100");h=p("jw-icon-volume",function(){t.setMute()},b,v)}}else{(d=document.createElement("div")).className="jw-horizontal-volume-container";var y=(c=new Ge(i,"jw-icon-volume",b,le("volume-0,volume-50,volume-100"),d)).element();j.push(c),Object(l.s)(y,"role","button"),i.change("mute",function(e,t){var i=t?w.unmute:w.mute;Object(l.s)(y,"aria-label",i)},this)}var k=p("jw-icon-next",function(){t.next({feedShownId:m,reason:"interaction"})},w.next,le("next")),x=p("jw-icon-settings jw-settings-submenu-button",function(e){s.trigger("settingsInteraction","quality",!0,e)},w.settings,le("settings"));Object(l.s)(x.element(),"aria-haspopup","true");var O=p("jw-icon-cc jw-settings-submenu-button",function(e){s.trigger("settingsInteraction","captions",!1,e)},w.cc,le("cc-off,cc-on"));Object(l.s)(O.element(),"aria-haspopup","true");var T=p("jw-text-live",function(){s.goToLiveEdge()},w.liveBroadcast);T.element().textContent=w.liveBroadcast;var C,_,S,M=this.elements={alt:(C="jw-text-alt",_="status",S=document.createElement("span"),S.className="jw-text jw-reset "+C,_&&Object(l.s)(S,"role",_),S),play:p("jw-icon-playback",function(){t.playToggle({reason:"interaction"})},w.play,le("play,pause,stop")),rewind:p("jw-icon-rewind",function(){s.rewind()},w.rewind,le("rewind")),live:T,next:k,elapsed:ot("jw-text-elapsed","timer"),countdown:ot("jw-text-countdown","timer"),time:g,duration:ot("jw-text-duration","timer"),mute:h,volumetooltip:c,horizontalVolumeContainer:d,cast:rt(function(){t.castToggle()},w),fullscreen:p("jw-icon-fullscreen",function(){t.setFullscreen()},w.fullscreen,le("fullscreen-off,fullscreen-on")),spacer:at("jw-spacer"),buttonContainer:at("jw-button-container"),settingsButton:x,captionsButton:O},E=$e(O.element(),"captions",w.cc),z=function(e){var t=e.get("captionsList")[e.get("captionsIndex")],i=w.cc;t&&"Off"!==t.label&&(i=t.label),E.setText(i)},A=$e(M.play.element(),"play",w.play);this.setPlayText=function(e){A.setText(e)};var L=M.next.element(),P=$e(L,"next",w.nextUp,function(){var e=i.get("nextUp");m=it(et),s.trigger("nextShown",{mode:e.mode,ui:"nextup",itemsShown:[e],feedData:e.feedData,reason:"hover",feedShownId:m})},function(){m=""});Object(l.s)(L,"dir","auto"),$e(M.rewind.element(),"rewind",w.rewind),$e(M.settingsButton.element(),"settings",w.settings);var I=$e(M.fullscreen.element(),"fullscreen",w.fullscreen),B=[M.play,M.rewind,M.next,M.volumetooltip,M.mute,M.horizontalVolumeContainer,M.alt,M.live,M.elapsed,M.countdown,M.duration,M.spacer,M.cast,M.captionsButton,M.settingsButton,M.fullscreen].filter(function(e){return e}),R=[M.time,M.buttonContainer].filter(function(e){return e});this.el=document.createElement("div"),this.el.className="jw-controlbar jw-reset",lt(M.buttonContainer,B),lt(this.el,R);var V=i.get("logo");if(V&&"control-bar"===V.position&&this.addLogo(V),M.play.show(),M.fullscreen.show(),M.mute&&M.mute.show(),i.change("volume",this.onVolume,this),i.change("mute",function(e,t){s.renderVolume(t,e.get("volume"))},this),i.change("state",this.onState,this),i.change("duration",this.onDuration,this),i.change("position",this.onElapsed,this),i.change("fullscreen",function(e,t){var i=s.elements.fullscreen.element();Object(l.u)(i,"jw-off",t);var n=e.get("fullscreen")?w.exitFullscreen:w.fullscreen;I.setText(n),Object(l.s)(i,"aria-label",n)},this),i.change("streamType",this.onStreamTypeChange,this),i.change("dvrLive",function(e,t){var i=w.liveBroadcast,n=w.notLive,o=s.elements.live.element(),a=!1===t;Object(l.u)(o,"jw-dvr-live",a),Object(l.s)(o,"aria-label",a?n:i),o.textContent=i},this),i.change("altText",this.setAltText,this),i.change("customButtons",this.updateButtons,this),i.on("change:captionsIndex",z,this),i.on("change:captionsList",z,this),i.change("nextUp",function(e,t){m=it(et);var i=w.nextUp;t&&t.title&&(i+=": ".concat(t.title)),P.setText(i),M.next.toggle(!!t)},this),i.change("audioMode",this.onAudioMode,this),M.cast&&(i.change("castAvailable",this.onCastAvailable,this),i.change("castActive",this.onCastActive,this)),M.volumetooltip&&(M.volumetooltip.on("update",function(e){var t=e.percentage;this._api.setVolume(t)},this),M.volumetooltip.on("toggleValue",function(){this._api.setMute()},this),M.volumetooltip.on("adjustVolume",function(e){this.trigger("adjustVolume",e)},this)),M.cast&&M.cast.button){var H=new u.a(M.cast.element()).on("click tap enter",function(e){"click"!==e.type&&M.cast.button.click(),this._model.set("castClicked",!0)},this);this.ui.push(H)}var N=new u.a(M.duration).on("click tap enter",function(){if("DVR"===this._model.get("streamType")){var e=this._model.get("position"),t=this._model.get("dvrSeekLimit");this._api.seek(Math.max(-t,e),{reason:"interaction"})}},this);this.ui.push(N);var F=new u.a(this.el).on("click tap drag",function(){this.trigger(a.rb)},this);this.ui.push(F),j.forEach(function(e){e.on("open-tooltip",s.closeMenus,s)})}var t,i,n;return t=e,(i=[{key:"onVolume",value:function(e,t){this.renderVolume(e.get("mute"),t)}},{key:"renderVolume",value:function(e,t){var i=this.elements.mute,n=this.elements.volumetooltip;if(i&&(Object(l.u)(i.element(),"jw-off",e),Object(l.u)(i.element(),"jw-full",!e)),n){var o=e?0:t,a=n.element();n.verticalSlider.render(o),n.horizontalSlider.render(o);var r=n.tooltip,s=n.horizontalContainer;Object(l.u)(a,"jw-off",e),Object(l.u)(a,"jw-full",t>=75&&!e),Object(l.s)(r,"aria-valuenow",o),Object(l.s)(s,"aria-valuenow",o);var c="Volume ".concat(o,"%");Object(l.s)(r,"aria-valuetext",c),Object(l.s)(s,"aria-valuetext",c),document.activeElement!==r&&document.activeElement!==s&&(this._volumeAnnouncer.textContent=c)}}},{key:"onCastAvailable",value:function(e,t){this.elements.cast.toggle(t)}},{key:"onCastActive",value:function(e,t){this.elements.fullscreen.toggle(!t),this.elements.cast.button&&Object(l.u)(this.elements.cast.button,"jw-off",!t)}},{key:"onElapsed",value:function(e,t){var i,n,o=e.get("duration");if("DVR"===e.get("streamType")){var a=Math.ceil(t),r=this._model.get("dvrSeekLimit");i=n=a>=-r?"":"-"+Object(ge.timeFormat)(-(t+r)),e.set("dvrLive",a>=-r)}else i=Object(ge.timeFormat)(t),n=Object(ge.timeFormat)(o-t);this.elements.elapsed.textContent=i,this.elements.countdown.textContent=n}},{key:"onDuration",value:function(e,t){this.elements.duration.textContent=Object(ge.timeFormat)(Math.abs(t))}},{key:"onAudioMode",value:function(e,t){var i=this.elements.time.element();t?this.elements.buttonContainer.insertBefore(i,this.elements.elapsed):Object(l.l)(this.el,i)}},{key:"element",value:function(){return this.el}},{key:"setAltText",value:function(e,t){this.elements.alt.textContent=t}},{key:"closeMenus",value:function(e){this.menus.forEach(function(t){e&&e.target===t.el||t.closeTooltip(e)})}},{key:"rewind",value:function(){var e,t=0,i=this._model.get("currentTime");i?e=i-10:(e=this._model.get("position")-10,"DVR"===this._model.get("streamType")&&(t=this._model.get("duration"))),this._api.seek(Math.max(e,t),{reason:"interaction"})}},{key:"onState",value:function(e,t){var i=e.get("localization"),n=i.play;this.setPlayText(n),t===a.ob&&("LIVE"!==e.get("streamType")?(n=i.pause,this.setPlayText(n)):(n=i.stop,this.setPlayText(n))),Object(l.s)(this.elements.play.element(),"aria-label",n)}},{key:"onStreamTypeChange",value:function(e,t){var i="LIVE"===t,n="DVR"===t;this.elements.rewind.toggle(!i),this.elements.live.toggle(i||n),Object(l.s)(this.elements.live.element(),"tabindex",i?"-1":"0"),this.elements.duration.style.display=n?"none":"",this.onDuration(e,e.get("duration")),this.onState(e,e.get("state"))}},{key:"addLogo",value:function(e){var t=this.elements.buttonContainer,i=new we(e.file,this._model.get("localization").logo,function(){e.link&&Object(l.k)(e.link,"_blank",{rel:"noreferrer"})},"logo","jw-logo-button");e.link||Object(l.s)(i.element(),"tabindex","-1"),t.insertBefore(i.element(),t.querySelector(".jw-spacer").nextSibling)}},{key:"goToLiveEdge",value:function(){if("DVR"===this._model.get("streamType")){var e=Math.min(this._model.get("position"),-1),t=this._model.get("dvrSeekLimit");this._api.seek(Math.max(-t,e),{reason:"interaction"}),this._api.play({reason:"interaction"})}}},{key:"updateButtons",value:function(e,t,i){if(t){var n,o,a=this.elements.buttonContainer;t!==i&&i?(n=st(t,i),o=st(i,t),this.removeButtons(a,o)):n=t;for(var r=n.length-1;r>=0;r--){var s=n[r],l=new we(s.img,s.tooltip,s.callback,s.id,s.btnClass);s.tooltip&&$e(l.element(),s.id,s.tooltip);var c=void 0;"related"===l.id?c=this.elements.settingsButton.element():"share"===l.id?c=a.querySelector('[button="related"]')||this.elements.settingsButton.element():(c=this.elements.spacer.nextSibling)&&"logo"===c.getAttribute("button")&&(c=c.nextSibling),a.insertBefore(l.element(),c)}}}},{key:"removeButtons",value:function(e,t){for(var i=t.length;i--;){var n=e.querySelector('[button="'.concat(t[i].id,'"]'));n&&e.removeChild(n)}}},{key:"toggleCaptionsButtonState",value:function(e){var t=this.elements.captionsButton;t&&Object(l.u)(t.element(),"jw-off",!e)}},{key:"destroy",value:function(){var e=this;this._model.off(null,null,this),Object.keys(this.elements).forEach(function(t){var i=e.elements[t];i&&"function"==typeof i.destroy&&e.elements[t].destroy()}),this.ui.forEach(function(e){e.destroy()}),this.ui=[]}}])&&nt(t.prototype,i),n&&nt(t,n),e}(),ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return'<div class="jw-display-icon-container jw-display-icon-'.concat(e,' jw-reset">')+'<div class="jw-icon jw-icon-'.concat(e,' jw-button-color jw-reset" role="button" tabindex="0" aria-label="').concat(t,'"></div>')+"</div>"},dt=function(e){return'<div class="jw-display jw-reset"><div class="jw-display-container jw-reset"><div class="jw-display-controls jw-reset">'+ut("rewind",e.rewind)+ut("display",e.playback)+ut("next",e.next)+"</div></div></div>"};function pt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ft=function(){function e(t,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var o=n.querySelector(".jw-icon");this.el=n,this.ui=new u.a(o).on("click tap enter",function(){var e=t.get("position"),n=t.get("duration"),o=e-10,a=0;"DVR"===t.get("streamType")&&(a=n),i.seek(Math.max(o,a))})}var t,i,n;return t=e,(i=[{key:"element",value:function(){return this.el}}])&&pt(t.prototype,i),n&&pt(t,n),e}();function ht(e){return(ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function gt(e,t){return!t||"object"!==ht(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jt(e){return(jt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mt(e,t){return(mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bt=function(e){function t(e,i,n){var o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o=gt(this,jt(t).call(this));var a=e.get("localization"),r=n.querySelector(".jw-icon");if(o.icon=r,o.el=n,o.ui=new u.a(r).on("click tap enter",function(e){o.trigger(e.type)}),e.on("change:state",function(e,t){var i;switch(t){case"buffering":i=a.buffer;break;case"playing":i=a.pause;break;case"idle":case"paused":i=a.playback;break;case"complete":i=a.replay;break;default:i=""}""!==i?r.setAttribute("aria-label",i):r.removeAttribute("aria-label")}),e.get("displayPlaybackLabel")){var s=o.icon.getElementsByClassName("jw-idle-icon-text")[0];s||(s=Object(l.e)('<div class="jw-idle-icon-text">'.concat(a.playback,"</div>")),Object(l.a)(o.icon,"jw-idle-label"),o.icon.appendChild(s))}return o}var i,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mt(e,t)}(t,r["a"]),i=t,(n=[{key:"element",value:function(){return this.el}}])&&wt(i.prototype,n),o&&wt(i,o),t}();function vt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var yt=function(){function e(t,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var o=n.querySelector(".jw-icon");this.ui=new u.a(o).on("click tap enter",function(){i.next({reason:"interaction"})}),t.change("nextUp",function(e,t){n.style.visibility=t?"":"hidden"}),this.el=n}var t,i,n;return t=e,(i=[{key:"element",value:function(){return this.el}}])&&vt(t.prototype,i),n&&vt(t,n),e}();function kt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xt=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.el=Object(l.e)(dt(t.get("localization")));var n=this.el.querySelector(".jw-display-controls"),o={};Ot("rewind",le("rewind"),ft,n,o,t,i),Ot("display",le("play,pause,buffer,replay"),bt,n,o,t,i),Ot("next",le("next"),yt,n,o,t,i),this.container=n,this.buttons=o}var t,i,n;return t=e,(i=[{key:"element",value:function(){return this.el}},{key:"destroy",value:function(){var e=this.buttons;Object.keys(e).forEach(function(t){e[t].ui&&e[t].ui.destroy()})}}])&&kt(t.prototype,i),n&&kt(t,n),e}();function Ot(e,t,i,n,o,a,r){var s=n.querySelector(".jw-display-icon-".concat(e)),l=n.querySelector(".jw-icon-".concat(e));t.forEach(function(e){l.appendChild(e)}),o[e]=new i(a,r,s)}var Tt=i(2);function Ct(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var _t=function(){function e(t,i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Object(f.h)(this,r.a),this._model=t,this._api=i,this._playerElement=n,this.localization=t.get("localization"),this.state="tooltip",this.enabled=!1,this.shown=!1,this.feedShownId="",this.closeUi=null,this.tooltipUi=null,this.reset()}var t,i,n;return t=e,(i=[{key:"setup",value:function(e){this.container=e.createElement("div"),this.container.className="jw-nextup-container jw-reset";var t=Object(l.e)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return'<div class="jw-nextup jw-background-color jw-reset"><div class="jw-nextup-tooltip jw-reset"><div class="jw-nextup-thumbnail jw-reset"></div><div class="jw-nextup-body jw-reset">'+'<div class="jw-nextup-header jw-reset">'.concat(e,"</div>")+'<div class="jw-nextup-title jw-reset-text" dir="auto">'.concat(t,"</div>")+'<div class="jw-nextup-duration jw-reset">'.concat(i,"</div>")+"</div></div>"+'<button type="button" class="jw-icon jw-nextup-close jw-reset" aria-label="'.concat(n,'"></button>')+"</div>"}());t.querySelector(".jw-nextup-close").appendChild(se("close")),this.addContent(t),this.closeButton=this.content.querySelector(".jw-nextup-close"),this.closeButton.setAttribute("aria-label",this.localization.close),this.tooltip=this.content.querySelector(".jw-nextup-tooltip");var i=this._model,n=i.player;this.enabled=!1,i.on("change:nextUp",this.onNextUp,this),n.change("duration",this.onDuration,this),n.change("position",this.onElapsed,this),n.change("streamType",this.onStreamType,this),n.change("state",function(e,t){"complete"===t&&this.toggle(!1)},this),this.closeUi=new u.a(this.closeButton,{directSelect:!0}).on("click tap enter",function(){this.nextUpSticky=!1,this.toggle(!1)},this),this.tooltipUi=new u.a(this.tooltip).on("click tap",this.click,this)}},{key:"loadThumbnail",value:function(e){return this.nextUpImage=new Image,this.nextUpImage.onload=function(){this.nextUpImage.onload=null}.bind(this),this.nextUpImage.src=e,{backgroundImage:'url("'+e+'")'}}},{key:"click",value:function(){var e=this.feedShownId;this.reset(),this._api.next({feedShownId:e,reason:"interaction"})}},{key:"toggle",value:function(e,t){if(this.enabled&&(Object(l.u)(this.container,"jw-nextup-sticky",!!this.nextUpSticky),this.shown!==e)){this.shown=e,Object(l.u)(this.container,"jw-nextup-container-visible",e),Object(l.u)(this._playerElement,"jw-flag-nextup",e);var i=this._model.get("nextUp");e&&i?(this.feedShownId=it(et),this.trigger("nextShown",{mode:i.mode,ui:"nextup",itemsShown:[i],feedData:i.feedData,reason:t,feedShownId:this.feedShownId})):this.feedShownId=""}}},{key:"setNextUpItem",value:function(e){var t=this;setTimeout(function(){if(t.thumbnail=t.content.querySelector(".jw-nextup-thumbnail"),Object(l.u)(t.content,"jw-nextup-thumbnail-visible",!!e.image),e.image){var i=t.loadThumbnail(e.image);Object(pe.d)(t.thumbnail,i)}t.header=t.content.querySelector(".jw-nextup-header"),t.header.textContent=t.localization.nextUp,t.title=t.content.querySelector(".jw-nextup-title");var n=e.title;t.title.textContent=n?Object(l.e)(n).textContent:"";var o=e.duration;o&&(t.duration=t.content.querySelector(".jw-nextup-duration"),t.duration.textContent="number"==typeof o?Object(ge.timeFormat)(o):o)},500)}},{key:"onNextUp",value:function(e,t){this.reset(),t||(t={showNextUp:!1}),this.enabled=!(!t.title&&!t.image),this.enabled&&(t.showNextUp||(this.nextUpSticky=!1,this.toggle(!1)),this.setNextUpItem(t))}},{key:"onDuration",value:function(e,t){if(t){var i=Object(Tt.f)(e.get("nextupoffset")||-10);i<0&&(i+=t),this.offset=i}}},{key:"onElapsed",value:function(e,t){var i=this.nextUpSticky;if(this.enabled&&!1!==i){var n=t>=this.offset;n&&void 0===i?(this.nextUpSticky=n,this.toggle(n,"time")):!n&&i&&this.reset()}}},{key:"onStreamType",value:function(e,t){"VOD"!==t&&(this.nextUpSticky=!1,this.toggle(!1))}},{key:"element",value:function(){return this.container}},{key:"addContent",value:function(e){this.content&&this.removeContent(),this.content=e,this.container.appendChild(e)}},{key:"removeContent",value:function(){this.content&&(this.container.removeChild(this.content),this.content=null)}},{key:"reset",value:function(){this.nextUpSticky=void 0,this.toggle(!1)}},{key:"destroy",value:function(){this.off(),this._model.off(null,null,this),this.closeUi&&this.closeUi.destroy(),this.tooltipUi&&this.tooltipUi.destroy()}}])&&Ct(t.prototype,i),n&&Ct(t,n),e}(),St=function(e,t){var i=e.featured,n=e.showLogo,o=e.type;return e.logo=n?'<span class="jw-rightclick-logo jw-reset"></span>':"",'<li class="jw-reset jw-rightclick-item '.concat(i?"jw-featured":"",'">').concat(Mt[o](e,t),"</li>")},Mt={link:function(e){var t=e.link,i=e.title,n=e.logo;return'<a href="'.concat(t||"",'" class="jw-rightclick-link jw-reset" target="_blank" rel="noreferrer">').concat(n).concat(i||"","</a>")},info:function(e,t){return'<button type="button" class="jw-reset jw-rightclick-link jw-info-overlay-item">'.concat(t.videoInfo,"</button>")},share:function(e,t){return'<button type="button" class="jw-reset jw-rightclick-link jw-share-item">'.concat(t.sharing.heading,"</button>")},keyboardShortcuts:function(){return'<button type="button" class="jw-reset jw-rightclick-link jw-shortcuts-item">Keyboard Shortcuts</button>'}},Et=i(23),zt=i(5),At=i(12);function Lt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enum