UNPKG

@vime/core

Version:

Customizable, extensible, accessible and framework agnostic media player.

1 lines 1.11 kB
import{g as n}from"./p-aa8acb66.js";import{f as o,e as t,l as r}from"./p-b018976f.js";import{g as i}from"./p-152748b8.js";const e=(o,t)=>function(o,t,r){void 0===r&&(r=!0);var i="Function"===o.constructor.name?o.prototype:o,e=i.componentWillLoad;i.componentWillLoad=function(){var o,i=this,s=n(this),u={promise:new Promise((function(n){o=n})),resolve:o},c=new CustomEvent("openWormhole",{bubbles:!0,composed:!0,detail:{consumer:this,fields:t,updater:function(n,o){(n in s?s:i)[n]=o},onOpen:u}});s.dispatchEvent(c);var a=function(){if(e)return e.call(i)};return r?u.promise.then((function(){return a()})):a()}}(o,t),s=(n,e,s,u)=>{return c=void 0,a=void 0,m=function*(){const c=null!=u?u:yield o(n),a=t(c)?[]:e.map((n=>{const o=i(n);return r(c,o,(()=>{s(n,c[n])}))}));return()=>{a.forEach((n=>n()))}},new((f=void 0)||(f=Promise))((function(n,o){function t(n){try{i(m.next(n))}catch(n){o(n)}}function r(n){try{i(m.throw(n))}catch(n){o(n)}}function i(o){var i;o.done?n(o.value):(i=o.value,i instanceof f?i:new f((function(n){n(i)}))).then(t,r)}i((m=m.apply(c,a||[])).next())}));var c,a,f,m};export{s as u,e as w}