import{R as Re}from"./index-5EWtcenj.js";import{M as Le}from"./index-B4nclofW.js";function fe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function he(n){for(var e=1;e=0;--M){var w=this.tryEntries[M],C=w.completion;if(w.tryLoc==="root")return d("end");if(w.tryLoc<=this.prev){var A=t.call(w,"catchLoc"),I=t.call(w,"finallyLoc");if(A&&I){if(this.prev=0;--d){var M=this.tryEntries[d];if(M.tryLoc<=this.prev&&t.call(M,"finallyLoc")&&this.prev=0;--l){var d=this.tryEntries[l];if(d.finallyLoc===c)return this.complete(d.completion,d.afterLoc),y(d),k}},catch:function(c){for(var l=this.tryEntries.length-1;l>=0;--l){var d=this.tryEntries[l];if(d.tryLoc===c){var M=d.completion;if(M.type==="throw"){var w=M.arg;y(d)}return w}}throw new Error("illegal catch attempt")},delegateYield:function(c,l,d){return this.delegate={iterator:q(c),resultName:l,nextLoc:d},this.method==="next"&&(this.arg=void 0),k}},n}function de(n,e,t,r,i,a,o){try{var u=n[a](o),h=u.value}catch(s){t(s);return}u.done?e(h):Promise.resolve(h).then(r,i)}function W(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var a=n.apply(e,t);function o(h){de(a,r,i,o,u,"next",h)}function u(h){de(a,r,i,o,u,"throw",h)}o(void 0)})}}function ke(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function je(n,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function K(n,e,t){return Pe()?K=Reflect.construct.bind():K=function(i,a,o){var u=[null];u.push.apply(u,a);var h=Function.bind.apply(i,u),s=new h;return o&&J(s,o.prototype),s},K.apply(null,arguments)}function Fe(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function se(n){var e=typeof Map=="function"?new Map:void 0;return se=function(r){if(r===null||!Fe(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return K(r,arguments,Y(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),J(i,r)},se(n)}function Z(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function qe(n,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Z(n)}function Ve(n){var e=Pe();return function(){var r=Y(n),i;if(e){var a=Y(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return qe(this,i)}}function De(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function Te(n){var e=De(n,"string");return typeof e=="symbol"?e:String(e)}var Me=typeof global<"u"&&{}.toString.call(global)==="[object global]";function pe(n,e){return n.indexOf(e.toLowerCase())===0?n:"".concat(e.toLowerCase()).concat(n.substr(0,1).toUpperCase()).concat(n.substr(1))}function $e(n){return!!(n&&n.nodeType===1&&"nodeName"in n&&n.ownerDocument&&n.ownerDocument.defaultView)}function xe(n){return!isNaN(parseFloat(n))&&isFinite(n)&&Math.floor(n)==n}function H(n){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(n)}function Se(n){var e=/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/;return e.test(n)}function We(n){for(var e=(n||"").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),t=(e&&e[1]||"").replace("player.",""),r=[".videoji.hk",".vimeo.work",".videoji.cn"],i=0,a=r;i0&&arguments[0]!==void 0?arguments[0]:{},e=n.id,t=n.url,r=e||t;if(!r)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(xe(r))return"https://vimeo.com/".concat(r);if(H(r))return r.replace("http:","https:");throw e?new TypeError("“".concat(e,"” is not a valid video id.")):new TypeError("“".concat(r,"” is not a vimeo.com url."))}var ve=function(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"addEventListener",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"removeEventListener",o=typeof t=="string"?[t]:t;return o.forEach(function(u){e[i](u,r)}),{cancel:function(){return o.forEach(function(h){return e[a](h,r)})}}},He=typeof Array.prototype.indexOf<"u",ze=typeof window<"u"&&typeof window.postMessage<"u";if(!Me&&(!He||!ze))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Be(n,e){return e={exports:{}},n(e,e.exports),e.exports}(function(n){if(n.WeakMap)return;var e=Object.prototype.hasOwnProperty,t=Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{value:1}).x===1}catch{}})(),r=function(a,o,u){t?Object.defineProperty(a,o,{configurable:!0,writable:!0,value:u}):a[o]=u};n.WeakMap=(function(){function a(){if(this===void 0)throw new TypeError("Constructor WeakMap requires 'new'");if(r(this,"_id",u("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}r(a.prototype,"delete",function(s){if(o(this,"delete"),!i(s))return!1;var E=s[this._id];return E&&E[0]===s?(delete s[this._id],!0):!1}),r(a.prototype,"get",function(s){if(o(this,"get"),!!i(s)){var E=s[this._id];if(E&&E[0]===s)return E[1]}}),r(a.prototype,"has",function(s){if(o(this,"has"),!i(s))return!1;var E=s[this._id];return!!(E&&E[0]===s)}),r(a.prototype,"set",function(s,E){if(o(this,"set"),!i(s))throw new TypeError("Invalid value used as weak map key");var k=s[this._id];return k&&k[0]===s?(k[1]=E,this):(r(s,this._id,[s,E]),this)});function o(s,E){if(!i(s)||!e.call(s,"_id"))throw new TypeError(E+" method called on incompatible receiver "+typeof s)}function u(s){return s+"_"+h()+"."+h()}function h(){return Math.random().toString().substring(2)}return r(a,"_polyfill",!0),a})();function i(a){return Object(a)===a}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:G);var V=Be(function(n){(function(t,r,i){r[t]=r[t]||i(),n.exports&&(n.exports=r[t])})("Promise",G,function(){var t,r,i,a=Object.prototype.toString,o=typeof setImmediate<"u"?function(p){return setImmediate(p)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(p,f,v,b){return Object.defineProperty(p,f,{value:v,writable:!0,configurable:b!==!1})}}catch{t=function(f,v,b){return f[v]=b,f}}i=(function(){var p,f,v;function b(S,y){this.fn=S,this.self=y,this.next=void 0}return{add:function(y,j){v=new b(y,j),f?f.next=v:p=v,f=v,v=void 0},drain:function(){var y=p;for(p=f=r=void 0;y;)y.fn.call(y.self),y=y.next}}})();function u(m,p){i.add(m,p),r||(r=o(i.drain))}function h(m){var p,f=typeof m;return m!=null&&(f=="object"||f=="function")&&(p=m.then),typeof p=="function"?p:!1}function s(){for(var m=0;m0&&u(s,f))}catch(v){T.call(new g(f),v)}}}function T(m){var p=this;p.triggered||(p.triggered=!0,p.def&&(p=p.def),p.msg=m,p.state=2,p.chain.length>0&&u(s,p))}function P(m,p,f,v){for(var b=0;b=8&&i<10&&(r=JSON.stringify(r)),n.element.contentWindow.postMessage(r,n.origin)}}function Qe(n,e){e=re(e);var t=[],r;if(e.event){if(e.event==="error"){var i=ee(n,e.data.method);i.forEach(function(o){var u=new Error(e.data.message);u.name=e.data.name,o.reject(u),te(n,e.data.method,o)})}t=ee(n,"event:".concat(e.event)),r=e.data}else if(e.method){var a=Ge(n,e.method);a&&(t.push(a),r=e.value)}t.forEach(function(o){try{if(typeof o=="function"){o.call(n,r);return}o.resolve(r)}catch{}})}var Ye=["airplay","audio_tracks","audiotrack","autopause","autoplay","background","byline","cc","chapter_id","chapters","chromecast","color","colors","controls","dnt","end_time","fullscreen","height","id","initial_quality","interactive_params","keyboard","loop","maxheight","max_quality","maxwidth","min_quality","muted","play_button_position","playsinline","portrait","preload","progress_bar","quality","quality_selector","responsive","skipping_forward","speed","start_time","texttrack","thumbnail_id","title","transcript","transparent","unmute_button","url","vimeo_logo","volume","watch_full_video","width"];function Oe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ye.reduce(function(t,r){var i=n.getAttribute("data-vimeo-".concat(r));return(i||i==="")&&(t[r]=i===""?1:i),t},e)}function le(n,e){var t=n.html;if(!e)throw new TypeError("An element must be provided");if(e.getAttribute("data-vimeo-initialized")!==null)return e.querySelector("iframe");var r=document.createElement("div");return r.innerHTML=t,e.appendChild(r.firstChild),e.setAttribute("data-vimeo-initialized","true"),e.querySelector("iframe")}function _e(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return new Promise(function(r,i){if(!H(n))throw new TypeError("“".concat(n,"” is not a vimeo.com url."));var a=We(n),o="https://".concat(a,"/api/oembed.json?url=").concat(encodeURIComponent(n));for(var u in e)e.hasOwnProperty(u)&&(o+="&".concat(u,"=").concat(encodeURIComponent(e[u])));var h="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;h.open("GET",o,!0),h.onload=function(){if(h.status===404){i(new Error("“".concat(n,"” was not found.")));return}if(h.status===403){i(new Error("“".concat(n,"” is not embeddable.")));return}try{var s=JSON.parse(h.responseText);if(s.domain_status_code===403){le(s,t),i(new Error("“".concat(n,"” is not embeddable.")));return}r(s)}catch(E){i(E)}},h.onerror=function(){var s=h.status?" (".concat(h.status,")"):"";i(new Error("There was an error fetching the embed code from Vimeo".concat(s,".")))},h.send()})}function Je(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,e=[].slice.call(n.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(r){try{if(r.getAttribute("data-vimeo-defer")!==null)return;var i=Oe(r),a=Ce(i);_e(a,i,r).then(function(o){return le(o,r)}).catch(t)}catch(o){t(o)}})}function Xe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoPlayerResizeEmbeds_){window.VimeoPlayerResizeEmbeds_=!0;var e=function(r){if(H(r.origin)&&!(!r.data||r.data.event!=="spacechange")){for(var i=n.querySelectorAll("iframe"),a=0;a0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoSeoMetadataAppended){window.VimeoSeoMetadataAppended=!0;var e=function(r){if(H(r.origin)){var i=re(r.data);if(!(!i||i.event!=="ready"))for(var a=n.querySelectorAll("iframe"),o=0;o0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoCheckedUrlTimeParam){window.VimeoCheckedUrlTimeParam=!0;var e=function(i){"console"in window&&console.error&&console.error("There was an error getting video Id: ".concat(i))},t=function(i){if(H(i.origin)){var a=re(i.data);if(!(!a||a.event!=="ready"))for(var o=n.querySelectorAll("iframe"),u=function(){var E=o[h],k=E.contentWindow===i.source;if(Se(E.src)&&k){var T=new ce(E);T.getVideoId().then(function(P){var g=new RegExp("[?&]vimeo_t_".concat(P,"=([^&#]*)")).exec(window.location.href);if(g&&g[1]){var _=decodeURI(g[1]);T.setCurrentTime(_)}}).catch(e)}},h=0;h2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;return ke(this,t),a=e.call(this),X(Z(a),"logger",void 0),X(Z(a),"speedAdjustment",0),X(Z(a),"adjustSpeed",(function(){var h=W(R().mark(function s(E,k){var T;return R().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(a.speedAdjustment!==k){g.next=2;break}return g.abrupt("return");case 2:return g.next=4,E.getPlaybackRate();case 4:return g.t0=g.sent,g.t1=a.speedAdjustment,g.t2=g.t0-g.t1,g.t3=k,T=g.t2+g.t3,a.log("New playbackRate: ".concat(T)),g.next=12,E.setPlaybackRate(T);case 12:a.speedAdjustment=k;case 13:case"end":return g.stop()}},s)}));return function(s,E){return h.apply(this,arguments)}})()),a.logger=u,a.init(i,r,he(he({},tt),o)),a}return Ee(t,[{key:"disconnect",value:function(){this.dispatchEvent(new Event("disconnect"))}},{key:"init",value:(function(){var r=W(R().mark(function a(o,u,h){var s=this,E,k,T;return R().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.waitForTOReadyState(o,"open");case 2:if(h.role!=="viewer"){g.next=10;break}return g.next=5,this.updatePlayer(o,u,h);case 5:E=ve(o,"change",function(){return s.updatePlayer(o,u,h)}),k=this.maintainPlaybackPosition(o,u,h),this.addEventListener("disconnect",function(){k.cancel(),E.cancel()}),g.next=14;break;case 10:return g.next=12,this.updateTimingObject(o,u);case 12:T=ve(u,["seeked","play","pause","ratechange"],function(){return s.updateTimingObject(o,u)},"on","off"),this.addEventListener("disconnect",function(){return T.cancel()});case 14:case"end":return g.stop()}},a,this)}));function i(a,o,u){return r.apply(this,arguments)}return i})()},{key:"updateTimingObject",value:(function(){var r=W(R().mark(function a(o,u){return R().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.t0=o,s.next=3,u.getCurrentTime();case 3:return s.t1=s.sent,s.next=6,u.getPaused();case 6:if(!s.sent){s.next=10;break}s.t2=0,s.next=13;break;case 10:return s.next=12,u.getPlaybackRate();case 12:s.t2=s.sent;case 13:s.t3=s.t2,s.t4={position:s.t1,velocity:s.t3},s.t0.update.call(s.t0,s.t4);case 16:case"end":return s.stop()}},a)}));function i(a,o){return r.apply(this,arguments)}return i})()},{key:"updatePlayer",value:(function(){var r=W(R().mark(function a(o,u,h){var s,E,k;return R().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(s=o.query(),E=s.position,k=s.velocity,typeof E=="number"&&u.setCurrentTime(E),typeof k!="number"){P.next=25;break}if(k!==0){P.next=11;break}return P.next=6,u.getPaused();case 6:if(P.t0=P.sent,P.t0!==!1){P.next=9;break}u.pause();case 9:P.next=25;break;case 11:if(!(k>0)){P.next=25;break}return P.next=14,u.getPaused();case 14:if(P.t1=P.sent,P.t1!==!0){P.next=19;break}return P.next=18,u.play().catch((function(){var g=W(R().mark(function _(O){return R().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!(O.name==="NotAllowedError"&&h.autoPlayMuted)){m.next=5;break}return m.next=3,u.setMuted(!0);case 3:return m.next=5,u.play().catch(function(p){return console.error("Couldn't play the video from TimingSrcConnector. Error:",p)});case 5:case"end":return m.stop()}},_)}));return function(_){return g.apply(this,arguments)}})());case 18:this.updatePlayer(o,u,h);case 19:return P.next=21,u.getPlaybackRate();case 21:if(P.t2=P.sent,P.t3=k,P.t2===P.t3){P.next=25;break}u.setPlaybackRate(k);case 25:case"end":return P.stop()}},a,this)}));function i(a,o,u){return r.apply(this,arguments)}return i})()},{key:"maintainPlaybackPosition",value:function(i,a,o){var u=this,h=o.allowedDrift,s=o.maxAllowedDrift,E=o.minCheckInterval,k=o.maxRateAdjustment,T=o.maxTimeToCatchUp,P=Math.min(T,Math.max(E,s))*1e3,g=(function(){var O=W(R().mark(function N(){var m,p,f,v,b;return R().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(y.t0=i.query().velocity===0,y.t0){y.next=6;break}return y.next=4,a.getPaused();case 4:y.t1=y.sent,y.t0=y.t1===!0;case 6:if(!y.t0){y.next=8;break}return y.abrupt("return");case 8:return y.t2=i.query().position,y.next=11,a.getCurrentTime();case 11:if(y.t3=y.sent,m=y.t2-y.t3,p=Math.abs(m),u.log("Drift: ".concat(m)),!(p>s)){y.next=22;break}return y.next=18,u.adjustSpeed(a,0);case 18:a.setCurrentTime(i.query().position),u.log("Resync by currentTime"),y.next=29;break;case 22:if(!(p>h)){y.next=29;break}return f=p/T,v=k,b=f1&&arguments[1]!==void 0?arguments[1]:{};if(ke(this,n),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"&&typeof e=="string"&&(e=document.getElementById(e)),!$e(e))throw new TypeError("You must pass either a valid element or a valid id.");if(e.nodeName!=="IFRAME"){var i=e.querySelector("iframe");i&&(e=i)}if(e.nodeName==="IFRAME"&&!H(e.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(B.has(e))return B.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin="*";var a=new V(function(u,h){if(t._onMessage=function(k){if(!(!H(k.origin)||t.element.contentWindow!==k.source)){t.origin==="*"&&(t.origin=k.origin);var T=re(k.data),P=T&&T.event==="error",g=P&&T.data&&T.data.method==="ready";if(g){var _=new Error(T.data.message);_.name=T.data.name,h(_);return}var O=T&&T.event==="ready",N=T&&T.method==="ping";if(O||N){t.element.setAttribute("data-ready","true"),u();return}Qe(t,T)}},t._window.addEventListener("message",t._onMessage),t.element.nodeName!=="IFRAME"){var s=Oe(e,r),E=Ce(s);_e(E,s,e).then(function(k){var T=le(k,e);return t.element=T,t._originalElement=e,Ue(e,T),B.set(t.element,t),k}).catch(h)}});if(ie.set(this,a),B.set(this.element,this),this.element.nodeName==="IFRAME"&&x(this,"ping"),L.isEnabled){var o=function(){return L.exit()};this.fullscreenchangeHandler=function(){L.isFullscreen?Q(t,"event:exitFullscreen",o):te(t,"event:exitFullscreen",o),t.ready().then(function(){x(t,"fullscreenchange",L.isFullscreen)})},L.on("fullscreenchange",this.fullscreenchangeHandler)}return this}return Ee(n,[{key:"callMethod",value:function(t){for(var r=this,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod("addCuePoint",{time:t,data:r})}},{key:"removeCuePoint",value:function(t){return this.callMethod("removeCuePoint",t)}},{key:"enableTextTrack",value:function(t,r){if(!t)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:t,kind:r})}},{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 L.isEnabled?L.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return L.isEnabled?L.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return L.isEnabled?V.resolve(L.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:"remotePlaybackPrompt",value:function(){return this.callMethod("remotePlaybackPrompt")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var t=this;return new V(function(r){if(ie.delete(t),B.delete(t.element),t._originalElement&&(B.delete(t._originalElement),t._originalElement.removeAttribute("data-vimeo-initialized")),t.element&&t.element.nodeName==="IFRAME"&&t.element.parentNode&&(t.element.parentNode.parentNode&&t._originalElement&&t._originalElement!==t.element.parentNode?t.element.parentNode.parentNode.removeChild(t.element.parentNode):t.element.parentNode.removeChild(t.element)),t.element&&t.element.nodeName==="DIV"&&t.element.parentNode){t.element.removeAttribute("data-vimeo-initialized");var i=t.element.querySelector("iframe");i&&i.parentNode&&(i.parentNode.parentNode&&t._originalElement&&t._originalElement!==i.parentNode?i.parentNode.parentNode.removeChild(i.parentNode):i.parentNode.removeChild(i))}t._window.removeEventListener("message",t._onMessage),L.isEnabled&&L.off("fullscreenchange",t.fullscreenchangeHandler),r()})}},{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:"getColors",value:function(){return V.all([this.get("colorOne"),this.get("colorTwo"),this.get("colorThree"),this.get("colorFour")])}},{key:"setColor",value:function(t){return this.set("color",t)}},{key:"setColors",value:function(t){if(!Array.isArray(t))return new V(function(a,o){return o(new TypeError("Argument must be an array."))});var r=new V(function(a){return a(null)}),i=[t[0]?this.set("colorOne",t[0]):r,t[1]?this.set("colorTwo",t[1]):r,t[2]?this.set("colorThree",t[2]):r,t[3]?this.set("colorFour",t[3]):r];return V.all(i)}},{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:"getRemotePlaybackAvailability",value:function(){return this.get("remotePlaybackAvailability")}},{key:"getRemotePlaybackState",value:function(){return this.get("remotePlaybackState")}},{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)}},{key:"setTimingSrc",value:(function(){var e=W(R().mark(function r(i,a){var o=this,u;return R().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(i){s.next=2;break}throw new TypeError("A Timing Object must be provided.");case 2:return s.next=4,this.ready();case 4:return u=new rt(this,i,a),x(this,"notifyTimingObjectConnect"),u.addEventListener("disconnect",function(){return x(o,"notifyTimingObjectDisconnect")}),s.abrupt("return",u);case 8:case"end":return s.stop()}},r,this)}));function t(r,i){return e.apply(this,arguments)}return t})()}]),n})();Me||(L=et(),Je(),Xe(),Ke(),Ze());const nt="https://player.vimeo.com/video",it="https://vimeo.com/event",at=/vimeo\.com\/(video\/|event\/)?(\d+)(?:\/([\w-]+))?/;function me(n,e={}){var t;const r={src:ot(n,e),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"};return e.config&&(r["data-config"]=JSON.stringify(e.config)),(t=e.config)!=null&&t.referrerpolicy&&(r.referrerpolicy=e.config.referrerpolicy),` `}function ot(n,e){if(!n.src)return;let t=new URL(n.src);const r=n.src.match(at),i=r?.[1],a=r?.[2],o=t.searchParams.get("h")||r?.[3],u={controls:n.controls===""?null:0,autoplay:n.autoplay,loop:n.loop,muted:n.muted,playsinline:n.playsinline,preload:n.preload??"metadata",transparent:!1,autopause:n.autopause,h:o,...e.config};if(i==="event/"){const h=o?`/${o}`:"";return delete u.h,`${it}/${a}/embed${h}?${ge(u)}`}return`${nt}/${a}?${ge(u)}`}class Ae extends Le(globalThis.HTMLElement??class{}){static getTemplateHTML=me;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src"];loadComplete=new oe;#u;#h;#d;#t=0;#n=NaN;#i=!1;#e=!this.autoplay;#s=1;#l=0;#a=0;#c=!1;#o=1;#p=NaN;#v=NaN;#r=null;#f=!1;constructor(){super(),this.#y("config")}requestFullscreen(){var e,t;return(t=(e=this.api)==null?void 0:e.requestFullscreen)==null?void 0:t.call(e)}exitFullscreen(){var e,t;return(t=(e=this.api)==null?void 0:e.exitFullscreen)==null?void 0:t.call(e)}requestPictureInPicture(){var e,t;return(t=(e=this.api)==null?void 0:e.requestPictureInPicture)==null?void 0:t.call(e)}exitPictureInPicture(){var e,t;return(t=(e=this.api)==null?void 0:e.exitPictureInPicture)==null?void 0:t.call(e)}get config(){return this.#r}set config(e){e??=null,JSON.stringify(this.#r)!==JSON.stringify(e)&&(this.#r=e,this.load())}async load(){var e;if(this.#u)return;await(this.#u=Promise.resolve()),this.#u=null,this.#t=0,this.#n=NaN,this.#i=!1,this.#e=!this.autoplay,this.#s=1,this.#l=0,this.#a=0,this.#c=!1,this.#o=1,this.#a=0,this.#p=NaN,this.#v=NaN,this.dispatchEvent(new Event("emptied"));let t=this.api;if(this.api=null,!this.src)return;this.#h&&(this.loadComplete=new oe),this.#h=!0,this.dispatchEvent(new Event("loadstart"));const r={autoplay:this.autoplay,controls:this.controls,loop:this.loop,muted:this.defaultMuted,playsinline:this.playsInline,preload:this.preload??"metadata",transparent:!1,autopause:this.hasAttribute("autopause"),...this.#r};if(this.#d){this.api=t,await this.api.loadVideo({...r,url:this.src}),await this.#m(),await this.loadComplete;return}this.#d=!0,this.shadowRoot||this.attachShadow({mode:"open"});const i=this.shadowRoot.querySelector("iframe");i&&!this.#f?this.#r||(this.#r=JSON.parse(i.getAttribute("data-config")||"{}")):this.shadowRoot.innerHTML=me(lt(this.attributes),this),this.#f=!1,(e=t?.destroy)==null||e.call(t);const o=this.shadowRoot.querySelector("iframe");this.api=new ce(o),this.#g(),await this.loadComplete}connectedCallback(){var e;this.#f&&this.load(),(e=super.connectedCallback)==null||e.call(this)}disconnectedCallback(){var e,t,r;this.#f=!0,this.#u=null,this.#h=null,this.#d=null,this.loadComplete=new oe,(t=(e=this.api)==null?void 0:e.destroy)==null||t.call(e),this.api=null,(r=super.disconnectedCallback)==null||r.call(this)}#m=async()=>{this.#a=1,this.dispatchEvent(new Event("loadedmetadata")),this.api&&(this.#i=await this.api.getMuted(),this.#o=await this.api.getVolume(),this.dispatchEvent(new Event("volumechange")),this.#n=await this.api.getDuration(),this.dispatchEvent(new Event("durationchange"))),this.dispatchEvent(new Event("loadcomplete")),this.loadComplete.resolve()};#g(){const e=document.createElement("video");this.textTracks=e.textTracks,this.api.getTextTracks().then(r=>{r.forEach(i=>{e.addTextTrack(i.kind,i.label,i.language)})}),this.textTracks.addEventListener("change",()=>{const r=Array.from(this.textTracks).find(i=>i.mode==="showing");r?this.api.enableTextTrack(r.language,r.kind):this.api.disableTextTrack()});const t=()=>{this.api.off("loaded",t),this.#m()};this.api.on("loaded",t),this.api.on("bufferstart",()=>{this.#e&&(this.#e=!1,this.dispatchEvent(new Event("play"))),this.dispatchEvent(new Event("waiting"))}),this.api.on("play",()=>{this.#e&&(this.#e=!1,this.dispatchEvent(new Event("play")))}),this.api.on("playing",()=>{this.#a=3,this.#e=!1,this.dispatchEvent(new Event("playing"))}),this.api.on("seeking",()=>{this.#c=!0,this.onSeeking(),this.dispatchEvent(new Event("seeking"))}),this.api.on("seeked",async()=>{this.#c=!1,this.#t=await this.api.getCurrentTime().catch(()=>this.#t),this.dispatchEvent(new Event("seeked"))}),this.api.on("pause",()=>{this.#e=!0,this.dispatchEvent(new Event("pause"))}),this.api.on("ended",()=>{this.#e=!0,this.dispatchEvent(new Event("ended"))}),this.api.on("ratechange",({playbackRate:r})=>{this.#s=r,this.dispatchEvent(new Event("ratechange"))}),this.api.on("volumechange",async({volume:r})=>{this.#o=r,this.api&&(this.#i=await this.api.getMuted()),this.dispatchEvent(new Event("volumechange"))}),this.api.on("durationchange",({duration:r})=>{this.#n=r,this.dispatchEvent(new Event("durationchange"))}),this.api.on("timeupdate",({seconds:r})=>{const i=Math.round(r*100)/100;this.#t=i,this.dispatchEvent(new Event("timeupdate"))}),this.api.on("progress",({seconds:r})=>{this.#l=r,this.dispatchEvent(new Event("progress"))}),this.api.on("resize",({videoWidth:r,videoHeight:i})=>{this.#p=r,this.#v=i,this.dispatchEvent(new Event("resize"))})}async attributeChangedCallback(e,t,r){if(t!==r){switch(e){case"autoplay":case"controls":case"src":{this.load();return}}switch(await this.loadComplete,e){case"loop":{this.api.setLoop(this.loop);break}}}}async play(){var e;this.#e=!1,this.dispatchEvent(new Event("play")),await this.loadComplete;try{await((e=this.api)==null?void 0:e.play())}catch(t){throw this.#e=!0,this.dispatchEvent(new Event("pause")),t}}async pause(){var e;return await this.loadComplete,(e=this.api)==null?void 0:e.pause()}get ended(){return this.#t>=this.#n}get seeking(){return this.#c}get readyState(){return this.#a}get videoWidth(){return this.#p}get videoHeight(){return this.#v}get src(){return this.getAttribute("src")}set src(e){this.src!=e&&this.setAttribute("src",e)}get paused(){return this.#e}get duration(){return this.#n}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(e){this.autoplay!=e&&this.toggleAttribute("autoplay",!!e)}get buffered(){return this.#l>0?ye(0,this.#l):ye()}get controls(){return this.hasAttribute("controls")}set controls(e){this.controls!=e&&this.toggleAttribute("controls",!!e)}get currentTime(){return this.#t}set currentTime(e){this.currentTime!=e&&(this.#t=e,this.loadComplete.then(()=>{var t;(t=this.api)==null||t.setCurrentTime(e).catch(()=>{})}))}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.defaultMuted!=e&&this.toggleAttribute("muted",!!e)}get loop(){return this.hasAttribute("loop")}set loop(e){this.loop!=e&&this.toggleAttribute("loop",!!e)}get muted(){return this.#i}set muted(e){this.muted!=e&&(this.#i=e,this.loadComplete.then(()=>{var t;(t=this.api)==null||t.setMuted(e).catch(()=>{})}))}get playbackRate(){return this.#s}set playbackRate(e){this.playbackRate!=e&&(this.#s=e,this.loadComplete.then(()=>{var t;(t=this.api)==null||t.setPlaybackRate(e).catch(()=>{})}))}get playsInline(){return this.hasAttribute("playsinline")}set playsInline(e){this.playsInline!=e&&this.toggleAttribute("playsinline",!!e)}get poster(){return this.getAttribute("poster")}set poster(e){this.poster!=e&&this.setAttribute("poster",`${e}`)}get volume(){return this.#o}set volume(e){this.volume!=e&&(this.#o=e,this.loadComplete.then(()=>{var t;(t=this.api)==null||t.setVolume(e).catch(()=>{})}))}#y(e){if(Object.prototype.hasOwnProperty.call(this,e)){const t=this[e];delete this[e],this[e]=t}}}function ut(n){let e="";for(const t in n){const r=n[t];r===""?e+=` ${ae(t)}`:e+=` ${ae(t)}="${ae(`${r}`)}"`}return e}function ae(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}function ge(n){return String(new URLSearchParams(st(n)))}function st(n){let e={};for(let t in n){let r=n[t];r===!0||r===""?e[t]=1:r===!1?e[t]=0:r!=null&&(e[t]=r)}return e}function lt(n){let e={};for(let t of n)e[t.name]=t.value;return e}class oe extends Promise{constructor(e=()=>{}){let t,r;super((i,a)=>{e(i,a),t=i,r=a}),this.resolve=t,this.reject=r}}function ye(n,e){return Array.isArray(n)?ue(n):n==null||e==null||n===0&&e===0?ue([[0,0]]):ue([[n,e]])}function ue(n){return Object.defineProperties(n,{start:{value:e=>n[e][0]},end:{value:e=>n[e][1]}}),n}globalThis.customElements&&!globalThis.customElements.get("vimeo-video")&&globalThis.customElements.define("vimeo-video",Ae);var ct=Ae,ft=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),ht={className:"class",htmlFor:"for"};function Ne(n){return n.toLowerCase()}function we(n){if(typeof n=="boolean")return n?"":void 0;if(typeof n!="function"&&!(typeof n=="object"&&n!==null))return n}function dt({react:n,tagName:e,elementClass:t,events:r,displayName:i,defaultProps:a,toAttributeName:o=Ne,toAttributeValue:u=we}){const h=Number.parseInt(n.version)>=19,s=n.forwardRef((E,k)=>{var T,P;const g=n.useRef(null),_=n.useRef(new Map),O={},N={},m={},p={};for(const[f,v]of Object.entries(E)){if(ft.has(f)){m[f]=v;continue}const b=o(ht[f]??f);if(t.prototype&&f in t.prototype&&!(f in(((T=globalThis.HTMLElement)==null?void 0:T.prototype)??{}))&&!((P=t.observedAttributes)!=null&&P.some(y=>y===b))){p[f]=v;continue}if(f.startsWith("on")){O[f]=v;continue}const S=u(v);if(b&&S!=null&&(N[b]=String(S),h||(m[b]=S)),b&&h){const y=we(v);S!==y?m[b]=S:m[b]=v}}if(typeof window<"u"){for(const f in O){const v=O[f],b=f.endsWith("Capture"),S=(r?.[f]??f.slice(2).toLowerCase()).slice(0,b?-7:void 0);n.useLayoutEffect(()=>{const y=g?.current;if(!(!y||typeof v!="function"))return y.addEventListener(S,v,b),()=>{y.removeEventListener(S,v,b)}},[g?.current,v])}n.useLayoutEffect(()=>{if(g.current===null)return;const f=new Map;for(const v in p)be(g.current,v,p[v]),_.current.delete(v),f.set(v,p[v]);for(const[v,b]of _.current)be(g.current,v,void 0);_.current=f})}if(typeof window>"u"&&t?.getTemplateHTML&&t?.shadowRootOptions){const{mode:f,delegatesFocus:v}=t.shadowRootOptions,b=n.createElement("template",{shadowrootmode:f,shadowrootdelegatesfocus:v,dangerouslySetInnerHTML:{__html:t.getTemplateHTML(N,E)},key:"ce-la-react-ssr-template-shadow-root"});m.children=[b,m.children]}return n.createElement(e,{...a,...m,ref:n.useCallback(f=>{g.current=f,typeof k=="function"?k(f):k!==null&&(k.current=f)},[k])},m.children)});return s.displayName=i??t.name,s}function be(n,e,t){var r;n[e]=t,t==null&&e in(((r=globalThis.HTMLElement)==null?void 0:r.prototype)??{})&&n.removeAttribute(e)}var mt=dt({react:Re,tagName:"vimeo-video",elementClass:ct,toAttributeName(n){return n==="muted"?"":n==="defaultMuted"?"muted":Ne(n)}});export{mt as default}; //# sourceMappingURL=react-B4u19M0u.js.map