/*!
 * @license MIT
 * @name vlitejs
 * @version 4.1.1
 * @copyright 2022 Joris DANIEL
 */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VlitejsVimeo=t():e.VlitejsVimeo=t()}(globalThis,(()=>{return e={868:(e,t,i)=>{var n;n=function(e,t){"use strict";t.default=function(e){if(window.VlitejsVimeoQueue=window.VlitejsVimeoQueue||[],void 0===window.Vimeo){const e=document.createElement("script");e.async=!0,e.type="text/javascript",e.src="https://player.vimeo.com/api/player.js",e.onload=()=>{window.VlitejsVimeoQueue.forEach((e=>{e.initVimeoPlayer().then((()=>{e.addSpecificEvents(),e.onReady()}))})),window.VlitejsVimeoQueue=[]},document.getElementsByTagName("body")[0].appendChild(e)}return class extends e{constructor(e){super(e);const t={id:this.media.getAttribute("data-vimeo-id"),playsinline:this.options.playsinline?1:0,loop:this.options.loop?1:0,controls:!1};this.params=Object.assign(Object.assign({},t),this.options.providerParams),this.events=[{type:"timeupdate",listener:super.onTimeUpdate},{type:"ended",listener:super.onMediaEnded},{type:"playing",listener:this.onPlaying},{type:"waiting",listener:this.onWaiting},{type:"seeking",listener:this.onSeeking},{type:"seeked",listener:this.onSeeked}]}init(){this.waitUntilVideoIsReady().then((()=>{this.addSpecificEvents(),super.onReady()}))}waitUntilVideoIsReady(){return new window.Promise((e=>{void 0!==window.Vimeo?this.initVimeoPlayer().then(e):window.VlitejsVimeoQueue.push(this)}))}initVimeoPlayer(){return new window.Promise((e=>{this.instance=new window.Vimeo.Player(this.media.getAttribute("id"),this.params),this.media=this.instance.element,this.instance.ready().then((()=>{this.media.firstElementChild.setAttribute("tabindex","-1"),e()}))}))}addSpecificEvents(){this.events.forEach((e=>{this.instance.on(e.type,e.listener.bind(this))}))}getInstance(){return this.instance}getCurrentTime(){return new window.Promise((e=>{this.instance.getCurrentTime().then((t=>e(t)))}))}getDuration(){return new window.Promise((e=>{this.instance.getDuration().then((t=>e(t)))}))}methodPlay(){this.instance.play()}methodPause(){this.instance.pause()}methodSetVolume(e){this.instance.setVolume(e)}methodGetVolume(){return new window.Promise((e=>{this.instance.getVolume().then((t=>{e(t)}))}))}methodMute(){this.instance.setVolume(0)}methodUnMute(){this.instance.setVolume(1)}methodSeekTo(e){this.instance.setCurrentTime(e)}onWaiting(){this.loading(!0)}onPlaying(){this.loading(!1)}onSeeking(){this.loading(!0)}onSeeked(){this.loading(!1)}removeSpecificEvents(){this.events.forEach((e=>{this.instance.off(e.type,e.listener)}))}destroy(){this.removeSpecificEvents(),this.instance.destroy(),super.destroy()}}}}.apply(t,[i,t]),void 0===n||(e.exports=n)}},t={},i=function i(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,i),o.exports}(868),i=i.default;var e,t,i}));