',n=(i=d.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),o=i.querySelector(".".concat(g,"-toolbar")),a=i.querySelector(".".concat(g,"-navbar")),m=i.querySelector(".".concat(g,"-button")),d=i.querySelector(".".concat(g,"-canvas")),this.parent=e,this.viewer=i,this.title=n,this.toolbar=o,this.navbar=a,this.button=m,this.canvas=d,this.footer=i.querySelector(".".concat(g,"-footer")),this.tooltipBox=i.querySelector(".".concat(g,"-tooltip")),this.player=i.querySelector(".".concat(g,"-player")),this.list=i.querySelector(".".concat(g,"-list")),i.id="".concat(g).concat(this.id),n.id="".concat(g,"Title").concat(this.id),lt(n,s.title?Tt(Array.isArray(s.title)?s.title[0]:s.title):w),lt(a,s.navbar?Tt(s.navbar):w),ut(m,w,!s.button),s.keyboard&&m.setAttribute("tabindex",0),s.backdrop&&(lt(i,"".concat(g,"-backdrop")),s.inline||"static"===s.backdrop||ft(d,K,"hide")),_(s.className)&&s.className&&s.className.split(Z).forEach(function(t){lt(i,t)}),s.toolbar?(r=document.createElement("ul"),h=it(s.toolbar),l=$.slice(0,3),c=$.slice(7,9),u=$.slice(9),h||lt(o,Tt(s.toolbar)),ot(h?s.toolbar:$,function(t,e){var i=h&&it(t),n=h?mt(e):t,o=i&&!Q(t.show)?t.show:t;!o||!s.zoomable&&-1!==l.indexOf(n)||!s.rotatable&&-1!==c.indexOf(n)||!s.scalable&&-1!==u.indexOf(n)||(e=i&&!Q(t.size)?t.size:t,i=i&&!Q(t.click)?t.click:t,t=document.createElement("li"),s.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),lt(t,"".concat(g,"-").concat(n)),nt(i)||ft(t,K,n),J(o)&<(t,Tt(o)),-1!==["small","large"].indexOf(e)?lt(t,"".concat(g,"-").concat(e)):"play"===n&<(t,"".concat(g,"-large")),nt(i)&&yt(t,O,i),r.appendChild(t))}),o.appendChild(r)):lt(o,w),s.rotatable||(lt(d=o.querySelectorAll('li[class*="rotate"]'),D),ot(d,function(t){o.appendChild(t)})),s.inline?(lt(m,b),rt(i,{zIndex:s.zIndexInline}),"static"===window.getComputedStyle(e).position&&rt(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(lt(m,f),lt(i,p),lt(i,v),lt(i,w),rt(i,{zIndex:s.zIndex}),(m=(m=_(m=s.container)?t.ownerDocument.querySelector(m):m)||this.body).appendChild(i)),s.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,nt(s.ready)&&yt(t,j,s.ready,{once:!0}),!1!==xt(t,j)?this.ready&&s.inline&&this.view(this.index):this.ready=!1)}}])&&o(t.prototype,e),n&&o(t,n),i}();return st(n.prototype,At,r,t,St,Ot),n});/*!
* jQuery Viewer v1.0.1
* https://fengyuanchen.github.io/jquery-viewer
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-12-14T09:00:02.315Z
*/
(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?factory(require('jquery'),require('viewerjs')):typeof define==='function'&&define.amd?define(['jquery','viewerjs'],factory):(global=global||self,factory(global.jQuery,global.Viewer))}(this,(function($,Viewer){'use strict';$=$&&$.hasOwnProperty('default')?$['default']:$;Viewer=Viewer&&Viewer.hasOwnProperty('default')?Viewer['default']:Viewer;if($&&$.fn&&Viewer){var AnotherViewer=$.fn.viewer;var NAMESPACE='viewer';$.fn.viewer=function jQueryViewer(option){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key]}
var result;this.each(function(i,element){var $element=$(element);var isDestroy=option==='destroy';var viewer=$element.data(NAMESPACE);if(!viewer){if(isDestroy){return}
var options=$.extend({},$element.data(),$.isPlainObject(option)&&option);viewer=new Viewer(element,options);$element.data(NAMESPACE,viewer)}
if(typeof option==='string'){var fn=viewer[option];if($.isFunction(fn)){result=fn.apply(viewer,args);if(result===viewer){result=undefined}
if(isDestroy){$element.removeData(NAMESPACE)}}}});return result!==undefined?result:this};$.fn.viewer.Constructor=Viewer;$.fn.viewer.setDefaults=Viewer.setDefaults;$.fn.viewer.noConflict=function noConflict(){$.fn.viewer=AnotherViewer;return this}}})));!function(t,e){if("object"==typeof exports&&"undefined"!=typeof module){var i=require("video.js");module.exports=e(i.default||i)}else"function"==typeof define&&define.amd?define(["videojs"],(function(i){return t.Youtube=e(i)})):t.Youtube=e(t.videojs)}(this,(function(t){"use strict";var e,i,s,o,r,a,n,h,l=t.browser.IS_IOS||t.browser.IS_NATIVE_ANDROID,d=t.getTech("Tech");class u extends d{constructor(t,e){super(t,e),this.setPoster(t.poster),this.setSrc(this.options_.source,!0),this.setTimeout(function(){this.el_&&(this.el_.parentNode.className+=" vjs-youtube",l&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),u.isApiReady?this.initYTPlayer():u.apiReadyQueue.push(this))}.bind(this))}dispose(){if(this.ytPlayer)this.ytPlayer.stopVideo&&this.ytPlayer.stopVideo(),this.ytPlayer.destroy&&this.ytPlayer.destroy();else{var t=u.apiReadyQueue.indexOf(this);-1!==t&&u.apiReadyQueue.splice(t,1)}this.ytPlayer=null,this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile",""),this.el_.parentNode.removeChild(this.el_),d.prototype.dispose.call(this)}createEl(){var t=document.createElement("div");t.setAttribute("id",this.options_.techId),t.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute"),t.setAttribute("class","vjs-tech");var e=document.createElement("div");if(e.appendChild(t),!l&&!this.options_.ytControls){var i=document.createElement("div");i.setAttribute("class","vjs-iframe-blocker"),i.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),i.onclick=function(){this.pause()}.bind(this),e.appendChild(i)}return e}initYTPlayer(){var t={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(void 0!==this.options_.autohide&&(t.autohide=this.options_.autohide),void 0!==this.options_.cc_load_policy&&(t.cc_load_policy=this.options_.cc_load_policy),void 0!==this.options_.ytControls&&(t.controls=this.options_.ytControls),void 0!==this.options_.disablekb&&(t.disablekb=this.options_.disablekb),void 0!==this.options_.color&&(t.color=this.options_.color),t.controls?void 0!==this.options_.fs&&(t.fs=this.options_.fs):t.fs=0,-1!==this.options_.source.src.indexOf("end=")){var e=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(e[1])}if(void 0!==this.options_.end&&(t.end=this.options_.end),void 0!==this.options_.hl?t.hl=this.options_.hl:void 0!==this.options_.language&&(t.hl=this.options_.language.substr(0,2)),void 0!==this.options_.iv_load_policy&&(t.iv_load_policy=this.options_.iv_load_policy),void 0!==this.options_.list?t.list=this.options_.list:this.url&&void 0!==this.url.listId&&(t.list=this.url.listId),void 0!==this.options_.listType&&(t.listType=this.options_.listType),void 0!==this.options_.modestbranding&&(t.modestbranding=this.options_.modestbranding),void 0!==this.options_.playlist&&(t.playlist=this.options_.playlist),void 0!==this.options_.playsinline&&(t.playsinline=this.options_.playsinline),void 0!==this.options_.rel&&(t.rel=this.options_.rel),void 0!==this.options_.showinfo&&(t.showinfo=this.options_.showinfo),-1!==this.options_.source.src.indexOf("start=")){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(void 0!==this.options_.start&&(t.start=this.options_.start),void 0!==this.options_.theme&&(t.theme=this.options_.theme),void 0!==this.options_.customVars){var s=this.options_.customVars;Object.keys(s).forEach((function(e){t[e]=s[e]}))}this.activeVideoId=this.url?this.url.videoId:null,this.activeList=t.list;var o={videoId:this.activeVideoId,playerVars:t,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};void 0!==this.options_.enablePrivacyEnhancedMode&&this.options_.enablePrivacyEnhancedMode&&(o.host="https://www.youtube-nocookie.com"),this.ytPlayer=new YT.Player(this.options_.techId,o)}onPlayerReady(){this.options_.muted&&this.ytPlayer.mute(),this.ytPlayer.getAvailablePlaybackRates().length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():this.cueOnReady&&(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)}onPlayerPlaybackQualityChange(){}onPlayerPlaybackRateChange(){this.trigger("ratechange")}onPlayerStateChange(t){var e=t.data;if(e!==this.lastState&&!this.errorNumber)switch(this.lastState=e,e){case-1:this.trigger("loadstart"),this.trigger("loadedmetadata"),this.trigger("durationchange"),this.trigger("ratechange");break;case YT.PlayerState.ENDED:this.trigger("ended");break;case YT.PlayerState.PLAYING:this.trigger("timeupdate"),this.trigger("durationchange"),this.trigger("playing"),this.trigger("play"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting")}}onPlayerVolumeChange(){this.trigger("volumechange")}onPlayerError(t){this.errorNumber=t.data,this.trigger("pause"),this.trigger("error")}error(){var t=1e3+this.errorNumber;switch(this.errorNumber){case 5:return{code:t,message:"Error while trying to play the video"};case 2:case 100:return{code:t,message:"Unable to find the video"};case 101:case 150:return{code:t,message:"Playback on other Websites has been disabled by the video owner."}}return{code:t,message:"YouTube unknown error ("+this.errorNumber+")"}}loadVideoById_(t){var e={videoId:t};this.options_.start&&(e.startSeconds=this.options_.start),this.options_.end&&(e.endSeconds=this.options_.end),this.ytPlayer.loadVideoById(e)}cueVideoById_(t){var e={videoId:t};this.options_.start&&(e.startSeconds=this.options_.start),this.options_.end&&(e.endSeconds=this.options_.end),this.ytPlayer.cueVideoById(e)}src(t){return t&&this.setSrc({src:t}),this.source}poster(){return l?null:this.poster_}setPoster(t){this.poster_=t}setSrc(t){t&&t.src&&(delete this.errorNumber,this.source=t,this.url=u.parseUrl(t.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!l?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}autoplay(){return this.options_.autoplay}setAutoplay(t){this.options_.autoplay=t}loop(){return this.options_.loop}setLoop(t){this.options_.loop=t}play(){this.url&&this.url.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))}pause(){this.ytPlayer&&this.ytPlayer.pauseVideo()}paused(){return!this.ytPlayer||this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(t){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(t,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==t&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(function(){this.lastState===YT.PlayerState.PAUSED&&this.isSeeking?this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked()):clearInterval(this.checkSeekedInPauseInterval)}.bind(this),250))}seeking(){return this.isSeeking}seekable(){return this.ytPlayer?t.createTimeRange(0,this.ytPlayer.getDuration()):t.createTimeRange()}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(t){this.ytPlayer&&this.ytPlayer.setPlaybackRate(t)}duration(){return this.ytPlayer?this.ytPlayer.getDuration():0}currentSrc(){return this.source&&this.source.src}ended(){return!!this.ytPlayer&&this.lastState===YT.PlayerState.ENDED}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(t){this.ytPlayer&&this.ytPlayer.setVolume(100*t)}muted(){return!!this.ytPlayer&&this.ytPlayer.isMuted()}setMuted(t){this.ytPlayer&&(this.muted(!0),t?this.ytPlayer.mute():this.ytPlayer.unMute(),this.setTimeout((function(){this.trigger("volumechange")}),50))}buffered(){if(!this.ytPlayer||!this.ytPlayer.getVideoLoadedFraction)return t.createTimeRange();var e=this.ytPlayer.getVideoLoadedFraction()*this.ytPlayer.getDuration();return t.createTimeRange(0,e)}preload(){}load(){}reset(){}networkState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 3:return 2;default:return 1}}readyState(){if(!this.ytPlayer)return 0;switch(this.ytPlayer.getPlayerState()){case-1:return 0;case 5:return 1;case 3:return 2;default:return 4}}supportsFullScreen(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled}checkHighResPoster(){var t="https://img.youtube.com/vi/"+this.url.videoId+"/maxresdefault.jpg";try{var e=new Image;e.onload=function(){if("naturalHeight"in e){if(e.naturalHeight<=90||e.naturalWidth<=120)return}else if(e.height<=90||e.width<=120)return;this.poster_=t,this.trigger("posterchange")}.bind(this),e.onerror=function(){},e.src=t}catch(t){}}}u.isSupported=function(){return!0},u.canPlaySource=function(t){return u.canPlayType(t.type)},u.canPlayType=function(t){return"video/youtube"===t},u.parseUrl=function(t){var e={videoId:null},i=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|shorts\/|watch\?v=|\&v=)([^#\&\?]*).*/);i&&11===i[2].length&&(e.videoId=i[2]);return(i=t.match(/[?&]list=([^#\&\?]+)/))&&i[1]&&(e.listId=i[1]),e},u.apiReadyQueue=[],"undefined"!=typeof document&&(o="https://www.youtube.com/iframe_api",r=function(){YT.ready((function(){u.isApiReady=!0;for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:{};var id=oEmbedParameters.id;var url=oEmbedParameters.url;var idOrUrl=id||url;if(!idOrUrl){throw new Error('An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.')}
if(isInteger(idOrUrl)){return"https://vimeo.com/".concat(idOrUrl)}
if(isVimeoUrl(idOrUrl)){return idOrUrl.replace('http:','https:')}
if(id){throw new TypeError("\u201C".concat(id,"\u201D is not a valid video id."))}
throw new TypeError("\u201C".concat(idOrUrl,"\u201D is not a vimeo.com url."))}
var arrayIndexOfSupport=typeof Array.prototype.indexOf!=='undefined';var postMessageSupport=typeof window!=='undefined'&&typeof window.postMessage!=='undefined';if(!isNode&&(!arrayIndexOfSupport||!postMessageSupport)){throw new Error('Sorry, the Vimeo Player API is not available in this browser.')}
var commonjsGlobal=typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports}/*!
* weakmap-polyfill v2.0.0 - ECMAScript6 WeakMap polyfill
* https://github.com/polygonplanet/weakmap-polyfill
* Copyright (c) 2015-2016 polygon planet
* @license MIT
*/
(function(self){if(self.WeakMap){return}
var hasOwnProperty=Object.prototype.hasOwnProperty;var defineProperty=function(object,name,value){if(Object.defineProperty){Object.defineProperty(object,name,{configurable:!0,writable:!0,value:value})}else{object[name]=value}};self.WeakMap=function(){function WeakMap(){if(this===void 0){throw new TypeError("Constructor WeakMap requires 'new'")}
defineProperty(this,'_id',genId('_WeakMap'));if(arguments.length>0){throw new TypeError('WeakMap iterable is not supported')}}
defineProperty(WeakMap.prototype,'delete',function(key){checkInstance(this,'delete');if(!isObject(key)){return!1}
var entry=key[this._id];if(entry&&entry[0]===key){delete key[this._id];return!0}
return!1});defineProperty(WeakMap.prototype,'get',function(key){checkInstance(this,'get');if(!isObject(key)){return void 0}
var entry=key[this._id];if(entry&&entry[0]===key){return entry[1]}
return void 0});defineProperty(WeakMap.prototype,'has',function(key){checkInstance(this,'has');if(!isObject(key)){return!1}
var entry=key[this._id];if(entry&&entry[0]===key){return!0}
return!1});defineProperty(WeakMap.prototype,'set',function(key,value){checkInstance(this,'set');if(!isObject(key)){throw new TypeError('Invalid value used as weak map key')}
var entry=key[this._id];if(entry&&entry[0]===key){entry[1]=value;return this}
defineProperty(key,this._id,[key,value]);return this});function checkInstance(x,methodName){if(!isObject(x)||!hasOwnProperty.call(x,'_id')){throw new TypeError(methodName+' method called on incompatible receiver '+typeof x)}}
function genId(prefix){return prefix+'_'+rand()+'.'+rand()}
function rand(){return Math.random().toString().substring(2)}
defineProperty(WeakMap,'_polyfill',!0);return WeakMap}();function isObject(x){return Object(x)===x}})(typeof self!=='undefined'?self:typeof window!=='undefined'?window:typeof commonjsGlobal!=='undefined'?commonjsGlobal:commonjsGlobal);var npo_src=createCommonjsModule(function(module){/*! Native Promise Only
v0.8.1 (c) Kyle Simpson
MIT License: http://getify.mit-license.org
*/
(function UMD(name,context,definition){context[name]=context[name]||definition();if(module.exports){module.exports=context[name]}})("Promise",typeof commonjsGlobal!="undefined"?commonjsGlobal:commonjsGlobal,function DEF(){var builtInProp,cycle,scheduling_queue,ToString=Object.prototype.toString,timer=typeof setImmediate!="undefined"?function timer(fn){return setImmediate(fn)}:setTimeout;try{Object.defineProperty({},"x",{});builtInProp=function builtInProp(obj,name,val,config){return Object.defineProperty(obj,name,{value:val,writable:!0,configurable:config!==!1})}}catch(err){builtInProp=function builtInProp(obj,name,val){obj[name]=val;return obj}}
scheduling_queue=function Queue(){var first,last,item;function Item(fn,self){this.fn=fn;this.self=self;this.next=void 0}
return{add:function add(fn,self){item=new Item(fn,self);if(last){last.next=item}else{first=item}
last=item;item=void 0},drain:function drain(){var f=first;first=last=cycle=void 0;while(f){f.fn.call(f.self);f=f.next}}}}();function schedule(fn,self){scheduling_queue.add(fn,self);if(!cycle){cycle=timer(scheduling_queue.drain)}}
function isThenable(o){var _then,o_type=typeof o;if(o!=null&&(o_type=="object"||o_type=="function")){_then=o.then}
return typeof _then=="function"?_then:!1}
function notify(){for(var i=0;i0){schedule(notify,self)}}}catch(err){reject.call(new MakeDefWrapper(self),err)}}
function reject(msg){var self=this;if(self.triggered){return}
self.triggered=!0;if(self.def){self=self.def}
self.msg=msg;self.state=2;if(self.chain.length>0){schedule(notify,self)}}
function iteratePromises(Constructor,arr,resolver,rejecter){for(var idx=0;idx1&&arguments[1]!==undefined?arguments[1]:{};return oEmbedParameters.reduce(function(params,param){var value=element.getAttribute("data-vimeo-".concat(param));if(value||value===''){params[param]=value===''?1:value}
return params},defaults)}
function createEmbed(_ref,element){var html=_ref.html;if(!element){throw new TypeError('An element must be provided')}
if(element.getAttribute('data-vimeo-initialized')!==null){return element.querySelector('iframe')}
var div=document.createElement('div');div.innerHTML=html;element.appendChild(div.firstChild);element.setAttribute('data-vimeo-initialized','true');return element.querySelector('iframe')}
function getOEmbedData(videoUrl){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var element=arguments.length>2?arguments[2]:undefined;return new Promise(function(resolve,reject){if(!isVimeoUrl(videoUrl)){throw new TypeError("\u201C".concat(videoUrl,"\u201D is not a vimeo.com url."))}
var url="https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(videoUrl));for(var param in params){if(params.hasOwnProperty(param)){url+="&".concat(param,"=").concat(encodeURIComponent(params[param]))}}
var xhr='XDomainRequest' in window?new XDomainRequest():new XMLHttpRequest();xhr.open('GET',url,!0);xhr.onload=function(){if(xhr.status===404){reject(new Error("\u201C".concat(videoUrl,"\u201D was not found.")));return}
if(xhr.status===403){reject(new Error("\u201C".concat(videoUrl,"\u201D is not embeddable.")));return}
try{var json=JSON.parse(xhr.responseText);if(json.domain_status_code===403){createEmbed(json,element);reject(new Error("\u201C".concat(videoUrl,"\u201D is not embeddable.")));return}
resolve(json)}catch(error){reject(error)}};xhr.onerror=function(){var status=xhr.status?" (".concat(xhr.status,")"):'';reject(new Error("There was an error fetching the embed code from Vimeo".concat(status,".")))};xhr.send()})}
function initializeEmbeds(){var parent=arguments.length>0&&arguments[0]!==undefined?arguments[0]:document;var elements=[].slice.call(parent.querySelectorAll('[data-vimeo-id], [data-vimeo-url]'));var handleError=function handleError(error){if('console' in window&&console.error){console.error("There was an error creating an embed: ".concat(error))}};elements.forEach(function(element){try{if(element.getAttribute('data-vimeo-defer')!==null){return}
var params=getOEmbedParameters(element);var url=getVimeoUrl(params);getOEmbedData(url,params,element).then(function(data){return createEmbed(data,element)}).catch(handleError)}catch(error){handleError(error)}})}
function resizeEmbeds(){var parent=arguments.length>0&&arguments[0]!==undefined?arguments[0]:document;if(window.VimeoPlayerResizeEmbeds_){return}
window.VimeoPlayerResizeEmbeds_=!0;var onMessage=function onMessage(event){if(!isVimeoUrl(event.origin)){return}
if(!event.data||event.data.event!=='spacechange'){return}
var iframes=parent.querySelectorAll('iframe');for(var i=0;i=8&&ieVersion<10){message=JSON.stringify(message)}
player.element.contentWindow.postMessage(message,player.origin)}
function processData(player,data){data=parseMessageData(data);var callbacks=[];var param;if(data.event){if(data.event==='error'){var promises=getCallbacks(player,data.data.method);promises.forEach(function(promise){var error=new Error(data.data.message);error.name=data.data.name;promise.reject(error);removeCallback(player,data.data.method,promise)})}
callbacks=getCallbacks(player,"event:".concat(data.event));param=data.data}else if(data.method){var callback=shiftCallbacks(player,data.method);if(callback){callbacks.push(callback);param=data.value}}
callbacks.forEach(function(callback){try{if(typeof callback==='function'){callback.call(player,param);return}
callback.resolve(param)}catch(e){}})}
var playerMap=new WeakMap();var readyMap=new WeakMap();var Player=function(){function Player(element){var _this=this;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Player);if(window.jQuery&&element instanceof jQuery){if(element.length>1&&window.console&&console.warn){console.warn('A jQuery object with multiple elements was passed, using the first element.')}
element=element[0]}
if(typeof document!=='undefined'&&typeof element==='string'){element=document.getElementById(element)}
if(!isDomElement(element)){throw new TypeError('You must pass either a valid element or a valid id.')}
var win=element.ownerDocument.defaultView;if(element.nodeName!=='IFRAME'){var iframe=element.querySelector('iframe');if(iframe){element=iframe}}
if(element.nodeName==='IFRAME'&&!isVimeoUrl(element.getAttribute('src')||'')){throw new Error('The player element passed isn’t a Vimeo embed.')}
if(playerMap.has(element)){return playerMap.get(element)}
this.element=element;this.origin='*';var readyPromise=new npo_src(function(resolve,reject){var onMessage=function onMessage(event){if(!isVimeoUrl(event.origin)||_this.element.contentWindow!==event.source){return}
if(_this.origin==='*'){_this.origin=event.origin}
var data=parseMessageData(event.data);var isError=data&&data.event==='error';var isReadyError=isError&&data.data&&data.data.method==='ready';if(isReadyError){var error=new Error(data.data.message);error.name=data.data.name;reject(error);return}
var isReadyEvent=data&&data.event==='ready';var isPingResponse=data&&data.method==='ping';if(isReadyEvent||isPingResponse){_this.element.setAttribute('data-ready','true');resolve();return}
processData(_this,data)};if(win.addEventListener){win.addEventListener('message',onMessage,!1)}else if(win.attachEvent){win.attachEvent('onmessage',onMessage)}
if(_this.element.nodeName!=='IFRAME'){var params=getOEmbedParameters(element,options);var url=getVimeoUrl(params);getOEmbedData(url,params,element).then(function(data){var iframe=createEmbed(data,element);_this.element=iframe;_this._originalElement=element;swapCallbacks(element,iframe);playerMap.set(_this.element,_this);return data}).catch(reject)}});readyMap.set(this,readyPromise);playerMap.set(this.element,this);if(this.element.nodeName==='IFRAME'){postMessage(this,'ping')}
return this}
_createClass(Player,[{key:"callMethod",value:function callMethod(name){var _this2=this;var args=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new npo_src(function(resolve,reject){return _this2.ready().then(function(){storeCallback(_this2,name,{resolve:resolve,reject:reject});postMessage(_this2,name,args)}).catch(reject)})}},{key:"get",value:function get(name){var _this3=this;return new npo_src(function(resolve,reject){name=getMethodName(name,'get');return _this3.ready().then(function(){storeCallback(_this3,name,{resolve:resolve,reject:reject});postMessage(_this3,name)}).catch(reject)})}},{key:"set",value:function set(name,value){var _this4=this;return new npo_src(function(resolve,reject){name=getMethodName(name,'set');if(value===undefined||value===null){throw new TypeError('There must be a value to set.')}
return _this4.ready().then(function(){storeCallback(_this4,name,{resolve:resolve,reject:reject});postMessage(_this4,name,value)}).catch(reject)})}},{key:"on",value:function on(eventName,callback){if(!eventName){throw new TypeError('You must pass an event name.')}
if(!callback){throw new TypeError('You must pass a callback function.')}
if(typeof callback!=='function'){throw new TypeError('The callback must be a function.')}
var callbacks=getCallbacks(this,"event:".concat(eventName));if(callbacks.length===0){this.callMethod('addEventListener',eventName).catch(function(){})}
storeCallback(this,"event:".concat(eventName),callback)}},{key:"off",value:function off(eventName,callback){if(!eventName){throw new TypeError('You must pass an event name.')}
if(callback&&typeof callback!=='function'){throw new TypeError('The callback must be a function.')}
var lastCallback=removeCallback(this,"event:".concat(eventName),callback);if(lastCallback){this.callMethod('removeEventListener',eventName).catch(function(e){})}}},{key:"loadVideo",value:function loadVideo(options){return this.callMethod('loadVideo',options)}},{key:"ready",value:function ready(){var readyPromise=readyMap.get(this)||new npo_src(function(resolve,reject){reject(new Error('Unknown player. Probably unloaded.'))});return npo_src.resolve(readyPromise)}},{key:"addCuePoint",value:function addCuePoint(time){var data=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.callMethod('addCuePoint',{time:time,data:data})}},{key:"removeCuePoint",value:function removeCuePoint(id){return this.callMethod('removeCuePoint',id)}},{key:"enableTextTrack",value:function enableTextTrack(language,kind){if(!language){throw new TypeError('You must pass a language.')}
return this.callMethod('enableTextTrack',{language:language,kind:kind})}},{key:"disableTextTrack",value:function disableTextTrack(){return this.callMethod('disableTextTrack')}},{key:"pause",value:function pause(){return this.callMethod('pause')}},{key:"play",value:function play(){return this.callMethod('play')}},{key:"unload",value:function unload(){return this.callMethod('unload')}},{key:"destroy",value:function destroy(){var _this5=this;return new npo_src(function(resolve){readyMap.delete(_this5);playerMap.delete(_this5.element);if(_this5._originalElement){playerMap.delete(_this5._originalElement);_this5._originalElement.removeAttribute('data-vimeo-initialized')}
if(_this5.element&&_this5.element.nodeName==='IFRAME'&&_this5.element.parentNode){_this5.element.parentNode.removeChild(_this5.element)}
resolve()})}},{key:"getAutopause",value:function getAutopause(){return this.get('autopause')}},{key:"setAutopause",value:function setAutopause(autopause){return this.set('autopause',autopause)}},{key:"getBuffered",value:function getBuffered(){return this.get('buffered')}},{key:"getColor",value:function getColor(){return this.get('color')}},{key:"setColor",value:function setColor(color){return this.set('color',color)}},{key:"getCuePoints",value:function getCuePoints(){return this.get('cuePoints')}},{key:"getCurrentTime",value:function getCurrentTime(){return this.get('currentTime')}},{key:"setCurrentTime",value:function setCurrentTime(currentTime){return this.set('currentTime',currentTime)}},{key:"getDuration",value:function getDuration(){return this.get('duration')}},{key:"getEnded",value:function getEnded(){return this.get('ended')}},{key:"getLoop",value:function getLoop(){return this.get('loop')}},{key:"setLoop",value:function setLoop(loop){return this.set('loop',loop)}},{key:"setMuted",value:function setMuted(muted){return this.set('muted',muted)}},{key:"getMuted",value:function getMuted(){return this.get('muted')}},{key:"getPaused",value:function getPaused(){return this.get('paused')}},{key:"getPlaybackRate",value:function getPlaybackRate(){return this.get('playbackRate')}},{key:"setPlaybackRate",value:function setPlaybackRate(playbackRate){return this.set('playbackRate',playbackRate)}},{key:"getPlayed",value:function getPlayed(){return this.get('played')}},{key:"getSeekable",value:function getSeekable(){return this.get('seekable')}},{key:"getSeeking",value:function getSeeking(){return this.get('seeking')}},{key:"getTextTracks",value:function getTextTracks(){return this.get('textTracks')}},{key:"getVideoEmbedCode",value:function getVideoEmbedCode(){return this.get('videoEmbedCode')}},{key:"getVideoId",value:function getVideoId(){return this.get('videoId')}},{key:"getVideoTitle",value:function getVideoTitle(){return this.get('videoTitle')}},{key:"getVideoWidth",value:function getVideoWidth(){return this.get('videoWidth')}},{key:"getVideoHeight",value:function getVideoHeight(){return this.get('videoHeight')}},{key:"getVideoUrl",value:function getVideoUrl(){return this.get('videoUrl')}},{key:"getVolume",value:function getVolume(){return this.get('volume')}},{key:"setVolume",value:function setVolume(volume){return this.set('volume',volume)}}]);return Player}();if(!isNode){initializeEmbeds();resizeEmbeds()}
let cssInjected=!1;function injectCss(){if(cssInjected){return}
cssInjected=!0;const css=`
.vjs-vimeo iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
`;const head=document.head||document.getElementsByTagName('head')[0];const style=document.createElement('style');style.type='text/css';if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}
head.appendChild(style)}
const Tech=videojs.getTech('Tech');class Vimeo extends Tech{constructor(options,ready){super(options,ready);injectCss();this.setPoster(options.poster);this.initVimeoPlayer()}
initVimeoPlayer(){const vimeoOptions={url:this.options_.source.src,byline:!1,portrait:!1,title:!1};if(this.options_.autoplay){vimeoOptions.autoplay=!0}
if(this.options_.height){vimeoOptions.height=this.options_.height}
if(this.options_.width){vimeoOptions.width=this.options_.width}
if(this.options_.maxheight){vimeoOptions.maxheight=this.options_.maxheight}
if(this.options_.maxwidth){vimeoOptions.maxwidth=this.options_.maxwidth}
if(this.options_.loop){vimeoOptions.loop=this.options_.loop}
if(this.options_.color){vimeoOptions.color=this.options_.color.replace(/^#/,'')}
this._player=new Player(this.el(),vimeoOptions);this.initVimeoState();['play','pause','ended','timeupdate','progress','seeked'].forEach(e=>{this._player.on(e,(progress)=>{if(this._vimeoState.progress.duration!==progress.duration){this.trigger('durationchange')}
this._vimeoState.progress=progress;this.trigger(e)})});this._player.on('pause',()=>(this._vimeoState.playing=!1));this._player.on('play',()=>{this._vimeoState.playing=!0;this._vimeoState.ended=!1});this._player.on('ended',()=>{this._vimeoState.playing=!1;this._vimeoState.ended=!0});this._player.on('volumechange',(v)=>(this._vimeoState.volume=v));this._player.on('error',e=>this.trigger('error',e));this.triggerReady()}
initVimeoState(){const state=this._vimeoState={ended:!1,playing:!1,volume:0,progress:{seconds:0,percent:0,duration:0}};this._player.getCurrentTime().then(time=>(state.progress.seconds=time));this._player.getDuration().then(time=>(state.progress.duration=time));this._player.getPaused().then(paused=>(state.playing=!paused));this._player.getVolume().then(volume=>(state.volume=volume))}
createEl(){const div=videojs.dom.createEl('div',{id:this.options_.techId});div.style.cssText='width:100%;height:100%;top:0;left:0;position:absolute';div.className='vjs-vimeo';return div}
controls(){return!0}
supportsFullScreen(){return!0}
src(){return this.options_.source}
currentSrc(){return this.options_.source.src}
currentTime(){return this._vimeoState.progress.seconds}
setCurrentTime(time){this._player.setCurrentTime(time)}
volume(){return this._vimeoState.volume}
setVolume(volume){return this._player.setVolume(volume)}
duration(){return this._vimeoState.progress.duration}
buffered(){const progress=this._vimeoState.progress;return videojs.createTimeRange(0,progress.percent*progress.duration)}
paused(){return!this._vimeoState.playing}
pause(){this._player.pause()}
play(){this._player.play()}
muted(){return this._vimeoState.volume===0}
ended(){return this._vimeoState.ended}
playbackRate(){return 1}}
Vimeo.prototype.featuresTimeupdateEvents=!0;Vimeo.isSupported=function(){return!0};Tech.withSourceHandlers(Vimeo);Vimeo.nativeSourceHandler={};Vimeo.nativeSourceHandler.canPlayType=function(source){if(source==='video/vimeo'){return'maybe'}
return''};Vimeo.nativeSourceHandler.canHandleSource=function(source){if(source.type){return Vimeo.nativeSourceHandler.canPlayType(source.type)}else if(source.src){return Vimeo.nativeSourceHandler.canPlayType(source.src)}
return''};Vimeo.nativeSourceHandler.handleSource=function(source,tech){tech.src(source.src)};Vimeo.nativeSourceHandler.dispose=function(){};Vimeo.registerSourceHandler(Vimeo.nativeSourceHandler);if(typeof videojs.registerTech!=='undefined'){videojs.registerTech('Vimeo',Vimeo)}else{videojs.registerComponent('Vimeo',Vimeo)}
Vimeo.VERSION='0.0.1';return Vimeo})))