1import{al as ie,h as G,r as x,d as se,s as ae,aI as ue,v as Q,aJ as le,R as ce,aq as de,f as fe,j as he,b as $,c as me,H as pe,e as ge,o as Y}from"./a9uo9n0h.js";import we from"./BLgP_-Rl.js";const ye=typeof global<"u"&&{}.toString.call(global)==="[object global]",ve=typeof Bun<"u",be=typeof Deno<"u",Ee=typeof WebSocketPair=="function"&&typeof caches?.default<"u",Z=ye||ve||be||Ee;function J(r,e){return r.indexOf(e.toLowerCase())===0?r:`${e.toLowerCase()}${r.substr(0,1).toUpperCase()}${r.substr(1)}`}function Pe(r){return!!(r&&r.nodeType===1&&"nodeName"in r&&r.ownerDocument&&r.ownerDocument.defaultView)}function Te(r){return!isNaN(parseFloat(r))&&isFinite(r)&&Math.floor(r)==r}function R(r){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(r)}function K(r){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(r)}function ke(r){const e=(r||"").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),t=(e&&e[1]||"").replace("player.",""),n=[".videoji.hk",".vimeo.work",".videoji.cn"];for(const o of n)if(t.endsWith(o))return t;return"vimeo.com"}function ee(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const 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(Te(n))return`https://vimeo.com/${n}`;if(R(n))return n.replace("http:","https:");throw e?new TypeError(`â${e}â is not a valid video id.`):new TypeError(`â${n}â is not a vimeo.com url.`)}const X=function(r,e,t){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"addEventListener",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"removeEventListener";const i=typeof e=="string"?[e]:e;return i.forEach(s=>{r[n](s,t)}),{cancel:()=>i.forEach(s=>r[o](s,t))}};function U(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;if(!r||!e||typeof e.querySelectorAll!="function")return null;const t=e.querySelectorAll("iframe");for(let n=0;n<t.length;n++)if(t[n]&&t[n].contentWindow===r)return t[n];return null}const _e=typeof Array.prototype.indexOf<"u",Me=typeof window<"u"&&typeof window.postMessage<"u";if(!Z&&(!_e||!Me))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var D=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ce(r,e){return e={exports:{}},r(e,e.exports),e.exports}(function(r){if(r.WeakMap)return;var e=Object.prototype.hasOwnProperty,t=Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{value:1}).x===1}catch{}})(),n=function(i,s,l){t?Object.defineProperty(i,s,{configurable:!0,writable:!0,value:l}):i[s]=l};r.WeakMap=(function(){function i(){if(this===void 0)throw new TypeError("Constructor WeakMap requires 'new'");if(n(this,"_id",l("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}n(i.prototype,"delete",function(f){if(s(this,"delete"),!o(f))return!1;var w=f[this._id];return w&&w[0]===f?(delete f[this._id],!0):!1}),n(i.prototype,"get",function(f){if(s(this,"get"),!!o(f)){var w=f[this._id];if(w&&w[0]===f)return w[1]}}),n(i.prototype,"has",function(f){if(s(this,"has"),!o(f))return!1;var w=f[this._id];return!!(w&&w[0]===f)}),n(i.prototype,"set",function(f,w){if(s(this,"set"),!o(f))throw new TypeError("Invalid value used as weak map key");var E=f[this._id];return E&&E[0]===f?(E[1]=w,this):(n(f,this._id,[f,w]),this)});function s(f,w){if(!o(f)||!e.call(f,"_id"))throw new TypeError(w+" method called on incompatible receiver "+typeof f)}function l(f){return f+"_"+p()+"."+p()}function p(){return Math.random().toString().substring(2)}return n(i,"_polyfill",!0),i})();function o(i){return Object(i)===i}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:D);var M=Ce(function(r){(function(t,n,o){n[t]=n[t]||o(),r.exports&&(r.exports=n[t])})("Promise",D,function(){var t,n,o,i=Object.prototype.toString,s=typeof setImmediate<"u"?function(a){return setImmediate(a)}:setTimeout;try{Object.defineProperty({},"x",{}),t=function(a,u,c,m){return Object.defineProperty(a,u,{value:c,writable:!0,configurable:m!==!1})}}catch{t=function(u,c,m){return u[c]=m,u}}o=(function(){var a,u,c;function m(y,v){this.fn=y,this.self=v,this.next=void 0}return{add:function(v,C){c=new m(v,C),u?u.next=c:a=c,u=c,c=void 0},drain:function(){var v=a;for(a=u=n=void 0;v;)v.fn.call(v.self),v=v.next}}})();function l(d,a){o.add(d,a),n||(n=s(o.drain))}function p(d){var a,u=typeof d;return d!=null&&(u=="object"||u=="function")&&(a=d.then),typeof a=="function"?a:!1}function f(){for(var d=0;d<this.chain.length;d++)w(this,this.state===1?this.chain[d].success:this.chain[d].failure,this.chain[d]);this.chain.length=0}function w(d,a,u){var c,m;try{a===!1?u.reject(d.msg):(a===!0?c=d.msg:c=a.call(void 0,d.msg),c===u.promise?u.reject(TypeError("Promise-chain cycle")):(m=p(c))?m.call(c,u.resolve,u.reject):u.resolve(c))}catch(y){u.reject(y)}}function E(d){var a,u=this;if(!u.triggered){u.triggered=!0,u.def&&(u=u.def);try{(a=p(d))?l(function(){var c=new P(u);try{a.call(d,function(){E.apply(c,arguments)},function(){b.apply(c,arguments)})}catch(m){b.call(c,m)}}):(u.msg=d,u.state=1,u.chain.length>0&&l(f,u))}catch(c){b.call(new P(u),c)}}}function b(d){var a=this;a.triggered||(a.triggered=!0,a.def&&(a=a.def),a.msg=d,a.state=2,a.chain.length>0&&l(f,a))}function S(d,a,u,c){for(var m=0;m<a.length;m++)(function(v){d.resolve(a[v]).then(function(A){u(v,A)},c)})(m)}function P(d){this.def=d,this.triggered=!1}function V(d){this.promise=d,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function _(d){if(typeof d!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var a=new V(this);this.then=function(c,m){var y={success:typeof c=="function"?c:!0,failure:typeof m=="function"?m:!1};return y.promise=new this.constructor(function(C,A){if(typeof C!="function"||typeof A!="function")throw TypeError("Not a function");y.resolve=C,y.reject=A}),a.chain.push(y),a.state!==0&&l(f,a),y.promise},this.catch=function(c){return this.then(void 0,c)};try{d.call(void 0,function(c){E.call(a,c)},function(c){b.call(a,c)})}catch(u){b.call(a,u)}}var h=t({},"constructor",_,!1);return _.prototype=h,t(h,"__NPO__",0,!1),t(_,"resolve",function(a){var u=this;return a&&typeof a=="object"&&a.__NPO__===1?a:new u(function(m,y){if(typeof m!="function"||typeof y!="function")throw TypeError("Not a function");m(a)})}),t(_,"reject",function(a){return new this(function(c,m){if(typeof c!="function"||typeof m!="function")throw TypeError("Not a function");m(a)})}),t(_,"all",function(a){var u=this;return i.call(a)!="[object Array]"?u.reject(TypeError("Not an array")):a.length===0?u.resolve([]):new u(function(m,y){if(typeof m!="function"||typeof y!="function")throw TypeError("Not a function");var v=a.length,C=Array(v),A=0;S(u,a,function(g,T){C[g]=T,++A===v&&m(C)},y)})}),t(_,"race",function(a){var u=this;return i.call(a)!="[object Array]"?u.reject(TypeError("Not an array")):new u(function(m,y){if(typeof m!="function"||typeof y!="function")throw TypeError("Not a function");S(u,a,function(C,A){m(A)},y)})}),_})});const I=new WeakMap;function j(r,e,t){const n=I.get(r.element)||{};e in n||(n[e]=[]),n[e].push(t),I.set(r.element,n)}function L(r,e){return(I.get(r.element)||{})[e]||[]}function W(r,e,t){const n=I.get(r.element)||{};if(!n[e])return!0;
1if(!t)return n[e]=[],I.set(r.element,n),!0;const o=n[e].indexOf(t);return o!==-1&&n[e].splice(o,1),I.set(r.element,n),n[e]&&n[e].length===0}function Fe(r,e){const t=L(r,e);if(t.length<1)return!1;const n=t.shift();return W(r,e,n),n}function Ae(r,e){const t=I.get(r);I.set(e,t),I.delete(r)}function O(r){if(typeof r=="string")try{r=JSON.parse(r)}catch(e){return console.warn(e),{}}return r}function N(r,e,t){if(!r.element.contentWindow||!r.element.contentWindow.postMessage)return;let n={method:e};t!==void 0&&(n.value=t);const o=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1"));o>=8&&o<10&&(n=JSON.stringify(n)),r.element.contentWindow.postMessage(n,r.origin)}function xe(r,e){e=O(e);let t=[],n;if(e.event)e.event==="error"&&L(r,e.data.method).forEach(i=>{const s=new Error(e.data.message);s.name=e.data.name,i.reject(s),W(r,e.data.method,i)}),t=L(r,`event:${e.event}`),n=e.data;else if(e.method){const o=Fe(r,e.method);o&&(t.push(o),n=e.value)}t.forEach(o=>{try{if(typeof o=="function"){o.call(r,n);return}o.resolve(n)}catch{}})}const Se=["airplay","audio_tracks","audiotrack","autopause","autoplay","background","byline","cc","chapter_id","chapters","chromecast","color","colors","controls","disable_context_menu","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 te(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Se.reduce((t,n)=>{const o=r.getAttribute(`data-vimeo-${n}`);return(o||o==="")&&(t[n]=o===""?1:o),t},e)}function B(r,e){let{html:t}=r;if(!e)throw new TypeError("An element must be provided");if(e.getAttribute("data-vimeo-initialized")!==null)return e.querySelector("iframe");const n=document.createElement("div");return n.innerHTML=t,e.appendChild(n.firstChild),e.setAttribute("data-vimeo-initialized","true"),e.querySelector("iframe")}function ne(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2?arguments[2]:void 0;return new Promise((n,o)=>{if(!R(r))throw new TypeError(`â${r}â is not a vimeo.com url.`);let s=`https://${ke(r)}/api/oembed.json?url=${encodeURIComponent(r)}`;for(const p in e)e.hasOwnProperty(p)&&(s+=`&${p}=${encodeURIComponent(e[p])}`);const l="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;l.open("GET",s,!0),l.onload=function(){if(l.status===404){o(new Error(`â${r}â was not found.`));return}if(l.status===403){o(new Error(`â${r}â is not embeddable.`));return}try{const p=JSON.parse(l.responseText);if(p.domain_status_code===403){B(p,t),o(new Error(`â${r}â is not embeddable.`));return}n(p)}catch(p){o(p)}},l.onerror=function(){const p=l.status?` (${l.status})`:"";o(new Error(`There was an error fetching the embed code from Vimeo${p}.`))},l.send()})}function Re(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=[].slice.call(r.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")),t=n=>{"console"in window&&console.error&&console.error(`There was an error creating an embed: ${n}`)};e.forEach(n=>{try{if(n.getAttribute("data-vimeo-defer")!==null)return;const o=te(n),i=ee(o);ne(i,o,n).then(s=>B(s,n)).catch(t)}catch(o){t(o)}})}function Ie(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoPlayerResizeEmbeds_)return;window.VimeoPlayerResizeEmbeds_=!0;const e=t=>{if(!R(t.origin)||!t.data||t.data.event!=="spacechange")return;const n=t.source?U(t.source,r):null;if(n){const o=n.parentElement;o.style.paddingBottom=`${t.data.data[0].bottom}px`}};window.addEventListener("message",e)}function Ve(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoSeoMetadataAppended)return;window.VimeoSeoMetadataAppended=!0;const e=t=>{if(!R(t.origin))return;const n=O(t.data);if(!n||n.event!=="ready")return;const o=t.source?U(t.source,r):null;o&&K(o.src)&&new H(o).callMethod("appendVideoMetadata",window.location.href)};window.addEventListener("message",e)}function $e(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(window.VimeoCheckedUrlTimeParam)return;
1window.VimeoCheckedUrlTimeParam=!0;const e=n=>{"console"in window&&console.error&&console.error(`There was an error getting video Id: ${n}`)},t=n=>{if(!R(n.origin))return;const o=O(n.data);if(!o||o.event!=="ready")return;const i=n.source?U(n.source,r):null;if(i&&K(i.src)){const s=new H(i);s.getVideoId().then(l=>{const p=new RegExp(`[?&]vimeo_t_${l}=([^&#]*)`).exec(window.location.href);if(p&&p[1]){const f=decodeURI(p[1]);s.setCurrentTime(f)}}).catch(e)}};window.addEventListener("message",t)}function Ne(){if(window.VimeoDRMEmbedsUpdated)return;window.VimeoDRMEmbedsUpdated=!0;const r=e=>{if(!R(e.origin))return;const t=O(e.data);if(!t||t.event!=="drminitfailed")return;const n=e.source?U(e.source):null;if(!n)return;const o=n.getAttribute("allow")||"";if(!o.includes("encrypted-media")){n.setAttribute("allow",`${o}; encrypted-media`);const s=new URL(n.getAttribute("src"));s.searchParams.set("forcereload","drm"),n.setAttribute("src",s.toString());return}};window.addEventListener("message",r)}function qe(){const r=(function(){let n;const o=[["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"]];let i=0;const s=o.length,l={};for(;i<s;i++)if(n=o[i],n&&n[1]in document){for(i=0;i<n.length;i++)l[o[0][i]]=n[i];return l}return!1})(),e={fullscreenchange:r.fullscreenchange,fullscreenerror:r.fullscreenerror},t={request(n){return new Promise((o,i)=>{const s=function(){t.off("fullscreenchange",s),o()};t.on("fullscreenchange",s),n=n||document.documentElement;const l=n[r.requestFullscreen]();l instanceof Promise&&l.then(s).catch(i)})},exit(){return new Promise((n,o)=>{if(!t.isFullscreen){n();return}const i=function(){t.off("fullscreenchange",i),n()};t.on("fullscreenchange",i);const s=document[r.exitFullscreen]();s instanceof Promise&&s.then(i).catch(o)})},on(n,o){const i=e[n];i&&document.addEventListener(i,o)},off(n,o){const i=e[n];i&&document.removeEventListener(i,o)}};return Object.defineProperties(t,{isFullscreen:{get(){return!!document[r.fullscreenElement]}},element:{enumerable:!0,get(){return document[r.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[r.fullscreenEnabled]}}}),t}const De={role:"viewer",autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1};
1class je extends EventTarget{logger;constructor(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;super(),this.logger=o,this.init(t,e,{...De,...n})}disconnect(){this.dispatchEvent(new Event("disconnect"))}async init(e,t,n){if(await this.waitForTOReadyState(e,"open"),n.role==="viewer"){await this.updatePlayer(e,t,n);const o=X(e,"change",()=>this.updatePlayer(e,t,n)),i=this.maintainPlaybackPosition(e,t,n);this.addEventListener("disconnect",()=>{i.cancel(),o.cancel()})}else{await this.updateTimingObject(e,t);const o=X(t,["seeked","play","pause","ratechange"],()=>this.updateTimingObject(e,t),"on","off");this.addEventListener("disconnect",()=>o.cancel())}}async updateTimingObject(e,t){const[n,o,i]=await Promise.all([t.getCurrentTime(),t.getPaused(),t.getPlaybackRate()]);e.update({position:n,velocity:o?0:i})}async updatePlayer(e,t,n){const{position:o,velocity:i}=e.query();typeof o=="number"&&t.setCurrentTime(o),typeof i=="number"&&(i===0?await t.getPaused()===!1&&t.pause():i>0&&(await t.getPaused()===!0&&(await t.play().catch(async s=>{s.name==="NotAllowedError"&&n.autoPlayMuted&&(await t.setMuted(!0),await t.play().catch(l=>console.error("Couldn't play the video from TimingSrcConnector. Error:",l)))}),this.updatePlayer(e,t,n)),await t.getPlaybackRate()!==i&&t.setPlaybackRate(i)))}maintainPlaybackPosition(e,t,n){const{allowedDrift:o,maxAllowedDrift:i,minCheckInterval:s,maxRateAdjustment:l,maxTimeToCatchUp:p}=n,f=Math.min(p,Math.max(s,i))*1e3,w=async()=>{if(e.query().velocity===0||await t.getPaused()===!0)return;const b=e.query().position-await t.getCurrentTime(),S=Math.abs(b);if(this.log(`Drift: ${b}`),S>i)await this.adjustSpeed(t,0),t.setCurrentTime(e.query().position),this.log("Resync by currentTime");else if(S>o){const P=S/p,V=l,_=P<V?(V-P)/2:V;await this.adjustSpeed(t,_*Math.sign(b)),this.log("Resync by playbackRate")}},E=setInterval(()=>w(),f);return{cancel:()=>clearInterval(E)}}log(e){this.logger?.(`TimingSrcConnector: ${e}`)}speedAdjustment=0;adjustSpeed=async(e,t)=>{if(this.speedAdjustment===t)return;const n=await e.getPlaybackRate()-this.speedAdjustment+t;this.log(`New playbackRate: ${n}`),await e.setPlaybackRate(n),this.speedAdjustment=t};waitForTOReadyState(e,t){return new Promise(n=>{const o=()=>{e.readyState===t?n():e.addEventListener("readystatechange",o,{once:!0})};o()})}}const q=new WeakMap,z=new WeakMap;let k={};class H{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(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)),!Pe(e))throw new TypeError("You must pass either a valid element or a valid id.");if(e.nodeName!=="IFRAME"){const o=e.querySelector("iframe");o&&(e=o)}if(e.nodeName==="IFRAME"&&!R(e.getAttribute("src")||""))throw new Error("The player element passed isnât a Vimeo embed.");if(q.has(e))return q.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin="*";const n=new M((o,i)=>{if(this._onMessage=s=>{if(!R(s.origin)||this.element.contentWindow!==s.source)return;this.origin==="*"&&(this.origin=s.origin);const l=O(s.data);if(l&&l.event==="error"&&l.data&&l.data.method==="ready"){const b=new Error(l.data.message);b.name=l.data.name,i(b);return}const w=l&&l.event==="ready",E=l&&l.method==="ping";if(w||E){this.element.setAttribute("data-ready","true"),o();return}xe(this,l)},this._window.addEventListener("message",this._onMessage),this.element.nodeName!=="IFRAME"){const s=te(e,t),l=ee(s);ne(l,s,e).then(p=>{const f=B(p,e);return this.element=f,this._originalElement=e,Ae(e,f),q.set(this.element,this),p}).catch(i)}});if(z.set(this,n),q.set(this.element,this),this.element.nodeName==="IFRAME"&&N(this,"ping"),k.isEnabled){const o=()=>k.exit();this.fullscreenchangeHandler=()=>{k.isFullscreen?j(this,"event:exitFullscreen",o):W(this,"event:exitFullscreen",o),this.ready().then(()=>{N(this,"fullscreenchange",k.isFullscreen)})},k.on("fullscreenchange",this.fullscreenchangeHandler)}return this}static isVimeoUrl(e){return R(e)}callMethod(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];
1if(e==null)throw new TypeError("You must pass a method name.");return new M((i,s)=>this.ready().then(()=>{j(this,e,{resolve:i,reject:s}),n.length===0?n={}:n.length===1&&(n=n[0]),N(this,e,n)}).catch(s))}get(e){return new M((t,n)=>(e=J(e,"get"),this.ready().then(()=>{j(this,e,{resolve:t,reject:n}),N(this,e)}).catch(n)))}set(e,t){return new M((n,o)=>{if(e=J(e,"set"),t==null)throw new TypeError("There must be a value to set.");return this.ready().then(()=>{j(this,e,{resolve:n,reject:o}),N(this,e,t)}).catch(o)})}on(e,t){if(!e)throw new TypeError("You must pass an event name.");if(!t)throw new TypeError("You must pass a callback function.");if(typeof t!="function")throw new TypeError("The callback must be a function.");L(this,`event:${e}`).length===0&&this.callMethod("addEventListener",e).catch(()=>{}),j(this,`event:${e}`,t)}off(e,t){if(!e)throw new TypeError("You must pass an event name.");if(t&&typeof t!="function")throw new TypeError("The callback must be a function.");W(this,`event:${e}`,t)&&this.callMethod("removeEventListener",e).catch(o=>{})}loadVideo(e){return this.callMethod("loadVideo",e)}ready(){const e=z.get(this)||new M((t,n)=>{n(new Error("Unknown player. Probably unloaded."))});return M.resolve(e)}addCuePoint(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod("addCuePoint",{time:e,data:t})}removeCuePoint(e){return this.callMethod("removeCuePoint",e)}enableTextTrack(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:e,kind:t,showing:n})}disableTextTrack(){return this.callMethod("disableTextTrack")}selectAudioTrack(e,t){if(!e)throw new TypeError("You must pass a language.");return this.callMethod("selectAudioTrack",{language:e,kind:t})}selectDefaultAudioTrack(){return this.callMethod("selectDefaultAudioTrack")}pause(){return this.callMethod("pause")}play(){return this.callMethod("play")}requestFullscreen(){return k.isEnabled?k.request(this.element):this.callMethod("requestFullscreen")}exitFullscreen(){return k.isEnabled?k.exit():this.callMethod("exitFullscreen")}getFullscreen(){return k.isEnabled?M.resolve(k.isFullscreen):this.get("fullscreen")}requestPictureInPicture(){return this.callMethod("requestPictureInPicture")}exitPictureInPicture(){return this.callMethod("exitPictureInPicture")}getPictureInPicture(){return this.get("pictureInPicture")}remotePlaybackPrompt(){return this.callMethod("remotePlaybackPrompt")}unload(){return this.callMethod("unload")}destroy(){return new M(e=>{if(z.delete(this),q.delete(this.element),this._originalElement&&(q.delete(this._originalElement),this._originalElement.removeAttribute("data-vimeo-initialized")),this.element&&this.element.nodeName==="IFRAME"&&this.element.parentNode&&(this.element.parentNode.parentNode&&this._originalElement&&this._originalElement!==this.element.parentNode?this.element.parentNode.parentNode.removeChild(this.element.parentNode):this.element.parentNode.removeChild(this.element)),this.element&&this.element.nodeName==="DIV"&&this.element.parentNode){this.element.removeAttribute("data-vimeo-initialized");const t=this.element.querySelector("iframe");t&&t.parentNode&&(t.parentNode.parentNode&&this._originalElement&&this._originalElement!==t.parentNode?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))}this._window.removeEventListener("message",this._onMessage),k.isEnabled&&k.off("fullscreenchange",this.fullscreenchangeHandler),e()})}getAutopause(){return this.get("autopause")}setAutopause(e){return this.set("autopause",e)}getBuffered(){return this.get("buffered")}getCameraProps(){return this.get("cameraProps")}setCameraProps(e){return this.set("cameraProps",e)}getChapters(){return this.get("chapters")}getCurrentChapter(){return this.get("currentChapter")}getColor(){return this.get("color")}getColors(){return M.all([this.get("colorOne"),this.get("colorTwo"),this.get("colorThree"),this.get("colorFour")])}setColor(e){return this.set("color",e)}setColors(e){if(!Array.isArray(e))return new M((o,i)=>i(new TypeError("Argument must be an array.")));const t=new M(o=>o(null)),n=[e[0]?this.set("colorOne",e[0]):t,e[1]?this.set("colorTwo",e[1]):t,e[2]?this.set("colorThree",e[2]):t,e[3]?this.set("colorFour",e[3]):t];return M.all(n)}getCuePoints(){return this.get("cuePoints")}getCurrentTime(){return this.get("currentTime")}setCurrentTime(e){return this.set("currentTime",e)}
1getDuration(){return this.get("duration")}getEnded(){return this.get("ended")}getLoop(){return this.get("loop")}setLoop(e){return this.set("loop",e)}setMuted(e){return this.set("muted",e)}getMuted(){return this.get("muted")}getPaused(){return this.get("paused")}getPlaybackRate(){return this.get("playbackRate")}setPlaybackRate(e){return this.set("playbackRate",e)}getPlayed(){return this.get("played")}getQualities(){return this.get("qualities")}getQuality(){return this.get("quality")}setQuality(e){return this.set("quality",e)}getRemotePlaybackAvailability(){return this.get("remotePlaybackAvailability")}getRemotePlaybackState(){return this.get("remotePlaybackState")}getSeekable(){return this.get("seekable")}getSeeking(){return this.get("seeking")}getTextTracks(){return this.get("textTracks")}getAudioTracks(){return this.get("audioTracks")}getEnabledAudioTrack(){return this.get("enabledAudioTrack")}getDefaultAudioTrack(){return this.get("defaultAudioTrack")}getVideoEmbedCode(){return this.get("videoEmbedCode")}getVideoId(){return this.get("videoId")}getVideoTitle(){return this.get("videoTitle")}getVideoWidth(){return this.get("videoWidth")}getVideoHeight(){return this.get("videoHeight")}getVideoUrl(){return this.get("videoUrl")}getVolume(){return this.get("volume")}setVolume(e){return this.set("volume",e)}async setTimingSrc(e,t){if(!e)throw new TypeError("A Timing Object must be provided.");await this.ready();const n=new je(this,e,t);return N(this,"notifyTimingObjectConnect"),n.addEventListener("disconnect",()=>N(this,"notifyTimingObjectDisconnect")),n}}Z||(k=qe(),Re(),Ie(),Ve(),$e(),Ne());const Oe=ie("ui",{state:()=>({viewportActive:!0,isFullScreen:!1}),actions:{toggleViewportActive(r){this.viewportActive=r},toggleIsFullscreen(r){this.isFullScreen=r}}}),Le=()=>{const r=x(!1);return G(()=>{r.value="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}),{isTouch:r}},We=["src"],Ue=se({__name:"VimeoPlayer",props:{data:{},autoplay:{type:Boolean,default:!0},set_muted:{type:Boolean,default:!1},set_play:{type:Boolean,default:!1},controls:{type:Boolean,default:!0}},emits:["play","pause","ended"],setup(r,{expose:e,emit:t}){const n=Oe(),{viewportActive:o}=ae(n),{isTouch:i}=Le(),s=r,l=t,p=x(null),{isFullscreen:f,toggle:w}=ue(p),E=x(null),b=s.set_muted?x(0):x(100),S=x(0),P=x(!0),V=s.set_muted?x(!0):x(!1),_=x(!1);let h=null;const d=ge(()=>{const g=a(s.data.video||""),T=s.autoplay?1:0,F=V.value?1:0,oe=s.autoplay?1:0;return`https://player.vimeo.com/video/${g}?autoplay=${T}&loop=0&muted=${F}&controls=0&preload=auto&playsinline=1${oe?"&background=1":""}`}),a=g=>{if(!g)return;if(!g.includes("vimeo.com"))return g;const T=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/)([0-9]+)/,F=g.match(T);return F?F[1]:null},u=async()=>{if(h)if(i.value)try{await h.getFullscreen()?await h.exitFullscreen():await h.requestFullscreen()}catch{console.log("Vimeo fullscreen not supported")}else w().catch(()=>console.log("Fullscreen not supported"))},c=()=>{h&&h.getPaused().then(g=>{h&&(g?(h.play(),P.value=!0):(h.pause(),P.value=!1))})},m=()=>{h&&h.getVolume().then(g=>{h&&(g===0?(h.setVolume(1),b.value=100):(h.setVolume(0),b.value=0))})},y=g=>{if(!h)return;const T=g;h.getDuration().then(F=>{h?.setCurrentTime(T/100*F)})},v=g=>{h&&(b.value=g,h.setVolume(b.value/100))},C=()=>new Promise((g,T)=>{const F=document.createElement("script");F.src="https://player.vimeo.com/api/player.js",F.onload=g,F.onerror=T,document.head.appendChild(F)});Q(()=>s.set_play,()=>{c()});const A=le(p,{threshold:.25});return Q(A,g=>{h&&s.autoplay&&(V.value=!0,h.getPaused().then(T=>{h&&(g?(h.play(),P.value=!0):(h.pause(),P.value=!1))}))}),G(async()=>{if(await C(),await ce(),!E.value)return;_.value=s.controls,h=new H(E.value,{autoplay:s.autoplay});const g=window.innerWidth>768?"1080p":"720p";h.setQuality(g).catch(()=>{console.log("Could not set quality.")}),h.on("timeupdate",T=>{S.value=T.seconds/T.duration*100}),h.on("play",()=>{P.value=!0,l("play")}),h.on("pause",()=>{P.value=!1,l("pause")}),h.on("ended",()=>{P.value=!1,l("ended")})}),de(()=>{h&&h.unload()}),e({pause:()=>{h?.pause().catch(()=>{})}}),(g,T)=>(Y(),fe("div",{ref_key:"wrapper",ref:p,onDblclick:u,class:"video__player group/video relative aspect-video w-full overflow-hidden"},[he("iframe",{ref_key:"vimeoPlayerIframe",ref:E,src:$(d),class:"pointer-events-auto absolute top-1/2 left-1/2 z-1 h-[57vw]! min-h-full w-[160.5vh] min-w-full -translate-x-1/2 -translate-y-1/2",frameborder:"0",allow:"accelerometer; autoplay; gyroscope; encrypted-media; picture-in-picture;",allowfullscreen:"true",loading:"lazy",playsinline:""},null,8,We),$(_)?(Y(),me(we,{key:0,"is-playing":$(P),volume:$(b),progress:$(S),"is-full-screen":$(f),"viewport-active":$(o),onPlayPause:c,onMuteToggle:m,onVolumeChange:v,onSeek:y,onFullscreenToggle:u},null,8,["is-playing","volume","progress","is-full-screen","viewport-active"])):pe("",!0)],544))}}),He=Object.assign(Ue,{__name:"LayoutElementsVideoVimeoPlayer"});export{He as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.