@maveio/components 0.0.167 → 0.0.169
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2E5GLLOS.cjs +19 -0
- package/dist/chunk-2EIQ3VMA.cjs +1 -0
- package/dist/chunk-2FUCHY2J.cjs +35 -0
- package/dist/chunk-2JCNQPEK.js +1 -0
- package/dist/chunk-5PIHL662.js +19 -0
- package/dist/chunk-5QLIDHRT.cjs +33 -0
- package/dist/chunk-AOBEOJ2U.cjs +10 -0
- package/dist/chunk-B6P2GJBQ.js +9 -0
- package/dist/chunk-BL2IUHCP.cjs +1663 -0
- package/dist/chunk-BTCK3T4L.cjs +24 -0
- package/dist/{chunk-DITZCOYN.cjs → chunk-C3CI3U2Z.js} +6 -6
- package/dist/{chunk-SF36AD3G.js → chunk-CNPQ5Q2M.js} +1 -1
- package/dist/chunk-CVXHA76S.js +3 -0
- package/dist/chunk-DL4BV5IH.cjs +24 -0
- package/dist/chunk-EVKPEPYP.cjs +2 -0
- package/dist/chunk-FAONFKQ2.cjs +9 -0
- package/dist/{chunk-E2IDHUN5.js → chunk-GHE5KR7E.js} +4 -4
- package/dist/chunk-GSVKVWEI.js +33 -0
- package/dist/chunk-IBQULJZC.cjs +3 -0
- package/dist/chunk-IETV3B4F.cjs +38 -0
- package/dist/{chunk-AJ33W3DD.cjs → chunk-IMY6Z3YA.cjs} +3 -3
- package/dist/{chunk-YKO34INI.cjs → chunk-K5Z7QHTN.cjs} +1 -1
- package/dist/{chunk-7MR3ZC3G.js → chunk-KLJGACPT.js} +3 -3
- package/dist/{chunk-HS74B6NF.cjs → chunk-L667KKJP.cjs} +4 -4
- package/dist/{chunk-BS3IICLO.cjs → chunk-MU4WLTQR.cjs} +4 -4
- package/dist/chunk-N2L5GXPF.cjs +211 -0
- package/dist/chunk-NPP5B5PV.cjs +16 -0
- package/dist/chunk-OVZCXWUJ.js +1663 -0
- package/dist/{chunk-WO4HFIOO.js → chunk-OX42Y2HR.js} +1 -1
- package/dist/{chunk-BN4D4W23.js → chunk-P5OWX4UR.js} +4 -4
- package/dist/chunk-PTN427IG.js +24 -0
- package/dist/chunk-Q3FGRSLA.js +38 -0
- package/dist/chunk-QFF6OUH6.js +9 -0
- package/dist/chunk-QOM4AP6R.cjs +9 -0
- package/dist/chunk-QQDH35OW.cjs +9 -0
- package/dist/{chunk-ZZBI6DXY.js → chunk-R3SDTEHC.js} +1 -1
- package/dist/chunk-RHTBV6KZ.js +24 -0
- package/dist/{chunk-PXLLLBZ3.cjs → chunk-RQN3DXJB.cjs} +1 -1
- package/dist/{chunk-E7TZALBH.js → chunk-SWRFZ3FV.js} +1 -1
- package/dist/chunk-TFOTA27Y.js +211 -0
- package/dist/chunk-TH3DUBVR.js +35 -0
- package/dist/{chunk-JUDFZS5N.cjs → chunk-TKJYRGEU.cjs} +1 -1
- package/dist/{chunk-T2P4BAWY.js → chunk-V54NMMTT.cjs} +6 -6
- package/dist/chunk-WOXKZOJ3.js +10 -0
- package/dist/chunk-WTS6WHUH.js +1 -0
- package/dist/chunk-X7OGQ4KH.cjs +1 -0
- package/dist/chunk-YPCQNE3R.js +16 -0
- package/dist/chunk-ZTDQPDC6.js +2 -0
- package/dist/components/audio-track-menu.cjs +1 -1
- package/dist/components/audio-track-menu.js +1 -1
- package/dist/components/clip.cjs +1 -1
- package/dist/components/clip.js +1 -1
- package/dist/components/files.cjs +1 -1
- package/dist/components/files.js +1 -1
- package/dist/components/img.cjs +1 -1
- package/dist/components/img.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/player.cjs +1 -1
- package/dist/components/player.js +1 -1
- package/dist/components/pop.cjs +1 -1
- package/dist/components/pop.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/upload.cjs +1 -1
- package/dist/components/upload.js +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/embed/api.cjs +1 -1
- package/dist/embed/api.js +1 -1
- package/dist/embed/caption.cjs +1 -1
- package/dist/embed/caption.js +1 -1
- package/dist/embed/controller.cjs +1 -1
- package/dist/embed/controller.js +1 -1
- package/dist/embed/socket.cjs +1 -1
- package/dist/embed/socket.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/themes/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/utils/localization.cjs +1 -1
- package/dist/utils/localization.d.cts +2 -2
- package/dist/utils/localization.d.ts +2 -2
- package/dist/utils/localization.js +1 -1
- package/dist/utils/mave_element.cjs +1 -1
- package/dist/utils/mave_element.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +16 -16
- package/dist/vue.d.ts +16 -16
- package/dist/vue.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-27BWRXCN.js +0 -29
- package/dist/chunk-3T573OW4.cjs +0 -35
- package/dist/chunk-55JWHJJ5.cjs +0 -211
- package/dist/chunk-5STN56TL.cjs +0 -2
- package/dist/chunk-6XBQ5C3V.js +0 -17
- package/dist/chunk-BSJIDMTZ.js +0 -18
- package/dist/chunk-BZKKXYJP.js +0 -37
- package/dist/chunk-D75M3UFL.js +0 -1
- package/dist/chunk-D7LG2SMD.cjs +0 -33
- package/dist/chunk-ES5FUTSE.cjs +0 -1
- package/dist/chunk-F6EKAS27.js +0 -1
- package/dist/chunk-FUSQ4EZG.cjs +0 -3
- package/dist/chunk-GO6BV3T4.cjs +0 -29
- package/dist/chunk-HT464LCH.js +0 -10
- package/dist/chunk-J74VK4RB.cjs +0 -9
- package/dist/chunk-JBV2AYRP.js +0 -2
- package/dist/chunk-JR7IABIG.cjs +0 -18
- package/dist/chunk-KNAAIER3.js +0 -3
- package/dist/chunk-KUPCZDOX.cjs +0 -10
- package/dist/chunk-M22WSPSU.js +0 -9
- package/dist/chunk-NB5PC42C.js +0 -33
- package/dist/chunk-NROHM3YR.cjs +0 -1532
- package/dist/chunk-O2WRWRDO.cjs +0 -9
- package/dist/chunk-OIZ5B5LE.cjs +0 -17
- package/dist/chunk-TSTFPNEM.js +0 -211
- package/dist/chunk-TVXCJNTZ.js +0 -1532
- package/dist/chunk-UHJ4X2NY.cjs +0 -37
- package/dist/chunk-WIS6FQDY.cjs +0 -24
- package/dist/chunk-ZJWT7IOI.js +0 -24
- package/dist/chunk-ZODBVQLM.cjs +0 -1
- package/dist/chunk-ZUM5T3HV.js +0 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-2JCNQPEK.js';import {a as a$1}from'./chunk-QFF6OUH6.js';import {a as a$3}from'./chunk-ZTDQPDC6.js';var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=true;this.loading=true;this.host=e,this.type=t,this.loading=true,this.task=new a$1(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${a$2}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=true,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return a$3.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=true,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest.json"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}return this.token&&t.append("token",this.token),e=="manifest.json"&&(t.has("e")&&t.delete("e"),t.append("e",new Date().getTime().toString())),e!=="manifest.json"&&!this.caching&&(t.has("e")||t.append("e",new Date().getTime().toString())),s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};export{c as a,a as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
2
|
-
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let n=g$1(this,i,U).call(this),t=g$1(this,i,F).call(this),o=this._slottedChildren.map(a=>{function h(){let s;return a.nodeName==="TEMPLATE"?s=a.content.cloneNode(true):s=a.cloneNode(true),s}if(a.getAttribute("name")=="mave-files-video"){if(!n)return;let s=h(),d=Number(this._data.created_at),m=d&&d<1e12?d*1e3:d;Number.isFinite(m)&&g$1(this,i,l).call(this,s,"date",new Date(m).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&g$1(this,i,l).call(this,s,"duration",this.durationToTime(p));let u=this._data.video.filetype;u&&g$1(this,i,l).call(this,s,"filetype",u);let k=n.file_size||this._data.video.size;k&&g$1(this,i,l).call(this,s,"size",g$1(this,i,v).call(this,k));let M=g$1(this,i,z).call(this,n),S=n.container||"mp4",b=g$1(this,i,g).call(this,M,`${this._data.name}.${S}`);return b.setAttribute("aria-label","Download video"),b.appendChild(s),
|
|
3
|
-
`}renderPending(){return
|
|
1
|
+
import {b}from'./chunk-OX42Y2HR.js';import {a as a$2}from'./chunk-SWRFZ3FV.js';import {a as a$1}from'./chunk-PTN427IG.js';import {a as a$3}from'./chunk-5PIHL662.js';import {a}from'./chunk-YPCQNE3R.js';import {c,e,g as g$1}from'./chunk-KA24PL7V.js';var i,l,C,R,g,v,w,z,L,U,F,y,f=class extends a$2{constructor(){super(...arguments);e(this,i);this.embedController=new b(this);}get embed(){return this._embed}set embed(e){this._embed!==e&&(this._embed=e,this.requestUpdate("embed"),this.embedController.embed=this.embed);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}render(){return a$3`
|
|
2
|
+
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let n=g$1(this,i,U).call(this),t=g$1(this,i,F).call(this),o=this._slottedChildren.map(a=>{function h(){let s;return a.nodeName==="TEMPLATE"?s=a.content.cloneNode(true):s=a.cloneNode(true),s}if(a.getAttribute("name")=="mave-files-video"){if(!n)return;let s=h(),d=Number(this._data.created_at),m=d&&d<1e12?d*1e3:d;Number.isFinite(m)&&g$1(this,i,l).call(this,s,"date",new Date(m).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&g$1(this,i,l).call(this,s,"duration",this.durationToTime(p));let u=this._data.video.filetype;u&&g$1(this,i,l).call(this,s,"filetype",u);let k=n.file_size||this._data.video.size;k&&g$1(this,i,l).call(this,s,"size",g$1(this,i,v).call(this,k));let M=g$1(this,i,z).call(this,n),S=n.container||"mp4",b=g$1(this,i,g).call(this,M,`${this._data.name}.${S}`);return b.setAttribute("aria-label","Download video"),b.appendChild(s),a$3`${b}`}if(t&&a.getAttribute("name")=="mave-files-audio"){let s=h(),d=t.codec||g$1(this,i,y).call(this,t.filename)||"mp3";g$1(this,i,l).call(this,s,"filetype",d);let m=t.file_size;m&&g$1(this,i,l).call(this,s,"size",g$1(this,i,v).call(this,m));let p=g$1(this,i,L).call(this,t),u=g$1(this,i,g).call(this,p,t.filename||`${this._data.name}.${d}`);return u.setAttribute("aria-label","Download audio"),u.appendChild(s),a$3`${u}`}let _=this._data.subtitles.find(s=>s.language==this._data.video.language);if(_&&a.getAttribute("name")=="mave-files-subtitles"){let s=h();g$1(this,i,l).call(this,s,"filetype","vtt");let d=g$1(this,i,g).call(this,_.path,`${this._data.name}.vtt`);return d.setAttribute("aria-label","Download subtitles"),d.appendChild(s),a$3`${d}`}});return a$3`${this._stylesheets} ${o}`}})}
|
|
3
|
+
`}renderPending(){return a$3`<slot style="display: none"></slot>`}};i=new WeakSet,l=function(e,n,t){let o=e.querySelector(`[slot="${n}"], [data-slot="${n}"]`);o&&(o.textContent=t,o.removeAttribute("slot"),o.removeAttribute("data-slot"));},C=function(e,n){let t=window.URL.createObjectURL(e),o=document.createElement("a");o.style.display="none",o.href=t,o.download=n,this.appendChild(o),o.click(),window.URL.revokeObjectURL(t),this.removeChild(o);},R=function(e,n){return fetch(e).then(t=>{if(!t.ok)throw new Error("Network response was not ok");return t.blob()}).then(t=>g$1(this,i,C).call(this,t,n)).catch(t=>console.error("Something went wrong:",t))},g=function(e,n){let t=document.createElement("a");t.classList.add("link"),t.setAttribute("href",e),t.setAttribute("download",n),t.setAttribute("target","new");let o=false;return t.addEventListener("click",a=>{a.preventDefault(),!o&&(o=true,t.style.cursor="wait",t.style.opacity="0.5",g$1(this,i,R).call(this,e,n).then(()=>{o=false,t.style.cursor="pointer",t.style.opacity="1";}));}),t},v=function(e){let n=e/1e6;if(n<10)return `${n.toFixed(1)} MB`;let t=n%1!==0;return `${n.toFixed(t?1:0)} MB`},w=function(e){let n=this._data?.video?.version&&this._data.video.version>0?`v${this._data.video.version}/`:"";return `${this.cdn_root}/${this.embedId}/${n}${e}`},z=function(e){let n=e?.codec||"h264",t=e?.size||"hd",o=e?.container||"mp4";return g$1(this,i,w).call(this,`${n}_${t}.${o}`)},L=function(e){if(e?.path)return e.path;let n=e?.codec||g$1(this,i,y).call(this,e?.filename||"")||"mp3";return g$1(this,i,w).call(this,`audio.${n}`)},U=function(){let e=this._data?.video?.renditions||[];if(!e.length)return;let n=e.filter(o=>o.container==="mp4"&&o.codec==="h264"&&(!o.type||o.type==="video")),t=["hd","fhd","sd","qhd","uhd"];for(let o of t){let a=n.find(h=>h.size===o);if(a)return a}return n[0]||e.find(o=>o.type==="video")},F=function(){let e=this._data?.audio_tracks||[];if(e.length)return e.find(n=>n.default)||e[0]},y=function(e){if(!e)return;let n=e.split(".");return n.length>1?n.pop():void 0},f.styles=a`
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
6
|
--link-color: #006fc6;
|
|
@@ -17,4 +17,4 @@ import {b}from'./chunk-WO4HFIOO.js';import {a as a$1}from'./chunk-E7TZALBH.js';i
|
|
|
17
17
|
color: var(--link-color);
|
|
18
18
|
cursor: var(--link-cursor);
|
|
19
19
|
}
|
|
20
|
-
`,c([a({type:String})],f.prototype,"embed",1);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",f));export{f as a};
|
|
20
|
+
`,c([a$1({type:String})],f.prototype,"embed",1);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",f));export{f as a};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {c,b as b$1}from'./chunk-YPCQNE3R.js';var f={attribute:true,type:String,converter:b$1,reflect:false,hasChanged:c},h=(e=f,o,t)=>{let{kind:a,metadata:c}=t,i=globalThis.litPropertyMetadata.get(c);if(i===void 0&&globalThis.litPropertyMetadata.set(c,i=new Map),a==="setter"&&((e=Object.create(e)).wrapped=true),i.set(t.name,e),a==="accessor"){let{name:n}=t;return {set(s){let r=o.get.call(this);o.set.call(this,s),this.requestUpdate(n,r,e,true,s);},init(s){return s!==void 0&&this.C(n,void 0,e,s),s}}}if(a==="setter"){let{name:n}=t;return function(s){let r=this[n];o.call(this,s),this.requestUpdate(n,r,e,true,s);}}throw Error("Unsupported decorator location: "+a)};function d(e){return (o,t)=>typeof t=="object"?h(e,o,t):((a,c,i)=>{let n=c.hasOwnProperty(i);return c.constructor.createProperty(i,a),n?Object.getOwnPropertyDescriptor(c,i):void 0})(e,o,t)}function b(e){return d({...e,state:true,attribute:false})}var u=(e,o,t)=>(t.configurable=true,t.enumerable=true,Reflect.decorate&&typeof o!="object"&&Object.defineProperty(e,o,t),t);function E(e,o){return (t,a,c)=>{let i=n=>n.renderRoot?.querySelector(e)??null;if(o){let{get:n,set:s}=typeof a=="object"?t:c??(()=>{let r=Symbol();return {get(){return this[r]},set(m){this[r]=m;}}})();return u(t,a,{get(){let r=n.call(this);return r===void 0&&(r=i(this),(r!==null||this.hasUpdated)&&s.call(this,r)),r}})}return u(t,a,{get(){return i(this)}})}}/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/reactive-element/decorators/property.js:
|
|
4
|
+
@lit/reactive-element/decorators/state.js:
|
|
5
|
+
@lit/reactive-element/decorators/base.js:
|
|
6
|
+
@lit/reactive-element/decorators/query.js:
|
|
7
|
+
@lit/reactive-element/decorators/custom-element.js:
|
|
8
|
+
@lit/reactive-element/decorators/event-options.js:
|
|
9
|
+
@lit/reactive-element/decorators/query-all.js:
|
|
10
|
+
@lit/reactive-element/decorators/query-async.js:
|
|
11
|
+
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*)
|
|
17
|
+
|
|
18
|
+
@lit/reactive-element/decorators/query-assigned-elements.js:
|
|
19
|
+
(**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2021 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*)
|
|
24
|
+
*/export{d as a,b,E as c};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {a as a$2,c as c$2,b as b$2}from'./chunk-RHTBV6KZ.js';import {a as a$5}from'./chunk-MK4VIJT3.js';import {a as a$3}from'./chunk-R3SDTEHC.js';import {b as b$1}from'./chunk-OX42Y2HR.js';import {a as a$1,b}from'./chunk-PTN427IG.js';import {g,a as a$4}from'./chunk-5PIHL662.js';import {a}from'./chunk-YPCQNE3R.js';import {a as a$6}from'./chunk-ZTDQPDC6.js';import {c as c$1,e,g as g$1,d}from'./chunk-KA24PL7V.js';var i,v,c,u,y,M,p,I,S,T,r=class extends g{constructor(){super(...arguments);e(this,i);this.autoplay="lazy";this.quality="auto";this.fallback="placeholder";this._queue=[];this._failedPlay=false;this._intersectionObserver=new a$2(this,{callback:g$1(this,i,S).bind(this)});this.embedController=new b$1(this);}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.requestUpdate("embed"),this.embedController.embed=this.embed);}set loop(t){this._loop=(t===""||t=="true"||t==true)??false;}get loop(){return this._loop}get poster(){return this.embedController.embedFile(`${this.fallback}.jpg`)}set poster(t){if(t){let s=this._poster;this._poster=t,this.requestUpdate("poster",s);}}get token(){return this._token}set token(t){this._token!=t&&(this._token=t,this.requestUpdate("token"),this.embedController.token=this._token);}get sources(){let t=this.autoplay==="scroll"?["clip_keyframes"]:["video","clip"],s=this._embed.video.renditions.filter(e=>(this.quality=="auto"?e.size!=="uhd":d(this,i,c).indexOf(e.size)<=d(this,i,c).indexOf(this.quality))&&e.container==="mp4"&&d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>e.size===o.size?d(this,i,u).indexOf(e.codec)-d(this,i,u).indexOf(o.codec):d(this,i,c).indexOf(o.size)-d(this,i,c).indexOf(e.size)).map(e=>{let o=d(this,i,M).find(g=>g.size===e.size)?.media,m=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`;return {media:o,src:this.embedController.embedFile(m),codec:d(this,i,y)[e.codec]??e.codec}}),d$1=this._embed.video.renditions.filter(e=>d(this,i,c).indexOf(e.size)<=d(this,i,c).indexOf("fhd")&&e.container==="mp4"&&d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>d(this,i,c).indexOf(o.size)-d(this,i,c).indexOf(e.size));if(d$1.length>0){let e=d$1[0],o=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`,m={media:void 0,src:this.embedController.embedFile(o),codec:d(this,i,y)[e.codec]??e.codec};s.push(m);}return s}connectedCallback(){super.connectedCallback(),typeof document<"u"&&this.autoplay==="scroll"&&document.addEventListener("scroll",g$1(this,i,v).bind(this));}disconnectedCallback(){super.disconnectedCallback(),typeof document<"u"&&this.autoplay==="scroll"&&document.removeEventListener("scroll",g$1(this,i,v).bind(this)),this._metricsInstance?.demonitor();}set muted(t){this._videoElement?this._videoElement.muted=t:this._queue.push(()=>this._videoElement.muted=t);}get muted(){return this._videoElement?.muted||false}get paused(){return this._videoElement?.paused??true}get duration(){return new Promise((t,s)=>{if(this._videoElement&&!isNaN(this._videoElement.duration))return t(this._videoElement.duration);let d=()=>{this._videoElement?.addEventListener("loadedmetadata",()=>{this._videoElement&&t(this._videoElement.duration);}),this._videoElement?.addEventListener("error",e=>{s(new Error("Failed to load video metadata."));});};this._videoElement?d():this.addEventListener("mave:video_element_ready",()=>{d();});})}set currentTime(t){this._videoElement?this._videoElement.currentTime=t:this._queue.push(()=>this._videoElement.currentTime=t);}get currentTime(){return this._videoElement?this._videoElement?.currentTime:0}play(){this._videoElement?g$1(this,i,p).call(this):this._queue.push(()=>g$1(this,i,p).call(this));}pause(){this._videoElement?this._videoElement.pause():this._queue.push(()=>this._videoElement?.pause());}render(){return a$4`
|
|
2
|
+
${this.embedController.render({complete:t=>{if(this._embed=t,!!t)return a$4`
|
|
3
|
+
<video
|
|
4
|
+
@click=${g$1(this,i,T)}
|
|
5
|
+
preload="metadata"
|
|
6
|
+
style=${a$3(this._failedPlay||this.autoplay==="off"?"cursor: pointer":void 0)}
|
|
7
|
+
muted
|
|
8
|
+
playsinline
|
|
9
|
+
poster=${a$3(this._failedPlay?this.poster:void 0)}
|
|
10
|
+
${c$2(g$1(this,i,I))}
|
|
11
|
+
?autoplay=${this.autoplay==="always"}
|
|
12
|
+
?loop=${this.loop||true}
|
|
13
|
+
>
|
|
14
|
+
${this.sources.map(s=>a$4`
|
|
15
|
+
<source
|
|
16
|
+
media=${a$3(s.media?`(min-width: ${s.media}px)`:void 0)}
|
|
17
|
+
src=${s.src}
|
|
18
|
+
type=${`video/mp4; ${s.codec}`}
|
|
19
|
+
/>
|
|
20
|
+
`)}
|
|
21
|
+
</video>
|
|
22
|
+
`}})}
|
|
23
|
+
`}};i=new WeakSet,v=function(){if(typeof window>"u")return;let{height:t,top:s,bottom:d}=this.getBoundingClientRect(),e=window.innerHeight;if(this._videoElement){this._videoElement.duration||this._videoElement.load();let o=0;if(s<e&&d>0){let m=t+e;o=(e-s)/m*this._videoElement.duration;}o>=0&&o<=this._videoElement.duration&&(this._videoElement.currentTime=o);}},c=function(){return ["sd","hd","fhd","qhd","uhd"]},u=function(){let t=navigator.userAgent,s=/Edg/.test(t)&&/Mac OS/.test(t),d=/Safari/.test(t)&&!/Chrome/.test(t),e=/Mac OS/.test(t),o=/iPhone|iPad/.test(t);return e&&(d||s)||o?["hevc","h264"]:["av1","h264"]},y=function(){return {av1:"av01.0.08M.08.0.110.01.01.01.0,opus",hevc:"hevc.01.00.78,mp4a.40.2",h264:"avc1.64.00.28,mp4a.40.2"}},M=function(){return [{size:"qhd",media:1280},{size:"fhd",media:1080},{size:"hd",media:720},{size:"sd",media:640}]},p=function(){this._metricsInstance?.monitor(),this._videoElement&&(this._videoElement.muted=true,this._videoElement.play().catch(t=>{this._failedPlay=true;}));},I=function(t){if(this._videoElement||(this._videoElement=t,this.dispatchEvent(new CustomEvent("mave:video_element_ready",{detail:this._videoElement,bubbles:true,composed:true}))),this._intersectionObserver.observe(this._videoElement),this._videoElement&&this._embed){a$5.forEach(d=>{this._videoElement?.addEventListener(d,e=>{!this._canPlay&&this.autoplay==="scroll"&&d==="canplay"&&(this._canPlay=true,g$1(this,i,v).call(this)),this.dispatchEvent(new CustomEvent(d,{detail:e,bubbles:true,composed:true}));});});({video_id:this._embed.video.id,space_id:this._embed.space_id});b$2.config={apiEndpoint:a$6.metrics.endpoint},a$6.metrics.enabled&&(this._metricsInstance=new b$2(this._videoElement,this.embed,{component:"clip"}));}this._queue.length&&(this._queue.forEach(s=>s()),this._queue=[]);},S=function(t){for(let{isIntersecting:s}of t){if(this.autoplay==="always")return;s&&(this.autoplay==="lazy"||this.autoplay==="true")?this._videoElement?.paused&&g$1(this,i,p).call(this):this._videoElement?.paused||this._videoElement?.pause();}},T=function(){(this.autoplay==="off"||this._failedPlay)&&(this._videoElement?.paused?g$1(this,i,p).call(this):this._videoElement?.pause());},r.styles=a`
|
|
24
|
+
:host {
|
|
25
|
+
display: block;
|
|
26
|
+
position: relative;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
video {
|
|
31
|
+
all: initial;
|
|
32
|
+
display: block;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
object-fit: var(--clip-fit, cover);
|
|
36
|
+
object-position: var(--clip-position, 50% 50%);
|
|
37
|
+
}
|
|
38
|
+
`,c$1([a$1()],r.prototype,"embed",1),c$1([a$1()],r.prototype,"autoplay",2),c$1([a$1()],r.prototype,"quality",2),c$1([a$1()],r.prototype,"fallback",2),c$1([a$1()],r.prototype,"loop",1),c$1([a$1()],r.prototype,"poster",1),c$1([a$1()],r.prototype,"token",1),c$1([b()],r.prototype,"_failedPlay",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-clip")||window.customElements.define("mave-clip",r));export{r as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {c}from'./chunk-YPCQNE3R.js';var n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s;})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??true,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.());}hostUpdate(){this.autoRun===true&&this.S();}hostUpdated(){this.autoRun==="afterUpdate"&&this.S();}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t);}async run(t){let s,r;t??(t=this.T()),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=false;try{s=await this.v(t,{signal:this.q.signal});}catch(l){a=true,r=l;}if(this.p===i){if(s===n)this.i=0;else {if(a===false){try{this.k?.(s);}catch{}this.i=2,this.o?.(s);}else {try{this.A?.(r);}catch{}this.i=3,this.h?.(r);}this.u=s,this.l=r;}this._.requestUpdate();}}abort(t){this.i===1&&this.q?.abort(t);}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!c(s,t[r])));/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/task/task.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2017 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
*/export{e as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';var chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs');var n=Symbol(),e=class{get taskComplete(){return this.t||(this.i===1?this.t=new Promise(((t,s)=>{this.o=t,this.h=s;})):this.i===3?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,s,r){this.p=0,this.i=0,(this._=t).addController(this);let i=typeof s=="object"?s:{task:s,args:r};this.v=i.task,this.j=i.args,this.m=i.argsEqual??u,this.k=i.onComplete,this.A=i.onError,this.autoRun=i.autoRun??true,"initialValue"in i&&(this.u=i.initialValue,this.i=2,this.O=this.T?.());}hostUpdate(){this.autoRun===true&&this.S();}hostUpdated(){this.autoRun==="afterUpdate"&&this.S();}T(){if(this.j===void 0)return;let t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){let t=this.T(),s=this.O;this.O=t,t===s||t===void 0||s!==void 0&&this.m(s,t)||await this.run(t);}async run(t){let s,r;t??(t=this.T()),this.O=t,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun==="afterUpdate"?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let i=++this.p;this.q=new AbortController;let a=false;try{s=await this.v(t,{signal:this.q.signal});}catch(l){a=true,r=l;}if(this.p===i){if(s===n)this.i=0;else {if(a===false){try{this.k?.(s);}catch{}this.i=2,this.o?.(s);}else {try{this.A?.(r);}catch{}this.i=3,this.h?.(r);}this.u=s,this.l=r;}this._.requestUpdate();}}abort(t){this.i===1&&this.q?.abort(t);}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}},u=(h,t)=>h===t||h.length===t.length&&h.every(((s,r)=>!chunkNPP5B5PV_cjs.c(s,t[r])));/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/task/task.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2017 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
*/exports.a=e;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';var chunkRRCW5BBR_cjs=require('./chunk-RRCW5BBR.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs');var u="important",d=" !"+u,h=chunkRRCW5BBR_cjs.b(class extends chunkRRCW5BBR_cjs.c{constructor(s){if(super(s),s.type!==chunkRRCW5BBR_cjs.a.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((n,t)=>{let e=s[t];return e==null?n:n+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(s,[n]){let{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]==null&&(this.ft.delete(e),e.includes("-")?t.removeProperty(e):t[e]=null);for(let e in n){let r=n[e];if(r!=null){this.ft.add(e);let i=typeof r=="string"&&r.endsWith(d);e.includes("-")||i?t.setProperty(e,i?r.slice(0,-11):r,i?u:""):t[e]=r;}}return chunk2E5GLLOS_cjs.d}});/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
lit-html/directives/style-map.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2018 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
*/exports.a=h;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {b as b$1,c as c$1,a as a$1}from'./chunk-MMHEOMF5.js';import {f as f$1,e}from'./chunk-5PIHL662.js';var fe=class{constructor(e,{target:s,config:r,callback:d,skipInitial:y}){this.t=new Set,this.o=false,this.i=false,this.h=e,s!==null&&this.t.add(s??e),this.o=y??this.o,this.callback=d,window.IntersectionObserver?(this.u=new IntersectionObserver(B=>{let _=this.i;this.i=false,this.o&&_||(this.handleChanges(B),this.h.requestUpdate());},r),e.addController(this)):console.warn("IntersectionController error: browser does not support IntersectionObserver.");}handleChanges(e){this.value=this.callback?.(e,this.u);}hostConnected(){for(let e of this.t)this.observe(e);}hostDisconnected(){this.disconnect();}async hostUpdated(){let e=this.u.takeRecords();e.length&&this.handleChanges(e);}observe(e){this.t.add(e),this.u.observe(e),this.i=true;}unobserve(e){this.t.delete(e),this.u.unobserve(e);}disconnect(){this.u.disconnect();}};var pe=i=>{throw TypeError(i)},ie=(i,e,s)=>e.has(i)||pe("Cannot "+s),t=(i,e,s)=>(ie(i,e,"read from private field"),s?s.call(i):e.get(i)),o=(i,e,s)=>e.has(i)?pe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),n=(i,e,s,r)=>(ie(i,e,"write to private field"),e.set(i,s),s),h=(i,e,s)=>(ie(i,e,"access private method"),s),G,_e=class R{static setDebug(e){n(R,G,e);}static debugEnabled(){if(t(R,G))return true;try{let e=globalThis;if(e.__MAVE_DATA_DEBUG__===!0||e.localStorage?.getItem("MAVE_DATA_DEBUG")==="1")return !0}catch{}return false}static log(e){console.log(`[mave_data]: ${e}`);}static error(e,s){typeof s>"u"?console.error(`[mave_data]: ${e}`):console.error(`[mave_data]: ${e}`,s);}static debug(e,s){R.debugEnabled()&&(typeof s>"u"?console.debug(`[mave_data]: ${e}`):console.debug(`[mave_data]: ${e}`,s));}};G=new WeakMap;o(_e,G,false);var f=_e,q,m,I,S,se,Y,z,W,p,me,ve,$,ne,ge,ye,be,we,ke,Ae,Be=class g{constructor(){if(o(this,p),o(this,q,{apiEndpoint:""}),o(this,m,[]),o(this,I,null),o(this,S,null),o(this,se,5e3),o(this,Y,50),o(this,z,48*1024),o(this,W,null),typeof window<"u"){let e=h(this,p,Ae).bind(this);n(this,S,e),document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e);}}static get instance_(){return g.instance||(g.instance=new g),g.instance}static set config(e){n(g.instance_,q,e),typeof e.debug=="boolean"&&f.setDebug(e.debug);}static push(e){var s;h(s=g.instance_,p,me).call(s,e);}static flush(){var e;h(e=g.instance_,p,$).call(e);}static flushAsync(){var e;return h(e=g.instance_,p,ve).call(e)}static flushOnExit(){var e;h(e=g.instance_,p,$).call(e,{keepalive:true,preferBeacon:true});}static __resetForTests(){var e;g.instance&&h(e=g.instance,p,ge).call(e),g.instance=void 0;}};q=new WeakMap;m=new WeakMap;I=new WeakMap;S=new WeakMap;se=new WeakMap;Y=new WeakMap;z=new WeakMap;W=new WeakMap;p=new WeakSet;me=function(i){let e={name:i.name||"unknown",timestamp:i.timestamp||Date.now(),session_id:i.session_id||"",...i};t(this,m).push(e),f.debug("Data.push",{name:e.name,session_id:e.session_id,embed_id:e.embed_id,video_time:e.video_time,buffer_size:t(this,m).length}),!t(this,I)&&typeof globalThis.setInterval=="function"&&n(this,I,globalThis.setInterval(()=>h(this,p,$).call(this),t(this,se))),t(this,m).length>=t(this,Y)&&h(this,p,$).call(this);};ve=function(i){return h(this,p,$).call(this,i),t(this,W)??Promise.resolve(true)};$=function(i){if(t(this,m).length===0||t(this,W))return;let e=[...t(this,m)];n(this,m,[]);let s=t(this,q).apiEndpoint||"https://metrics.video-dns.com/v1/events",r=i?.keepalive??(typeof document<"u"&&document.visibilityState==="hidden"),d=i?.preferBeacon??false,y=h(this,p,ye).call(this,e);f.debug("Data.flush.start",{url:s,buffered:e.length,batches:y.map(_=>_.length),keepalive:r,preferBeacon:d});let B=false;n(this,W,(async()=>{for(let _ of y){let Ce={events:_};if(f.debug("Data.flush.batch",{size:_.length,first:_[0]?.name,last:_[_.length-1]?.name}),!await h(this,p,we).call(this,s,Ce,r,d))return n(this,m,[..._,...t(this,m)]),false}return true})().catch(_=>(f.error("Failed to send metrics",_),n(this,m,[...e,...t(this,m)]),false)).then(_=>(f.debug("Data.flush.done",{ok:_,remaining_buffer:t(this,m).length}),_&&t(this,m).length>0&&(B=true),_)).finally(()=>{n(this,W,null),t(this,m).length===0&&h(this,p,ne).call(this),B&&h(this,p,$).call(this);}));};ne=function(){t(this,I)!=null&&(typeof globalThis.clearInterval=="function"&&globalThis.clearInterval(t(this,I)),n(this,I,null));};ge=function(){typeof window<"u"&&t(this,S)&&(document.removeEventListener("visibilitychange",t(this,S)),window.removeEventListener("pagehide",t(this,S)),window.removeEventListener("beforeunload",t(this,S))),h(this,p,ne).call(this),n(this,m,[]),n(this,W,null);};ye=function(i){let e=[],s=[],r=0;for(let d of i){let y=h(this,p,be).call(this,d),B=r+y>t(this,z),_=s.length>=t(this,Y);s.length>0&&(B||_)&&(e.push(s),s=[],r=0),s.push(d),r+=y;}return s.length>0&&e.push(s),e};be=function(i){try{return JSON.stringify(i).length}catch{return 1024}};we=async function(i,e,s,r){if(r&&s&&h(this,p,ke).call(this,i,e))return f.debug("Data.send.beacon",{url:i,bytes:JSON.stringify(e).length}),true;try{let d=await fetch(i,{method:"POST",keepalive:s,headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return f.debug("Data.send.fetch",{url:i,ok:d.ok,status:d.status}),d.ok}catch(d){return f.error("Failed to send metrics",d),f.debug("Data.send.fetch.error",d),false}};ke=function(i,e){try{if(typeof navigator>"u"||typeof navigator.sendBeacon!="function")return !1;let s=JSON.stringify(e);if(s.length>t(this,z))return !1;let r=new Blob([s],{type:"application/json"});return navigator.sendBeacon(i,r)}catch{return false}};Ae=function(i){let e=i?.type==="pagehide"||i?.type==="beforeunload",s=document.visibilityState==="hidden";(e||s)&&(f.debug(`Data.handleVisibilityChange (${i?.type||"visibility"})`,{state:document.visibilityState}),h(this,p,$).call(this,{keepalive:true,preferBeacon:true}));};var u=Be;function Ne(){let i=globalThis.crypto;if(i?.randomUUID)return i.randomUUID();if(i?.getRandomValues)return "10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>{let d=i.getRandomValues(new Uint8Array(1))[0]??0;return (Number(r)^(d&15)>>Number(r)/4).toString(16)});let e=Math.random().toString(16).slice(2).padEnd(12,"0"),s=Date.now().toString(16).padStart(12,"0");return `${s.slice(0,8)}-${s.slice(8,12)}-4000-8000-${e.slice(0,12)}`}var ae=(i=>(i.PLAYING="playing",i.ENDED="ended",i.PAUSE="pause",i))(ae||{}),a,c,b,w,C,M,O,P,k,D,v,A,he,re,le,E,J,l,U,j,X,H,x,L,Me,Te,Ee,F,te,$e,Se,Pe,N,T,De,Ge=class{constructor(...i){if(o(this,l),this.VERSION="0.1.0",o(this,a),o(this,c,null),o(this,b,false),o(this,w,false),o(this,C,null),o(this,M,false),o(this,O,0),o(this,P,0),o(this,k,null),o(this,D,null),o(this,v,null),o(this,A,null),o(this,he,750),o(this,re,1),o(this,le,300),o(this,E,false),o(this,J,e=>h(this,l,De).call(this,e)),o(this,j,()=>{if(!t(this,b)||!t(this,a))return;h(this,l,U).call(this),f.debug("Metrics.native.seeking",{currentTime:t(this,a).currentTime,lastObservedVideoTime:t(this,P),paused:t(this,a).paused,seeking:t(this,a).seeking,lastEventType:t(this,c)});let e=t(this,c)==="play"||!t(this,a).paused&&!t(this,a).ended;if(e&&t(this,c)!=="pause"){n(this,w,true),n(this,M,false),h(this,l,F).call(this),h(this,l,T).call(this);let s=t(this,P)||t(this,a).currentTime||0,r=h(this,l,L).call(this,"pause");u.push({...r,name:"pause",video_time:s}),n(this,c,"pause"),u.flush(),f.debug("Metrics.scrub.pause_sent",{pauseTime:s,currentTime:t(this,a).currentTime});}else f.debug("Metrics.scrub.pause_not_sent",{wasPlaying:e,lastEventType:t(this,c)});}),o(this,X,()=>{t(this,b)&&t(this,a)&&(f.debug("Metrics.native.seeked",{currentTime:t(this,a).currentTime,paused:t(this,a).paused,seeking:t(this,a).seeking,wasPlayingBeforeSeek:t(this,w),lastEventType:t(this,c)}),t(this,w)&&(h(this,l,U).call(this),n(this,C,window.setTimeout(()=>{if(n(this,C,null),!!t(this,b)&&t(this,a)){if(t(this,c)==="play"){n(this,w,false),n(this,M,false);return}if(!t(this,a).seeking&&!t(this,a).paused&&!t(this,a).ended){let e=h(this,l,L).call(this,"play");u.push({...e,name:"play"}),n(this,c,"play"),n(this,D,Date.now()),n(this,E,true),n(this,O,Date.now()+1500),h(this,l,N).call(this),n(this,M,false),u.flush(),n(this,w,false);}else n(this,M,true),n(this,w,false);}},200))));}),o(this,H,()=>{t(this,b)&&document.visibilityState==="hidden"&&u.flush();}),o(this,x,e=>{if(t(this,b)){if(e.persisted){u.flush();return}h(this,l,te).call(this),h(this,l,Ee).call(this),u.flushOnExit();}}),this.sessionId=Ne(),i.length<2)f.error("Metrics requires two arguments: a querySelectorable, hls instance or HTMLMediaElement/HTMLVideoElement and a unique embedId for your video.");else if(typeof i[0]=="string"&&(this.querySelectorable=i[0],this.embedId=i[1]),i[0]instanceof HTMLVideoElement||i[0]instanceof HTMLMediaElement?n(this,a,i[0]):typeof i[0]=="object"&&(this.hls=i[0]),this.embedId=i[1],i[2]){let e=i[2];this.component=e.component;}}static set config(i){u.config=i,typeof i.debug=="boolean"&&f.setDebug(i.debug);}monitor(){let i=this.querySelectorable?document.querySelector(this.querySelectorable):this.hls?.media;return t(this,b)?this:(i||t(this,a)?(t(this,a)||n(this,a,i),f.debug("Metrics.monitor",{embed_id:this.embedId,session_id:this.sessionId,currentTime:t(this,a).currentTime,paused:t(this,a).paused,seeking:t(this,a).seeking,readyState:t(this,a).readyState}),h(this,l,Se).call(this),n(this,P,t(this,a).currentTime||0),window.addEventListener("visibilitychange",t(this,H)),window.addEventListener("pagehide",t(this,x)),n(this,b,true)):f.error(`${this.querySelectorable} is not a valid reference to a HTMLVideoElement.`),this)}demonitor(){t(this,b)&&(h(this,l,te).call(this),h(this,l,Me).call(this),h(this,l,U).call(this),h(this,l,T).call(this),h(this,l,Pe).call(this),window.removeEventListener("visibilitychange",t(this,H)),window.removeEventListener("pagehide",t(this,x)),n(this,b,false));}};a=new WeakMap;c=new WeakMap;b=new WeakMap;w=new WeakMap;C=new WeakMap;M=new WeakMap;O=new WeakMap;P=new WeakMap;k=new WeakMap;D=new WeakMap;v=new WeakMap;A=new WeakMap;he=new WeakMap;re=new WeakMap;le=new WeakMap;E=new WeakMap;J=new WeakMap;l=new WeakSet;U=function(){t(this,C)!=null&&(window.clearTimeout(t(this,C)),n(this,C,null));};j=new WeakMap;X=new WeakMap;H=new WeakMap;x=new WeakMap;L=function(i){return {name:i,duration:t(this,a)?.duration,video_time:t(this,a)?.currentTime,session_id:this.sessionId,embed_id:this.embedId||"unknown",component:this.component,source_url:window.location.href,timestamp:Date.now()}};Me=function(){t(this,a)&&(t(this,a).paused||t(this,c)!=="pause"&&(t(this,v)||(h(this,l,Te).call(this),u.flush())));};Te=function(){t(this,a)&&t(this,c)!=="pause"&&(t(this,v)||(u.push(h(this,l,L).call(this,"pause")),n(this,c,"pause")));};Ee=function(){t(this,a)&&t(this,c)==="play"&&(t(this,v)||(u.push(h(this,l,L).call(this,"pause")),n(this,c,"pause")));};F=function(){t(this,v)&&(window.clearTimeout(t(this,v)),n(this,v,null)),n(this,A,null);};te=function(){if(!t(this,v)||!t(this,A))return;window.clearTimeout(t(this,v));let i=t(this,A);n(this,v,null),n(this,A,null),u.push(i),n(this,c,"pause"),n(this,E,false),u.flush();};$e=function(i){t(this,v)||(n(this,A,i),n(this,v,window.setTimeout(()=>{if(!t(this,A)){n(this,v,null);return}let e=t(this,A);n(this,A,null),n(this,v,null),u.push(e),n(this,c,"pause"),u.flush();},t(this,le))));};Se=function(){f.debug("Metrics.listeners.attach",{embed_id:this.embedId,session_id:this.sessionId});for(let i of Object.values(ae))t(this,a).addEventListener(i,t(this,J));t(this,a).addEventListener("seeking",t(this,j)),t(this,a).addEventListener("seeked",t(this,X));};Pe=function(){for(let i of Object.values(ae))t(this,a).removeEventListener(i,t(this,J));t(this,a).removeEventListener("seeking",t(this,j)),t(this,a).removeEventListener("seeked",t(this,X));};N=function(){if(!t(this,a)||t(this,k)!=null)return;let i=()=>{if(!t(this,a)){n(this,k,null);return}n(this,P,t(this,a).currentTime||t(this,P)),t(this,b)&&!t(this,a).paused&&!t(this,a).ended?n(this,k,window.requestAnimationFrame(i)):n(this,k,null);};n(this,k,window.requestAnimationFrame(i));};T=function(){t(this,k)!=null&&(window.cancelAnimationFrame(t(this,k)),n(this,k,null));};De=function(i){let e=h(this,l,L).call(this,i.type);switch(f.debug("Metrics.native.event",{type:i.type,currentTime:t(this,a)?.currentTime,paused:t(this,a)?.paused,seeking:t(this,a)?.seeking,readyState:t(this,a)?.readyState,lastEventType:t(this,c),wasPlayingBeforeSeek:t(this,w),awaitingSeekResumePlay:t(this,M)}),i.type){case "playing":if(h(this,l,F).call(this),t(this,M)){if(t(this,c)!=="play"){let d=h(this,l,L).call(this,"play");u.push({...d,name:"play"}),n(this,c,"play"),n(this,D,Date.now()),n(this,E,true),n(this,O,Date.now()+1500),h(this,l,N).call(this),u.flush();}n(this,M,false);break}if(t(this,a)?.seeking||t(this,w))break;if(Date.now()<t(this,O)){n(this,c,"play"),h(this,l,N).call(this);break}if(t(this,c)==="play")break;u.push({...e,name:"play"}),n(this,c,"play"),n(this,D,Date.now()),n(this,E,false),h(this,l,N).call(this);break;case "pause":if(t(this,a)?.seeking){h(this,l,T).call(this);break}if(t(this,c)==="pause"){h(this,l,T).call(this);break}let s=t(this,D)==null?Number.POSITIVE_INFINITY:Date.now()-t(this,D),r=t(this,a)?.currentTime??0;if(s<=t(this,he)&&(r<=t(this,re)||t(this,E))){h(this,l,$e).call(this,{...e,name:"pause"}),h(this,l,T).call(this);break}u.push({...e,name:"pause"}),n(this,c,"pause"),n(this,E,false),h(this,l,T).call(this),u.flush();break;case "ended":h(this,l,F).call(this),h(this,l,T).call(this),t(this,c)!=="pause"&&(u.push({...e,name:"pause"}),n(this,c,"pause"),u.flush());break;}};var{I:ze}=f$1;var Ie=i=>i.strings===void 0;var V=(i,e)=>{let s=i._$AN;if(s===void 0)return false;for(let r of s)r._$AO?.(e,false),V(r,e);return true},Q=i=>{let e,s;do{if((e=i._$AM)===void 0)break;s=e._$AN,s.delete(i),i=e;}while(s?.size===0)},We=i=>{for(let e;e=i._$AM;i=e){let s=e._$AN;if(s===void 0)e._$AN=s=new Set;else if(s.has(i))break;s.add(i),Re(e);}};function Oe(i){this._$AN!==void 0?(Q(this),this._$AM=i,We(this)):this._$AM=i;}function Ve(i,e=false,s=0){let r=this._$AH,d=this._$AN;if(d!==void 0&&d.size!==0)if(e)if(Array.isArray(r))for(let y=s;y<r.length;y++)V(r[y],false),Q(r[y]);else r!=null&&(V(r,false),Q(r));else V(this,i);}var Re=i=>{i.type==a$1.CHILD&&(i._$AP??(i._$AP=Ve),i._$AQ??(i._$AQ=Oe));},K=class extends c$1{constructor(){super(...arguments),this._$AN=void 0;}_$AT(e,s,r){super._$AT(e,s,r),We(this),this.isConnected=e._$AU;}_$AO(e,s=true){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),s&&(V(this,e),Q(this));}setValue(e){if(Ie(this._$Ct))this._$Ct._$AI(e,this);else {let s=[...this._$Ct._$AH];s[this._$Ci]=e,this._$Ct._$AI(s,this,0);}}disconnected(){}reconnected(){}};var oe=new WeakMap,it=b$1(class extends K{render(i){return e}update(i,[e$1]){let s=e$1!==this.G;return s&&this.G!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e$1,this.ht=i.options?.host,this.rt(this.ct=i.element)),e}rt(i){if(this.isConnected||(i=void 0),typeof this.G=="function"){let e=this.ht??globalThis,s=oe.get(e);s===void 0&&(s=new WeakMap,oe.set(e,s)),s.get(this.G)!==void 0&&this.G.call(this.ht,void 0),s.set(this.G,i),i!==void 0&&this.G.call(this.ht,i);}else this.G.value=i;}get lt(){return typeof this.G=="function"?oe.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0);}reconnected(){this.rt(this.ct);}});/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit-labs/observers/intersection-controller.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2021 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
|
|
10
|
+
lit-html/directive-helpers.js:
|
|
11
|
+
lit-html/directives/ref.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2020 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*)
|
|
17
|
+
|
|
18
|
+
lit-html/async-directive.js:
|
|
19
|
+
(**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*)
|
|
24
|
+
*/export{fe as a,Ge as b,it as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkX7OGQ4KH_cjs=require('./chunk-X7OGQ4KH.cjs'),chunkQOM4AP6R_cjs=require('./chunk-QOM4AP6R.cjs'),chunkEVKPEPYP_cjs=require('./chunk-EVKPEPYP.cjs');var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=true;this.loading=true;this.host=e,this.type=t,this.loading=true,this.task=new chunkQOM4AP6R_cjs.a(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${chunkX7OGQ4KH_cjs.a}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=true,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return chunkEVKPEPYP_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=true,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest.json"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}return this.token&&t.append("token",this.token),e=="manifest.json"&&(t.has("e")&&t.delete("e"),t.append("e",new Date().getTime().toString())),e!=="manifest.json"&&!this.caching&&(t.has("e")||t.append("e",new Date().getTime().toString())),s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};exports.a=c;exports.b=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-PTN427IG.js';import {g,a as a$2}from'./chunk-5PIHL662.js';import {a as a$1}from'./chunk-ZTDQPDC6.js';import {c}from'./chunk-KA24PL7V.js';var s=class extends g{constructor(){super(...arguments);this.EVENT_TYPES={CLICK:"user_click"};}get embed(){return this._embed}set embed(t){this._embed=t;}get embedId(){return this._embed?.substring(5,this._embed?.length)}get spaceId(){return this.embed?.substring(0,5)}get cdn_root(){return a$1.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}get _stylesheets(){if(typeof document>"u")return a$2``;let t=document.querySelectorAll('style, link[rel="stylesheet"]');return a$2`${Array.from(t).map(e=>e.cloneNode(true))}`}durationToTime(t){let e=Math.floor(t),n=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return n>0?`${n}:${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${i}:${o.toString().padStart(2,"0")}`}emit(t,e){this.dispatchEvent(new CustomEvent(`mave:${t}`,{detail:{...e,eventType:t}})),this.dispatchEvent(new CustomEvent("mave:*",{detail:{...e,eventType:t}}));}};c([a({type:String})],s.prototype,"embed",1);export{s as a};
|