@vime-js/lite
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -6,2 +6,15 @@ # Change Log | ||
## [1.5.1](https://github.com/vime-js/vime/tree/master/packages/vime-lite/compare/v1.5.0...v1.5.1) (2020-04-26) | ||
### Bug Fixes | ||
* **standard:** audio player not visible ([00f2c90](https://github.com/vime-js/vime/tree/master/packages/vime-lite/commit/00f2c90219c9f7d1923235184923df1addc4d8e1)) | ||
* vimeo controls are not being hidden ([3690633](https://github.com/vime-js/vime/tree/master/packages/vime-lite/commit/36906336f94aebe31a97fcfa860036f2bf5525da)), closes [#32](https://github.com/vime-js/vime/tree/master/packages/vime-lite/issues/32) | ||
* **lite:** vimeo embed is not responsive ([d74b846](https://github.com/vime-js/vime/tree/master/packages/vime-lite/commit/d74b846ca80d783152446612ccabf8dbe48c9aad)), closes [#31](https://github.com/vime-js/vime/tree/master/packages/vime-lite/issues/31) | ||
# [1.5.0](https://github.com/vime-js/vime/tree/master/packages/vime-lite/compare/v1.4.4...v1.5.0) (2020-04-12) | ||
@@ -8,0 +21,0 @@ |
@@ -498,3 +498,3 @@ function noop() { } | ||
/* src/Embed.svelte generated by Svelte v3.20.1 */ | ||
/* src/Embed.svelte generated by Svelte v3.21.0 */ | ||
@@ -705,3 +705,3 @@ function add_css() { | ||
/* src/Lazy.svelte generated by Svelte v3.20.1 */ | ||
/* src/Lazy.svelte generated by Svelte v3.21.0 */ | ||
@@ -815,8 +815,8 @@ function add_css$1() { | ||
/* src/PlayerWrapper.svelte generated by Svelte v3.20.1 */ | ||
/* src/PlayerWrapper.svelte generated by Svelte v3.21.0 */ | ||
function add_css$2() { | ||
var style = element("style"); | ||
style.id = "svelte-db7j6d-style"; | ||
style.textContent = "div.svelte-db7j6d{position:relative}.bg.svelte-db7j6d{background:#000}"; | ||
style.id = "svelte-1gc7ub8-style"; | ||
style.textContent = "div.svelte-1gc7ub8{position:relative}.video.svelte-1gc7ub8{height:0;overflow:hidden;background:#000}"; | ||
append(document.head, style); | ||
@@ -926,4 +926,4 @@ } | ||
if (default_slot) default_slot.c(); | ||
attr(div, "class", "svelte-db7j6d"); | ||
toggle_class(div, "bg", !is_null(/*aspectRatio*/ ctx[0])); | ||
attr(div, "class", "svelte-1gc7ub8"); | ||
toggle_class(div, "video", !is_null(/*aspectRatio*/ ctx[0])); | ||
}, | ||
@@ -952,3 +952,3 @@ m(target, anchor, remount) { | ||
if (dirty & /*is_null, aspectRatio*/ 1) { | ||
toggle_class(div, "bg", !is_null(/*aspectRatio*/ ctx[0])); | ||
toggle_class(div, "video", !is_null(/*aspectRatio*/ ctx[0])); | ||
} | ||
@@ -994,3 +994,6 @@ }, | ||
if_block.p(ctx, dirty); | ||
transition_in(if_block, 1); | ||
if (dirty & /*intersecting*/ 128) { | ||
transition_in(if_block, 1); | ||
} | ||
} else { | ||
@@ -1126,3 +1129,3 @@ if_block = create_if_block_1(ctx); | ||
super(); | ||
if (!document.getElementById("svelte-db7j6d-style")) add_css$2(); | ||
if (!document.getElementById("svelte-1gc7ub8-style")) add_css$2(); | ||
init(this, options, instance$2, create_fragment$2, safe_not_equal, { aspectRatio: 0, isEnabled: 1 }); | ||
@@ -1132,3 +1135,3 @@ } | ||
/* src/LitePlayer.svelte generated by Svelte v3.20.1 */ | ||
/* src/LitePlayer.svelte generated by Svelte v3.21.0 */ | ||
@@ -1139,20 +1142,20 @@ function create_default_slot$1(ctx) { | ||
let embed_1_props = { | ||
params: /*params*/ ctx[0], | ||
decoder: /*decoder*/ ctx[7], | ||
preconnections: /*preconnections*/ ctx[8], | ||
src: /*embedURL*/ ctx[5], | ||
title: /*iframeTitle*/ ctx[6], | ||
origin: /*origin*/ ctx[4] | ||
decoder: /*decoder*/ ctx[6], | ||
preconnections: /*preconnections*/ ctx[7], | ||
src: /*embedURL*/ ctx[4], | ||
params: /*allParams*/ ctx[9], | ||
title: /*iframeTitle*/ ctx[5], | ||
origin: /*origin*/ ctx[3] | ||
}; | ||
const embed_1 = new Embed({ props: embed_1_props }); | ||
/*embed_1_binding*/ ctx[30](embed_1); | ||
embed_1.$on("load", /*load_handler*/ ctx[31]); | ||
embed_1.$on("data", /*data_handler*/ ctx[32]); | ||
embed_1.$on("message", /*message_handler*/ ctx[33]); | ||
embed_1.$on("rebuild", /*rebuild_handler*/ ctx[34]); | ||
/*embed_1_binding*/ ctx[32](embed_1); | ||
embed_1.$on("load", /*load_handler*/ ctx[33]); | ||
embed_1.$on("data", /*data_handler*/ ctx[34]); | ||
embed_1.$on("message", /*message_handler*/ ctx[35]); | ||
embed_1.$on("rebuild", /*rebuild_handler*/ ctx[36]); | ||
embed_1.$on("load", /*onLoad*/ ctx[11]); | ||
embed_1.$on("data", function () { | ||
if (is_function(/*onData*/ ctx[9])) /*onData*/ ctx[9].apply(this, arguments); | ||
if (is_function(/*onData*/ ctx[8])) /*onData*/ ctx[8].apply(this, arguments); | ||
}); | ||
@@ -1173,8 +1176,8 @@ | ||
const embed_1_changes = {}; | ||
if (dirty[0] & /*params*/ 1) embed_1_changes.params = /*params*/ ctx[0]; | ||
if (dirty[0] & /*decoder*/ 128) embed_1_changes.decoder = /*decoder*/ ctx[7]; | ||
if (dirty[0] & /*preconnections*/ 256) embed_1_changes.preconnections = /*preconnections*/ ctx[8]; | ||
if (dirty[0] & /*embedURL*/ 32) embed_1_changes.src = /*embedURL*/ ctx[5]; | ||
if (dirty[0] & /*iframeTitle*/ 64) embed_1_changes.title = /*iframeTitle*/ ctx[6]; | ||
if (dirty[0] & /*origin*/ 16) embed_1_changes.origin = /*origin*/ ctx[4]; | ||
if (dirty[0] & /*decoder*/ 64) embed_1_changes.decoder = /*decoder*/ ctx[6]; | ||
if (dirty[0] & /*preconnections*/ 128) embed_1_changes.preconnections = /*preconnections*/ ctx[7]; | ||
if (dirty[0] & /*embedURL*/ 16) embed_1_changes.src = /*embedURL*/ ctx[4]; | ||
if (dirty[0] & /*allParams*/ 512) embed_1_changes.params = /*allParams*/ ctx[9]; | ||
if (dirty[0] & /*iframeTitle*/ 32) embed_1_changes.title = /*iframeTitle*/ ctx[5]; | ||
if (dirty[0] & /*origin*/ 8) embed_1_changes.origin = /*origin*/ ctx[3]; | ||
embed_1.$set(embed_1_changes); | ||
@@ -1192,3 +1195,3 @@ }, | ||
d(detaching) { | ||
/*embed_1_binding*/ ctx[30](null); | ||
/*embed_1_binding*/ ctx[32](null); | ||
destroy_component(embed_1, detaching); | ||
@@ -1204,4 +1207,4 @@ } | ||
props: { | ||
aspectRatio: /*aspectRatio*/ ctx[2], | ||
isEnabled: /*hasWrapper*/ ctx[1], | ||
aspectRatio: /*aspectRatio*/ ctx[1], | ||
isEnabled: /*hasWrapper*/ ctx[0], | ||
$$slots: { default: [create_default_slot$1] }, | ||
@@ -1222,6 +1225,6 @@ $$scope: { ctx } | ||
const playerwrapper_changes = {}; | ||
if (dirty[0] & /*aspectRatio*/ 4) playerwrapper_changes.aspectRatio = /*aspectRatio*/ ctx[2]; | ||
if (dirty[0] & /*hasWrapper*/ 2) playerwrapper_changes.isEnabled = /*hasWrapper*/ ctx[1]; | ||
if (dirty[0] & /*aspectRatio*/ 2) playerwrapper_changes.aspectRatio = /*aspectRatio*/ ctx[1]; | ||
if (dirty[0] & /*hasWrapper*/ 1) playerwrapper_changes.isEnabled = /*hasWrapper*/ ctx[0]; | ||
if (dirty[0] & /*params, decoder, preconnections, embedURL, iframeTitle, origin, embed, onData*/ 1017 | dirty[1] & /*$$scope*/ 16) { | ||
if (dirty[0] & /*decoder, preconnections, embedURL, allParams, iframeTitle, origin, embed, onData*/ 1020 | dirty[1] & /*$$scope*/ 64) { | ||
playerwrapper_changes.$$scope = { dirty, ctx }; | ||
@@ -1268,2 +1271,3 @@ } | ||
let { aspectRatio = "16:9" } = $$props; | ||
let { ignoreDefaultParams = false } = $$props; | ||
const getOrigin = () => origin; | ||
@@ -1295,6 +1299,6 @@ const getEmbed = () => embed; | ||
ready = deferred(); | ||
$$invalidate(24, initialized = false); | ||
$$invalidate(26, initialized = false); | ||
ready.promise.then(() => { | ||
$$invalidate(24, initialized = true); | ||
$$invalidate(26, initialized = true); | ||
dispatch(Event.READY); | ||
@@ -1307,3 +1311,3 @@ }).catch(e => { | ||
const onSrcChange = () => { | ||
$$invalidate(22, mediaTitle = null); | ||
$$invalidate(24, mediaTitle = null); | ||
}; | ||
@@ -1319,3 +1323,3 @@ | ||
Provider.resolveReadyState(data, ready, sendCommand); | ||
if (!mediaTitle) $$invalidate(22, mediaTitle = Provider.extractMediaTitle(data)); | ||
if (!mediaTitle) $$invalidate(24, mediaTitle = Provider.extractMediaTitle(data)); | ||
}; | ||
@@ -1327,3 +1331,3 @@ | ||
binding_callbacks[$$value ? "unshift" : "push"](() => { | ||
$$invalidate(3, embed = $$value); | ||
$$invalidate(2, embed = $$value); | ||
}); | ||
@@ -1350,7 +1354,8 @@ } | ||
if ("src" in $$props) $$invalidate(12, src = $$props.src); | ||
if ("params" in $$props) $$invalidate(0, params = $$props.params); | ||
if ("providers" in $$props) $$invalidate(13, providers = $$props.providers); | ||
if ("cookies" in $$props) $$invalidate(14, cookies = $$props.cookies); | ||
if ("hasWrapper" in $$props) $$invalidate(1, hasWrapper = $$props.hasWrapper); | ||
if ("aspectRatio" in $$props) $$invalidate(2, aspectRatio = $$props.aspectRatio); | ||
if ("params" in $$props) $$invalidate(13, params = $$props.params); | ||
if ("providers" in $$props) $$invalidate(14, providers = $$props.providers); | ||
if ("cookies" in $$props) $$invalidate(15, cookies = $$props.cookies); | ||
if ("hasWrapper" in $$props) $$invalidate(0, hasWrapper = $$props.hasWrapper); | ||
if ("aspectRatio" in $$props) $$invalidate(1, aspectRatio = $$props.aspectRatio); | ||
if ("ignoreDefaultParams" in $$props) $$invalidate(16, ignoreDefaultParams = $$props.ignoreDefaultParams); | ||
}; | ||
@@ -1365,2 +1370,3 @@ | ||
let onData; | ||
let allParams; | ||
@@ -1372,16 +1378,16 @@ $$self.$$.update = () => { | ||
if ($$self.$$.dirty[0] & /*providers, src*/ 12288) { | ||
$$invalidate(25, Provider = providers.find(p => p.canPlay(src))); | ||
if ($$self.$$.dirty[0] & /*providers, src*/ 20480) { | ||
$$invalidate(27, Provider = providers.find(p => p.canPlay(src))); | ||
} | ||
if ($$self.$$.dirty[0] & /*Provider, cookies*/ 33570816) { | ||
$$invalidate(4, origin = Provider ? Provider.buildOrigin(cookies) : null); | ||
if ($$self.$$.dirty[0] & /*Provider, cookies*/ 134250496) { | ||
$$invalidate(3, origin = Provider ? Provider.buildOrigin(cookies) : null); | ||
} | ||
if ($$self.$$.dirty[0] & /*Provider, src, cookies*/ 33574912) { | ||
$$invalidate(5, embedURL = Provider ? Provider.buildEmbedURL(src, cookies) : null); | ||
if ($$self.$$.dirty[0] & /*Provider, src, cookies*/ 134254592) { | ||
$$invalidate(4, embedURL = Provider ? Provider.buildEmbedURL(src, cookies) : null); | ||
} | ||
if ($$self.$$.dirty[0] & /*Provider, mediaTitle*/ 37748736) { | ||
$$invalidate(6, iframeTitle = Provider && mediaTitle | ||
if ($$self.$$.dirty[0] & /*Provider, mediaTitle*/ 150994944) { | ||
$$invalidate(5, iframeTitle = Provider && mediaTitle | ||
? `${Provider.name} - ${mediaTitle || "Video Player"}` | ||
@@ -1391,14 +1397,20 @@ : null); | ||
if ($$self.$$.dirty[0] & /*Provider*/ 33554432) { | ||
$$invalidate(7, decoder = Provider ? Provider.decoder : null); | ||
if ($$self.$$.dirty[0] & /*Provider*/ 134217728) { | ||
$$invalidate(6, decoder = Provider ? Provider.decoder : null); | ||
} | ||
if ($$self.$$.dirty[0] & /*Provider*/ 33554432) { | ||
$$invalidate(8, preconnections = Provider ? Provider.preconnections : []); | ||
if ($$self.$$.dirty[0] & /*Provider*/ 134217728) { | ||
$$invalidate(7, preconnections = Provider ? Provider.preconnections : []); | ||
} | ||
if ($$self.$$.dirty[0] & /*initialized, mediaTitle*/ 20971520) { | ||
$$invalidate(9, onData = !initialized || !mediaTitle ? onDataHandler : null); | ||
if ($$self.$$.dirty[0] & /*initialized, mediaTitle*/ 83886080) { | ||
$$invalidate(8, onData = !initialized || !mediaTitle ? onDataHandler : null); | ||
} | ||
if ($$self.$$.dirty[0] & /*ignoreDefaultParams, Provider, params*/ 134291456) { | ||
$$invalidate(9, allParams = !ignoreDefaultParams && Provider && Provider.defaultParams | ||
? { ...Provider.defaultParams, ...params } | ||
: params); | ||
} | ||
if ($$self.$$.dirty[0] & /*src*/ 4096) { | ||
@@ -1408,11 +1420,11 @@ dispatch(Event.SRC_CHANGE, src); | ||
if ($$self.$$.dirty[0] & /*mediaTitle*/ 4194304) { | ||
if ($$self.$$.dirty[0] & /*mediaTitle*/ 16777216) { | ||
dispatch(Event.TITLE_CHANGE, mediaTitle); | ||
} | ||
if ($$self.$$.dirty[0] & /*origin*/ 16) { | ||
if ($$self.$$.dirty[0] & /*origin*/ 8) { | ||
dispatch(Event.ORIGIN_CHANGE, origin); | ||
} | ||
if ($$self.$$.dirty[0] & /*embedURL*/ 32) { | ||
if ($$self.$$.dirty[0] & /*embedURL*/ 16) { | ||
dispatch(Event.EMBED_URL_CHANGE, embedURL); | ||
@@ -1423,3 +1435,2 @@ } | ||
return [ | ||
params, | ||
hasWrapper, | ||
@@ -1434,7 +1445,10 @@ aspectRatio, | ||
onData, | ||
allParams, | ||
onReload, | ||
onLoad, | ||
src, | ||
params, | ||
providers, | ||
cookies, | ||
ignoreDefaultParams, | ||
getOrigin, | ||
@@ -1475,14 +1489,15 @@ getEmbed, | ||
src: 12, | ||
params: 0, | ||
providers: 13, | ||
cookies: 14, | ||
hasWrapper: 1, | ||
aspectRatio: 2, | ||
getOrigin: 15, | ||
getEmbed: 16, | ||
getEmbedURL: 17, | ||
getTitle: 18, | ||
getProvider: 19, | ||
getMediaId: 20, | ||
sendCommand: 21 | ||
params: 13, | ||
providers: 14, | ||
cookies: 15, | ||
hasWrapper: 0, | ||
aspectRatio: 1, | ||
ignoreDefaultParams: 16, | ||
getOrigin: 17, | ||
getEmbed: 18, | ||
getEmbedURL: 19, | ||
getTitle: 20, | ||
getProvider: 21, | ||
getMediaId: 22, | ||
sendCommand: 23 | ||
}, | ||
@@ -1503,3 +1518,3 @@ [-1, -1] | ||
get params() { | ||
return this.$$.ctx[0]; | ||
return this.$$.ctx[13]; | ||
} | ||
@@ -1513,3 +1528,3 @@ | ||
get providers() { | ||
return this.$$.ctx[13]; | ||
return this.$$.ctx[14]; | ||
} | ||
@@ -1523,3 +1538,3 @@ | ||
get cookies() { | ||
return this.$$.ctx[14]; | ||
return this.$$.ctx[15]; | ||
} | ||
@@ -1533,3 +1548,3 @@ | ||
get hasWrapper() { | ||
return this.$$.ctx[1]; | ||
return this.$$.ctx[0]; | ||
} | ||
@@ -1543,3 +1558,3 @@ | ||
get aspectRatio() { | ||
return this.$$.ctx[2]; | ||
return this.$$.ctx[1]; | ||
} | ||
@@ -1552,28 +1567,37 @@ | ||
get ignoreDefaultParams() { | ||
return this.$$.ctx[16]; | ||
} | ||
set ignoreDefaultParams(ignoreDefaultParams) { | ||
this.$set({ ignoreDefaultParams }); | ||
flush(); | ||
} | ||
get getOrigin() { | ||
return this.$$.ctx[15]; | ||
return this.$$.ctx[17]; | ||
} | ||
get getEmbed() { | ||
return this.$$.ctx[16]; | ||
return this.$$.ctx[18]; | ||
} | ||
get getEmbedURL() { | ||
return this.$$.ctx[17]; | ||
return this.$$.ctx[19]; | ||
} | ||
get getTitle() { | ||
return this.$$.ctx[18]; | ||
return this.$$.ctx[20]; | ||
} | ||
get getProvider() { | ||
return this.$$.ctx[19]; | ||
return this.$$.ctx[21]; | ||
} | ||
get getMediaId() { | ||
return this.$$.ctx[20]; | ||
return this.$$.ctx[22]; | ||
} | ||
get sendCommand() { | ||
return this.$$.ctx[21]; | ||
return this.$$.ctx[23]; | ||
} | ||
@@ -1647,3 +1671,3 @@ } | ||
const FILE_URL = /vimeo\.com\/external\/[0-9]+\..+/; | ||
const BLANK_SRC_ID = '390460225'; | ||
const BLANK_SRC_ID = '411655713'; | ||
@@ -1678,2 +1702,5 @@ const PRECONNECTIONS$1 = [ | ||
extractMediaId: extract_media_id$1, | ||
defaultParams: { | ||
transparent: false, | ||
}, | ||
onLoad: () => {}, | ||
@@ -1680,0 +1707,0 @@ buildOrigin: () => EMBED_ORIGIN, |
@@ -1,1 +0,1 @@ | ||
function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e,n,o){if(t){const r=c(t,e,n,o);return t[0](r)}}function c(t,e,n,o){return t[1]&&o?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](o(e))):n.ctx}function a(t,e,n,o){if(t[2]&&o){const r=t[2](o(n));if(void 0===e.dirty)return r;if("object"==typeof r){const t=[],n=Math.max(e.dirty.length,r.length);for(let o=0;o<n;o+=1)t[o]=e.dirty[o]|r[o];return t}return e.dirty|r}return e.dirty}function l(t,e){t.appendChild(e)}function d(t,e,n){t.insertBefore(e,n||null)}function u(t){t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function $(){return document.createTextNode("")}function m(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function h(t,e,n){t.classList[n?"add":"remove"](e)}let g;function y(t){g=t}function v(){if(!g)throw new Error("Function called outside component initialization");return g}function b(){const t=v();return(e,n)=>{const o=t.$$.callbacks[e];if(o){const r=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(e,n);o.slice().forEach(e=>{e.call(t,r)})}}}function w(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(t=>t(e))}const E=[],x=[],R=[],I=[],_=Promise.resolve();let C=!1;function M(){C||(C=!0,_.then(k))}function A(t){R.push(t)}let L=!1;const j=new Set;function k(){if(!L){L=!0;do{for(let t=0;t<E.length;t+=1){const e=E[t];y(e),O(e.$$)}for(E.length=0;x.length;)x.pop()();for(let t=0;t<R.length;t+=1){const e=R[t];j.has(e)||(j.add(e),e())}R.length=0}while(E.length);for(;I.length;)I.pop()();C=!1,L=!1,j.clear()}}function O(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(A)}}const P=new Set;let S;function N(){S={r:0,c:[],p:S}}function T(){S.r||o(S.c),S=S.p}function G(t,e){t&&t.i&&(P.delete(t),t.i(e))}function U(t,e,n,o){if(t&&t.o){if(P.has(t))return;P.add(t),S.c.push(()=>{P.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}function W(t){t&&t.c()}function B(t,n,i){const{fragment:s,on_mount:c,on_destroy:a,after_update:l}=t.$$;s&&s.m(n,i),A(()=>{const n=c.map(e).filter(r);a?a.push(...n):o(n),t.$$.on_mount=[]}),l.forEach(A)}function D(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function H(e,r,i,s,c,a,l=[-1]){const d=g;y(e);const p=r.props||{},$=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:n(),dirty:l};let m=!1;if($.ctx=i?i(e,p,(t,n,...o)=>{const r=o.length?o[0]:n;return $.ctx&&c($.ctx[t],$.ctx[t]=r)&&($.bound[t]&&$.bound[t](r),m&&function(t,e){-1===t.$$.dirty[0]&&(E.push(t),M(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(e,t)),n}):[],$.update(),m=!0,o($.before_update),$.fragment=!!s&&s($.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);$.fragment&&$.fragment.l(t),t.forEach(u)}else $.fragment&&$.fragment.c();r.intro&&G(e.$$.fragment),B(e,r.target,r.anchor),k()}y(d)}class V{$destroy(){D(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}const Y=(t,e,n=null)=>{t&&(t.style[e]=n)},F=t=>null===t,J=t=>F(t)||(t=>void 0===t)(t),q=t=>J(t)?null:t.constructor,z=t=>q(t)===Object,K=t=>q(t)===String,Q=t=>Array.isArray(t),X="undefined"!=typeof window,Z=X&&window.navigator.userAgent.toLowerCase(),tt=(Z&&/msie|trident/.test(Z),Z&&/iphone|ipad|ipod|ios/.test(Z),Z&&/android/.test(Z),Z&&Z.indexOf("edge/"),Z&&/chrome\/\d+/.test(Z),X&&/(iPhone|iPod)/gi.test(navigator.platform),(t,e="")=>{if(!X)return e;try{return window.decodeURIComponent(t)}catch(n){return e}}),et=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g,nt=(t,e,n)=>{if(!X)return!1;const o=p("link");return o.rel=t,o.href=e,n&&(o.as=n),o.crossorigin=!0,document.head.append(o),!0},ot=t=>{return!!(e=t)&&(z(e)||e.startsWith("{"))&&(t=>z(t)?t:function(t,e){try{return JSON.parse(t)}catch(n){return null}}(t))(t);var e},rt=()=>{let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}};function it(t,e){const n=e=>{if(!e)return void Y(t,"paddingBottom");const[n,o]=e.split(":");Y(t,"paddingBottom",`${100/n*o}%`)};return n(e),{update:n,destroy(){n(null)}}}function st(e){let n,r,i;return{c(){n=p("iframe"),f(n,"id",e[3]),f(n,"title",e[0]),n.src!==(r=e[2])&&f(n,"src",r),n.allowFullscreen="1",f(n,"allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),f(n,"class","svelte-jvy9c2")},m(t,r,s){d(t,n,r),e[18](n),s&&o(i),i=[m(window,"message",e[4]),m(n,"load",e[17])]},p(t,[e]){1&e&&f(n,"title",t[0]),4&e&&n.src!==(r=t[2])&&f(n,"src",r)},i:t,o:t,d(t){t&&u(n),e[18](null),o(i)}}}let ct=0;const at=[];function lt(t,e,n){let o=null,r=null;ct+=1;const i=`vime-embed-${ct}`,s=b(),c={SRC_CHANGE:"srcchange",MESSAGE:"message",DATA:"data",REBUILD:"rebuild"};let{src:a=null}=e,{title:l=null}=e,{params:d={}}=e,{origin:u=null}=e,{preconnections:p=[]}=e,{decoder:$=null}=e;const m=t=>!(!o||t.source!==o.contentWindow)&&K(u)&&u===t.origin;return t.$set=t=>{"src"in t&&n(5,a=t.src),"title"in t&&n(0,l=t.title),"params"in t&&n(6,d=t.params),"origin"in t&&n(7,u=t.origin),"preconnections"in t&&n(8,p=t.preconnections),"decoder"in t&&n(9,$=t.decoder)},t.$$.update=()=>{96&t.$$.dirty&&n(2,r=a?((t,e)=>((t,e)=>{if(!e)return t;const n=t.split("?",2);return n[0]+(n[1]?`?${n[1]}&${e}`:`?${e}`)})(t,(t=>{const e=[],n=(t,n)=>{e.push(`${encodeURIComponent(t)}=${encodeURIComponent(n)}`)};return Object.keys(t).forEach(e=>{const o=t[e];J(o)||(Q(o)?o.forEach(t=>n(e,t)):n(e,o))}),e.join("&")})(e)))(a,d):null),4&t.$$.dirty&&s(c.SRC_CHANGE,r),4&t.$$.dirty&&r&&s(c.REBUILD),6&t.$$.dirty&&(!r||o||at.includes(r)||nt("preconnect",r)&&at.push(r)),256&t.$$.dirty&&p.filter(t=>!at.includes(t)).forEach(t=>{nt("preconnect",t)&&at.push(t)})},[l,o,r,i,t=>{if(!m(t))return;s(c.MESSAGE,t);const e=$?$(t.data):null;e&&s(c.DATA,e)},a,d,u,p,$,()=>i,()=>o,()=>r,(t,e)=>{o&&o.contentWindow&&o.contentWindow.postMessage(JSON.stringify(t),e||u||"*")},s,c,m,function(e){w(t,e)},function(t){x[t?"unshift":"push"](()=>{n(1,o=t)})}]}class dt extends V{constructor(t){var e;super(),document.getElementById("svelte-jvy9c2-style")||((e=p("style")).id="svelte-jvy9c2-style",e.textContent="iframe.svelte-jvy9c2{position:absolute;top:0;left:0;border:0;-webkit-user-select:none;user-select:none;width:100%;height:100%}",l(document.head,e)),H(this,t,lt,st,i,{src:5,title:0,params:6,origin:7,preconnections:8,decoder:9,getId:10,getIframe:11,getSrc:12,postMessage:13})}get getId(){return this.$$.ctx[10]}get getIframe(){return this.$$.ctx[11]}get getSrc(){return this.$$.ctx[12]}get postMessage(){return this.$$.ctx[13]}}const ut=t=>({intersecting:2&t}),pt=t=>({intersecting:t[1]});function $t(t){let e,n;const o=t[4].default,r=s(o,t,t[3],pt);return{c(){e=p("div"),r&&r.c(),f(e,"class","svelte-1d9hxr8")},m(o,i){d(o,e,i),r&&r.m(e,null),t[5](e),n=!0},p(t,[e]){r&&r.p&&10&e&&r.p(c(o,t,t[3],pt),a(o,t[3],e,ut))},i(t){n||(G(r,t),n=!0)},o(t){U(r,t),n=!1},d(n){n&&u(e),r&&r.d(n),t[5](null)}}}function mt(t,e,n){let o,r=!1,{threshold:i=.75}=e;var s;s=()=>{if("undefined"!=typeof IntersectionObserver){const t=new IntersectionObserver(e=>{n(1,r=e[0].isIntersecting),r&&t.unobserve(o)},{threshold:i});return t.observe(o),()=>t.unobserve(o)}function t(){const e=o.getBoundingClientRect();n(1,r=e.bottom>0&&e.right>0&&e.top*(1+i)<window.innerHeight&&e.left<window.innerWidth),r&&window.removeEventListener("scroll",t)}return window.addEventListener("scroll",t),()=>window.removeEventListener("scroll",t)},v().$$.on_mount.push(s);let{$$slots:c={},$$scope:a}=e;return t.$set=t=>{"threshold"in t&&n(2,i=t.threshold),"$$scope"in t&&n(3,a=t.$$scope)},[o,r,i,a,c,function(t){x[t?"unshift":"push"](()=>{n(0,o=t)})}]}class ft extends V{constructor(t){var e;super(),document.getElementById("svelte-1d9hxr8-style")||((e=p("style")).id="svelte-1d9hxr8-style",e.textContent="div.svelte-1d9hxr8{width:100%}",l(document.head,e)),H(this,t,mt,$t,i,{threshold:2})}}function ht(t){let e;const n=t[4].default,o=s(n,t,t[6],null);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,e){o&&o.p&&64&e&&o.p(c(n,t,t[6],null),a(n,t[6],e,null))},i(t){e||(G(o,t),e=!0)},o(t){U(o,t),e=!1},d(t){o&&o.d(t)}}}function gt(t){let e;const n=new ft({props:{$$slots:{default:[vt,({intersecting:t})=>({7:t}),({intersecting:t})=>t?128:0]},$$scope:{ctx:t}}});return{c(){W(n.$$.fragment)},m(t,o){B(n,t,o),e=!0},p(t,e){const o={};199&e&&(o.$$scope={dirty:e,ctx:t}),n.$set(o)},i(t){e||(G(n.$$.fragment,t),e=!0)},o(t){U(n.$$.fragment,t),e=!1},d(t){D(n,t)}}}function yt(e){let n,o,i,l;const $=e[4].default,m=s($,e,e[6],null);return{c(){n=p("div"),m&&m.c(),f(n,"class","svelte-db7j6d"),h(n,"bg",!F(e[0]))},m(s,c,a){var u;d(s,n,c),m&&m.m(n,null),e[5](n),i=!0,a&&l(),u=o=it.call(null,n,e[1]?e[0]:null),l=u&&r(u.destroy)?u.destroy:t},p(t,e){m&&m.p&&64&e&&m.p(c($,t,t[6],null),a($,t[6],e,null)),o&&r(o.update)&&3&e&&o.update.call(null,t[1]?t[0]:null),1&e&&h(n,"bg",!F(t[0]))},i(t){i||(G(m,t),i=!0)},o(t){U(m,t),i=!1},d(t){t&&u(n),m&&m.d(t),e[5](null),l()}}}function vt(t){let e,n,o=t[7]&&yt(t);return{c(){o&&o.c(),e=$()},m(t,r){o&&o.m(t,r),d(t,e,r),n=!0},p(t,n){t[7]?o?(o.p(t,n),G(o,1)):(o=yt(t),o.c(),G(o,1),o.m(e.parentNode,e)):o&&(N(),U(o,1,1,()=>{o=null}),T())},i(t){n||(G(o),n=!0)},o(t){U(o),n=!1},d(t){o&&o.d(t),t&&u(e)}}}function bt(t){let e,n,o,r;const i=[gt,ht],s=[];function c(t,e){return t[1]?0:1}return e=c(t),n=s[e]=i[e](t),{c(){n.c(),o=$()},m(t,n){s[e].m(t,n),d(t,o,n),r=!0},p(t,[r]){let a=e;e=c(t),e===a?s[e].p(t,r):(N(),U(s[a],1,1,()=>{s[a]=null}),T(),n=s[e],n||(n=s[e]=i[e](t),n.c()),G(n,1),n.m(o.parentNode,o))},i(t){r||(G(n),r=!0)},o(t){U(n),r=!1},d(t){s[e].d(t),t&&u(o)}}}function wt(t,e,n){const o=b();let r,{aspectRatio:i=null}=e,{isEnabled:s=!0}=e,{$$slots:c={},$$scope:a}=e;return t.$set=t=>{"aspectRatio"in t&&n(0,i=t.aspectRatio),"isEnabled"in t&&n(1,s=t.isEnabled),"$$scope"in t&&n(6,a=t.$$scope)},t.$$.update=()=>{4&t.$$.dirty&&r&&o("mount",r)},[i,s,r,o,c,function(t){x[t?"unshift":"push"](()=>{n(2,r=t)})},a]}class Et extends V{constructor(t){var e;super(),document.getElementById("svelte-db7j6d-style")||((e=p("style")).id="svelte-db7j6d-style",e.textContent="div.svelte-db7j6d{position:relative}.bg.svelte-db7j6d{background:#000}",l(document.head,e)),H(this,t,wt,bt,i,{aspectRatio:0,isEnabled:1})}}function xt(t){let e,n={params:t[0],decoder:t[7],preconnections:t[8],src:t[5],title:t[6],origin:t[4]};const o=new dt({props:n});return t[30](o),o.$on("load",t[31]),o.$on("data",t[32]),o.$on("message",t[33]),o.$on("rebuild",t[34]),o.$on("load",t[11]),o.$on("data",(function(){r(t[9])&&t[9].apply(this,arguments)})),o.$on("srcchange",t[10]),{c(){W(o.$$.fragment)},m(t,n){B(o,t,n),e=!0},p(e,n){t=e;const r={};1&n[0]&&(r.params=t[0]),128&n[0]&&(r.decoder=t[7]),256&n[0]&&(r.preconnections=t[8]),32&n[0]&&(r.src=t[5]),64&n[0]&&(r.title=t[6]),16&n[0]&&(r.origin=t[4]),o.$set(r)},i(t){e||(G(o.$$.fragment,t),e=!0)},o(t){U(o.$$.fragment,t),e=!1},d(e){t[30](null),D(o,e)}}}function Rt(t){let e;const n=new Et({props:{aspectRatio:t[2],isEnabled:t[1],$$slots:{default:[xt]},$$scope:{ctx:t}}});return{c(){W(n.$$.fragment)},m(t,o){B(n,t,o),e=!0},p(t,e){const o={};4&e[0]&&(o.aspectRatio=t[2]),2&e[0]&&(o.isEnabled=t[1]),1017&e[0]|16&e[1]&&(o.$$scope={dirty:e,ctx:t}),n.$set(o)},i(t){e||(G(n.$$.fragment,t),e=!0)},o(t){U(n.$$.fragment,t),e=!1},d(t){D(n,t)}}}function It(e,n,o){const r=b(),i={READY:"ready",TITLE_CHANGE:"titlechange",ORIGIN_CHANGE:"originchange",EMBED_URL_CHANGE:"embedurlchange",ERROR:"error"};let s,c=null,a=rt(),l=!1,{src:d=null}=n,{params:u={}}=n,{providers:p=[]}=n,{cookies:$=!1}=n,{hasWrapper:m=!0}=n,{aspectRatio:f="16:9"}=n;const h=async(t,e,n)=>{if(I)try{n||(await(M(),_),await a.promise),s.postMessage(I.buildPostMessage(t,e))}catch(o){}},g=()=>{a.promise.catch(t),a.reject(),a=rt(),o(24,l=!1),a.promise.then(()=>{o(24,l=!0),r(i.READY)}).catch(t=>{r(i.ERROR,t)})},y=()=>{o(22,c=null)},v=t=>{const e=t.detail;e&&I&&(I.resolveReadyState(e,a,h),c||o(22,c=I.extractMediaTitle(e)))};let E,R,I,C,A,L,j;return g(),e.$set=t=>{"src"in t&&o(12,d=t.src),"params"in t&&o(0,u=t.params),"providers"in t&&o(13,p=t.providers),"cookies"in t&&o(14,$=t.cookies),"hasWrapper"in t&&o(1,m=t.hasWrapper),"aspectRatio"in t&&o(2,f=t.aspectRatio)},e.$$.update=()=>{4096&e.$$.dirty[0]&&y(),12288&e.$$.dirty[0]&&o(25,I=p.find(t=>t.canPlay(d))),33570816&e.$$.dirty[0]&&o(4,E=I?I.buildOrigin($):null),33574912&e.$$.dirty[0]&&o(5,R=I?I.buildEmbedURL(d,$):null),37748736&e.$$.dirty[0]&&o(6,C=I&&c?`${I.name} - ${c||"Video Player"}`:null),33554432&e.$$.dirty[0]&&o(7,A=I?I.decoder:null),33554432&e.$$.dirty[0]&&o(8,L=I?I.preconnections:[]),20971520&e.$$.dirty[0]&&o(9,j=l&&c?null:v),4096&e.$$.dirty[0]&&r(i.SRC_CHANGE,d),4194304&e.$$.dirty[0]&&r(i.TITLE_CHANGE,c),16&e.$$.dirty[0]&&r(i.ORIGIN_CHANGE,E),32&e.$$.dirty[0]&&r(i.EMBED_URL_CHANGE,R)},[u,m,f,s,E,R,C,A,L,j,g,()=>{I&&I.onLoad(s)},d,p,$,()=>E,()=>s,()=>R,()=>c,()=>I,()=>I?I.extractMediaId(d):null,h,c,a,l,I,r,i,y,v,function(t){x[t?"unshift":"push"](()=>{o(3,s=t)})},function(t){w(e,t)},function(t){w(e,t)},function(t){w(e,t)},function(t){w(e,t)}]}class _t extends V{constructor(t){super(),H(this,t,It,Rt,i,{src:12,params:0,providers:13,cookies:14,hasWrapper:1,aspectRatio:2,getOrigin:15,getEmbed:16,getEmbedURL:17,getTitle:18,getProvider:19,getMediaId:20,sendCommand:21},[-1,-1])}get src(){return this.$$.ctx[12]}set src(t){this.$set({src:t}),k()}get params(){return this.$$.ctx[0]}set params(t){this.$set({params:t}),k()}get providers(){return this.$$.ctx[13]}set providers(t){this.$set({providers:t}),k()}get cookies(){return this.$$.ctx[14]}set cookies(t){this.$set({cookies:t}),k()}get hasWrapper(){return this.$$.ctx[1]}set hasWrapper(t){this.$set({hasWrapper:t}),k()}get aspectRatio(){return this.$$.ctx[2]}set aspectRatio(t){this.$set({aspectRatio:t}),k()}get getOrigin(){return this.$$.ctx[15]}get getEmbed(){return this.$$.ctx[16]}get getEmbedURL(){return this.$$.ctx[17]}get getTitle(){return this.$$.ctx[18]}get getProvider(){return this.$$.ctx[19]}get getMediaId(){return this.$$.ctx[20]}get sendCommand(){return this.$$.ctx[21]}}const Ct="https://www.youtube.com",Mt=/(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/,At=t=>t?Ct:"https://www.youtube-nocookie.com",Lt=t=>{const e=t?t.match(Mt):null;return e?e[1]:null};var jt={name:"YouTube",decoder:ot,preconnections:[Ct,"https://www.youtube-nocookie.com","https://www.google.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net","https://s.ytimg.com","https://i.ytimg.com"],canPlay:t=>K(t)&&Mt.test(t),buildOrigin:At,extractMediaId:Lt,buildEmbedURL:(t,e)=>{const n=Lt(t);return n?`${At(e)}/embed/${n}?enablejsapi=1`:null},onLoad:t=>{setTimeout(()=>t.postMessage({event:"listening"}),100)},buildPostMessage:(t,e)=>({event:"command",func:t,args:e||""}),resolveReadyState:(t,e)=>{const{info:n,event:o}=t,r=n&&n.playerState;"error"===o&&e.reject(n),5===r&&e.resolve()},extractMediaTitle:t=>{const e=t.info&&t.info.videoData;return e&&e.title||null}};const kt=/vimeo(?:\.com|)\/([0-9]{9,})/,Ot=/vimeo\.com\/external\/[0-9]+\..+/,Pt=t=>{const e=t?t.match(kt):null;return e?e[1]:null};var St={name:"Vimeo",decoder:ot,preconnections:["https://www.vimeo.com","https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"],canPlay:t=>K(t)&&!Ot.test(t)&&kt.test(t),buildEmbedURL:t=>`https://player.vimeo.com/video/${Pt(t)||"390460225"}`,extractMediaId:Pt,onLoad:()=>{},buildOrigin:()=>"https://player.vimeo.com",buildPostMessage:(t,e)=>({method:t,value:e||""}),resolveReadyState:(t,e,n)=>{const{event:o,data:r}=t;if("error"===o&&r&&"ready"===r.method){const t=new Error(r.message);t.name=r.name,e.reject(t)}"ready"===o&&n("addEventListener","loaded",!0),"loaded"===o&&(e.resolve(),n("getVideoTitle",[],!0))},extractMediaTitle:t=>"getVideoTitle"===t.method?t.value:null};const Nt="https://www.dailymotion.com",Tt=/(?:dai\.ly|dailymotion|dailymotion\.com)\/(?:video\/|embed\/|)(?:video\/|)((?:\w)+)/,Gt=t=>{const e=t?t.match(Tt):null;return e?e[1]:null};var Ut={name:"Dailymotion",decoder:t=>K(t)&&(t=>{const e=Object.create(null);if(!t)return e;let n;for(;n=et.exec(t);){const t=tt(n[1],n[1]).replace("[]",""),o=n[2]?tt(n[2].replace(/\+/g," "),n[2]):"",r=e[t];r&&!Q(r)&&(e[t]=[r]),r?e[t].push(o):e[t]=o}return e})(t),preconnections:[Nt,"https://static1.dmcdn.net"],canPlay:t=>K(t)&&Tt.test(t),extractMediaId:Gt,buildEmbedURL:t=>{const e=Gt(t);return e?`${Nt}/embed/video/${e}?api=1`:null},onLoad:()=>{},buildOrigin:()=>Nt,buildPostMessage:(t,e)=>({command:t,parameters:e||[]}),resolveReadyState:(t,e)=>{const{event:n}=t;"playback_ready"===n&&e.resolve(),"error"===n&&e.reject(t)},extractMediaTitle:t=>{const{event:e}=t;return"videochange"===e?t.title:null}};export{Ut as DailymotionProvider,dt as Embed,ft as Lazy,_t as Player,Et as PlayerWrapper,St as VimeoProvider,jt as YouTubeProvider}; | ||
function t(){}function e(t){return t()}function n(){return Object.create(null)}function r(t){t.forEach(e)}function o(t){return"function"==typeof t}function i(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e,n,r){if(t){const o=c(t,e,n,r);return t[0](o)}}function c(t,e,n,r){return t[1]&&r?function(t,e){for(const n in e)t[n]=e[n];return t}(n.ctx.slice(),t[1](r(e))):n.ctx}function a(t,e,n,r){if(t[2]&&r){const o=t[2](r(n));if(void 0===e.dirty)return o;if("object"==typeof o){const t=[],n=Math.max(e.dirty.length,o.length);for(let r=0;r<n;r+=1)t[r]=e.dirty[r]|o[r];return t}return e.dirty|o}return e.dirty}function l(t,e){t.appendChild(e)}function u(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function m(){return document.createTextNode("")}function $(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function g(t,e,n){t.classList[n?"add":"remove"](e)}let h;function y(t){h=t}function v(){if(!h)throw new Error("Function called outside component initialization");return h}function b(){const t=v();return(e,n)=>{const r=t.$$.callbacks[e];if(r){const o=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(e,n);r.slice().forEach(e=>{e.call(t,o)})}}}function w(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(t=>t(e))}const E=[],x=[],R=[],P=[],I=Promise.resolve();let _=!1;function C(){_||(_=!0,I.then(k))}function M(t){R.push(t)}let A=!1;const L=new Set;function k(){if(!A){A=!0;do{for(let t=0;t<E.length;t+=1){const e=E[t];y(e),O(e.$$)}for(E.length=0;x.length;)x.pop()();for(let t=0;t<R.length;t+=1){const e=R[t];L.has(e)||(L.add(e),e())}R.length=0}while(E.length);for(;P.length;)P.pop()();_=!1,A=!1,L.clear()}}function O(t){if(null!==t.fragment){t.update(),r(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(M)}}const S=new Set;let D;function N(){D={r:0,c:[],p:D}}function T(){D.r||r(D.c),D=D.p}function j(t,e){t&&t.i&&(S.delete(t),t.i(e))}function G(t,e,n,r){if(t&&t.o){if(S.has(t))return;S.add(t),D.c.push(()=>{S.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function U(t){t&&t.c()}function W(t,n,i){const{fragment:s,on_mount:c,on_destroy:a,after_update:l}=t.$$;s&&s.m(n,i),M(()=>{const n=c.map(e).filter(o);a?a.push(...n):r(n),t.$$.on_mount=[]}),l.forEach(M)}function B(t,e){const n=t.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function H(e,o,i,s,c,a,l=[-1]){const u=h;y(e);const p=o.props||{},m=e.$$={fragment:null,ctx:null,props:a,update:t,not_equal:c,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:[]),callbacks:n(),dirty:l};let $=!1;if(m.ctx=i?i(e,p,(t,n,...r)=>{const o=r.length?r[0]:n;return m.ctx&&c(m.ctx[t],m.ctx[t]=o)&&(m.bound[t]&&m.bound[t](o),$&&function(t,e){-1===t.$$.dirty[0]&&(E.push(t),C(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(e,t)),n}):[],m.update(),$=!0,r(m.before_update),m.fragment=!!s&&s(m.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);m.fragment&&m.fragment.l(t),t.forEach(d)}else m.fragment&&m.fragment.c();o.intro&&j(e.$$.fragment),W(e,o.target,o.anchor),k()}y(u)}class V{$destroy(){B(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}const Y=(t,e,n=null)=>{t&&(t.style[e]=n)},F=t=>null===t,J=t=>F(t)||(t=>void 0===t)(t),q=t=>J(t)?null:t.constructor,z=t=>q(t)===Object,K=t=>q(t)===String,Q=t=>Array.isArray(t),X="undefined"!=typeof window,Z=X&&window.navigator.userAgent.toLowerCase(),tt=(Z&&/msie|trident/.test(Z),Z&&/iphone|ipad|ipod|ios/.test(Z),Z&&/android/.test(Z),Z&&Z.indexOf("edge/"),Z&&/chrome\/\d+/.test(Z),X&&/(iPhone|iPod)/gi.test(navigator.platform),(t,e="")=>{if(!X)return e;try{return window.decodeURIComponent(t)}catch(n){return e}}),et=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g,nt=(t,e,n)=>{if(!X)return!1;const r=p("link");return r.rel=t,r.href=e,n&&(r.as=n),r.crossorigin=!0,document.head.append(r),!0},rt=t=>{return!!(e=t)&&(z(e)||e.startsWith("{"))&&(t=>z(t)?t:function(t,e){try{return JSON.parse(t)}catch(n){return null}}(t))(t);var e},ot=()=>{let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}};function it(t,e){const n=e=>{if(!e)return void Y(t,"paddingBottom");const[n,r]=e.split(":");Y(t,"paddingBottom",100/n*r+"%")};return n(e),{update:n,destroy(){n(null)}}}function st(e){let n,o,i;return{c(){n=p("iframe"),f(n,"id",e[3]),f(n,"title",e[0]),n.src!==(o=e[2])&&f(n,"src",o),n.allowFullscreen="1",f(n,"allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"),f(n,"class","svelte-jvy9c2")},m(t,o,s){u(t,n,o),e[18](n),s&&r(i),i=[$(window,"message",e[4]),$(n,"load",e[17])]},p(t,[e]){1&e&&f(n,"title",t[0]),4&e&&n.src!==(o=t[2])&&f(n,"src",o)},i:t,o:t,d(t){t&&d(n),e[18](null),r(i)}}}let ct=0;const at=[];function lt(t,e,n){let r=null,o=null;ct+=1;const i="vime-embed-"+ct,s=b(),c={SRC_CHANGE:"srcchange",MESSAGE:"message",DATA:"data",REBUILD:"rebuild"};let{src:a=null}=e,{title:l=null}=e,{params:u={}}=e,{origin:d=null}=e,{preconnections:p=[]}=e,{decoder:m=null}=e;const $=t=>!(!r||t.source!==r.contentWindow)&&K(d)&&d===t.origin;return t.$set=t=>{"src"in t&&n(5,a=t.src),"title"in t&&n(0,l=t.title),"params"in t&&n(6,u=t.params),"origin"in t&&n(7,d=t.origin),"preconnections"in t&&n(8,p=t.preconnections),"decoder"in t&&n(9,m=t.decoder)},t.$$.update=()=>{96&t.$$.dirty&&n(2,o=a?((t,e)=>((t,e)=>{if(!e)return t;const n=t.split("?",2);return n[0]+(n[1]?`?${n[1]}&${e}`:"?"+e)})(t,(t=>{const e=[],n=(t,n)=>{e.push(`${encodeURIComponent(t)}=${encodeURIComponent(n)}`)};return Object.keys(t).forEach(e=>{const r=t[e];J(r)||(Q(r)?r.forEach(t=>n(e,t)):n(e,r))}),e.join("&")})(e)))(a,u):null),4&t.$$.dirty&&s(c.SRC_CHANGE,o),4&t.$$.dirty&&o&&s(c.REBUILD),6&t.$$.dirty&&(!o||r||at.includes(o)||nt("preconnect",o)&&at.push(o)),256&t.$$.dirty&&p.filter(t=>!at.includes(t)).forEach(t=>{nt("preconnect",t)&&at.push(t)})},[l,r,o,i,t=>{if(!$(t))return;s(c.MESSAGE,t);const e=m?m(t.data):null;e&&s(c.DATA,e)},a,u,d,p,m,()=>i,()=>r,()=>o,(t,e)=>{r&&r.contentWindow&&r.contentWindow.postMessage(JSON.stringify(t),e||d||"*")},s,c,$,function(e){w(t,e)},function(t){x[t?"unshift":"push"](()=>{n(1,r=t)})}]}class ut extends V{constructor(t){var e;super(),document.getElementById("svelte-jvy9c2-style")||((e=p("style")).id="svelte-jvy9c2-style",e.textContent="iframe.svelte-jvy9c2{position:absolute;top:0;left:0;border:0;-webkit-user-select:none;user-select:none;width:100%;height:100%}",l(document.head,e)),H(this,t,lt,st,i,{src:5,title:0,params:6,origin:7,preconnections:8,decoder:9,getId:10,getIframe:11,getSrc:12,postMessage:13})}get getId(){return this.$$.ctx[10]}get getIframe(){return this.$$.ctx[11]}get getSrc(){return this.$$.ctx[12]}get postMessage(){return this.$$.ctx[13]}}const dt=t=>({intersecting:2&t}),pt=t=>({intersecting:t[1]});function mt(t){let e,n;const r=t[4].default,o=s(r,t,t[3],pt);return{c(){e=p("div"),o&&o.c(),f(e,"class","svelte-1d9hxr8")},m(r,i){u(r,e,i),o&&o.m(e,null),t[5](e),n=!0},p(t,[e]){o&&o.p&&10&e&&o.p(c(r,t,t[3],pt),a(r,t[3],e,dt))},i(t){n||(j(o,t),n=!0)},o(t){G(o,t),n=!1},d(n){n&&d(e),o&&o.d(n),t[5](null)}}}function $t(t,e,n){let r,o=!1,{threshold:i=.75}=e;var s;s=()=>{if("undefined"!=typeof IntersectionObserver){const t=new IntersectionObserver(e=>{n(1,o=e[0].isIntersecting),o&&t.unobserve(r)},{threshold:i});return t.observe(r),()=>t.unobserve(r)}function t(){const e=r.getBoundingClientRect();n(1,o=e.bottom>0&&e.right>0&&e.top*(1+i)<window.innerHeight&&e.left<window.innerWidth),o&&window.removeEventListener("scroll",t)}return window.addEventListener("scroll",t),()=>window.removeEventListener("scroll",t)},v().$$.on_mount.push(s);let{$$slots:c={},$$scope:a}=e;return t.$set=t=>{"threshold"in t&&n(2,i=t.threshold),"$$scope"in t&&n(3,a=t.$$scope)},[r,o,i,a,c,function(t){x[t?"unshift":"push"](()=>{n(0,r=t)})}]}class ft extends V{constructor(t){var e;super(),document.getElementById("svelte-1d9hxr8-style")||((e=p("style")).id="svelte-1d9hxr8-style",e.textContent="div.svelte-1d9hxr8{width:100%}",l(document.head,e)),H(this,t,$t,mt,i,{threshold:2})}}function gt(t){let e;const n=t[4].default,r=s(n,t,t[6],null);return{c(){r&&r.c()},m(t,n){r&&r.m(t,n),e=!0},p(t,e){r&&r.p&&64&e&&r.p(c(n,t,t[6],null),a(n,t[6],e,null))},i(t){e||(j(r,t),e=!0)},o(t){G(r,t),e=!1},d(t){r&&r.d(t)}}}function ht(t){let e;const n=new ft({props:{$$slots:{default:[vt,({intersecting:t})=>({7:t}),({intersecting:t})=>t?128:0]},$$scope:{ctx:t}}});return{c(){U(n.$$.fragment)},m(t,r){W(n,t,r),e=!0},p(t,e){const r={};199&e&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){e||(j(n.$$.fragment,t),e=!0)},o(t){G(n.$$.fragment,t),e=!1},d(t){B(n,t)}}}function yt(e){let n,r,i,l;const m=e[4].default,$=s(m,e,e[6],null);return{c(){n=p("div"),$&&$.c(),f(n,"class","svelte-1gc7ub8"),g(n,"video",!F(e[0]))},m(s,c,a){var d;u(s,n,c),$&&$.m(n,null),e[5](n),i=!0,a&&l(),d=r=it.call(null,n,e[1]?e[0]:null),l=d&&o(d.destroy)?d.destroy:t},p(t,e){$&&$.p&&64&e&&$.p(c(m,t,t[6],null),a(m,t[6],e,null)),r&&o(r.update)&&3&e&&r.update.call(null,t[1]?t[0]:null),1&e&&g(n,"video",!F(t[0]))},i(t){i||(j($,t),i=!0)},o(t){G($,t),i=!1},d(t){t&&d(n),$&&$.d(t),e[5](null),l()}}}function vt(t){let e,n,r=t[7]&&yt(t);return{c(){r&&r.c(),e=m()},m(t,o){r&&r.m(t,o),u(t,e,o),n=!0},p(t,n){t[7]?r?(r.p(t,n),128&n&&j(r,1)):(r=yt(t),r.c(),j(r,1),r.m(e.parentNode,e)):r&&(N(),G(r,1,1,()=>{r=null}),T())},i(t){n||(j(r),n=!0)},o(t){G(r),n=!1},d(t){r&&r.d(t),t&&d(e)}}}function bt(t){let e,n,r,o;const i=[ht,gt],s=[];function c(t,e){return t[1]?0:1}return e=c(t),n=s[e]=i[e](t),{c(){n.c(),r=m()},m(t,n){s[e].m(t,n),u(t,r,n),o=!0},p(t,[o]){let a=e;e=c(t),e===a?s[e].p(t,o):(N(),G(s[a],1,1,()=>{s[a]=null}),T(),n=s[e],n||(n=s[e]=i[e](t),n.c()),j(n,1),n.m(r.parentNode,r))},i(t){o||(j(n),o=!0)},o(t){G(n),o=!1},d(t){s[e].d(t),t&&d(r)}}}function wt(t,e,n){const r=b();let o,{aspectRatio:i=null}=e,{isEnabled:s=!0}=e,{$$slots:c={},$$scope:a}=e;return t.$set=t=>{"aspectRatio"in t&&n(0,i=t.aspectRatio),"isEnabled"in t&&n(1,s=t.isEnabled),"$$scope"in t&&n(6,a=t.$$scope)},t.$$.update=()=>{4&t.$$.dirty&&o&&r("mount",o)},[i,s,o,r,c,function(t){x[t?"unshift":"push"](()=>{n(2,o=t)})},a]}class Et extends V{constructor(t){var e;super(),document.getElementById("svelte-1gc7ub8-style")||((e=p("style")).id="svelte-1gc7ub8-style",e.textContent="div.svelte-1gc7ub8{position:relative}.video.svelte-1gc7ub8{height:0;overflow:hidden;background:#000}",l(document.head,e)),H(this,t,wt,bt,i,{aspectRatio:0,isEnabled:1})}}function xt(t){let e,n={decoder:t[6],preconnections:t[7],src:t[4],params:t[9],title:t[5],origin:t[3]};const r=new ut({props:n});return t[32](r),r.$on("load",t[33]),r.$on("data",t[34]),r.$on("message",t[35]),r.$on("rebuild",t[36]),r.$on("load",t[11]),r.$on("data",(function(){o(t[8])&&t[8].apply(this,arguments)})),r.$on("srcchange",t[10]),{c(){U(r.$$.fragment)},m(t,n){W(r,t,n),e=!0},p(e,n){t=e;const o={};64&n[0]&&(o.decoder=t[6]),128&n[0]&&(o.preconnections=t[7]),16&n[0]&&(o.src=t[4]),512&n[0]&&(o.params=t[9]),32&n[0]&&(o.title=t[5]),8&n[0]&&(o.origin=t[3]),r.$set(o)},i(t){e||(j(r.$$.fragment,t),e=!0)},o(t){G(r.$$.fragment,t),e=!1},d(e){t[32](null),B(r,e)}}}function Rt(t){let e;const n=new Et({props:{aspectRatio:t[1],isEnabled:t[0],$$slots:{default:[xt]},$$scope:{ctx:t}}});return{c(){U(n.$$.fragment)},m(t,r){W(n,t,r),e=!0},p(t,e){const r={};2&e[0]&&(r.aspectRatio=t[1]),1&e[0]&&(r.isEnabled=t[0]),1020&e[0]|64&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){e||(j(n.$$.fragment,t),e=!0)},o(t){G(n.$$.fragment,t),e=!1},d(t){B(n,t)}}}function Pt(e,n,r){const o=b(),i={READY:"ready",TITLE_CHANGE:"titlechange",ORIGIN_CHANGE:"originchange",EMBED_URL_CHANGE:"embedurlchange",ERROR:"error"};let s,c=null,a=ot(),l=!1,{src:u=null}=n,{params:d={}}=n,{providers:p=[]}=n,{cookies:m=!1}=n,{hasWrapper:$=!0}=n,{aspectRatio:f="16:9"}=n,{ignoreDefaultParams:g=!1}=n;const h=async(t,e,n)=>{if(_)try{n||(await(C(),I),await a.promise),s.postMessage(_.buildPostMessage(t,e))}catch(r){}},y=()=>{a.promise.catch(t),a.reject(),a=ot(),r(26,l=!1),a.promise.then(()=>{r(26,l=!0),o(i.READY)}).catch(t=>{o(i.ERROR,t)})},v=()=>{r(24,c=null)},E=t=>{const e=t.detail;e&&_&&(_.resolveReadyState(e,a,h),c||r(24,c=_.extractMediaTitle(e)))};let R,P,_,M,A,L,k,O;return y(),e.$set=t=>{"src"in t&&r(12,u=t.src),"params"in t&&r(13,d=t.params),"providers"in t&&r(14,p=t.providers),"cookies"in t&&r(15,m=t.cookies),"hasWrapper"in t&&r(0,$=t.hasWrapper),"aspectRatio"in t&&r(1,f=t.aspectRatio),"ignoreDefaultParams"in t&&r(16,g=t.ignoreDefaultParams)},e.$$.update=()=>{4096&e.$$.dirty[0]&&v(),20480&e.$$.dirty[0]&&r(27,_=p.find(t=>t.canPlay(u))),134250496&e.$$.dirty[0]&&r(3,R=_?_.buildOrigin(m):null),134254592&e.$$.dirty[0]&&r(4,P=_?_.buildEmbedURL(u,m):null),150994944&e.$$.dirty[0]&&r(5,M=_&&c?`${_.name} - ${c||"Video Player"}`:null),134217728&e.$$.dirty[0]&&r(6,A=_?_.decoder:null),134217728&e.$$.dirty[0]&&r(7,L=_?_.preconnections:[]),83886080&e.$$.dirty[0]&&r(8,k=l&&c?null:E),134291456&e.$$.dirty[0]&&r(9,O=!g&&_&&_.defaultParams?{..._.defaultParams,...d}:d),4096&e.$$.dirty[0]&&o(i.SRC_CHANGE,u),16777216&e.$$.dirty[0]&&o(i.TITLE_CHANGE,c),8&e.$$.dirty[0]&&o(i.ORIGIN_CHANGE,R),16&e.$$.dirty[0]&&o(i.EMBED_URL_CHANGE,P)},[$,f,s,R,P,M,A,L,k,O,y,()=>{_&&_.onLoad(s)},u,d,p,m,g,()=>R,()=>s,()=>P,()=>c,()=>_,()=>_?_.extractMediaId(u):null,h,c,a,l,_,o,i,v,E,function(t){x[t?"unshift":"push"](()=>{r(2,s=t)})},function(t){w(e,t)},function(t){w(e,t)},function(t){w(e,t)},function(t){w(e,t)}]}class It extends V{constructor(t){super(),H(this,t,Pt,Rt,i,{src:12,params:13,providers:14,cookies:15,hasWrapper:0,aspectRatio:1,ignoreDefaultParams:16,getOrigin:17,getEmbed:18,getEmbedURL:19,getTitle:20,getProvider:21,getMediaId:22,sendCommand:23},[-1,-1])}get src(){return this.$$.ctx[12]}set src(t){this.$set({src:t}),k()}get params(){return this.$$.ctx[13]}set params(t){this.$set({params:t}),k()}get providers(){return this.$$.ctx[14]}set providers(t){this.$set({providers:t}),k()}get cookies(){return this.$$.ctx[15]}set cookies(t){this.$set({cookies:t}),k()}get hasWrapper(){return this.$$.ctx[0]}set hasWrapper(t){this.$set({hasWrapper:t}),k()}get aspectRatio(){return this.$$.ctx[1]}set aspectRatio(t){this.$set({aspectRatio:t}),k()}get ignoreDefaultParams(){return this.$$.ctx[16]}set ignoreDefaultParams(t){this.$set({ignoreDefaultParams:t}),k()}get getOrigin(){return this.$$.ctx[17]}get getEmbed(){return this.$$.ctx[18]}get getEmbedURL(){return this.$$.ctx[19]}get getTitle(){return this.$$.ctx[20]}get getProvider(){return this.$$.ctx[21]}get getMediaId(){return this.$$.ctx[22]}get sendCommand(){return this.$$.ctx[23]}}const _t="https://www.youtube.com",Ct=/(?:youtu\.be|youtube|youtube\.com|youtube-nocookie\.com)\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=|)((?:\w|-){11})/,Mt=t=>t?_t:"https://www.youtube-nocookie.com",At=t=>{const e=t?t.match(Ct):null;return e?e[1]:null};var Lt={name:"YouTube",decoder:rt,preconnections:[_t,"https://www.youtube-nocookie.com","https://www.google.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net","https://s.ytimg.com","https://i.ytimg.com"],canPlay:t=>K(t)&&Ct.test(t),buildOrigin:Mt,extractMediaId:At,buildEmbedURL:(t,e)=>{const n=At(t);return n?`${Mt(e)}/embed/${n}?enablejsapi=1`:null},onLoad:t=>{setTimeout(()=>t.postMessage({event:"listening"}),100)},buildPostMessage:(t,e)=>({event:"command",func:t,args:e||""}),resolveReadyState:(t,e)=>{const{info:n,event:r}=t,o=n&&n.playerState;"error"===r&&e.reject(n),5===o&&e.resolve()},extractMediaTitle:t=>{const e=t.info&&t.info.videoData;return e&&e.title||null}};const kt=/vimeo(?:\.com|)\/([0-9]{9,})/,Ot=/vimeo\.com\/external\/[0-9]+\..+/,St=t=>{const e=t?t.match(kt):null;return e?e[1]:null};var Dt={name:"Vimeo",decoder:rt,preconnections:["https://www.vimeo.com","https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"],canPlay:t=>K(t)&&!Ot.test(t)&&kt.test(t),buildEmbedURL:t=>"https://player.vimeo.com/video/"+(St(t)||"411655713"),extractMediaId:St,defaultParams:{transparent:!1},onLoad:()=>{},buildOrigin:()=>"https://player.vimeo.com",buildPostMessage:(t,e)=>({method:t,value:e||""}),resolveReadyState:(t,e,n)=>{const{event:r,data:o}=t;if("error"===r&&o&&"ready"===o.method){const t=new Error(o.message);t.name=o.name,e.reject(t)}"ready"===r&&n("addEventListener","loaded",!0),"loaded"===r&&(e.resolve(),n("getVideoTitle",[],!0))},extractMediaTitle:t=>"getVideoTitle"===t.method?t.value:null};const Nt="https://www.dailymotion.com",Tt=/(?:dai\.ly|dailymotion|dailymotion\.com)\/(?:video\/|embed\/|)(?:video\/|)((?:\w)+)/,jt=t=>{const e=t?t.match(Tt):null;return e?e[1]:null};var Gt={name:"Dailymotion",decoder:t=>K(t)&&(t=>{const e=Object.create(null);if(!t)return e;let n;for(;n=et.exec(t);){const t=tt(n[1],n[1]).replace("[]",""),r=n[2]?tt(n[2].replace(/\+/g," "),n[2]):"",o=e[t];o&&!Q(o)&&(e[t]=[o]),o?e[t].push(r):e[t]=r}return e})(t),preconnections:[Nt,"https://static1.dmcdn.net"],canPlay:t=>K(t)&&Tt.test(t),extractMediaId:jt,buildEmbedURL:t=>{const e=jt(t);return e?`${Nt}/embed/video/${e}?api=1`:null},onLoad:()=>{},buildOrigin:()=>Nt,buildPostMessage:(t,e)=>({command:t,parameters:e||[]}),resolveReadyState:(t,e)=>{const{event:n}=t;"playback_ready"===n&&e.resolve(),"error"===n&&e.reject(t)},extractMediaTitle:t=>{const{event:e}=t;return"videochange"===e?t.title:null}};export{Gt as DailymotionProvider,ut as Embed,ft as Lazy,It as Player,Et as PlayerWrapper,Dt as VimeoProvider,Lt as YouTubeProvider}; |
{ | ||
"name": "@vime-js/lite", | ||
"description": "Vime Lite Player", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"svelte": "src/index.js", | ||
@@ -41,3 +41,3 @@ "main": "dist/lite.js", | ||
"dependencies": { | ||
"@vime-js/core": "^1.5.0", | ||
"@vime-js/core": "^1.5.1", | ||
"@vime-js/utils": "^1.5.0" | ||
@@ -48,3 +48,3 @@ }, | ||
}, | ||
"gitHead": "72ab058f69124f6777a141bc5a6f99f0c6f82260" | ||
"gitHead": "01d0be2c3d0d377bc2b351dbe325a7a4d27dc2c4" | ||
} |
@@ -14,2 +14,5 @@ import { | ||
extractMediaId: extract_media_id, | ||
defaultParams: { | ||
transparent: false, | ||
}, | ||
onLoad: () => {}, | ||
@@ -16,0 +19,0 @@ buildOrigin: () => ORIGIN, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373542
7912
Updated@vime-js/core@^1.5.1