!function(C,_){"object"==typeof exports&&typeof module<"u"?module.exports=_():"function"==typeof define&&define.amd?define(_):((C=typeof globalThis<"u"?globalThis:C||self).Vimeo=C.Vimeo||{},C.Vimeo.Player=_())}(this,function(){"use strict";function _(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}var L=typeof global<"u"&&"[object global]"==={}.toString.call(global);function z(r,e){return 0===r.indexOf(e.toLowerCase())?r:"".concat(e.toLowerCase()).concat(r.substr(0,1).toUpperCase()).concat(r.substr(1))}function I(r){return/^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(r)}function $(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=r.id,t=r.url,n=e||t;if(!n)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(function J(r){return!isNaN(parseFloat(r))&&isFinite(r)&&Math.floor(r)==r}(n))return"https://vimeo.com/".concat(n);if(I(n))return n.replace("http:","https:");throw e?new TypeError("\u201c".concat(e,"\u201d is not a valid video id.")):new TypeError("\u201c".concat(n,"\u201d is not a vimeo.com url."))}var X=typeof Array.prototype.indexOf<"u",G=typeof window<"u"&&typeof window.postMessage<"u";if(!(L||X&&G))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};!function(r){if(!r.WeakMap){var e=Object.prototype.hasOwnProperty,t=function(i,a,s){Object.defineProperty?Object.defineProperty(i,a,{configurable:!0,writable:!0,value:s}):i[a]=s};r.WeakMap=function(){function i(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(t(this,"_id",function s(l){return l+"_"+d()+"."+d()}("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}function a(l,g){if(!n(l)||!e.call(l,"_id"))throw new TypeError(g+" method called on incompatible receiver "+typeof l)}function d(){return Math.random().toString().substring(2)}return t(i.prototype,"delete",function(l){if(a(this,"delete"),!n(l))return!1;var g=l[this._id];return!(!g||g[0]!==l)&&(delete l[this._id],!0)}),t(i.prototype,"get",function(l){if(a(this,"get"),n(l)){var g=l[this._id];if(g&&g[0]===l)return g[1]}}),t(i.prototype,"has",function(l){if(a(this,"has"),!n(l))return!1;var g=l[this._id];return!(!g||g[0]!==l)}),t(i.prototype,"set",function(l,g){if(a(this,"set"),!n(l))throw new TypeError("Invalid value used as weak map key");var M=l[this._id];return M&&M[0]===l?(M[1]=g,this):(t(l,this._id,[l,g]),this)}),t(i,"_polyfill",!0),i}()}function n(i){return Object(i)===i}}(typeof self<"u"?self:typeof window<"u"?window:F);var T=function K(r,e){return r(e={exports:{}},e.exports),e.exports}(function(r){var t,n;(n=F)[t="Promise"]=n[t]||function(){var t,n,i,a=Object.prototype.toString,s=typeof setImmediate<"u"?function(o){return setImmediate(o)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(o,u,f,h){return Object.defineProperty(o,u,{value:f,writable:!0,configurable:!1!==h})}}catch{t=function(u,f,h){return u[f]=h,u}}function d(c,o){i.add(c,o),n||(n=s(i.drain))}function l(c){var o,u=typeof c;return null!=c&&("object"==u||"function"==u)&&(o=c.then),"function"==typeof o&&o}function g(){for(var c=0;c<this.chain.length;c++)M(this,1===this.state?this.chain[c].success:this.chain[c].failure,this.chain[c]);this.chain.length=0}function M(c,o,u){var f,h;try{!1===o?u.reject(c.msg):(f=!0===o?c.msg:o.call(void 0,c.msg))===u.promise?u.reject(TypeError("Promise-chain cycle")):(h=l(f))?h.call(f,u.resolve,u.reject):u.resolve(f)}catch(m){u.reject(m)}}function w(c){var o,u=this;if(!u.triggered){u.triggered=!0,u.def&&(u=u.def);try{(o=l(c))?d(function(){var f=new O(u);try{o.call(c,function(){w.apply(f,arguments)},function(){v.apply(f,arguments)})}catch(h){v.call(f,h)}}):(u.msg=c,u.state=1,u.chain.length>0&&d(g,u))}catch(f){v.call(new O(u),f)}}}function v(c){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=c,o.state=2,o.chain.length>0&&d(g,o))}function A(c,o,u,f){for(var h=0;h<o.length;h++)!function(p){c.resolve(o[p]).then(function(P){u(p,P)},f)}(h)}function O(c){this.def=c,this.triggered=!1}function R(c){this.promise=c,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function k(c){if("function"!=typeof c)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var o=new R(this);this.then=function(f,h){var m={success:"function"!=typeof f||f,failure:"function"==typeof h&&h};return m.promise=new this.constructor(function(E,P){if("function"!=typeof E||"function"!=typeof P)throw TypeError("Not a function");m.resolve=E,m.reject=P}),o.chain.push(m),0!==o.state&&d(g,o),m.promise},this.catch=function(f){return this.then(void 0,f)};try{c.call(void 0,function(f){w.call(o,f)},function(f){v.call(o,f)})}catch(u){v.call(o,u)}}i=function(){var o,u,f;function h(m,p){this.fn=m,this.self=p,this.next=void 0}return{add:function(p,E){f=new h(p,E),u?u.next=f:o=f,u=f,f=void 0},drain:function(){var p=o;for(o=u=n=void 0;p;)p.fn.call(p.self),p=p.next}}}();var j=t({},"constructor",k,!1);return k.prototype=j,t(j,"__NPO__",0,!1),t(k,"resolve",function(o){var u=this;return o&&"object"==typeof o&&1===o.__NPO__?o:new u(function(h,m){if("function"!=typeof h||"function"!=typeof m)throw TypeError("Not a function");h(o)})}),t(k,"reject",function(o){return new this(function(f,h){if("function"!=typeof f||"function"!=typeof h)throw TypeError("Not a function");h(o)})}),t(k,"all",function(o){var u=this;return"[object Array]"!=a.call(o)?u.reject(TypeError("Not an array")):0===o.length?u.resolve([]):new u(function(h,m){if("function"!=typeof h||"function"!=typeof m)throw TypeError("Not a function");var p=o.length,E=Array(p),P=0;A(u,o,function(ae,se){E[ae]=se,++P===p&&h(E)},m)})}),t(k,"race",function(o){var u=this;return"[object Array]"!=a.call(o)?u.reject(TypeError("Not an array")):new u(function(h,m){if("function"!=typeof h||"function"!=typeof m)throw TypeError("Not a function");A(u,o,function(E,P){h(P)},m)})}),k}(),r.exports&&(r.exports=n[t])}),b=new WeakMap;function S(r,e,t){var n=b.get(r.element)||{};e in n||(n[e]=[]),n[e].push(t),b.set(r.element,n)}function N(r,e){return(b.get(r.element)||{})[e]||[]}function q(r,e,t){var n=b.get(r.element)||{};if(!n[e])return!0;if(!t)return n[e]=[],b.set(r.element,n),!0;var i=n[e].indexOf(t);return-1!==i&&n[e].splice(i,1),b.set(r.element,n),n[e]&&0===n[e].length}var te=["autopause","autoplay","background","byline","color","controls","dnt","height","id","loop","maxheight","maxwidth","muted","playsinline","portrait","responsive","speed","texttrack","title","transparent","url","width"];function Q(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return te.reduce(function(t,n){var i=r.getAttribute("data-vimeo-".concat(n));return(i||""===i)&&(t[n]=""===i?1:i),t},e)}function D(r,e){var t=r.html;if(!e)throw new TypeError("An element must be provided");if(null!==e.getAttribute("data-vimeo-initialized"))return e.querySelector("iframe");var n=document.createElement("div");return n.innerHTML=t,e.appendChild(n.firstChild),e.setAttribute("data-vimeo-initialized","true"),e.querySelector("iframe")}function B(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return new Promise(function(n,i){if(!I(r))throw new TypeError("\u201c".concat(r,"\u201d is not a vimeo.com url."));var a="https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(r));for(var s in e)e.hasOwnProperty(s)&&(a+="&".concat(s,"=").concat(encodeURIComponent(e[s])));var d="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;d.open("GET",a,!0),d.onload=function(){if(404!==d.status)if(403!==d.status)try{var l=JSON.parse(d.responseText);if(403===l.domain_status_code)return D(l,t),void i(new Error("\u201c".concat(r,"\u201d is not embeddable.")));n(l)}catch(g){i(g)}else i(new Error("\u201c".concat(r,"\u201d is not embeddable.")));else i(new Error("\u201c".concat(r,"\u201d was not found.")))},d.onerror=function(){var l=d.status?" (".concat(d.status,")"):"";i(new Error("There was an error fetching the embed code from Vimeo".concat(l,".")))},d.send()})}function H(r){if("string"==typeof r)try{r=JSON.parse(r)}catch(e){return console.warn(e),{}}return r}function V(r,e,t){if(r.element.contentWindow&&r.element.contentWindow.postMessage){var n={method:e};void 0!==t&&(n.value=t);var i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1"));i>=8&&i<10&&(n=JSON.stringify(n)),r.element.contentWindow.postMessage(n,r.origin)}}function ie(r,e){var n,t=[];if((e=H(e)).event){if("error"===e.event)N(r,e.data.method).forEach(function(s){var d=new Error(e.data.message);d.name=e.data.name,s.reject(d),q(r,e.data.method,s)});t=N(r,"event:".concat(e.event)),n=e.data}else if(e.method){var a=function Z(r,e){var t=N(r,e);if(t.length<1)return!1;var n=t.shift();return q(r,e,n),n}(r,e.method);a&&(t.push(a),n=e.value)}t.forEach(function(s){try{if("function"==typeof s)return void s.call(r,n);s.resolve(n)}catch{}})}var x=new WeakMap,W=new WeakMap,y={},ue=function(){function r(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function C(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r),window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),e=e[0]),typeof document<"u"&&"string"==typeof e&&(e=document.getElementById(e)),!function Y(r){return Boolean(r&&1===r.nodeType&&"nodeName"in r&&r.ownerDocument&&r.ownerDocument.defaultView)}(e))throw new TypeError("You must pass either a valid element or a valid id.");if("IFRAME"!==e.nodeName){var i=e.querySelector("iframe");i&&(e=i)}if("IFRAME"===e.nodeName&&!I(e.getAttribute("src")||""))throw new Error("The player element passed isn\u2019t a Vimeo embed.");if(x.has(e))return x.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin="*";var a=new T(function(d,l){if(t._onMessage=function(w){if(I(w.origin)&&t.element.contentWindow===w.source){"*"===t.origin&&(t.origin=w.origin);var v=H(w.data);if(v&&"error"===v.event&&v.data&&"ready"===v.data.method){var R=new Error(v.data.message);return R.name=v.data.name,void l(R)}var k=v&&"ready"===v.event,j=v&&"ping"===v.method;if(k||j)return t.element.setAttribute("data-ready","true"),void d();ie(t,v)}},t._window.addEventListener("message",t._onMessage),"IFRAME"!==t.element.nodeName){var g=Q(e,n);B($(g),g,e).then(function(w){var v=D(w,e);return t.element=v,t._originalElement=e,function ee(r,e){var t=b.get(r);b.set(e,t),b.delete(r)}(e,v),x.set(t.element,t),w}).catch(l)}});if(W.set(this,a),x.set(this.element,this),"IFRAME"===this.element.nodeName&&V(this,"ping"),y.isEnabled){var s=function(){return y.exit()};y.on("fullscreenchange",function(){y.isFullscreen?S(t,"event:exitFullscreen",s):q(t,"event:exitFullscreen",s),t.ready().then(function(){V(t,"fullscreenchange",y.isFullscreen)})})}return this}return function U(r,e,t){return e&&_(r.prototype,e),t&&_(r,t),r}(r,[{key:"callMethod",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new T(function(a,s){return n.ready().then(function(){S(n,t,{resolve:a,reject:s}),V(n,t,i)}).catch(s)})}},{key:"get",value:function(t){var n=this;return new T(function(i,a){return t=z(t,"get"),n.ready().then(function(){S(n,t,{resolve:i,reject:a}),V(n,t)}).catch(a)})}},{key:"set",value:function(t,n){var i=this;return new T(function(a,s){if(t=z(t,"set"),null==n)throw new TypeError("There must be a value to set.");return i.ready().then(function(){S(i,t,{resolve:a,reject:s}),V(i,t,n)}).catch(s)})}},{key:"on",value:function(t,n){if(!t)throw new TypeError("You must pass an event name.");if(!n)throw new TypeError("You must pass a callback function.");if("function"!=typeof n)throw new TypeError("The callback must be a function.");0===N(this,"event:".concat(t)).length&&this.callMethod("addEventListener",t).catch(function(){}),S(this,"event:".concat(t),n)}},{key:"off",value:function(t,n){if(!t)throw new TypeError("You must pass an event name.");if(n&&"function"!=typeof n)throw new TypeError("The callback must be a function.");q(this,"event:".concat(t),n)&&this.callMethod("removeEventListener",t).catch(function(a){})}},{key:"loadVideo",value:function(t){return this.callMethod("loadVideo",t)}},{key:"ready",value:function(){var t=W.get(this);return T.resolve(t)}},{key:"addCuePoint",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.callMethod("addCuePoint",{time:t,data:n})}},{key:"removeCuePoint",value:function(t){return this.callMethod("removeCuePoint",t)}},{key:"enableTextTrack",value:function(t,n){if(!t)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:t,kind:n})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"requestFullscreen",value:function(){return y.isEnabled?y.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return y.isEnabled?y.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return y.isEnabled?T.resolve(y.isFullscreen):this.get("fullscreen")}},{key:"requestPictureInPicture",value:function(){return this.callMethod("requestPictureInPicture")}},{key:"exitPictureInPicture",value:function(){return this.callMethod("exitPictureInPicture")}},{key:"getPictureInPicture",value:function(){return this.get("pictureInPicture")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var t=this;return new T(function(n){if(W.delete(t),x.delete(t.element),t._originalElement&&(x.delete(t._originalElement),t._originalElement.removeAttribute("data-vimeo-initialized")),t.element&&"IFRAME"===t.element.nodeName&&t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.element&&"DIV"===t.element.nodeName&&t.element.parentNode){t.element.removeAttribute("data-vimeo-initialized");var i=t.element.querySelector("iframe");i&&i.parentNode&&i.parentNode.removeChild(i)}t._window.removeEventListener("message",t._onMessage),n()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(t){return this.set("autopause",t)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getCameraProps",value:function(){return this.get("cameraProps")}},{key:"setCameraProps",value:function(t){return this.set("cameraProps",t)}},{key:"getChapters",value:function(){return this.get("chapters")}},{key:"getCurrentChapter",value:function(){return this.get("currentChapter")}},{key:"getColor",value:function(){return this.get("color")}},{key:"setColor",value:function(t){return this.set("color",t)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(t){return this.set("currentTime",t)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(t){return this.set("loop",t)}},{key:"setMuted",value:function(t){return this.set("muted",t)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(t){return this.set("playbackRate",t)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getQualities",value:function(){return this.get("qualities")}},{key:"getQuality",value:function(){return this.get("quality")}},{key:"setQuality",value:function(t){return this.set("quality",t)}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(t){return this.set("volume",t)}}]),r}();return L||(y=function oe(){var r=function(){for(var n,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],a=0,s=i.length,d={};a<s;a++)if((n=i[a])&&n[1]in document){for(a=0;a<n.length;a++)d[i[0][a]]=n[a];return d}return!1}(),e={fullscreenchange:r.fullscreenchange,fullscreenerror:r.fullscreenerror},t={request:function(i){return new Promise(function(a,s){var d=function g(){t.off("fullscreenchange",g),a()};t.on("fullscreenchange",d);var l=(i=i||document.documentElement)[r.requestFullscreen]();l instanceof Promise&&l.then(d).catch(s)})},exit:function(){return new Promise(function(i,a){if(t.isFullscreen){var s=function l(){t.off("fullscreenchange",l),i()};t.on("fullscreenchange",s);var d=document[r.exitFullscreen]();d instanceof Promise&&d.then(s).catch(a)}else i()})},on:function(i,a){var s=e[i];s&&document.addEventListener(s,a)},off:function(i,a){var s=e[i];s&&document.removeEventListener(s,a)}};return Object.defineProperties(t,{isFullscreen:{get:function(){return Boolean(document[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return document[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(document[r.fullscreenEnabled])}}}),t}(),function ne(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=[].slice.call(r.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")),t=function(i){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(i))};e.forEach(function(n){try{if(null!==n.getAttribute("data-vimeo-defer"))return;var i=Q(n);B($(i),i,n).then(function(s){return D(s,n)}).catch(t)}catch(s){t(s)}})}(),function re(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;if(!window.VimeoPlayerResizeEmbeds_){window.VimeoPlayerResizeEmbeds_=!0;window.addEventListener("message",function(n){if(I(n.origin)&&n.data&&"spacechange"===n.data.event)for(var i=r.querySelectorAll("iframe"),a=0;a<i.length;a++)if(i[a].contentWindow===n.source){i[a].parentElement.style.paddingBottom="".concat(n.data.data[0].bottom,"px");break}})}}()),ue});