@maveio/components 0.0.154 → 0.0.155-beta.0
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/README.md +12 -0
- package/dist/chunk-2ELUELDT.cjs +1 -0
- package/dist/chunk-3MEOYLCV.cjs +20 -0
- package/dist/chunk-45FW5DBN.js +1 -0
- package/dist/{chunk-2C6BGW6H.js → chunk-4CDE2QCJ.js} +2 -2
- package/dist/chunk-4M7XLFOJ.cjs +161 -0
- package/dist/chunk-6MCTUE3H.js +37 -0
- package/dist/{chunk-YVMWE3I7.js → chunk-6NE3LOKU.js} +3 -3
- package/dist/{chunk-WLVMWIKH.cjs → chunk-6NWQAHZT.cjs} +2 -2
- package/dist/chunk-7MHSKSE5.js +161 -0
- package/dist/{chunk-D3LG3UTO.js → chunk-7WWUNKRI.js} +3 -3
- package/dist/{chunk-SAOOZPZZ.cjs → chunk-ALY7UTZA.cjs} +3 -3
- package/dist/{chunk-36CSGHYJ.js → chunk-ESQT2PPF.js} +2 -2
- package/dist/chunk-F6EKAS27.js +1 -0
- package/dist/chunk-FSFJQ67W.js +93 -0
- package/dist/{chunk-DH5I55F5.js → chunk-HX6F65VL.js} +1 -1
- package/dist/{chunk-WFWUIIE6.js → chunk-IBTJ5OMP.js} +2 -2
- package/dist/chunk-J7OISSKU.cjs +1 -0
- package/dist/chunk-JBRRVOTV.cjs +37 -0
- package/dist/{chunk-2P6HF22Q.cjs → chunk-KTGL4HLA.cjs} +2 -2
- package/dist/{chunk-YAVQQEFQ.cjs → chunk-M3UFDMO6.cjs} +3 -3
- package/dist/chunk-MC6T46LX.cjs +93 -0
- package/dist/chunk-MKZYI5TY.cjs +1 -0
- package/dist/chunk-OTDMHX6X.js +20 -0
- package/dist/chunk-P6SBZPDR.js +1 -0
- package/dist/{chunk-EB4QCWWS.cjs → chunk-RFBU3KXA.cjs} +3 -3
- package/dist/{chunk-X3IY737A.cjs → chunk-TVNAG7X4.cjs} +2 -2
- package/dist/{chunk-HKHV3KLY.js → chunk-VZKW2VWI.js} +2 -2
- package/dist/{chunk-Y7NYUH3P.cjs → chunk-YT56YDUY.cjs} +1 -1
- package/dist/{chunk-TI75IJ2E.cjs → chunk-ZODBVQLM.cjs} +1 -1
- package/dist/chunk-ZOWJYZSD.js +1 -0
- 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.d.cts +19 -3
- package/dist/components/upload.d.ts +19 -3
- package/dist/components/upload.js +1 -1
- package/dist/embed/api.cjs +1 -1
- package/dist/embed/api.d.cts +4 -3
- package/dist/embed/api.d.ts +4 -3
- package/dist/embed/api.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.js +1 -1
- package/dist/utils/mave_element.cjs +1 -1
- package/dist/utils/mave_element.js +1 -1
- package/dist/utils/origin.cjs +1 -1
- package/dist/utils/origin.js +1 -1
- package/dist/vue.cjs +1 -0
- package/dist/vue.d.cts +65 -0
- package/dist/vue.d.ts +65 -0
- package/dist/vue.js +1 -0
- package/package.json +22 -7
- package/dist/chunk-2EYY6N7K.js +0 -20
- package/dist/chunk-3PLBZPRP.js +0 -1
- package/dist/chunk-4GTAVYTC.cjs +0 -93
- package/dist/chunk-5OEIKFAN.js +0 -93
- package/dist/chunk-6QHPCMNQ.js +0 -104
- package/dist/chunk-COWZ7GYF.cjs +0 -1
- package/dist/chunk-F2VMRZFU.cjs +0 -20
- package/dist/chunk-GMEHYYP4.js +0 -37
- package/dist/chunk-LOR3PIH5.cjs +0 -37
- package/dist/chunk-MB72HBHH.cjs +0 -1
- package/dist/chunk-NV7C4TBM.js +0 -1
- package/dist/chunk-TIOUPJWD.js +0 -1
- package/dist/chunk-TPP5OQFR.js +0 -1
- package/dist/chunk-VW7IKXVI.cjs +0 -1
- package/dist/chunk-WEZKG6QZ.cjs +0 -104
- package/dist/lottie-player.esm-BBAKIFYQ.js +0 -283
- package/dist/lottie-player.esm-OYBEUNQX.cjs +0 -283
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';var chunkJ7OISSKU_cjs=require('./chunk-J7OISSKU.cjs');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var M=e=>typeof e!="string"&&"strTag"in e,p=(e,t,o)=>{let n=e[0];for(let r=1;r<e.length;r++)n+=t[o?o[r-1]:r-1],n+=e[r];return n};var c=e=>M(e)?p(e.strings,e.values):e;var d="lit-localize-status";var x=class{constructor(t){this.__litLocalizeEventHandler=o=>{o.detail.status==="ready"&&this.host.requestUpdate();},this.host=t;}hostConnected(){window.addEventListener(d,this.__litLocalizeEventHandler);}hostDisconnected(){window.removeEventListener(d,this.__litLocalizeEventHandler);}},F=e=>e.addController(new x(e)),I=F;var N=()=>(e,t)=>(e.addInitializer(I),e);var u=class{constructor(){this.settled=false,this.promise=new Promise((t,o)=>{this._resolve=t,this._reject=o;});}resolve(t){this.settled=true,this._resolve(t);}reject(t){this.settled=true,this._reject(t);}};var i=[];for(let e=0;e<256;e++)i[e]=(e>>4&15).toString(16)+(e&15).toString(16);function C(e){let t=0,o=8997,n=0,r=33826,s=0,a=40164,L=0,f=52210;for(let v=0;v<e.length;v++)o^=e.charCodeAt(v),t=o*435,n=r*435,s=a*435,L=f*435,s+=o<<8,L+=r<<8,n+=t>>>16,o=t&65535,s+=n>>>16,r=n&65535,f=L+(s>>>16)&65535,a=s&65535;return i[f>>8]+i[f&255]+i[a>>8]+i[a&255]+i[r>>8]+i[r&255]+i[o>>8]+i[o&255]}var W="",$="h",b="s";function z(e,t){return (t?$:b)+C(typeof e=="string"?e:e.join(W))}var A=new WeakMap,R=new Map;function j(e,t,o){if(e){let n=o?.id??O(t),r=e[n];if(r){if(typeof r=="string")return r;if("strTag"in r)return p(r.strings,t.values,r.values);{let s=A.get(r);return s===void 0&&(s=r.values,A.set(r,s)),{...r,values:s.map(a=>t.values[a])}}}}return c(t)}function O(e){let t=typeof e=="string"?e:e.strings,o=R.get(t);return o===void 0&&(o=z(t,typeof e!="string"&&!("strTag"in e)),R.set(t,o)),o}function _(e){window.dispatchEvent(new CustomEvent(d,{detail:e}));}var g="",E,H,h,w,P,l=new u;l.resolve();var m=0,U=e=>(S((t,o)=>j(P,t,o)),g=H=e.sourceLocale,h=new Set(e.targetLocales),h.add(e.sourceLocale),w=e.loadLocale,{getLocale:k,setLocale:X}),k=()=>g,X=e=>{if(e===(E??g))return l.promise;if(!h||!w)throw new Error("Internal error");if(!h.has(e))throw new Error("Invalid locale code");m++;let t=m;return E=e,l.settled&&(l=new u),_({status:"loading",loadingLocale:e}),(e===H?Promise.resolve({templates:void 0}):w(e)).then(n=>{m===t&&(g=e,E=void 0,P=n.templates,_({status:"ready",readyLocale:e}),l.resolve());},n=>{m===t&&(_({status:"error",errorLocale:e,errorMessage:n.toString()}),l.reject(n));}),l.promise};exports.b=c;var V=false;function S(e){if(V)throw new Error("lit-localize can only be configured once");exports.b=e,V=true;}var G={en:()=>import('./generated/locales/en.cjs'),nl:()=>import('./generated/locales/nl.cjs'),de:()=>import('./generated/locales/de.cjs'),fr:()=>import('./generated/locales/fr.cjs')};function B(e){return G[e]}async function J(e){let t=chunkJ7OISSKU_cjs.a();if(!t)return null;try{return await import(new URL(`./${t}generated/locales/${e}.js`,(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-MC6T46LX.cjs', document.baseURI).href))).href)}catch{return null}}var K=U({sourceLocale:"default",targetLocales:["en","nl","de","fr"],loadLocale:async e=>{let t=B(e);if(t)try{return await t()}catch(n){console.error(`[mave-player]: failed to load locale ${e}`,n);}let o=await J(e);return o||(console.log(`[mave-player]: locale not loaded for ${e}`),null)}}),y=false,D=class{constructor(t){this._onLoad=t=>{t.detail.status==="loading"?y=false:t.detail.status==="ready"&&(y=true),this.host.requestUpdate();};this.host=t,t.addController(this);}get loaded(){return y}set locale(t){this._locale!==t&&(K.setLocale(t),this.host.requestUpdate());}get locale(){return this._locale}hostConnected(){typeof window<"u"&&window.addEventListener("lit-localize-status",this._onLoad);}hostDisconnected(){typeof window<"u"&&window.removeEventListener("lit-localize-status",this._onLoad);}};/*! Bundled license information:
|
|
2
|
+
|
|
3
|
+
@lit/localize/internal/str-tag.js:
|
|
4
|
+
(**
|
|
5
|
+
* @license
|
|
6
|
+
* Copyright 2021 Google LLC
|
|
7
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
8
|
+
*)
|
|
9
|
+
|
|
10
|
+
@lit/localize/internal/default-msg.js:
|
|
11
|
+
(**
|
|
12
|
+
* @license
|
|
13
|
+
* Copyright 2021 Google LLC
|
|
14
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
+
*)
|
|
16
|
+
|
|
17
|
+
@lit/localize/internal/locale-status-event.js:
|
|
18
|
+
(**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2021 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*)
|
|
23
|
+
|
|
24
|
+
@lit/localize/internal/types.js:
|
|
25
|
+
(**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright 2021 Google LLC
|
|
28
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
+
*)
|
|
30
|
+
|
|
31
|
+
@lit/localize/internal/localized-controller.js:
|
|
32
|
+
(**
|
|
33
|
+
* @license
|
|
34
|
+
* Copyright 2021 Google LLC
|
|
35
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
|
+
*)
|
|
37
|
+
|
|
38
|
+
@lit/localize/internal/localized-decorator.js:
|
|
39
|
+
(**
|
|
40
|
+
* @license
|
|
41
|
+
* Copyright 2021 Google LLC
|
|
42
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
+
*)
|
|
44
|
+
|
|
45
|
+
@lit/localize/internal/deferred.js:
|
|
46
|
+
(**
|
|
47
|
+
* @license
|
|
48
|
+
* Copyright 2020 Google LLC
|
|
49
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
+
*)
|
|
51
|
+
|
|
52
|
+
@lit/localize/internal/fnv1a64.js:
|
|
53
|
+
(**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2014 Travis Webb
|
|
56
|
+
* SPDX-License-Identifier: MIT
|
|
57
|
+
*)
|
|
58
|
+
|
|
59
|
+
@lit/localize/internal/id-generation.js:
|
|
60
|
+
(**
|
|
61
|
+
* @license
|
|
62
|
+
* Copyright 2020 Google LLC
|
|
63
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
64
|
+
*)
|
|
65
|
+
|
|
66
|
+
@lit/localize/internal/runtime-msg.js:
|
|
67
|
+
(**
|
|
68
|
+
* @license
|
|
69
|
+
* Copyright 2021 Google LLC
|
|
70
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
+
*)
|
|
72
|
+
|
|
73
|
+
@lit/localize/init/runtime.js:
|
|
74
|
+
(**
|
|
75
|
+
* @license
|
|
76
|
+
* Copyright 2021 Google LLC
|
|
77
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
|
+
*)
|
|
79
|
+
|
|
80
|
+
@lit/localize/init/transform.js:
|
|
81
|
+
(**
|
|
82
|
+
* @license
|
|
83
|
+
* Copyright 2021 Google LLC
|
|
84
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
85
|
+
*)
|
|
86
|
+
|
|
87
|
+
@lit/localize/lit-localize.js:
|
|
88
|
+
(**
|
|
89
|
+
* @license
|
|
90
|
+
* Copyright 2020 Google LLC
|
|
91
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
92
|
+
*)
|
|
93
|
+
*/exports.a=N;exports.c=K;exports.d=D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var s=class extends chunk5NSCV6C2_cjs.i{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 chunk5STN56TL_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}get _stylesheets(){if(typeof document>"u")return chunk5NSCV6C2_cjs.c``;let t=document.querySelectorAll('style, link[rel="stylesheet"]');return chunk5NSCV6C2_cjs.c`${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}}));}};chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a({type:String})],s.prototype,"embed",1);exports.a=s;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-HX6F65VL.js';import {a as a$1}from'./chunk-45FW5DBN.js';import {a}from'./chunk-HMISRRKC.js';import {h,c as c$1}from'./chunk-A4GZBQEB.js';import {c,e,f as f$1}from'./chunk-NDDFZTBA.js';var t,l,C,x,b,v,y,z,L,T,U,f=class extends a$1{constructor(){super(...arguments);e(this,t);this.embedController=new b$1(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 c$1`
|
|
2
|
+
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let n=f$1(this,t,T).call(this),i=f$1(this,t,U).call(this),o=this._slottedChildren.map(d=>{function m(){let r;return d.nodeName==="TEMPLATE"?r=d.content.cloneNode(true):r=d.cloneNode(true),r}if(d.getAttribute("name")=="mave-files-video"){if(!n)return;let r=m(),a=Number(this._data.created_at),h=a&&a<1e12?a*1e3:a;Number.isFinite(h)&&f$1(this,t,l).call(this,r,'[slot="date"]',new Date(h).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&f$1(this,t,l).call(this,r,'[slot="duration"]',this.durationToTime(p));let u=this._data.video.filetype;u&&f$1(this,t,l).call(this,r,'[slot="filetype"]',u);let _=n.file_size||this._data.video.size;_&&f$1(this,t,l).call(this,r,'[slot="size"]',f$1(this,t,v).call(this,_));let M=f$1(this,t,z).call(this,n),S=n.container||"mp4",g=f$1(this,t,b).call(this,M,`${this._data.name}.${S}`);return g.setAttribute("aria-label","Download video"),g.appendChild(r),c$1`${g}`}if(i&&this._data.video.audio&&d.getAttribute("name")=="mave-files-audio"){let r=m(),a=i.container||"mp3";f$1(this,t,l).call(this,r,'[slot="filetype"]',a);let h=i.file_size;h&&f$1(this,t,l).call(this,r,'[slot="size"]',f$1(this,t,v).call(this,h));let p=f$1(this,t,L).call(this,i),u=f$1(this,t,b).call(this,p,`${this._data.name}.${a}`);return u.setAttribute("aria-label","Download audio"),u.appendChild(r),c$1`${u}`}let w=this._data.subtitles.find(r=>r.language==this._data.video.language);if(w&&d.getAttribute("name")=="mave-files-subtitles"){let r=m();f$1(this,t,l).call(this,r,'[slot="filetype"]',"vtt");let a=f$1(this,t,b).call(this,w.path,`${this._data.name}.vtt`);return a.setAttribute("aria-label","Download subtitles"),a.appendChild(r),c$1`${a}`}});return c$1`${this._stylesheets} ${o}`}})}
|
|
3
|
+
`}renderPending(){return c$1`<slot style="display: none"></slot>`}};t=new WeakSet,l=function(e,n,i){let o=e.querySelector(n);o&&(o.textContent=i,o.removeAttribute("slot"));},C=function(e,n){let i=window.URL.createObjectURL(e),o=document.createElement("a");o.style.display="none",o.href=i,o.download=n,this.appendChild(o),o.click(),window.URL.revokeObjectURL(i),this.removeChild(o);},x=function(e,n){return fetch(e).then(i=>{if(!i.ok)throw new Error("Network response was not ok");return i.blob()}).then(i=>f$1(this,t,C).call(this,i,n)).catch(i=>console.error("Something went wrong:",i))},b=function(e,n){let i=document.createElement("a");i.classList.add("link"),i.setAttribute("href",e),i.setAttribute("download",n),i.setAttribute("target","new");let o=false;return i.addEventListener("click",d=>{d.preventDefault(),!o&&(o=true,i.style.cursor="wait",i.style.opacity="0.5",f$1(this,t,x).call(this,e,n).then(()=>{o=false,i.style.cursor="pointer",i.style.opacity="1";}));}),i},v=function(e){let n=e/1e6;return n>=10?`${n.toFixed(0)} MB`:`${n.toFixed(1)} MB`},y=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",i=e?.size||"hd",o=e?.container||"mp4";return f$1(this,t,y).call(this,`${n}_${i}.${o}`)},L=function(e){let n=e?.container||"mp3";return f$1(this,t,y).call(this,`audio.${n}`)},T=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")),i=["hd","fhd","sd","qhd","uhd"];for(let o of i){let d=n.find(m=>m.size===o);if(d)return d}return n[0]||e.find(o=>o.type==="video")},U=function(){let e=this._data?.video?.renditions||[];if(e.length)return e.find(n=>n.type==="audio"||n.container==="mp3"||n.codec==="mp3")},f.styles=h`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
--link-color: #006fc6;
|
|
7
|
+
--link-decoration: underline;
|
|
8
|
+
--link-decoration-thickness: 1px;
|
|
9
|
+
--link-decoration-offset: 1px;
|
|
10
|
+
--link-cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
a {
|
|
14
|
+
text-decoration: var(--link-decoration);
|
|
15
|
+
text-decoration-thickness: var(--link-decoration-thickness);
|
|
16
|
+
text-underline-offset: var(--link-decoration-thickness);
|
|
17
|
+
color: var(--link-color);
|
|
18
|
+
cursor: var(--link-cursor);
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return typeof document>"u"?"":new URL(import.meta.url).pathname.includes("+esm")?"dist/":""}export{e as a};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
${this.embedController.render({pending:this.renderPending,error:t=>chunk5NSCV6C2_cjs.c`<p>${t instanceof Error?t.message:chunk5NSCV6C2_cjs.f}</p>`,complete:t=>{if(this._collection=t,!t)return this.renderPending();if(t.error)return console.warn(t.error);let o=this._slottedChildren.map(e=>{function i(){let s;return e.nodeName==="TEMPLATE"?s=e.content.cloneNode(true):s=e.cloneNode(true),s}if(e.getAttribute("name")=="list-title"){let s=i();return s.textContent=this._collection?.name,chunk5NSCV6C2_cjs.c`${s}`}if(e.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let s=i(),r=s.querySelector('[slot="root-link"]');return r&&(r.addEventListener("click",
|
|
1
|
+
'use strict';var chunkALY7UTZA_cjs=require('./chunk-ALY7UTZA.cjs'),chunkYT56YDUY_cjs=require('./chunk-YT56YDUY.cjs'),chunkMKZYI5TY_cjs=require('./chunk-MKZYI5TY.cjs'),chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var n,E,f,h,u=class extends chunkMKZYI5TY_cjs.a{constructor(){super(...arguments);chunkIPA5Q26W_cjs.e(this,n);this.order="newest";this.embedController=new chunkYT56YDUY_cjs.b(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(t,o){super.requestUpdate(t,o),t==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}updated(){this.shadowRoot&&chunkALY7UTZA_cjs.b(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(t){return this._collection?.videos?.some(o=>o.id===t)}getNextForEmbed(t){let o=chunkIPA5Q26W_cjs.f(this,n,E).call(this),e=o.findIndex(i=>i.id===t);if(e!==-1)return o[e+1]}render(){return chunk5NSCV6C2_cjs.c`
|
|
2
|
+
${this.embedController.render({pending:this.renderPending,error:t=>chunk5NSCV6C2_cjs.c`<p>${t instanceof Error?t.message:chunk5NSCV6C2_cjs.f}</p>`,complete:t=>{if(this._collection=t,!t)return this.renderPending();if(t.error)return console.warn(t.error);let o=this._slottedChildren.map(e=>{function i(){let s;return e.nodeName==="TEMPLATE"?s=e.content.cloneNode(true):s=e.cloneNode(true),s}if(e.getAttribute("name")=="list-title"){let s=i();return s.textContent=this._collection?.name,chunk5NSCV6C2_cjs.c`${s}`}if(e.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let s=i(),r=s.querySelector('[slot="root-link"]');return r&&(r.addEventListener("click",d=>{d.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),r.removeAttribute("slot")),chunk5NSCV6C2_cjs.c`${s}`}if(e.getAttribute("name")=="mave-list-folder"){let s=this._collection.collections?.map(r=>{let d=i(),l=d.querySelector('[slot="folder-link"]');return [e,l].forEach(a=>{a&&(a.addEventListener("click",p=>{p.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:r.id}),this.embedController.embed=r.id;}),a.removeAttribute("slot"));}),chunkIPA5Q26W_cjs.f(this,n,h).call(this,d,'[slot="folder-title"]',r.name),typeof r.video_count=="number"&&chunkIPA5Q26W_cjs.f(this,n,h).call(this,d,'[slot="folder-count"]',r.video_count.toString()),chunk5NSCV6C2_cjs.c`${d}`});return chunk5NSCV6C2_cjs.c`${s}`}if(e.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(e.hasAttribute("name")?e.getAttribute("name"):"")&&e.nodeName=="TEMPLATE"){let s=chunkIPA5Q26W_cjs.f(this,n,E).call(this).map((r,d)=>{let l=i(),a=d+1;chunkIPA5Q26W_cjs.f(this,n,h).call(this,l,'[slot="item-title"]',r.name),chunkIPA5Q26W_cjs.f(this,n,h).call(this,l,'[slot="item-position"]',a.toString()),chunkIPA5Q26W_cjs.f(this,n,h).call(this,l,'[slot="item-duration"]',this.durationToTime(r.duration)),chunkIPA5Q26W_cjs.f(this,n,f).call(this,l,"mave-clip",r.id),chunkIPA5Q26W_cjs.f(this,n,f).call(this,l,"mave-player",r.id),chunkIPA5Q26W_cjs.f(this,n,f).call(this,l,"mave-img",r.id);let p=l.querySelector("mave-clip"),T=l.querySelector('[slot="item-title"]'),A=l.querySelector("mave-img");return [p,T,A,l].forEach(S=>{S?.addEventListener("click",$=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:r.id,position:a});});}),chunk5NSCV6C2_cjs.c`${l}`});return chunk5NSCV6C2_cjs.c`${s}`}}).filter(e=>e);return chunk5NSCV6C2_cjs.c`${this._stylesheets} ${o}`}})}
|
|
3
3
|
`}renderPending(){return chunk5NSCV6C2_cjs.c`<slot style="display: none"></slot>`}};n=new WeakSet,E=function(){if(!this._collection)return [];let t=this._collection.videos;return this.order=="newest"&&(t=this._collection.videos?.sort((o,e)=>e.created-o.created)),this.order=="oldest"&&(t=this._collection.videos?.sort((o,e)=>o.created-e.created)),this.order=="az"&&(t=this._collection.videos?.sort((o,e)=>o.name.localeCompare(e.name))),this.order=="za"&&(t=this._collection.videos?.sort((o,e)=>e.name.localeCompare(o.name))),t},f=function(t,o,e){let i=t.querySelector(o);i&&(i.setAttribute("embed",e),i.removeAttribute("slot"));},h=function(t,o,e){let i=t.querySelector(o);i&&(i.textContent=e,i.removeAttribute("slot"));},u.styles=chunk5NSCV6C2_cjs.h`
|
|
4
4
|
:host {
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
7
|
-
`,chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],u.prototype,"token",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],u.prototype,"order",2);window&&window.customElements&&(window.customElements.get("mave-list")||window.customElements.define("mave-list",u));exports.a=u;
|
|
7
|
+
`,chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],u.prototype,"token",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],u.prototype,"order",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-list")||window.customElements.define("mave-list",u));exports.a=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var chunkQJHVSRHC_cjs=require('./chunk-QJHVSRHC.cjs'),chunkH57FX4I6_cjs=require('./chunk-H57FX4I6.cjs'),chunkQ22T22LT_cjs=require('./chunk-Q22T22LT.cjs'),chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var o,k,C,S,n=class extends chunk5NSCV6C2_cjs.i{constructor(){super(...arguments);chunkIPA5Q26W_cjs.e(this,o);this._clickable=true;this._autoscroll=true;this._lastScrollTime=0;this.currentTime=0;}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.captionController=new chunkQJHVSRHC_cjs.a(this,this.embed),this.reset(),this.requestUpdate("embed"));}get clickable(){return this._clickable}set clickable(t){this._clickable!=t&&(typeof t=="string"?this._clickable=t==="true"||t==="":this._clickable=t,this.requestUpdate("clickable"));}get autoscroll(){return this._autoscroll}set autoscroll(t){this._autoscroll!=t&&(typeof t=="string"?this._autoscroll=t==="true"||t==="":this._autoscroll=t,this.requestUpdate("autoscroll"));}get wordIndex(){return this._wordIndex}set wordIndex(t){if(this._wordIndex!=t&&(this._wordIndex=t,this.autoscroll)){let e=this.shadowRoot?.querySelector(`[data-word-id="word-${this.segmentIndex}-${this.wordIndex}"]`);if(e&&this._lastScrollTime+2500<Date.now()){let r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),s=i.top-r.top;if(s>0){let c=this.scrollTop+s;chunkIPA5Q26W_cjs.f(this,o,k).call(this,this,c-i.height/2);}}}}get segmentIndex(){return this._segmentIndex}set segmentIndex(t){this._segmentIndex!=t&&(this._segmentIndex=t);}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",chunkIPA5Q26W_cjs.f(this,o,C).bind(this)),this.reset();}reset(){this.loop=false,this.currentTime=0,this.wordIndex=0,this.segmentIndex=0;let t=document.querySelector(`mave-player[embed="${this.embed}"]`);t&&(this.player=t,t.addEventListener("play",()=>{this.loop=true,this.loopUpdateTime();}),t.addEventListener("pause",()=>{this.loop=false;}));}updateTime(){this.currentTime=this.player.currentTime;}loopUpdateTime(){this.updateTime(),setTimeout(()=>{this.loop&&requestAnimationFrame(this.loopUpdateTime.bind(this));},10);}inRange({start:t,end:e},r,i,s){if(this.currentTime>=t&&this.currentTime<=e)return s&&(this.wordIndex=s),i&&(this.segmentIndex=i),r||true}segmentStyle(){return this.clickable?{cursor:"pointer"}:{}}wordStyle(t){return t?{"background-color":this.highlight}:{}}render(){return this.captionController?this.captionController.render({complete:t=>(this.captions=t,chunk5NSCV6C2_cjs.c`
|
|
1
|
+
'use strict';var chunkQJHVSRHC_cjs=require('./chunk-QJHVSRHC.cjs'),chunkH57FX4I6_cjs=require('./chunk-H57FX4I6.cjs'),chunkQ22T22LT_cjs=require('./chunk-Q22T22LT.cjs'),chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var o,k,C,S,n=class extends chunk5NSCV6C2_cjs.i{constructor(){super(...arguments);chunkIPA5Q26W_cjs.e(this,o);this._clickable=true;this._autoscroll=true;this._lastScrollTime=0;this.currentTime=0;}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.captionController=new chunkQJHVSRHC_cjs.a(this,this.embed),this.reset(),this.requestUpdate("embed"));}get clickable(){return this._clickable}set clickable(t){this._clickable!=t&&(typeof t=="string"?this._clickable=t==="true"||t==="":this._clickable=t,this.requestUpdate("clickable"));}get autoscroll(){return this._autoscroll}set autoscroll(t){this._autoscroll!=t&&(typeof t=="string"?this._autoscroll=t==="true"||t==="":this._autoscroll=t,this.requestUpdate("autoscroll"));}get wordIndex(){return this._wordIndex}set wordIndex(t){if(this._wordIndex!=t&&(this._wordIndex=t,this.autoscroll)){let e=this.shadowRoot?.querySelector(`[data-word-id="word-${this.segmentIndex}-${this.wordIndex}"]`);if(e&&this._lastScrollTime+2500<Date.now()){let r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),s=i.top-r.top;if(s>0){let c=this.scrollTop+s;chunkIPA5Q26W_cjs.f(this,o,k).call(this,this,c-i.height/2);}}}}get segmentIndex(){return this._segmentIndex}set segmentIndex(t){this._segmentIndex!=t&&(this._segmentIndex=t);}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",chunkIPA5Q26W_cjs.f(this,o,C).bind(this)),this.reset();}reset(){if(typeof document>"u")return;this.loop=false,this.currentTime=0,this.wordIndex=0,this.segmentIndex=0;let t=document.querySelector(`mave-player[embed="${this.embed}"]`);t&&(this.player=t,t.addEventListener("play",()=>{this.loop=true,this.loopUpdateTime();}),t.addEventListener("pause",()=>{this.loop=false;}));}updateTime(){this.currentTime=this.player.currentTime;}loopUpdateTime(){this.updateTime(),setTimeout(()=>{this.loop&&requestAnimationFrame(this.loopUpdateTime.bind(this));},10);}inRange({start:t,end:e},r,i,s){if(this.currentTime>=t&&this.currentTime<=e)return s&&(this.wordIndex=s),i&&(this.segmentIndex=i),r||true}segmentStyle(){return this.clickable?{cursor:"pointer"}:{}}wordStyle(t){return t?{"background-color":this.highlight}:{}}render(){return this.captionController?this.captionController.render({complete:t=>(this.captions=t,chunk5NSCV6C2_cjs.c`
|
|
2
2
|
<div>
|
|
3
3
|
${this.captions.segments.map((e,r)=>chunk5NSCV6C2_cjs.c`
|
|
4
4
|
<p
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
[part='word'] {
|
|
33
33
|
background-color: rgba(255, 210, 42, 0.5);
|
|
34
34
|
}
|
|
35
|
-
`,chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"embed",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"highlight",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"clickable",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"autoscroll",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.b()],n.prototype,"currentTime",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.b()],n.prototype,"captions",2);window&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));exports.a=n;
|
|
35
|
+
`,chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"embed",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"highlight",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"clickable",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],n.prototype,"autoscroll",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.b()],n.prototype,"currentTime",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.b()],n.prototype,"captions",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));exports.a=n;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {a}from'./chunk-JBV2AYRP.js';var v=e=>typeof e=="function"?e:function(){return e},L=typeof self<"u"?self:null,T=typeof window<"u"?window:null,g=L||T||g,
|
|
2
|
-
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=false,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",false)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]);});}close(e,t,i){for(let n of this.reqs)n.abort();this.readyState=f.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:true},{code:e,reason:t,wasClean:i});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s);}ajax(e,t,i,s,n){let r,h=()=>{this.reqs.delete(r),s();};r=E.request(e,this.endpointURL(),t,i,this.timeout,h,o=>{this.reqs.delete(r),this.isActive()&&n(o);}),this.reqs.add(r);}};var b={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,s,n,r,h]=JSON.parse(e);return t({join_ref:i,ref:s,topic:n,event:r,payload:h})}},binaryEncode(e){let{join_ref:t,ref:i,event:s,topic:n,payload:r}=e,h=this.META_LENGTH+t.length+i.length+n.length+s.length,o=new ArrayBuffer(this.HEADER_LENGTH+h),a=new DataView(o),l=0;a.setUint8(l++,this.KINDS.push),a.setUint8(l++,t.length),a.setUint8(l++,i.length),a.setUint8(l++,n.length),a.setUint8(l++,s.length),Array.from(t,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(i,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(n,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(s,u=>a.setUint8(l++,u.charCodeAt(0)));var p=new Uint8Array(o.byteLength+r.byteLength);return p.set(new Uint8Array(o),0),p.set(new Uint8Array(r),o.byteLength),p.buffer},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),s=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),h=this.HEADER_LENGTH+this.META_LENGTH-1,o=i.decode(e.slice(h,h+s));h=h+s;let a=i.decode(e.slice(h,h+n));h=h+n;let l=i.decode(e.slice(h,h+r));h=h+r;let p=e.slice(h,e.byteLength);return {join_ref:o,ref:null,topic:a,event:l,payload:p}},decodeReply(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),h=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=i.decode(e.slice(o,o+s));o=o+s;let l=i.decode(e.slice(o,o+n));o=o+n;let p=i.decode(e.slice(o,o+r));o=o+r;let u=i.decode(e.slice(o,o+h));o=o+h;let w=e.slice(o,e.byteLength),A={status:u,response:w};return {join_ref:a,ref:l,topic:p,event:d.reply,payload:A}},decodeBroadcast(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=this.HEADER_LENGTH+2,h=i.decode(e.slice(r,r+s));r=r+s;let o=i.decode(e.slice(r,r+n));r=r+n;let a=e.slice(r,e.byteLength);return {join_ref:null,ref:null,topic:h,event:o,payload:a}}},j=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||P,this.transport=t.transport||g.WebSocket||m,this.primaryPassedHealthCheck=false,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||g&&g.sessionStorage,this.establishedConnections=0,this.defaultEncoder=b.encode.bind(b),this.defaultDecoder=b.decode.bind(b),this.closeWasClean=false,this.disconnecting=false,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==m?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;T&&T.addEventListener&&(T.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),i=this.connectClock);}),T.addEventListener("pageshow",s=>{i===this.connectClock&&(i=null,this.connect());})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,n,r)=>{console.log(`${s}: ${n}`,r);}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=v(t.params||{}),this.endPoint=`${e}/${k.websocket}`,this.vsn=t.vsn||H,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new y(()=>{this.teardown(()=>this.connect());},this.reconnectAfterMs);}getLongPollTransport(){return m}replaceTransport(e){this.connectClock++,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e;}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.disconnecting=true,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=false,e&&e();},t,i);}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=v(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==m?this.connectWithFallback(m,this.longPollFallbackMs):this.transportConnect());}log(e,t,i){this.logger&&this.logger(e,t,i);}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return false;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(n=>{n.ref===t&&(this.off([s]),e(Date.now()-i));});return true}transportConnect(){this.connectClock++,this.closeWasClean=false,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e);}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t);}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let i=false,s=true,n,r,h=o=>{this.log("transport",`falling back to ${e.name}...`,o),this.off([n,r]),s=false,this.replaceTransport(e),this.transportConnect();};if(this.getSession(`phx:fallback:${e.name}`))return h("memorized");this.fallbackTimer=setTimeout(h,t),r=this.onError(o=>{this.log("transport","error",o),s&&!i&&(clearTimeout(this.fallbackTimer),h(o));}),this.onOpen(()=>{if(i=true,!s)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,t),this.ping(o=>{this.log("transport","connected to primary after",o),this.primaryPassedHealthCheck=true,clearTimeout(this.fallbackTimer);});}),this.transportConnect();}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer);}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=false,this.disconnecting=false,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e());}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=false,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),B,"heartbeat timeout"));}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs));}teardown(e,t,i){if(!this.conn)return e&&e();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(t?this.conn.close(t,i||""):this.conn.close()),this.waitForSocketClosed(()=>{s===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e());}));});}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1);},150*t);}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===f.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1);},150*t);}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e));}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(e,t,i);}),(t===this.transport||i>0)&&this.triggerChanError();}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(d.error);});}connectionState(){switch(this.conn&&this.conn.readyState){case f.connecting:return "connecting";case f.open:return "open";case f.closing:return "closing";default:return "closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e);}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1);}channel(e,t={}){let i=new x(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:s,ref:n,join_ref:r}=e;this.log("push",`${t} ${i} (${r}, ${n})`,s);}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)));}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs));}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[]);}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:s,payload:n,ref:r,join_ref:h}=t;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${n.status||""} ${i} ${s} ${r&&"("+r+")"||""}`,n);for(let o=0;o<this.channels.length;o++){let a=this.channels[o];a.isMember(i,s,n,h)&&a.trigger(s,n,r,h);}for(let o=0;o<this.stateChangeCallbacks.message.length;o++){let[,a]=this.stateChangeCallbacks.message[o];a(t);}});}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave());}};var R=class e{constructor(){this.channels=[];}static connect(t){e.instance||(e.instance=new e,window&&(e.instance.socket=new j(a.upload.socket,{params:{token:t},reconnectAfterMs:s=>[1e3,3e3,5e3,1e4][s-1]||1e4}),e.instance.socket.connect()));let i=e.instance.channels.find(s=>s.token===t);if(i)return i;{let s=e.instance.socket.channel(`embed:${t}`);s.join();let n={token:t,channel:s};return s.on("initiate",({upload_id:r})=>{e.instance.channels.push({...n,upload_id:r});}),n}}};
|
|
1
|
+
import {a}from'./chunk-JBV2AYRP.js';var v=e=>typeof e=="function"?e:function(){return e},L=typeof self<"u"?self:null,T=typeof window<"u"?window:null,g=L||T||g,P="2.0.0",f={connecting:0,open:1,closing:2,closed:3},H=1e4,B=1e3,c={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},d={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},k={longpoll:"longpoll",websocket:"websocket"},_={complete:4},C=class{constructor(e,t,i,s){this.channel=e,this.event=t,this.payload=i||function(){return {}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=false;}resend(e){this.timeout=e,this.reset(),this.send();}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=true,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}));}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=false;}matchReceive({status:e,response:t,_ref:i}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t));}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent);}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null;}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e);}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{});},this.timeout);}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t});}},S=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0;}reset(){this.tries=0,clearTimeout(this.timer);}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback();},this.timerCalc(this.tries+1));}},x=class{constructor(e,t,i){this.state=c.closed,this.topic=e,this.params=v(t||{}),this.socket=i,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=false,this.joinPush=new C(this,d.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new S(()=>{this.socket.isConnected()&&this.rejoin();},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin();})),this.joinPush.receive("ok",()=>{this.state=c.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[];}),this.joinPush.receive("error",()=>{this.state=c.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=c.closed,this.socket.remove(this);}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=c.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new C(this,d.leave,v({}),this.timeout).send(),this.state=c.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.on(d.reply,(s,n)=>{this.trigger(this.replyEventName(n),s);});}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=true,this.rejoin(),this.joinPush}onClose(e){this.on(d.close,e);}onError(e){return this.on(d.error,t=>e(t))}on(e,t){let i=this.bindingRef++;return this.bindings.push({event:e,ref:i,callback:t}),i}off(e,t){this.bindings=this.bindings.filter(i=>!(i.event===e&&(typeof t>"u"||t===i.ref)));}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,i=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new C(this,e,function(){return t},i);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=c.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(d.close,"leave");},i=new C(this,d.leave,v({}),e);return i.receive("ok",()=>t()).receive("timeout",()=>t()),i.send(),this.canPush()||i.trigger("ok",{}),i}onMessage(e,t,i){return t}isMember(e,t,i,s){return this.topic!==e?false:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:i,joinRef:s}),false):true}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=c.joining,this.joinPush.resend(e));}trigger(e,t,i,s){let n=this.onMessage(e,t,i,s);if(t&&!n)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let r=this.bindings.filter(h=>h.event===e);for(let h=0;h<r.length;h++)r[h].callback(n,i,s||this.joinRef());}replyEventName(e){return `chan_reply_${e}`}isClosed(){return this.state===c.closed}isErrored(){return this.state===c.errored}isJoined(){return this.state===c.joined}isJoining(){return this.state===c.joining}isLeaving(){return this.state===c.leaving}},E=class{static request(e,t,i,s,n,r,h){if(g.XDomainRequest){let o=new g.XDomainRequest;return this.xdomainRequest(o,e,t,s,n,r,h)}else {let o=new g.XMLHttpRequest;return this.xhrRequest(o,e,t,i,s,n,r,h)}}static xdomainRequest(e,t,i,s,n,r,h){return e.timeout=n,e.open(t,i),e.onload=()=>{let o=this.parseJSON(e.responseText);h&&h(o);},r&&(e.ontimeout=r),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,i,s,n,r,h,o){return e.open(t,i,true),e.timeout=r,e.setRequestHeader("Content-Type",s),e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{if(e.readyState===_.complete&&o){let a=this.parseJSON(e.responseText);o(a);}},h&&(e.ontimeout=h),e.send(n),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let i=[];for(var s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let n=t?`${t}[${s}]`:s,r=e[s];typeof r=="object"?i.push(this.serialize(r,n)):i.push(encodeURIComponent(n)+"="+encodeURIComponent(r));}return i.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let i=e.match(/\?/)?"&":"?";return `${e}${i}${this.serialize(t)}`}},$=e=>{let t="",i=new Uint8Array(e),s=i.byteLength;for(let n=0;n<s;n++)t+=String.fromCharCode(i[n]);return btoa(t)},m=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=true,this.reqs=new Set,this.awaitingBatchAck=false,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=f.connecting,setTimeout(()=>this.poll(),0);}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+k.websocket),"$1/"+k.longpoll)}endpointURL(){return E.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,i){this.close(e,t,i),this.readyState=f.connecting;}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",false);}isActive(){return this.readyState===f.open||this.readyState===f.connecting}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:i,messages:s}=e;this.token=i;}else t=0;switch(t){case 200:s.forEach(n=>{setTimeout(()=>this.onmessage({data:n}),0);}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=f.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",false);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}});}send(e){typeof e!="string"&&(e=$(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null;},0));}batchSend(e){this.awaitingBatchAck=true,this.ajax("POST","application/x-ndjson",e.join(`
|
|
2
|
+
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=false,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",false)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]);});}close(e,t,i){for(let n of this.reqs)n.abort();this.readyState=f.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:true},{code:e,reason:t,wasClean:i});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s);}ajax(e,t,i,s,n){let r,h=()=>{this.reqs.delete(r),s();};r=E.request(e,this.endpointURL(),t,i,this.timeout,h,o=>{this.reqs.delete(r),this.isActive()&&n(o);}),this.reqs.add(r);}};var b={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let i=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(i))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[i,s,n,r,h]=JSON.parse(e);return t({join_ref:i,ref:s,topic:n,event:r,payload:h})}},binaryEncode(e){let{join_ref:t,ref:i,event:s,topic:n,payload:r}=e,h=this.META_LENGTH+t.length+i.length+n.length+s.length,o=new ArrayBuffer(this.HEADER_LENGTH+h),a=new DataView(o),l=0;a.setUint8(l++,this.KINDS.push),a.setUint8(l++,t.length),a.setUint8(l++,i.length),a.setUint8(l++,n.length),a.setUint8(l++,s.length),Array.from(t,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(i,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(n,u=>a.setUint8(l++,u.charCodeAt(0))),Array.from(s,u=>a.setUint8(l++,u.charCodeAt(0)));var p=new Uint8Array(o.byteLength+r.byteLength);return p.set(new Uint8Array(o),0),p.set(new Uint8Array(r),o.byteLength),p.buffer},binaryDecode(e){let t=new DataView(e),i=t.getUint8(0),s=new TextDecoder;switch(i){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),h=this.HEADER_LENGTH+this.META_LENGTH-1,o=i.decode(e.slice(h,h+s));h=h+s;let a=i.decode(e.slice(h,h+n));h=h+n;let l=i.decode(e.slice(h,h+r));h=h+r;let p=e.slice(h,e.byteLength);return {join_ref:o,ref:null,topic:a,event:l,payload:p}},decodeReply(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),h=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=i.decode(e.slice(o,o+s));o=o+s;let l=i.decode(e.slice(o,o+n));o=o+n;let p=i.decode(e.slice(o,o+r));o=o+r;let u=i.decode(e.slice(o,o+h));o=o+h;let w=e.slice(o,e.byteLength),A={status:u,response:w};return {join_ref:a,ref:l,topic:p,event:d.reply,payload:A}},decodeBroadcast(e,t,i){let s=t.getUint8(1),n=t.getUint8(2),r=this.HEADER_LENGTH+2,h=i.decode(e.slice(r,r+s));r=r+s;let o=i.decode(e.slice(r,r+n));r=r+n;let a=e.slice(r,e.byteLength);return {join_ref:null,ref:null,topic:h,event:o,payload:a}}},j=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||H,this.transport=t.transport||g.WebSocket||m,this.primaryPassedHealthCheck=false,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||g&&g.sessionStorage,this.establishedConnections=0,this.defaultEncoder=b.encode.bind(b),this.defaultDecoder=b.decode.bind(b),this.closeWasClean=false,this.disconnecting=false,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==m?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let i=null;T&&T.addEventListener&&(T.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),i=this.connectClock);}),T.addEventListener("pageshow",s=>{i===this.connectClock&&(i=null,this.connect());})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,n,r)=>{console.log(`${s}: ${n}`,r);}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=v(t.params||{}),this.endPoint=`${e}/${k.websocket}`,this.vsn=t.vsn||P,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new S(()=>{this.teardown(()=>this.connect());},this.reconnectAfterMs);}getLongPollTransport(){return m}replaceTransport(e){this.connectClock++,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e;}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=E.appendParams(E.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,i){this.connectClock++,this.disconnecting=true,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=false,e&&e();},t,i);}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=v(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==m?this.connectWithFallback(m,this.longPollFallbackMs):this.transportConnect());}log(e,t,i){this.logger&&this.logger(e,t,i);}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return false;let t=this.makeRef(),i=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(n=>{n.ref===t&&(this.off([s]),e(Date.now()-i));});return true}transportConnect(){this.connectClock++,this.closeWasClean=false,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e);}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t);}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let i=false,s=true,n,r,h=o=>{this.log("transport",`falling back to ${e.name}...`,o),this.off([n,r]),s=false,this.replaceTransport(e),this.transportConnect();};if(this.getSession(`phx:fallback:${e.name}`))return h("memorized");this.fallbackTimer=setTimeout(h,t),r=this.onError(o=>{this.log("transport","error",o),s&&!i&&(clearTimeout(this.fallbackTimer),h(o));}),this.onOpen(()=>{if(i=true,!s)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(h,t),this.ping(o=>{this.log("transport","connected to primary after",o),this.primaryPassedHealthCheck=true,clearTimeout(this.fallbackTimer);});}),this.transportConnect();}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer);}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=false,this.disconnecting=false,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e());}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=false,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),B,"heartbeat timeout"));}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs));}teardown(e,t,i){if(!this.conn)return e&&e();let s=this.connectClock;this.waitForBufferDone(()=>{s===this.connectClock&&(this.conn&&(t?this.conn.close(t,i||""):this.conn.close()),this.waitForSocketClosed(()=>{s===this.connectClock&&(this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e());}));});}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1);},150*t);}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===f.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1);},150*t);}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,i])=>i(e));}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,i=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,s])=>{s(e,t,i);}),(t===this.transport||i>0)&&this.triggerChanError();}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(d.error);});}connectionState(){switch(this.conn&&this.conn.readyState){case f.connecting:return "connecting";case f.open:return "open";case f.closing:return "closing";default:return "closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e);}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([i])=>e.indexOf(i)===-1);}channel(e,t={}){let i=new x(e,t,this);return this.channels.push(i),i}push(e){if(this.hasLogger()){let{topic:t,event:i,payload:s,ref:n,join_ref:r}=e;this.log("push",`${t} ${i} (${r}, ${n})`,s);}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)));}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs));}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[]);}onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:s,payload:n,ref:r,join_ref:h}=t;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${n.status||""} ${i} ${s} ${r&&"("+r+")"||""}`,n);for(let o=0;o<this.channels.length;o++){let a=this.channels[o];a.isMember(i,s,n,h)&&a.trigger(s,n,r,h);}for(let o=0;o<this.stateChangeCallbacks.message.length;o++){let[,a]=this.stateChangeCallbacks.message[o];a(t);}});}leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i.isJoined()||i.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave());}};var R=class e{constructor(){this.channels=[];}static connect(t){if(typeof window>"u"){let s={on:()=>s,push:()=>s,join:()=>s,leave:()=>Promise.resolve(),off:()=>{}};return {token:t,channel:s}}e.instance||(e.instance=new e,e.instance.socket=new j(a.upload.socket,{params:{token:t},reconnectAfterMs:s=>[1e3,3e3,5e3,1e4][s-1]||1e4}),e.instance.socket.connect());let i=e.instance.channels.find(s=>s.token===t);if(i)return i;{let s=e.instance.socket.channel(`embed:${t}`);s.join();let n={token:t,channel:s};return s.on("initiate",({upload_id:r})=>{e.instance.channels.push({...n,upload_id:r});}),n}}};
|
|
3
3
|
export{R as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkZODBVQLM_cjs=require('./chunk-ZODBVQLM.cjs'),chunkLG2O4WV2_cjs=require('./chunk-LG2O4WV2.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.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 chunkLG2O4WV2_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(`${chunkZODBVQLM_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 chunk5STN56TL_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
|
-
'use strict';var chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs');var
|
|
1
|
+
'use strict';var chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs');var i=chunk5STN56TL_cjs.a.api.endpoint;exports.a=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-P6SBZPDR.js';import {i,c as c$1,h as h$1}from'./chunk-A4GZBQEB.js';var a=["default","synthwave","dolphin"],h={default:()=>import('./themes/default.js'),synthwave:()=>import('./themes/synthwave.js'),dolphin:()=>import('./themes/dolphin.js')};async function p(t){if(!a.includes(t))return;if(!!a$1()){let e=`./dist/themes/${t}.js`;return c(e)}let s=h[t];return s?s():void 0}async function c(t){return import(t)}var d=class t{constructor(){this.themes=[];}static async get(n,s){if(t.instance||(t.instance=new t),t.instance.themes.find(e=>e.name===n))return Promise.resolve(t.instance);t.instance.themes.push({name:n}),t.instance.currentTheme=n;try{if(typeof document<"u"&&!a.includes(n)){let e=document.createElement("link");e.rel="stylesheet",e.href=`${s}/${n}.css`,document.head.appendChild(e);}}catch(e){console.log("[mave-player]: theme css not loaded",e);}try{if(s&&!a.includes(n)){let{build:e}=await c(`${s}/${n}.js`);e(n,i,c$1,h$1);}else {let e=await p(n);if(e)e.build(n,i,c$1,h$1);else {let m=`./${a$1()}themes/${n}.js`,{build:u}=await c(m);u(n,i,c$1,h$1);}}}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(t.instance)}static async external(n){t.instance||(t.instance=new t);let s=n.split("/").pop()?.replace(".js","")||"";try{if(typeof document<"u"){let e=document.createElement("link");e.rel="stylesheet",e.href=`${n.replace(".js","")}.css`,document.head.appendChild(e);}}catch(e){console.log("[mave-player]: theme css not loaded",e);}if(t.instance.themes.find(e=>e.name===s))return Promise.resolve(t.instance);t.instance.themes.push({name:s}),t.instance.currentTheme=s;try{let{build:e}=await c(n);e(s,i,c$1,h$1);}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(t.instance)}static getTheme(){return t.instance?t.instance.currentTheme:""}};export{d as a};
|
package/dist/components/clip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkJBRRVOTV_cjs=require('../chunk-JBRRVOTV.cjs');require('../chunk-H57FX4I6.cjs'),require('../chunk-5KQJTT3P.cjs'),require('../chunk-SDKTBB4N.cjs'),require('../chunk-RRCW5BBR.cjs'),require('../chunk-YT56YDUY.cjs'),require('../chunk-ZODBVQLM.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Clip",{enumerable:true,get:function(){return chunkJBRRVOTV_cjs.a}});
|
package/dist/components/clip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Clip}from'../chunk-
|
|
1
|
+
export{a as Clip}from'../chunk-6MCTUE3H.js';import'../chunk-3R7TX6NC.js';import'../chunk-CUGRXOA2.js';import'../chunk-MK4VIJT3.js';import'../chunk-MMHEOMF5.js';import'../chunk-HX6F65VL.js';import'../chunk-F6EKAS27.js';import'../chunk-LCTGZL3L.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk3MEOYLCV_cjs=require('../chunk-3MEOYLCV.cjs');require('../chunk-YT56YDUY.cjs'),require('../chunk-ZODBVQLM.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-MKZYI5TY.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Files",{enumerable:true,get:function(){return chunk3MEOYLCV_cjs.a}});
|
package/dist/components/files.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Files}from'../chunk-
|
|
1
|
+
export{a as Files}from'../chunk-OTDMHX6X.js';import'../chunk-HX6F65VL.js';import'../chunk-F6EKAS27.js';import'../chunk-LCTGZL3L.js';import'../chunk-45FW5DBN.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
package/dist/components/img.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk6NWQAHZT_cjs=require('../chunk-6NWQAHZT.cjs');require('../chunk-MKZYI5TY.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Image",{enumerable:true,get:function(){return chunk6NWQAHZT_cjs.a}});
|
package/dist/components/img.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Image}from'../chunk-
|
|
1
|
+
export{a as Image}from'../chunk-4CDE2QCJ.js';import'../chunk-45FW5DBN.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
package/dist/components/list.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkRFBU3KXA_cjs=require('../chunk-RFBU3KXA.cjs');require('../chunk-ALY7UTZA.cjs'),require('../chunk-M3UFDMO6.cjs'),require('../chunk-2ELUELDT.cjs'),require('../chunk-5NKBIUPL.cjs'),require('../chunk-J7OISSKU.cjs'),require('../chunk-Q22T22LT.cjs'),require('../chunk-5KQJTT3P.cjs'),require('../chunk-SDKTBB4N.cjs'),require('../chunk-RRCW5BBR.cjs'),require('../chunk-YT56YDUY.cjs'),require('../chunk-ZODBVQLM.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-MKZYI5TY.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"List",{enumerable:true,get:function(){return chunkRFBU3KXA_cjs.a}});
|
package/dist/components/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as List}from'../chunk-
|
|
1
|
+
export{a as List}from'../chunk-7WWUNKRI.js';import'../chunk-6NE3LOKU.js';import'../chunk-ESQT2PPF.js';import'../chunk-ZOWJYZSD.js';import'../chunk-WE5NUDRY.js';import'../chunk-P6SBZPDR.js';import'../chunk-MS5NFI3Q.js';import'../chunk-CUGRXOA2.js';import'../chunk-MK4VIJT3.js';import'../chunk-MMHEOMF5.js';import'../chunk-HX6F65VL.js';import'../chunk-F6EKAS27.js';import'../chunk-LCTGZL3L.js';import'../chunk-45FW5DBN.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkM3UFDMO6_cjs=require('../chunk-M3UFDMO6.cjs');require('../chunk-2ELUELDT.cjs'),require('../chunk-J7OISSKU.cjs'),require('../chunk-Q22T22LT.cjs'),require('../chunk-5KQJTT3P.cjs'),require('../chunk-SDKTBB4N.cjs'),require('../chunk-RRCW5BBR.cjs'),require('../chunk-YT56YDUY.cjs'),require('../chunk-ZODBVQLM.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-MKZYI5TY.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Player",{enumerable:true,get:function(){return chunkM3UFDMO6_cjs.a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Player}from'../chunk-
|
|
1
|
+
export{a as Player}from'../chunk-ESQT2PPF.js';import'../chunk-ZOWJYZSD.js';import'../chunk-P6SBZPDR.js';import'../chunk-MS5NFI3Q.js';import'../chunk-CUGRXOA2.js';import'../chunk-MK4VIJT3.js';import'../chunk-MMHEOMF5.js';import'../chunk-HX6F65VL.js';import'../chunk-F6EKAS27.js';import'../chunk-LCTGZL3L.js';import'../chunk-45FW5DBN.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
package/dist/components/pop.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkALY7UTZA_cjs=require('../chunk-ALY7UTZA.cjs');require('../chunk-M3UFDMO6.cjs'),require('../chunk-2ELUELDT.cjs'),require('../chunk-5NKBIUPL.cjs'),require('../chunk-J7OISSKU.cjs'),require('../chunk-Q22T22LT.cjs'),require('../chunk-5KQJTT3P.cjs'),require('../chunk-SDKTBB4N.cjs'),require('../chunk-RRCW5BBR.cjs'),require('../chunk-YT56YDUY.cjs'),require('../chunk-ZODBVQLM.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-MKZYI5TY.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Pop",{enumerable:true,get:function(){return chunkALY7UTZA_cjs.a}});Object.defineProperty(exports,"checkPop",{enumerable:true,get:function(){return chunkALY7UTZA_cjs.b}});
|
package/dist/components/pop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Pop,b as checkPop}from'../chunk-
|
|
1
|
+
export{a as Pop,b as checkPop}from'../chunk-6NE3LOKU.js';import'../chunk-ESQT2PPF.js';import'../chunk-ZOWJYZSD.js';import'../chunk-WE5NUDRY.js';import'../chunk-P6SBZPDR.js';import'../chunk-MS5NFI3Q.js';import'../chunk-CUGRXOA2.js';import'../chunk-MK4VIJT3.js';import'../chunk-MMHEOMF5.js';import'../chunk-HX6F65VL.js';import'../chunk-F6EKAS27.js';import'../chunk-LCTGZL3L.js';import'../chunk-45FW5DBN.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
package/dist/components/text.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkTVNAG7X4_cjs=require('../chunk-TVNAG7X4.cjs');require('../chunk-QJHVSRHC.cjs'),require('../chunk-H57FX4I6.cjs'),require('../chunk-Q22T22LT.cjs'),require('../chunk-RRCW5BBR.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Text",{enumerable:true,get:function(){return chunkTVNAG7X4_cjs.a}});
|
package/dist/components/text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Text}from'../chunk-
|
|
1
|
+
export{a as Text}from'../chunk-IBTJ5OMP.js';import'../chunk-ZWTODZDA.js';import'../chunk-3R7TX6NC.js';import'../chunk-MS5NFI3Q.js';import'../chunk-MMHEOMF5.js';import'../chunk-LCTGZL3L.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk4M7XLFOJ_cjs=require('../chunk-4M7XLFOJ.cjs');require('../chunk-MC6T46LX.cjs'),require('../chunk-KTGL4HLA.cjs'),require('../chunk-5NKBIUPL.cjs'),require('../chunk-J7OISSKU.cjs'),require('../chunk-Q22T22LT.cjs'),require('../chunk-RRCW5BBR.cjs'),require('../chunk-FUBUUA7Y.cjs'),require('../chunk-5NSCV6C2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"Upload",{enumerable:true,get:function(){return chunk4M7XLFOJ_cjs.a}});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
3
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
4
4
|
|
|
5
5
|
interface ErrorMessage {
|
|
6
6
|
message: string;
|
|
7
7
|
}
|
|
8
|
+
type UploadState = 'initial' | 'uploading' | 'processing' | 'done';
|
|
8
9
|
declare class Upload extends LitElement {
|
|
9
10
|
token: string;
|
|
10
11
|
locale: string;
|
|
@@ -15,8 +16,12 @@ declare class Upload extends LitElement {
|
|
|
15
16
|
_progress: number;
|
|
16
17
|
_upload_id: string;
|
|
17
18
|
_completed: boolean;
|
|
19
|
+
_dragging: boolean;
|
|
18
20
|
private embedChannel;
|
|
21
|
+
private fileInput?;
|
|
19
22
|
private languageController;
|
|
23
|
+
private lastState;
|
|
24
|
+
private lastProgress;
|
|
20
25
|
static styles: lit.CSSResult;
|
|
21
26
|
connectedCallback(): void;
|
|
22
27
|
requestUpdate(name?: PropertyKey, oldValue?: unknown): void;
|
|
@@ -41,9 +46,20 @@ declare class Upload extends LitElement {
|
|
|
41
46
|
styleFont(): {
|
|
42
47
|
fontFamily: string;
|
|
43
48
|
};
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
get currentState(): UploadState;
|
|
50
|
+
private openFileDialog;
|
|
51
|
+
private findActionTarget;
|
|
52
|
+
private handleActionClick;
|
|
53
|
+
private handleActionKeyDown;
|
|
54
|
+
private blockSubmit;
|
|
55
|
+
private handleDragEnter;
|
|
56
|
+
private handleDragOver;
|
|
57
|
+
private handleDragLeave;
|
|
58
|
+
protected updated(changedProperties: PropertyValues<Upload>): void;
|
|
59
|
+
renderInitial(): lit_html.TemplateResult<1>;
|
|
60
|
+
renderUploading(): lit_html.TemplateResult<1>;
|
|
46
61
|
renderProcessing(): lit_html.TemplateResult<1>;
|
|
62
|
+
renderDone(): lit_html.TemplateResult<1>;
|
|
47
63
|
}
|
|
48
64
|
declare global {
|
|
49
65
|
interface HTMLElementTagNameMap {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
3
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
4
4
|
|
|
5
5
|
interface ErrorMessage {
|
|
6
6
|
message: string;
|
|
7
7
|
}
|
|
8
|
+
type UploadState = 'initial' | 'uploading' | 'processing' | 'done';
|
|
8
9
|
declare class Upload extends LitElement {
|
|
9
10
|
token: string;
|
|
10
11
|
locale: string;
|
|
@@ -15,8 +16,12 @@ declare class Upload extends LitElement {
|
|
|
15
16
|
_progress: number;
|
|
16
17
|
_upload_id: string;
|
|
17
18
|
_completed: boolean;
|
|
19
|
+
_dragging: boolean;
|
|
18
20
|
private embedChannel;
|
|
21
|
+
private fileInput?;
|
|
19
22
|
private languageController;
|
|
23
|
+
private lastState;
|
|
24
|
+
private lastProgress;
|
|
20
25
|
static styles: lit.CSSResult;
|
|
21
26
|
connectedCallback(): void;
|
|
22
27
|
requestUpdate(name?: PropertyKey, oldValue?: unknown): void;
|
|
@@ -41,9 +46,20 @@ declare class Upload extends LitElement {
|
|
|
41
46
|
styleFont(): {
|
|
42
47
|
fontFamily: string;
|
|
43
48
|
};
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
get currentState(): UploadState;
|
|
50
|
+
private openFileDialog;
|
|
51
|
+
private findActionTarget;
|
|
52
|
+
private handleActionClick;
|
|
53
|
+
private handleActionKeyDown;
|
|
54
|
+
private blockSubmit;
|
|
55
|
+
private handleDragEnter;
|
|
56
|
+
private handleDragOver;
|
|
57
|
+
private handleDragLeave;
|
|
58
|
+
protected updated(changedProperties: PropertyValues<Upload>): void;
|
|
59
|
+
renderInitial(): lit_html.TemplateResult<1>;
|
|
60
|
+
renderUploading(): lit_html.TemplateResult<1>;
|
|
46
61
|
renderProcessing(): lit_html.TemplateResult<1>;
|
|
62
|
+
renderDone(): lit_html.TemplateResult<1>;
|
|
47
63
|
}
|
|
48
64
|
declare global {
|
|
49
65
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Upload}from'../chunk-
|
|
1
|
+
export{a as Upload}from'../chunk-7MHSKSE5.js';import'../chunk-FSFJQ67W.js';import'../chunk-VZKW2VWI.js';import'../chunk-WE5NUDRY.js';import'../chunk-P6SBZPDR.js';import'../chunk-MS5NFI3Q.js';import'../chunk-MMHEOMF5.js';import'../chunk-HMISRRKC.js';import'../chunk-A4GZBQEB.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
package/dist/embed/api.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkZODBVQLM_cjs=require('../chunk-ZODBVQLM.cjs');require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"baseUrl",{enumerable:true,get:function(){return chunkZODBVQLM_cjs.a}});
|
package/dist/embed/api.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type Rendition = {
|
|
2
2
|
size: 'sd' | 'hd' | 'fhd' | 'qhd' | 'uhd';
|
|
3
|
-
codec: 'h264' | 'hevc' | 'av1';
|
|
4
|
-
container: 'webm' | 'mp4' | 'hls';
|
|
5
|
-
type?: 'video' | 'clip_keyframes';
|
|
3
|
+
codec: 'h264' | 'hevc' | 'av1' | 'webp' | 'webm' | 'jpg' | 'mp3';
|
|
4
|
+
container: 'webp' | 'webm' | 'jpg' | 'mp4' | 'avif' | 'hls' | 'mp3';
|
|
5
|
+
type?: 'audio' | 'video' | 'poster' | 'thumbnail' | 'placeholder' | 'storyboard' | 'segments' | 'clip_keyframes' | 'clip' | 'custom_thumbnail';
|
|
6
|
+
file_size?: number;
|
|
6
7
|
};
|
|
7
8
|
type Poster = {
|
|
8
9
|
container: 'avif' | 'webp' | 'jpg';
|
package/dist/embed/api.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
type Rendition = {
|
|
2
2
|
size: 'sd' | 'hd' | 'fhd' | 'qhd' | 'uhd';
|
|
3
|
-
codec: 'h264' | 'hevc' | 'av1';
|
|
4
|
-
container: 'webm' | 'mp4' | 'hls';
|
|
5
|
-
type?: 'video' | 'clip_keyframes';
|
|
3
|
+
codec: 'h264' | 'hevc' | 'av1' | 'webp' | 'webm' | 'jpg' | 'mp3';
|
|
4
|
+
container: 'webp' | 'webm' | 'jpg' | 'mp4' | 'avif' | 'hls' | 'mp3';
|
|
5
|
+
type?: 'audio' | 'video' | 'poster' | 'thumbnail' | 'placeholder' | 'storyboard' | 'segments' | 'clip_keyframes' | 'clip' | 'custom_thumbnail';
|
|
6
|
+
file_size?: number;
|
|
6
7
|
};
|
|
7
8
|
type Poster = {
|
|
8
9
|
container: 'avif' | 'webp' | 'jpg';
|
package/dist/embed/api.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as baseUrl}from'../chunk-
|
|
1
|
+
export{a as baseUrl}from'../chunk-F6EKAS27.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkYT56YDUY_cjs=require('../chunk-YT56YDUY.cjs');require('../chunk-ZODBVQLM.cjs'),require('../chunk-LG2O4WV2.cjs'),require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');Object.defineProperty(exports,"EmbedController",{enumerable:true,get:function(){return chunkYT56YDUY_cjs.b}});Object.defineProperty(exports,"EmbedType",{enumerable:true,get:function(){return chunkYT56YDUY_cjs.a}});
|
package/dist/embed/controller.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as EmbedController,a as EmbedType}from'../chunk-
|
|
1
|
+
export{b as EmbedController,a as EmbedType}from'../chunk-HX6F65VL.js';import'../chunk-F6EKAS27.js';import'../chunk-LCTGZL3L.js';import'../chunk-JBV2AYRP.js';import'../chunk-NDDFZTBA.js';
|
package/dist/embed/socket.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkKTGL4HLA_cjs=require('../chunk-KTGL4HLA.cjs');require('../chunk-5STN56TL.cjs'),require('../chunk-IPA5Q26W.cjs');module.exports=chunkKTGL4HLA_cjs.a;
|