@maveio/components 0.0.171 → 0.0.173
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-Q3FGRSLA.js → chunk-5ZZKAVXJ.js} +4 -4
- package/dist/{chunk-N2L5GXPF.cjs → chunk-6DDQAAOQ.cjs} +9 -9
- package/dist/{chunk-GWLFO35M.js → chunk-6XQ6KWYP.js} +1 -1
- package/dist/chunk-BCTXH32I.cjs +1 -0
- package/dist/chunk-DXS4BF7U.js +33 -0
- package/dist/{chunk-26IKHTYO.cjs → chunk-GNSSFU2Y.cjs} +1 -1
- package/dist/chunk-KNLOZXCA.cjs +33 -0
- package/dist/{chunk-IETV3B4F.cjs → chunk-KZGLJUFY.cjs} +4 -4
- package/dist/{chunk-TQYBNODL.js → chunk-NRAQPBUM.js} +1 -1
- package/dist/{chunk-CQU5634L.cjs → chunk-R6AMJOJL.cjs} +2 -2
- package/dist/{chunk-TFOTA27Y.js → chunk-RKL7JR7S.js} +1 -1
- package/dist/{chunk-PUSIMWBW.cjs → chunk-S4RV2LTD.cjs} +5 -5
- package/dist/{chunk-4HURBTSI.js → chunk-YJOQHWVN.js} +1 -1
- package/dist/chunk-ZQXFK7PD.js +1 -0
- package/dist/components/clip.cjs +1 -1
- package/dist/components/clip.d.cts +1 -1
- package/dist/components/clip.d.ts +1 -1
- package/dist/components/clip.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/upload.cjs +1 -1
- package/dist/components/upload.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/default.cjs +2 -2
- package/dist/themes/default.js +2 -2
- package/dist/themes/dolphin.cjs +1 -1
- package/dist/themes/dolphin.js +1 -1
- package/dist/themes/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/themes/synthwave.cjs +1 -1
- package/dist/themes/synthwave.js +1 -1
- package/dist/utils/localization.cjs +1 -1
- package/dist/utils/localization.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5QB22TB5.cjs +0 -1
- package/dist/chunk-5QLIDHRT.cjs +0 -33
- package/dist/chunk-CSURX7CD.js +0 -1
- package/dist/chunk-GSVKVWEI.js +0 -33
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
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,L,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,L).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;}get loop(){return this._loop??false}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,n)=>e.size===n.size?d(this,i,u).indexOf(e.codec)-d(this,i,u).indexOf(n.codec):d(this,i,c).indexOf(n.size)-d(this,i,c).indexOf(e.size)).map(e=>{let n=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:n,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,n)=>d(this,i,c).indexOf(n.size)-d(this,i,c).indexOf(e.size));if(d$1.length>0){let e=d$1[0],n=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`,m={media:void 0,src:this.embedController.embedFile(n),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
2
|
${this.embedController.render({complete:t=>{if(this._embed=t,!!t)return a$4`
|
|
3
3
|
<video
|
|
4
|
-
@click=${g$1(this,i,
|
|
4
|
+
@click=${g$1(this,i,S)}
|
|
5
5
|
preload="metadata"
|
|
6
6
|
style=${a$3(this._failedPlay||this.autoplay==="off"?"cursor: pointer":void 0)}
|
|
7
7
|
muted
|
|
@@ -9,7 +9,7 @@ import {a as a$2,c as c$2,b as b$2}from'./chunk-RHTBV6KZ.js';import {a as a$5}fr
|
|
|
9
9
|
poster=${a$3(this._failedPlay?this.poster:void 0)}
|
|
10
10
|
${c$2(g$1(this,i,I))}
|
|
11
11
|
?autoplay=${this.autoplay==="always"}
|
|
12
|
-
?loop=${this
|
|
12
|
+
?loop=${d(this,i,T)}
|
|
13
13
|
>
|
|
14
14
|
${this.sources.map(s=>a$4`
|
|
15
15
|
<source
|
|
@@ -20,7 +20,7 @@ import {a as a$2,c as c$2,b as b$2}from'./chunk-RHTBV6KZ.js';import {a as a$5}fr
|
|
|
20
20
|
`)}
|
|
21
21
|
</video>
|
|
22
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
|
|
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 n=0;if(s<e&&d>0){let m=t+e;n=(e-s)/m*this._videoElement.duration;}n>=0&&n<=this._videoElement.duration&&(this._videoElement.currentTime=n);}},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),n=/iPhone|iPad/.test(t);return e&&(d||s)||n?["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=[]);},L=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();}},S=function(){(this.autoplay==="off"||this._failedPlay)&&(this._videoElement?.paused?g$1(this,i,p).call(this):this._videoElement?.pause());},T=function(){return this._loop!==void 0?this._loop:this.autoplay!=="off"},r.styles=a`
|
|
24
24
|
:host {
|
|
25
25
|
display: block;
|
|
26
26
|
position: relative;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var chunkIBQULJZC_cjs=require('./chunk-IBQULJZC.cjs'),chunk5QLIDHRT_cjs=require('./chunk-5QLIDHRT.cjs'),chunkQQDH35OW_cjs=require('./chunk-QQDH35OW.cjs'),chunkDL4BV5IH_cjs=require('./chunk-DL4BV5IH.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs'),chunkEVKPEPYP_cjs=require('./chunk-EVKPEPYP.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var kt=chunkJHSFSCC2_cjs.a((ro,Pt)=>{Pt.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return false;switch(r){case "http":case "ws":return t!==80;case "https":case "wss":return t!==443;case "ftp":return t!==21;case "gopher":return t!==70;case "file":return false}return t!==0};});var Ct=chunkJHSFSCC2_cjs.a(Ie=>{var Xr=Object.prototype.hasOwnProperty,Vr;function Rt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Dt(e){try{return encodeURIComponent(e)}catch{return null}}function Wr(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=Rt(n[1]),a=Rt(n[2]);o===null||a===null||o in r||(r[o]=a);}return r}function Yr(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(Xr.call(e,o)){if(n=e[o],!n&&(n===null||n===Vr||isNaN(n))&&(n=""),o=Dt(o),n=Dt(n),o===null||n===null)continue;r.push(o+"="+n);}return r.length?t+r.join("&"):""}Ie.stringify=Yr;Ie.parse=Wr;});var Ht=chunkJHSFSCC2_cjs.a((oo,Nt)=>{var jt=kt(),_e=Ct(),Zr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,At=/[\n\r\t]/g,Jr=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Lt=/:\d+$/,Qr=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,en=/^[a-zA-Z]:/;function He(e){return (e||"").toString().replace(Zr,"")}var Ne=[["#","hash"],["?","query"],function(t,r){return A(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Tt={hash:1,query:1};function Ft(e){var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},o=typeof e,a;if(e.protocol==="blob:")n=new L(unescape(e.pathname),{});else if(o==="string"){n=new L(e,{});for(a in Tt)delete n[a];}else if(o==="object"){for(a in e)a in Tt||(n[a]=e[a]);n.slashes===void 0&&(n.slashes=Jr.test(e.href));}return n}function A(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function It(e,t){e=He(e),e=e.replace(At,""),t=t||{};var r=Qr.exec(e),n=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],u=0,c;return o?a?(c=r[2]+r[3]+r[4],u=r[2].length+r[3].length):(c=r[2]+r[4],u=r[2].length):a?(c=r[3]+r[4],u=r[3].length):c=r[4],n==="file:"?u>=2&&(c=c.slice(2)):A(n)?c=r[4]:n?o&&(c=c.slice(2)):u>=2&&A(t.protocol)&&(c=r[4]),{protocol:n,slashes:o||A(n),slashesCount:u,rest:c}}function tn(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],a=false,u=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),u++):u&&(n===0&&(a=true),r.splice(n,1),u--);return a&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function L(e,t,r){if(e=He(e),e=e.replace(At,""),!(this instanceof L))return new L(e,t,r);var n,o,a,u,c,h,m=Ne.slice(),v=typeof t,y=this,C=0;for(v!=="object"&&v!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=_e.parse),t=Ft(t),o=It(e||"",t),n=!o.protocol&&!o.slashes,y.slashes=o.slashes||n&&t.slashes,y.protocol=o.protocol||t.protocol||"",e=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||en.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!A(y.protocol)))&&(m[3]=[/(.*)/,"pathname"]);C<m.length;C++){if(u=m[C],typeof u=="function"){e=u(e,y);continue}a=u[0],h=u[1],a!==a?y[h]=e:typeof a=="string"?(c=a==="@"?e.lastIndexOf(a):e.indexOf(a),~c&&(typeof u[2]=="number"?(y[h]=e.slice(0,c),e=e.slice(c+u[2])):(y[h]=e.slice(c),e=e.slice(0,c)))):(c=a.exec(e))&&(y[h]=c[1],e=e.slice(0,c.index)),y[h]=y[h]||n&&u[3]&&t[h]||"",u[4]&&(y[h]=y[h].toLowerCase());}r&&(y.query=r(y.query)),n&&t.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||t.pathname!=="")&&(y.pathname=tn(y.pathname,t.pathname)),y.pathname.charAt(0)!=="/"&&A(y.protocol)&&(y.pathname="/"+y.pathname),jt(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(c=y.auth.indexOf(":"),~c?(y.username=y.auth.slice(0,c),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(c+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&A(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString();}function rn(e,t,r){var n=this;switch(e){case "query":typeof t=="string"&&t.length&&(t=(r||_e.parse)(t)),n[e]=t;break;case "port":n[e]=t,jt(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case "hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case "host":n[e]=t,Lt.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case "protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case "pathname":case "hash":if(t){var o=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==o?o+t:t;}else n[e]=t;break;case "username":case "password":n[e]=encodeURIComponent(t);break;case "auth":var a=t.indexOf(":");~a?(n.username=t.slice(0,a),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(a+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t));}for(var u=0;u<Ne.length;u++){var c=Ne[u];c[4]&&(n[c[1]]=n[c[1]].toLowerCase());}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&A(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function nn(e){(!e||typeof e!="function")&&(e=_e.stringify);var t,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var a=o+(r.protocol&&r.slashes||A(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):r.protocol!=="file:"&&A(r.protocol)&&!n&&r.pathname!=="/"&&(a+="@"),(n[n.length-1]===":"||Lt.test(r.hostname)&&!r.port)&&(n+=":"),a+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(a+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(a+=r.hash),a}L.prototype={set:rn,toString:nn};L.extractProtocol=It;L.location=Ft;L.trimLeft=He;L.qs=_e;Nt.exports=L;});function J(e){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(e)}function wr(e,t,r){return Object.defineProperty(e,"prototype",{writable:false}),e}function xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Or(e,t,r){return t=fe(t),Ur(e,Te()?Reflect.construct(t,r||[],fe(e).constructor):t.apply(e,r))}function Ur(e,t){if(t&&(J(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pr(e)}function Pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&ue(e,t);}function Ce(e){var t=typeof Map=="function"?new Map:void 0;return Ce=function(n){if(n===null||!Dr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o);}function o(){return Rr(n,arguments,fe(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:false,writable:true,configurable:true}}),ue(o,n)},Ce(e)}function Rr(e,t,r){if(Te())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&ue(o,r.prototype),o}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (Te=function(){return !!e})()}function Dr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function ue(e,t){return ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ue(e,t)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fe(e)}var Cr=(function(e){function t(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(xr(this,t),n=Or(this,t,[r]),n.originalRequest=a,n.originalResponse=u,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),a!=null){var c=a.getHeader("X-Request-ID")||"n/a",h=a.getMethod(),m=a.getURL(),v=u?u.getStatus():"n/a",y=u?u.getBody()||"":"n/a";r+=", originated from request (method: ".concat(h,", url: ").concat(m,", response code: ").concat(v,", response text: ").concat(y,", request id: ").concat(c,")");}return n.message=r,n}return kr(t,e),wr(t)})(Ce(Error)),Q=Cr;function B(e){}function ce(e){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(e)}function jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function at(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Lr(n.key),n);}}function Ar(e,t,r){return t&&at(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Lr(e){var t=Fr(e,"string");return ce(t)=="symbol"?t:t+""}function Fr(e,t){if(ce(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ce(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var st=(function(){function e(){jr(this,e);}return Ar(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])})();var ht="3.7.8",Ir=ht,te=typeof Buffer=="function",lt=typeof TextDecoder=="function"?new TextDecoder:void 0,ut=typeof TextEncoder=="function"?new TextEncoder:void 0,Nr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",pe=Array.prototype.slice.call(Nr),ve=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(pe),Hr=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,O=String.fromCharCode.bind(String),ft=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),dt=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),yt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),mt=e=>{let t,r,n,o,a="",u=e.length%3;for(let c=0;c<e.length;){if((r=e.charCodeAt(c++))>255||(n=e.charCodeAt(c++))>255||(o=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,a+=pe[t>>18&63]+pe[t>>12&63]+pe[t>>6&63]+pe[t&63];}return u?a.slice(0,u-3)+"===".substring(u):a},Le=typeof btoa=="function"?e=>btoa(e):te?e=>Buffer.from(e,"binary").toString("base64"):mt,je=te?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(O.apply(null,e.subarray(n,n+4096)));return Le(r.join(""))},be=(e,t=false)=>t?dt(je(e)):je(e),Br=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?O(192|t>>>6)+O(128|t&63):O(224|t>>>12&15)+O(128|t>>>6&63)+O(128|t&63)}else {var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return O(240|t>>>18&7)+O(128|t>>>12&63)+O(128|t>>>6&63)+O(128|t&63)}},zr=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,gt=e=>e.replace(zr,Br),ct=te?e=>Buffer.from(e,"utf8").toString("base64"):ut?e=>je(ut.encode(e)):e=>Le(gt(e)),ee=(e,t=false)=>t?dt(ct(e)):ct(e),pt=e=>ee(e,true),qr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Mr=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return O((r>>>10)+55296)+O((r&1023)+56320);case 3:return O((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return O((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},vt=e=>e.replace(qr,Mr),bt=e=>{if(e=e.replace(/\s+/g,""),!Hr.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,o=[];for(let a=0;a<e.length;)t=ve[e.charAt(a++)]<<18|ve[e.charAt(a++)]<<12|(r=ve[e.charAt(a++)])<<6|(n=ve[e.charAt(a++)]),r===64?o.push(O(t>>16&255)):n===64?o.push(O(t>>16&255,t>>8&255)):o.push(O(t>>16&255,t>>8&255,t&255));return o.join("")},Fe=typeof atob=="function"?e=>atob(yt(e)):te?e=>Buffer.from(e,"base64").toString("binary"):bt,_t=te?e=>ft(Buffer.from(e,"base64")):e=>ft(Fe(e).split("").map(t=>t.charCodeAt(0))),wt=e=>_t(St(e)),$r=te?e=>Buffer.from(e,"base64").toString("utf8"):lt?e=>lt.decode(_t(e)):e=>vt(Fe(e)),St=e=>yt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Ae=e=>$r(St(e)),Gr=e=>{if(typeof e!="string")return false;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return !/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Et=e=>({value:e,enumerable:false,writable:true,configurable:true}),xt=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Et(r));e("fromBase64",function(){return Ae(this)}),e("toBase64",function(t){return ee(this,t)}),e("toBase64URI",function(){return ee(this,true)}),e("toBase64URL",function(){return ee(this,true)}),e("toUint8Array",function(){return wt(this)});},Ot=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Et(r));e("toBase64",function(t){return be(this,t)}),e("toBase64URI",function(){return be(this,true)}),e("toBase64URL",function(){return be(this,true)});},Kr=()=>{xt(),Ot();},Ut={version:ht,VERSION:Ir,atob:Fe,atobPolyfill:bt,btoa:Le,btoaPolyfill:mt,fromBase64:Ae,toBase64:ee,encode:ee,encodeURI:pt,encodeURL:pt,utob:gt,btou:vt,decode:Ae,isValid:Gr,fromUint8Array:be,toUint8Array:wt,extendString:xt,extendUint8Array:Ot,extendBuiltins:Kr};var Jt=chunkJHSFSCC2_cjs.b(Ht());function Be(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function ze(){ze=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,s){l[i]=s.value;},a=typeof Symbol=="function"?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function m(l,i,s){return Object.defineProperty(l,i,{value:s,enumerable:true,configurable:true,writable:true}),l[i]}try{m({},"");}catch{m=function(s,f,d){return s[f]=d};}function v(l,i,s,f){var d=i&&i.prototype instanceof F?i:F,p=Object.create(d.prototype),g=new $(f||[]);return o(p,"_invoke",{value:Pe(l,s,g)}),p}function y(l,i,s){try{return {type:"normal",arg:l.call(i,s)}}catch(f){return {type:"throw",arg:f}}}t.wrap=v;var C="suspendedStart",ae="suspendedYield",z="executing",j="completed",S={};function F(){}function R(){}function E(){}var T={};m(T,u,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(G([])));I&&I!==r&&n.call(I,u)&&(T=I);var D=E.prototype=F.prototype=Object.create(T);function se(l){["next","throw","return"].forEach(function(i){m(l,i,function(s){return this._invoke(i,s)});});}function N(l,i){function s(d,p,g,b){var _=y(l[d],l,p);if(_.type!=="throw"){var U=_.arg,x=U.value;return x&&W(x)=="object"&&n.call(x,"__await")?i.resolve(x.__await).then(function(P){s("next",P,g,b);},function(P){s("throw",P,g,b);}):i.resolve(x).then(function(P){U.value=P,g(U);},function(P){return s("throw",P,g,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(p,g){function b(){return new i(function(_,U){s(p,g,_,U);})}return f=f?f.then(b,b):b()}});}function Pe(l,i,s){var f=C;return function(d,p){if(f===z)throw Error("Generator is already running");if(f===j){if(d==="throw")throw p;return {value:e,done:true}}for(s.method=d,s.arg=p;;){var g=s.delegate;if(g){var b=le(g,s);if(b){if(b===S)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(f===C)throw f=j,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=z;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?j:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=j,s.method="throw",s.arg=_.arg);}}}function le(l,i){var s=i.method,f=l.iterator[s];if(f===e)return i.delegate=null,s==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,le(l,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),S;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,S;var p=d.arg;return p?p.done?(i[l.resultName]=p.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,S):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,S)}function ke(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i);}function M(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i;}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ke,this),this.reset(true);}function G(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,f=function d(){for(;++s<l.length;)if(n.call(l,s))return d.value=l[s],d.done=false,d;return d.value=e,d.done=true,d};return f.next=f}}throw new TypeError(W(l)+" is not iterable")}return R.prototype=E,o(D,"constructor",{value:E,configurable:true}),o(E,"constructor",{value:R,configurable:true}),R.displayName=m(E,h,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return !!i&&(i===R||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,E):(l.__proto__=E,m(l,h,"GeneratorFunction")),l.prototype=Object.create(D),l},t.awrap=function(l){return {__await:l}},se(N.prototype),m(N.prototype,c,function(){return this}),t.AsyncIterator=N,t.async=function(l,i,s,f,d){d===void 0&&(d=Promise);var p=new N(v(l,i,s,f),d);return t.isGeneratorFunction(i)?p:p.next().then(function(g){return g.done?g.value:p.next()})},se(D),m(D,h,"Generator"),m(D,u,function(){return this}),m(D,"toString",function(){return "[object Generator]"}),t.keys=function(l){var i=Object(l),s=[];for(var f in i)s.push(f);return s.reverse(),function d(){for(;s.length;){var p=s.pop();if(p in i)return d.value=p,d.done=false,d}return d.done=true,d}},t.values=G,$.prototype={constructor:$,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=false,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var s in this)s.charAt(0)==="t"&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e);},stop:function(){this.done=true;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function f(U,x){return g.type="throw",g.arg=i,s.next=U,x&&(s.method="next",s.arg=e),!!x}for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d],g=p.completion;if(p.tryLoc==="root")return f("end");if(p.tryLoc<=this.prev){var b=n.call(p,"catchLoc"),_=n.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return f(p.catchLoc,true);if(this.prev<p.finallyLoc)return f(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return f(p.catchLoc,true)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return f(p.finallyLoc)}}}},abrupt:function(i,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var p=d;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var g=p?p.completion:{};return g.type=i,g.arg=s,p?(this.method="next",this.next=p.finallyLoc,S):this.complete(g)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),S},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),S}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var p=d.arg;M(f);}return p}}throw Error("illegal catch attempt")},delegateYield:function(i,s,f){return this.delegate={iterator:G(i),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=e),S}},t}function Bt(e,t,r,n,o,a,u){try{var c=e[a](u),h=c.value;}catch(m){r(m);return}c.done?t(h):Promise.resolve(h).then(n,o);}function on(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){Bt(a,n,o,u,c,"next",h);}function c(h){Bt(a,n,o,u,c,"throw",h);}u(void 0);})}}function Wt(e,t){return ln(e)||sn(e,t)||Yt(e,t)||an()}function an(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
'use strict';var chunkIBQULJZC_cjs=require('./chunk-IBQULJZC.cjs'),chunkKNLOZXCA_cjs=require('./chunk-KNLOZXCA.cjs'),chunkQQDH35OW_cjs=require('./chunk-QQDH35OW.cjs'),chunkDL4BV5IH_cjs=require('./chunk-DL4BV5IH.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs'),chunkEVKPEPYP_cjs=require('./chunk-EVKPEPYP.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var kt=chunkJHSFSCC2_cjs.a((ro,Pt)=>{Pt.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return false;switch(r){case "http":case "ws":return t!==80;case "https":case "wss":return t!==443;case "ftp":return t!==21;case "gopher":return t!==70;case "file":return false}return t!==0};});var Ct=chunkJHSFSCC2_cjs.a(Ie=>{var Xr=Object.prototype.hasOwnProperty,Vr;function Rt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Dt(e){try{return encodeURIComponent(e)}catch{return null}}function Wr(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=Rt(n[1]),a=Rt(n[2]);o===null||a===null||o in r||(r[o]=a);}return r}function Yr(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(Xr.call(e,o)){if(n=e[o],!n&&(n===null||n===Vr||isNaN(n))&&(n=""),o=Dt(o),n=Dt(n),o===null||n===null)continue;r.push(o+"="+n);}return r.length?t+r.join("&"):""}Ie.stringify=Yr;Ie.parse=Wr;});var Ht=chunkJHSFSCC2_cjs.a((oo,Nt)=>{var jt=kt(),_e=Ct(),Zr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,At=/[\n\r\t]/g,Jr=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Lt=/:\d+$/,Qr=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,en=/^[a-zA-Z]:/;function He(e){return (e||"").toString().replace(Zr,"")}var Ne=[["#","hash"],["?","query"],function(t,r){return A(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Tt={hash:1,query:1};function Ft(e){var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},o=typeof e,a;if(e.protocol==="blob:")n=new L(unescape(e.pathname),{});else if(o==="string"){n=new L(e,{});for(a in Tt)delete n[a];}else if(o==="object"){for(a in e)a in Tt||(n[a]=e[a]);n.slashes===void 0&&(n.slashes=Jr.test(e.href));}return n}function A(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function It(e,t){e=He(e),e=e.replace(At,""),t=t||{};var r=Qr.exec(e),n=r[1]?r[1].toLowerCase():"",o=!!r[2],a=!!r[3],u=0,c;return o?a?(c=r[2]+r[3]+r[4],u=r[2].length+r[3].length):(c=r[2]+r[4],u=r[2].length):a?(c=r[3]+r[4],u=r[3].length):c=r[4],n==="file:"?u>=2&&(c=c.slice(2)):A(n)?c=r[4]:n?o&&(c=c.slice(2)):u>=2&&A(t.protocol)&&(c=r[4]),{protocol:n,slashes:o||A(n),slashesCount:u,rest:c}}function tn(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],a=false,u=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),u++):u&&(n===0&&(a=true),r.splice(n,1),u--);return a&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function L(e,t,r){if(e=He(e),e=e.replace(At,""),!(this instanceof L))return new L(e,t,r);var n,o,a,u,c,h,m=Ne.slice(),v=typeof t,y=this,C=0;for(v!=="object"&&v!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=_e.parse),t=Ft(t),o=It(e||"",t),n=!o.protocol&&!o.slashes,y.slashes=o.slashes||n&&t.slashes,y.protocol=o.protocol||t.protocol||"",e=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||en.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!A(y.protocol)))&&(m[3]=[/(.*)/,"pathname"]);C<m.length;C++){if(u=m[C],typeof u=="function"){e=u(e,y);continue}a=u[0],h=u[1],a!==a?y[h]=e:typeof a=="string"?(c=a==="@"?e.lastIndexOf(a):e.indexOf(a),~c&&(typeof u[2]=="number"?(y[h]=e.slice(0,c),e=e.slice(c+u[2])):(y[h]=e.slice(c),e=e.slice(0,c)))):(c=a.exec(e))&&(y[h]=c[1],e=e.slice(0,c.index)),y[h]=y[h]||n&&u[3]&&t[h]||"",u[4]&&(y[h]=y[h].toLowerCase());}r&&(y.query=r(y.query)),n&&t.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||t.pathname!=="")&&(y.pathname=tn(y.pathname,t.pathname)),y.pathname.charAt(0)!=="/"&&A(y.protocol)&&(y.pathname="/"+y.pathname),jt(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(c=y.auth.indexOf(":"),~c?(y.username=y.auth.slice(0,c),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(c+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&A(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString();}function rn(e,t,r){var n=this;switch(e){case "query":typeof t=="string"&&t.length&&(t=(r||_e.parse)(t)),n[e]=t;break;case "port":n[e]=t,jt(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case "hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case "host":n[e]=t,Lt.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case "protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case "pathname":case "hash":if(t){var o=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==o?o+t:t;}else n[e]=t;break;case "username":case "password":n[e]=encodeURIComponent(t);break;case "auth":var a=t.indexOf(":");~a?(n.username=t.slice(0,a),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(a+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t));}for(var u=0;u<Ne.length;u++){var c=Ne[u];c[4]&&(n[c[1]]=n[c[1]].toLowerCase());}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&A(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function nn(e){(!e||typeof e!="function")&&(e=_e.stringify);var t,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var a=o+(r.protocol&&r.slashes||A(r.protocol)?"//":"");return r.username?(a+=r.username,r.password&&(a+=":"+r.password),a+="@"):r.password?(a+=":"+r.password,a+="@"):r.protocol!=="file:"&&A(r.protocol)&&!n&&r.pathname!=="/"&&(a+="@"),(n[n.length-1]===":"||Lt.test(r.hostname)&&!r.port)&&(n+=":"),a+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(a+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(a+=r.hash),a}L.prototype={set:rn,toString:nn};L.extractProtocol=It;L.location=Ft;L.trimLeft=He;L.qs=_e;Nt.exports=L;});function J(e){"@babel/helpers - typeof";return J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(e)}function wr(e,t,r){return Object.defineProperty(e,"prototype",{writable:false}),e}function xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Or(e,t,r){return t=fe(t),Ur(e,Te()?Reflect.construct(t,r||[],fe(e).constructor):t.apply(e,r))}function Ur(e,t){if(t&&(J(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pr(e)}function Pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&ue(e,t);}function Ce(e){var t=typeof Map=="function"?new Map:void 0;return Ce=function(n){if(n===null||!Dr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o);}function o(){return Rr(n,arguments,fe(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:false,writable:true,configurable:true}}),ue(o,n)},Ce(e)}function Rr(e,t,r){if(Te())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&ue(o,r.prototype),o}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (Te=function(){return !!e})()}function Dr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function ue(e,t){return ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},ue(e,t)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fe(e)}var Cr=(function(e){function t(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(xr(this,t),n=Or(this,t,[r]),n.originalRequest=a,n.originalResponse=u,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),a!=null){var c=a.getHeader("X-Request-ID")||"n/a",h=a.getMethod(),m=a.getURL(),v=u?u.getStatus():"n/a",y=u?u.getBody()||"":"n/a";r+=", originated from request (method: ".concat(h,", url: ").concat(m,", response code: ").concat(v,", response text: ").concat(y,", request id: ").concat(c,")");}return n.message=r,n}return kr(t,e),wr(t)})(Ce(Error)),Q=Cr;function B(e){}function ce(e){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(e)}function jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function at(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Lr(n.key),n);}}function Ar(e,t,r){return t&&at(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Lr(e){var t=Fr(e,"string");return ce(t)=="symbol"?t:t+""}function Fr(e,t){if(ce(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ce(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var st=(function(){function e(){jr(this,e);}return Ar(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])})();var ht="3.7.8",Ir=ht,te=typeof Buffer=="function",lt=typeof TextDecoder=="function"?new TextDecoder:void 0,ut=typeof TextEncoder=="function"?new TextEncoder:void 0,Nr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",pe=Array.prototype.slice.call(Nr),ve=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(pe),Hr=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,O=String.fromCharCode.bind(String),ft=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),dt=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),yt=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),mt=e=>{let t,r,n,o,a="",u=e.length%3;for(let c=0;c<e.length;){if((r=e.charCodeAt(c++))>255||(n=e.charCodeAt(c++))>255||(o=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,a+=pe[t>>18&63]+pe[t>>12&63]+pe[t>>6&63]+pe[t&63];}return u?a.slice(0,u-3)+"===".substring(u):a},Le=typeof btoa=="function"?e=>btoa(e):te?e=>Buffer.from(e,"binary").toString("base64"):mt,je=te?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(O.apply(null,e.subarray(n,n+4096)));return Le(r.join(""))},be=(e,t=false)=>t?dt(je(e)):je(e),Br=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?O(192|t>>>6)+O(128|t&63):O(224|t>>>12&15)+O(128|t>>>6&63)+O(128|t&63)}else {var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return O(240|t>>>18&7)+O(128|t>>>12&63)+O(128|t>>>6&63)+O(128|t&63)}},zr=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,gt=e=>e.replace(zr,Br),ct=te?e=>Buffer.from(e,"utf8").toString("base64"):ut?e=>je(ut.encode(e)):e=>Le(gt(e)),ee=(e,t=false)=>t?dt(ct(e)):ct(e),pt=e=>ee(e,true),qr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Mr=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return O((r>>>10)+55296)+O((r&1023)+56320);case 3:return O((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return O((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},vt=e=>e.replace(qr,Mr),bt=e=>{if(e=e.replace(/\s+/g,""),!Hr.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,n,o=[];for(let a=0;a<e.length;)t=ve[e.charAt(a++)]<<18|ve[e.charAt(a++)]<<12|(r=ve[e.charAt(a++)])<<6|(n=ve[e.charAt(a++)]),r===64?o.push(O(t>>16&255)):n===64?o.push(O(t>>16&255,t>>8&255)):o.push(O(t>>16&255,t>>8&255,t&255));return o.join("")},Fe=typeof atob=="function"?e=>atob(yt(e)):te?e=>Buffer.from(e,"base64").toString("binary"):bt,_t=te?e=>ft(Buffer.from(e,"base64")):e=>ft(Fe(e).split("").map(t=>t.charCodeAt(0))),wt=e=>_t(St(e)),$r=te?e=>Buffer.from(e,"base64").toString("utf8"):lt?e=>lt.decode(_t(e)):e=>vt(Fe(e)),St=e=>yt(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),Ae=e=>$r(St(e)),Gr=e=>{if(typeof e!="string")return false;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return !/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Et=e=>({value:e,enumerable:false,writable:true,configurable:true}),xt=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Et(r));e("fromBase64",function(){return Ae(this)}),e("toBase64",function(t){return ee(this,t)}),e("toBase64URI",function(){return ee(this,true)}),e("toBase64URL",function(){return ee(this,true)}),e("toUint8Array",function(){return wt(this)});},Ot=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Et(r));e("toBase64",function(t){return be(this,t)}),e("toBase64URI",function(){return be(this,true)}),e("toBase64URL",function(){return be(this,true)});},Kr=()=>{xt(),Ot();},Ut={version:ht,VERSION:Ir,atob:Fe,atobPolyfill:bt,btoa:Le,btoaPolyfill:mt,fromBase64:Ae,toBase64:ee,encode:ee,encodeURI:pt,encodeURL:pt,utob:gt,btou:vt,decode:Ae,isValid:Gr,fromUint8Array:be,toUint8Array:wt,extendString:xt,extendUint8Array:Ot,extendBuiltins:Kr};var Jt=chunkJHSFSCC2_cjs.b(Ht());function Be(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function ze(){ze=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,s){l[i]=s.value;},a=typeof Symbol=="function"?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function m(l,i,s){return Object.defineProperty(l,i,{value:s,enumerable:true,configurable:true,writable:true}),l[i]}try{m({},"");}catch{m=function(s,f,d){return s[f]=d};}function v(l,i,s,f){var d=i&&i.prototype instanceof F?i:F,p=Object.create(d.prototype),g=new $(f||[]);return o(p,"_invoke",{value:Pe(l,s,g)}),p}function y(l,i,s){try{return {type:"normal",arg:l.call(i,s)}}catch(f){return {type:"throw",arg:f}}}t.wrap=v;var C="suspendedStart",ae="suspendedYield",z="executing",j="completed",S={};function F(){}function R(){}function E(){}var T={};m(T,u,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(G([])));I&&I!==r&&n.call(I,u)&&(T=I);var D=E.prototype=F.prototype=Object.create(T);function se(l){["next","throw","return"].forEach(function(i){m(l,i,function(s){return this._invoke(i,s)});});}function N(l,i){function s(d,p,g,b){var _=y(l[d],l,p);if(_.type!=="throw"){var U=_.arg,x=U.value;return x&&W(x)=="object"&&n.call(x,"__await")?i.resolve(x.__await).then(function(P){s("next",P,g,b);},function(P){s("throw",P,g,b);}):i.resolve(x).then(function(P){U.value=P,g(U);},function(P){return s("throw",P,g,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(p,g){function b(){return new i(function(_,U){s(p,g,_,U);})}return f=f?f.then(b,b):b()}});}function Pe(l,i,s){var f=C;return function(d,p){if(f===z)throw Error("Generator is already running");if(f===j){if(d==="throw")throw p;return {value:e,done:true}}for(s.method=d,s.arg=p;;){var g=s.delegate;if(g){var b=le(g,s);if(b){if(b===S)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(f===C)throw f=j,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=z;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?j:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=j,s.method="throw",s.arg=_.arg);}}}function le(l,i){var s=i.method,f=l.iterator[s];if(f===e)return i.delegate=null,s==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,le(l,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),S;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,S;var p=d.arg;return p?p.done?(i[l.resultName]=p.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,S):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,S)}function ke(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i);}function M(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i;}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ke,this),this.reset(true);}function G(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,f=function d(){for(;++s<l.length;)if(n.call(l,s))return d.value=l[s],d.done=false,d;return d.value=e,d.done=true,d};return f.next=f}}throw new TypeError(W(l)+" is not iterable")}return R.prototype=E,o(D,"constructor",{value:E,configurable:true}),o(E,"constructor",{value:R,configurable:true}),R.displayName=m(E,h,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return !!i&&(i===R||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,E):(l.__proto__=E,m(l,h,"GeneratorFunction")),l.prototype=Object.create(D),l},t.awrap=function(l){return {__await:l}},se(N.prototype),m(N.prototype,c,function(){return this}),t.AsyncIterator=N,t.async=function(l,i,s,f,d){d===void 0&&(d=Promise);var p=new N(v(l,i,s,f),d);return t.isGeneratorFunction(i)?p:p.next().then(function(g){return g.done?g.value:p.next()})},se(D),m(D,h,"Generator"),m(D,u,function(){return this}),m(D,"toString",function(){return "[object Generator]"}),t.keys=function(l){var i=Object(l),s=[];for(var f in i)s.push(f);return s.reverse(),function d(){for(;s.length;){var p=s.pop();if(p in i)return d.value=p,d.done=false,d}return d.done=true,d}},t.values=G,$.prototype={constructor:$,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=false,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var s in this)s.charAt(0)==="t"&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e);},stop:function(){this.done=true;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function f(U,x){return g.type="throw",g.arg=i,s.next=U,x&&(s.method="next",s.arg=e),!!x}for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d],g=p.completion;if(p.tryLoc==="root")return f("end");if(p.tryLoc<=this.prev){var b=n.call(p,"catchLoc"),_=n.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return f(p.catchLoc,true);if(this.prev<p.finallyLoc)return f(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return f(p.catchLoc,true)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return f(p.finallyLoc)}}}},abrupt:function(i,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var p=d;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var g=p?p.completion:{};return g.type=i,g.arg=s,p?(this.method="next",this.next=p.finallyLoc,S):this.complete(g)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),S},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),S}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var p=d.arg;M(f);}return p}}throw Error("illegal catch attempt")},delegateYield:function(i,s,f){return this.delegate={iterator:G(i),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=e),S}},t}function Bt(e,t,r,n,o,a,u){try{var c=e[a](u),h=c.value;}catch(m){r(m);return}c.done?t(h):Promise.resolve(h).then(n,o);}function on(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){Bt(a,n,o,u,c,"next",h);}function c(h){Bt(a,n,o,u,c,"throw",h);}u(void 0);})}}function Wt(e,t){return ln(e)||sn(e,t)||Yt(e,t)||an()}function an(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,u,c=[],h=true,m=false;try{if(a=(r=r.call(e)).next,t===0);else for(;!(h=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);h=!0);}catch(v){m=true,o=v;}finally{try{if(!h&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(m)throw o}}return c}}function ln(e){if(Array.isArray(e))return e}function W(e){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(e)}function un(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Yt(e))||t){r&&(e=r);var n=0,o=function(){};return {s:o,n:function(){return n>=e.length?{done:true}:{done:false,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=true,u=false,c;return {s:function(){r=r.call(e);},n:function(){var m=r.next();return a=m.done,m},e:function(m){u=true,c=m;},f:function(){try{!a&&r.return!=null&&r.return();}finally{if(u)throw c}}}}function Yt(e,t){if(e){if(typeof e=="string")return zt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zt(e,t)}}function zt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qt(Object(r),true).forEach(function(n){fn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function fn(e,t,r){return t=Zt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Zt(n.key),n);}}function pn(e,t,r){return t&&Mt(e.prototype,t),r&&Mt(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Zt(e){var t=hn(e,"string");return W(t)=="symbol"?t:t+""}function hn(e,t){if(W(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(W(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var we="tus-v1",Se="ietf-draft-03",he="ietf-draft-05",dn={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:false,headers:{},addRequestId:false,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:er,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:true,removeFingerprintOnSuccess:false,uploadLengthDeferred:false,uploadDataDuringCreation:false,urlStorage:null,fileReader:null,httpStack:null,protocol:we},Qt=(function(){function e(t,r){cn(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=false,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null;}return pn(e,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey;}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![we,Se,he].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var a=0,u=["uploadUrl","uploadSize","uploadLengthDeferred"];a<u.length;a++){var c=u[a];if(this.options[c]){this._emitError(new Error("tus: cannot use the ".concat(c," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(h){return r._fingerprint=h,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(h){if(r._source=h,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload();}).catch(function(h){r._emitError(h);});}},{key:"_startParallelUpload",value:function(){var r,n=this,o=this._size,a=0;this._parallelUploads=[];var u=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,c=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:mn(this._source.size,u);this._parallelUploadUrls&&c.forEach(function(v,y){v.uploadUrl=n._parallelUploadUrls[y]||null;}),this._parallelUploadUrls=new Array(c.length);var h=c.map(function(v,y){var C=0;return n._source.slice(v.start,v.end).then(function(ae){var z=ae.value;return new Promise(function(j,S){var F=re(re({},n.options),{},{uploadUrl:v.uploadUrl||null,storeFingerprintForResuming:false,removeFingerprintOnSuccess:false,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:re(re({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:j,onError:S,onProgress:function(T){a=a-C+T,C=T,n._emitProgress(a,o);},onUploadUrlAvailable:function(){n._parallelUploadUrls[y]=R.url,n._parallelUploadUrls.filter(function(T){return !!T}).length===c.length&&n._saveUploadInUrlStorage();}}),R=new e(z,F);R.start(),n._parallelUploads.push(R);})})}),m;Promise.all(h).then(function(){m=n._openRequest("POST",n.options.endpoint),m.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var v=$t(n.options.metadata);return v!==""&&m.setHeader("Upload-Metadata",v),n._sendRequest(m,null)}).then(function(v){if(!ne(v.getStatus(),200)){n._emitHttpError(m,v,"tus: unexpected response while creating upload");return}var y=v.getHeader("Location");if(y==null){n._emitHttpError(m,v,"tus: invalid or missing Location header");return}n.url=Vt(n.options.endpoint,y),B("Created upload at ".concat(n.url)),n._emitSuccess(v);}).catch(function(v){n._emitError(v);});}},{key:"_startSingleUpload",value:function(){if(this._aborted=false,this.url!=null){B("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){B("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload();}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=un(this._parallelUploads),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;u.abort(r);}}catch(c){o.e(c);}finally{o.f();}}return this._req!==null&&this._req.abort(),this._aborted=true,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,o,a){this._emitError(new Q(o,a,r,n));}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Xt(r,this._retryAttempt,this.options)){var a=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start();},a);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r});}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n);}},{key:"_emitChunkComplete",value:function(r,n,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o);}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var o=$t(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var a;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,a=this._addChunkToRequest(n)):((this.options.protocol===Se||this.options.protocol===he)&&n.setHeader("Upload-Complete","?0"),a=this._sendRequest(n,null)),a.then(function(u){if(!ne(u.getStatus(),200)){r._emitHttpError(n,u,"tus: unexpected response while creating upload");return}var c=u.getHeader("Location");if(c==null){r._emitHttpError(n,u,"tus: invalid or missing Location header");return}if(r.url=Vt(r.options.endpoint,c),B("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(u),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,u):(r._offset=0,r._performUpload());});}).catch(function(u){r._emitHttpError(n,null,"tus: failed to create upload",u);});}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(a){var u=a.getStatus();if(!ne(u,200)){if(u===423){r._emitHttpError(n,a,"tus: upload is currently locked; retry later");return}if(ne(u,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,a,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var c=Number.parseInt(a.getHeader("Upload-Offset"),10);if(Number.isNaN(c)){r._emitHttpError(n,a,"tus: invalid or missing offset value");return}var h=Number.parseInt(a.getHeader("Upload-Length"),10);if(Number.isNaN(h)&&!r.options.uploadLengthDeferred&&r.options.protocol===we){r._emitHttpError(n,a,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(c===h){r._emitProgress(h,h),r._emitSuccess(a);return}r._offset=c,r._performUpload();});}).catch(function(a){r._emitHttpError(n,null,"tus: failed to resume upload",a);});}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var o=this._addChunkToRequest(n);o.then(function(a){if(!ne(a.getStatus(),200)){r._emitHttpError(n,a,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,a);}).catch(function(a){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),a);});}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,a=this._offset+this.options.chunkSize;return r.setProgressHandler(function(u){n._emitProgress(o+u,n._size);}),this.options.protocol===we?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===he&&r.setHeader("Content-Type","application/partial-upload"),(a===Number.POSITIVE_INFINITY||a>this._size)&&!this.options.uploadLengthDeferred&&(a=this._size),this._source.slice(o,a).then(function(u){var c=u.value,h=u.done,m=c!=null&&c.size?c.size:0;n.options.uploadLengthDeferred&&h&&(n._size=n._offset+m,r.setHeader("Upload-Length","".concat(n._size)));var v=n._offset+m;return !n.options.uploadLengthDeferred&&h&&v!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(v," bytes"))):c===null?n._sendRequest(r):((n.options.protocol===Se||n.options.protocol===he)&&r.setHeader("Upload-Complete",h?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,c))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload();}},{key:"_openRequest",value:function(r,n){var o=Gt(r,n,this.options);return this._req=o,o}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n);}),this._urlStorageKey=null);}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(o){r._urlStorageKey=o;})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Kt(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Gt("DELETE",r,n);return Kt(o,null,n).then(function(a){if(a.getStatus()!==204)throw new Q("tus: unexpected response while terminating upload",null,o,a)}).catch(function(a){if(a instanceof Q||(a=new Q("tus: failed to terminate upload",a,o,null)),!Xt(a,0,n))throw a;var u=n.retryDelays[0],c=n.retryDelays.slice(1),h=re(re({},n),{},{retryDelays:c});return new Promise(function(m){return setTimeout(m,u)}).then(function(){return e.terminate(r,h)})})}}])})();function $t(e){return Object.entries(e).map(function(t){var r=Wt(t,2),n=r[0],o=r[1];return "".concat(n," ").concat(Ut.encode(String(o)))}).join(",")}function ne(e,t){return e>=t&&e<t+100}function Gt(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===Se?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===he?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},a=0,u=Object.entries(o);a<u.length;a++){var c=Wt(u[a],2),h=c[0],m=c[1];n.setHeader(h,m);}if(r.addRequestId){var v=Be();n.setHeader("X-Request-ID",v);}return n}function Kt(e,t,r){return qe.apply(this,arguments)}function qe(){return qe=on(ze().mark(function e(t,r,n){var o;return ze().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(typeof n.onBeforeRequest!="function"){u.next=3;break}return u.next=3,n.onBeforeRequest(t);case 3:return u.next=5,t.send(r);case 5:if(o=u.sent,typeof n.onAfterResponse!="function"){u.next=9;break}return u.next=9,n.onAfterResponse(t,o);case 9:return u.abrupt("return",o);case 10:case "end":return u.stop()}},e)})),qe.apply(this,arguments)}function yn(){var e=true;return typeof navigator<"u"&&navigator.onLine===false&&(e=false),e}function Xt(e,t,r){return r.retryDelays==null||t>=r.retryDelays.length||e.originalRequest==null?false:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(e,t,r):er(e)}function er(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return (!ne(t,400)||t===409||t===423)&&yn()}function Vt(e,t){return new Jt.default(t,e).toString()}function mn(e,t){for(var r=Math.floor(e/t),n=[],o=0;o<t;o++)n.push({start:r*o,end:r*(o+1)});return n[t-1].end=e,n}Qt.defaultOptions=dn;var Ee=Qt;var gn=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},xe=gn;function Me(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=n.response;t(o);},n.onerror=function(o){r(o);},n.open("GET",e),n.send();})}var vn=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},tr=vn;function $e(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var o=new Uint8Array(n.result);t({value:o});},n.onerror=function(o){r(o);},n.readAsArrayBuffer(e);})}function de(e){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(e)}function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,wn(n.key),n);}}function _n(e,t,r){return t&&rr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function wn(e){var t=Sn(e,"string");return de(t)=="symbol"?t:t+""}function Sn(e,t){if(de(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(de(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var Ge=(function(){function e(t){bn(this,e),this._file=t,this.size=t.size;}return _n(e,[{key:"slice",value:function(r,n){if(tr())return $e(this._file.slice(r,n));var o=this._file.slice(r,n),a=n>=this.size;return Promise.resolve({value:o,done:a})}},{key:"close",value:function(){}}])})();function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,On(n.key),n);}}function xn(e,t,r){return t&&nr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function On(e){var t=Un(e,"string");return ye(t)=="symbol"?t:t+""}function Un(e,t){if(ye(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ye(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}function or(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function Pn(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}var ir=(function(){function e(t){En(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=false;}return xn(e,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var o=this,a=n<=this._bufferOffset+or(this._buffer);if(this._done||a){var u=this._getDataFromBuffer(r,n),c=u==null?this._done:false;return Promise.resolve({value:u,done:c})}return this._reader.read().then(function(h){var m=h.value,v=h.done;return v?o._done=true:o._buffer===void 0?o._buffer=m:o._buffer=Pn(o._buffer,m),o._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var o=or(this._buffer)===0;return this._done&&o?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel();}}])})();function Y(e){"@babel/helpers - typeof";return Y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(e)}function Ke(){Ke=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,s){l[i]=s.value;},a=typeof Symbol=="function"?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function m(l,i,s){return Object.defineProperty(l,i,{value:s,enumerable:true,configurable:true,writable:true}),l[i]}try{m({},"");}catch{m=function(s,f,d){return s[f]=d};}function v(l,i,s,f){var d=i&&i.prototype instanceof F?i:F,p=Object.create(d.prototype),g=new $(f||[]);return o(p,"_invoke",{value:Pe(l,s,g)}),p}function y(l,i,s){try{return {type:"normal",arg:l.call(i,s)}}catch(f){return {type:"throw",arg:f}}}t.wrap=v;var C="suspendedStart",ae="suspendedYield",z="executing",j="completed",S={};function F(){}function R(){}function E(){}var T={};m(T,u,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(G([])));I&&I!==r&&n.call(I,u)&&(T=I);var D=E.prototype=F.prototype=Object.create(T);function se(l){["next","throw","return"].forEach(function(i){m(l,i,function(s){return this._invoke(i,s)});});}function N(l,i){function s(d,p,g,b){var _=y(l[d],l,p);if(_.type!=="throw"){var U=_.arg,x=U.value;return x&&Y(x)=="object"&&n.call(x,"__await")?i.resolve(x.__await).then(function(P){s("next",P,g,b);},function(P){s("throw",P,g,b);}):i.resolve(x).then(function(P){U.value=P,g(U);},function(P){return s("throw",P,g,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(p,g){function b(){return new i(function(_,U){s(p,g,_,U);})}return f=f?f.then(b,b):b()}});}function Pe(l,i,s){var f=C;return function(d,p){if(f===z)throw Error("Generator is already running");if(f===j){if(d==="throw")throw p;return {value:e,done:true}}for(s.method=d,s.arg=p;;){var g=s.delegate;if(g){var b=le(g,s);if(b){if(b===S)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(f===C)throw f=j,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=z;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?j:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=j,s.method="throw",s.arg=_.arg);}}}function le(l,i){var s=i.method,f=l.iterator[s];if(f===e)return i.delegate=null,s==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,le(l,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),S;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,S;var p=d.arg;return p?p.done?(i[l.resultName]=p.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,S):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,S)}function ke(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i);}function M(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i;}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ke,this),this.reset(true);}function G(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,f=function d(){for(;++s<l.length;)if(n.call(l,s))return d.value=l[s],d.done=false,d;return d.value=e,d.done=true,d};return f.next=f}}throw new TypeError(Y(l)+" is not iterable")}return R.prototype=E,o(D,"constructor",{value:E,configurable:true}),o(E,"constructor",{value:R,configurable:true}),R.displayName=m(E,h,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return !!i&&(i===R||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,E):(l.__proto__=E,m(l,h,"GeneratorFunction")),l.prototype=Object.create(D),l},t.awrap=function(l){return {__await:l}},se(N.prototype),m(N.prototype,c,function(){return this}),t.AsyncIterator=N,t.async=function(l,i,s,f,d){d===void 0&&(d=Promise);var p=new N(v(l,i,s,f),d);return t.isGeneratorFunction(i)?p:p.next().then(function(g){return g.done?g.value:p.next()})},se(D),m(D,h,"Generator"),m(D,u,function(){return this}),m(D,"toString",function(){return "[object Generator]"}),t.keys=function(l){var i=Object(l),s=[];for(var f in i)s.push(f);return s.reverse(),function d(){for(;s.length;){var p=s.pop();if(p in i)return d.value=p,d.done=false,d}return d.done=true,d}},t.values=G,$.prototype={constructor:$,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=false,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var s in this)s.charAt(0)==="t"&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e);},stop:function(){this.done=true;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function f(U,x){return g.type="throw",g.arg=i,s.next=U,x&&(s.method="next",s.arg=e),!!x}for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d],g=p.completion;if(p.tryLoc==="root")return f("end");if(p.tryLoc<=this.prev){var b=n.call(p,"catchLoc"),_=n.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return f(p.catchLoc,true);if(this.prev<p.finallyLoc)return f(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return f(p.catchLoc,true)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return f(p.finallyLoc)}}}},abrupt:function(i,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var p=d;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var g=p?p.completion:{};return g.type=i,g.arg=s,p?(this.method="next",this.next=p.finallyLoc,S):this.complete(g)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),S},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),S}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var p=d.arg;M(f);}return p}}throw Error("illegal catch attempt")},delegateYield:function(i,s,f){return this.delegate={iterator:G(i),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=e),S}},t}function ar(e,t,r,n,o,a,u){try{var c=e[a](u),h=c.value;}catch(m){r(m);return}c.done?t(h):Promise.resolve(h).then(n,o);}function kn(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){ar(a,n,o,u,c,"next",h);}function c(h){ar(a,n,o,u,c,"throw",h);}u(void 0);})}}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Cn(n.key),n);}}function Dn(e,t,r){return t&&sr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Cn(e){var t=Tn(e,"string");return Y(t)=="symbol"?t:t+""}function Tn(e,t){if(Y(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Y(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var lr=(function(){function e(){Rn(this,e);}return Dn(e,[{key:"openFile",value:(function(){var t=kn(Ke().mark(function n(o,a){var u;return Ke().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(xe()&&o&&typeof o.uri<"u")){h.next=11;break}return h.prev=1,h.next=4,Me(o.uri);case 4:return u=h.sent,h.abrupt("return",new Ge(u));case 8:throw h.prev=8,h.t0=h.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(h.t0));case 11:if(!(typeof o.slice=="function"&&typeof o.size<"u")){h.next=13;break}return h.abrupt("return",Promise.resolve(new Ge(o)));case 13:if(typeof o.read!="function"){h.next=18;break}if(a=Number(a),Number.isFinite(a)){h.next=17;break}return h.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return h.abrupt("return",Promise.resolve(new ir(o,a)));case 18:return h.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case "end":return h.stop()}},n,null,[[1,8]])}));function r(n,o){return t.apply(this,arguments)}return r})()}])})();function Xe(e,t){return xe()?Promise.resolve(jn(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function jn(e,t){var r=e.exif?An(JSON.stringify(e.exif)):"noexif";return ["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}function An(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t;}return t}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(e)}function Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ur(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Ln(n.key),n);}}function We(e,t,r){return t&&ur(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Ln(e){var t=Fn(e,"string");return me(t)=="symbol"?t:t+""}function Fn(e,t){if(me(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var fr=(function(){function e(){Ve(this,e);}return We(e,[{key:"createRequest",value:function(r,n){return new In(r,n)}},{key:"getName",value:function(){return "XHRHttpStack"}}])})();var In=(function(){function e(t,r){Ve(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,true),this._method=t,this._url=r,this._headers={};}return We(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n;}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded);});}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(o,a){r._xhr.onload=function(){o(new Nn(r._xhr));},r._xhr.onerror=function(u){a(u);},r._xhr.send(n);})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})(),Nn=(function(){function e(t){Ve(this,e),this._xhr=t;}return We(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})();function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}function Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,zn(n.key),n);}}function Bn(e,t,r){return t&&cr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function zn(e){var t=qn(e,"string");return ge(t)=="symbol"?t:t+""}function qn(e,t){if(ge(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var Ze=false;try{Ze="localStorage"in window,Oe="tusSupport",Ye=localStorage.getItem(Oe),localStorage.setItem(Oe,Ye),Ye===null&&localStorage.removeItem(Oe);}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Ze=false;else throw e}var Oe,Ye,pr=Ze,hr=(function(){function e(){Hn(this,e);}return Bn(e,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var o=Math.round(Math.random()*1e12),a="tus::".concat(r,"::").concat(o);return localStorage.setItem(a,JSON.stringify(n)),Promise.resolve(a)}},{key:"_findEntries",value:function(r){for(var n=[],o=0;o<localStorage.length;o++){var a=localStorage.key(o);if(a.indexOf(r)===0)try{var u=JSON.parse(localStorage.getItem(a));u.urlStorageKey=a,n.push(u);}catch{}}return n}}])})();function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function Mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,vr(n.key),n);}}function $n(e,t,r){return r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Gn(e,t,r){return t=Ue(t),Kn(e,gr()?Reflect.construct(t,r||[],Ue(e).constructor):t.apply(e,r))}function Kn(e,t){if(t&&(ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xn(e)}function Xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (gr=function(){return !!e})()}function Ue(e){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ue(e)}function Vn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&Je(e,t);}function Je(e,t){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Je(e,t)}function yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yr(Object(r),true).forEach(function(n){Wn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function Wn(e,t,r){return t=vr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function vr(e){var t=Yn(e,"string");return ie(t)=="symbol"?t:t+""}function Yn(e,t){if(ie(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ie(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var mr=oe(oe({},Ee.defaultOptions),{},{httpStack:new fr,fileReader:new lr,urlStorage:pr?new hr:new st,fingerprint:Xe}),br=(function(e){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Mn(this,t),n=oe(oe({},mr),n),Gn(this,t,[r,n])}return Vn(t,e),$n(t,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=oe(oe({},mr),o),Ee.terminate(n,o)}}])})(Ee);exports.a=class w extends chunk2E5GLLOS_cjs.g{constructor(){super(...arguments);this.disableCompletion=false;this._progress=0;this._completed=false;this._dragging=false;this._error=null;this._hasErrorSlot=false;this.playableEmitted=false;this.languageController=new chunk5QLIDHRT_cjs.d(this);this.lastState="initial";this.lastProgress=-1;}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleActionClick),this.addEventListener("keydown",this.handleActionKeyDown),this.languageController.locale=this.locale||"en",this.updateHasErrorSlot(),typeof MutationObserver<"u"&&(this.slotObserver=new MutationObserver(()=>{this.updateHasErrorSlot();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["slot"]})),this.embedChannel=chunkIBQULJZC_cjs.a.connect(this.token),this.embedChannel.upload_id&&(this._upload_id=this.embedChannel.upload_id),this.embedChannel.channel.on("initiate",({upload_id:r})=>{this._upload_id=r,this.embedChannel.upload_id=r,this.playableEmitted=false;}),this.embedChannel.channel.on("completed",this.completed.bind(this)),this.embedChannel.channel.on("rendition",this.rendition.bind(this)),this.embedChannel.channel.on("error",this.error.bind(this));}requestUpdate(r,n){super.requestUpdate(r,n),r==="locale"&&(this.languageController.locale=this.locale);}reset(){this._progress=0,this._completed=false,this._error=null,this.playableEmitted=false,this.currentEmbed=void 0,this.embedChannel.channel.push("reset",{});}disconnectedCallback(){chunkIBQULJZC_cjs.a.disconnect(this.embedChannel),this.removeEventListener("click",this.handleActionClick),this.removeEventListener("keydown",this.handleActionKeyDown),this.slotObserver?.disconnect(),this.slotObserver=void 0,super.disconnectedCallback();}handleDrop(r){r.preventDefault(),this._dragging=false;let n=r.dataTransfer;if(!n)return;let o=this.collectFilesFromDataTransfer(n);if(!o.length)return;this._error=null;let a=false;for(let u of o)this.isSupportedFile(u)?(a||(this._progress=1,a=true),this.upload(u)):this.handleUnsupportedFile(u);}handleForm(r){let n=r.target;if(n.files){n.files.length&&(this._error=null);let o=false;for(let a of n.files)this.isSupportedFile(a)?(o||(this._progress=1,o=true),this.upload(a)):this.handleUnsupportedFile(a);n.value="";}}upload(r){this.dispatchEvent(new CustomEvent("upload",{bubbles:true,composed:true,detail:{file:r}})),this._error=null;let n=new br(r,{endpoint:chunkEVKPEPYP_cjs.a.upload.endpoint,retryDelays:[0,3e3,5e3,1e4,2e4,6e4,6e4],metadata:{title:r.name,filetype:r.type,token:this.token,upload_id:this._upload_id},onError:o=>{console.log(o),this.dispatchEvent(new CustomEvent("failed",{bubbles:true,composed:true,detail:o}));},onProgress:(o,a)=>{let u=Math.round(o/a*100);u>this._progress&&(this._progress=u),this.dispatchEvent(new CustomEvent("progress",{bubbles:true,composed:true,detail:{progress:u}}));},onSuccess:()=>{this._progress=100,this.dispatchEvent(new CustomEvent("processing",{bubbles:true,composed:true}));},removeFingerprintOnSuccess:true});n.findPreviousUploads().then(o=>{o.length&&n.resumeFromPreviousUpload(o[0]),n.start();});}completed(r){this.currentEmbed=r?.embed,setTimeout(()=>{this.disableCompletion||(this._completed=true),this.dispatchEvent(new CustomEvent("completed",{bubbles:true,composed:true,detail:r}));},250);}rendition(r){!this.playableEmitted&&this.isPlayableRendition(r)&&(this.playableEmitted=true,setTimeout(()=>{this.dispatchEvent(new CustomEvent("playable",{bubbles:true,composed:true,detail:{embed:this.currentEmbed}}));},250)),this.dispatchEvent(new CustomEvent("rendition",{bubbles:true,composed:true,detail:r}));}error(r){console.warn(`[mave-upload] ${r.message}`),this._error={reason:"upload error",message:r.message},this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("error",{bubbles:true,detail:r}));}isPlayableRendition(r){return typeof r?.container=="string"&&r.container==="hls"&&r?.type==="video"}updateHasErrorSlot(r){let n=!!this.querySelector('[slot="error"]');this._hasErrorSlot!==n&&(this._hasErrorSlot=n);}render(){switch(this.currentState){case "error":return this.renderError();case "uploading":return this.renderUploading();case "processing":return this.renderProcessing();case "done":return this.renderDone();default:return this.renderInitial()}}styleOpacity(){return this.languageController.loaded?this._upload_id?{}:{pointerEvents:"none",opacity:"0.5"}:{pointerEvents:"none",opacity:"0"}}styleFont(){return this.font?{fontFamily:this.font}:{fontFamily:"system-ui"}}get currentState(){return this._error?"error":this._completed?"done":this._progress>=100&&this._progress>0?"processing":this._progress>0?"uploading":"initial"}openFileDialog(){this.fileInput&&!this.fileInput.disabled&&this.fileInput.click();}findActionTarget(r){for(let n of r.composedPath())if(n instanceof HTMLElement&&n.hasAttribute("data-mave-upload-select"))return n;return null}handleActionClick(r){this.findActionTarget(r)&&(r.preventDefault(),this.openFileDialog());}handleActionKeyDown(r){if(r.key!=="Enter"&&r.key!==" ")return;this.findActionTarget(r)&&(r.preventDefault(),this.openFileDialog());}blockSubmit(r){r.preventDefault();}collectFilesFromDataTransfer(r){let n=[];if(r.items&&r.items.length){for(let o of r.items){if(o.kind!=="file")continue;let a=o.getAsFile();a&&n.push(a);}if(n.length)return n}if(r.files&&r.files.length)for(let o of r.files)n.push(o);return n}hasSupportedFiles(r){let n=this.collectFilesFromDataTransfer(r);if(n.length)return n.some(a=>this.isSupportedFile(a));if(typeof navigator<"u"&&/^((?!chrome|crios|chromium|android).)*safari/i.test(navigator.userAgent))return true;if(r.items&&r.items.length)for(let a of r.items){if(a.kind!=="file")continue;let u=(a.type||"").toLowerCase();if(u.startsWith("video/")||u.startsWith("audio/"))return true}return false}handleDragEnter(r){r.preventDefault();let n=r.dataTransfer;if(!n){this._dragging=false;return}let o=this.hasSupportedFiles(n);n.dropEffect=o?"copy":"none",this._dragging=o;}handleDragOver(r){r.preventDefault();let n=r.dataTransfer;if(!n){this._dragging=false;return}let o=this.hasSupportedFiles(n);n.dropEffect=o?"copy":"none",this._dragging=o;}handleDragLeave(r){r.preventDefault();let n=r.currentTarget,o=r.relatedTarget;if(!n){this._dragging=false;return}(!o||!(o instanceof Node)||!n.contains(o))&&(this._dragging=false);}isSupportedFile(r){let n=(r.type||"").toLowerCase(),o=exports.a.getFileExtension(r);return n.startsWith("video/")?!o||exports.a.SUPPORTED_VIDEO_EXTENSIONS.has(o):n.startsWith("audio/")?!o||exports.a.SUPPORTED_AUDIO_EXTENSIONS.has(o):o?!!(exports.a.SUPPORTED_VIDEO_EXTENSIONS.has(o)||exports.a.SUPPORTED_AUDIO_EXTENSIONS.has(o)):false}static getFileExtension(r){let n=r.name||"",o=n.lastIndexOf(".");if(!(o===-1||o===n.length-1))return n.slice(o+1).toLowerCase()}handleUnsupportedFile(r){let n={file:r,reason:"unsupported type",allowedExtensions:{video:Array.from(exports.a.SUPPORTED_VIDEO_EXTENSIONS),audio:Array.from(exports.a.SUPPORTED_AUDIO_EXTENSIONS)}};this._error=n,this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("invalid",{bubbles:true,composed:true,detail:{...n,message:chunk5QLIDHRT_cjs.a("unsupported file type")}}));}updated(r){super.updated(r);let n=this._progress||0,o=this.currentState;this.setAttribute("state",o),this.setAttribute("progress",`${n}`),this.toggleAttribute("drag-over",this._dragging),this.toggleAttribute("ready",!!this._upload_id&&this.languageController.loaded);let a=o!==this.lastState,u=n!==this.lastProgress,c=r.has("_dragging");(a||u||c)&&this.dispatchEvent(new CustomEvent("statechange",{bubbles:true,composed:true,detail:{state:o,progress:n,dragging:this._dragging,error:this._error}})),this.lastState=o,this.lastProgress=n;}renderInitial(){let r=this.color?this.color:"#1997FF",n=this.radius?this.radius:"16px";return chunk2E5GLLOS_cjs.a`<form
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=true,u=false,c;return {s:function(){r=r.call(e);},n:function(){var m=r.next();return a=m.done,m},e:function(m){u=true,c=m;},f:function(){try{!a&&r.return!=null&&r.return();}finally{if(u)throw c}}}}function Yt(e,t){if(e){if(typeof e=="string")return zt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zt(e,t)}}function zt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qt(Object(r),true).forEach(function(n){fn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function fn(e,t,r){return t=Zt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Zt(n.key),n);}}function pn(e,t,r){return t&&Mt(e.prototype,t),r&&Mt(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Zt(e){var t=hn(e,"string");return W(t)=="symbol"?t:t+""}function hn(e,t){if(W(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(W(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var we="tus-v1",Se="ietf-draft-03",he="ietf-draft-05",dn={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:false,headers:{},addRequestId:false,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:er,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:true,removeFingerprintOnSuccess:false,uploadLengthDeferred:false,uploadDataDuringCreation:false,urlStorage:null,fileReader:null,httpStack:null,protocol:we},Qt=(function(){function e(t,r){cn(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=false,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null;}return pn(e,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey;}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![we,Se,he].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var a=0,u=["uploadUrl","uploadSize","uploadLengthDeferred"];a<u.length;a++){var c=u[a];if(this.options[c]){this._emitError(new Error("tus: cannot use the ".concat(c," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(h){return r._fingerprint=h,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(h){if(r._source=h,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload();}).catch(function(h){r._emitError(h);});}},{key:"_startParallelUpload",value:function(){var r,n=this,o=this._size,a=0;this._parallelUploads=[];var u=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,c=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:mn(this._source.size,u);this._parallelUploadUrls&&c.forEach(function(v,y){v.uploadUrl=n._parallelUploadUrls[y]||null;}),this._parallelUploadUrls=new Array(c.length);var h=c.map(function(v,y){var C=0;return n._source.slice(v.start,v.end).then(function(ae){var z=ae.value;return new Promise(function(j,S){var F=re(re({},n.options),{},{uploadUrl:v.uploadUrl||null,storeFingerprintForResuming:false,removeFingerprintOnSuccess:false,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:re(re({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:j,onError:S,onProgress:function(T){a=a-C+T,C=T,n._emitProgress(a,o);},onUploadUrlAvailable:function(){n._parallelUploadUrls[y]=R.url,n._parallelUploadUrls.filter(function(T){return !!T}).length===c.length&&n._saveUploadInUrlStorage();}}),R=new e(z,F);R.start(),n._parallelUploads.push(R);})})}),m;Promise.all(h).then(function(){m=n._openRequest("POST",n.options.endpoint),m.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var v=$t(n.options.metadata);return v!==""&&m.setHeader("Upload-Metadata",v),n._sendRequest(m,null)}).then(function(v){if(!ne(v.getStatus(),200)){n._emitHttpError(m,v,"tus: unexpected response while creating upload");return}var y=v.getHeader("Location");if(y==null){n._emitHttpError(m,v,"tus: invalid or missing Location header");return}n.url=Vt(n.options.endpoint,y),B("Created upload at ".concat(n.url)),n._emitSuccess(v);}).catch(function(v){n._emitError(v);});}},{key:"_startSingleUpload",value:function(){if(this._aborted=false,this.url!=null){B("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){B("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload();}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=un(this._parallelUploads),a;try{for(o.s();!(a=o.n()).done;){var u=a.value;u.abort(r);}}catch(c){o.e(c);}finally{o.f();}}return this._req!==null&&this._req.abort(),this._aborted=true,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,o,a){this._emitError(new Q(o,a,r,n));}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Xt(r,this._retryAttempt,this.options)){var a=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start();},a);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r});}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n);}},{key:"_emitChunkComplete",value:function(r,n,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o);}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var o=$t(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var a;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,a=this._addChunkToRequest(n)):((this.options.protocol===Se||this.options.protocol===he)&&n.setHeader("Upload-Complete","?0"),a=this._sendRequest(n,null)),a.then(function(u){if(!ne(u.getStatus(),200)){r._emitHttpError(n,u,"tus: unexpected response while creating upload");return}var c=u.getHeader("Location");if(c==null){r._emitHttpError(n,u,"tus: invalid or missing Location header");return}if(r.url=Vt(r.options.endpoint,c),B("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(u),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,u):(r._offset=0,r._performUpload());});}).catch(function(u){r._emitHttpError(n,null,"tus: failed to create upload",u);});}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(a){var u=a.getStatus();if(!ne(u,200)){if(u===423){r._emitHttpError(n,a,"tus: upload is currently locked; retry later");return}if(ne(u,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,a,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var c=Number.parseInt(a.getHeader("Upload-Offset"),10);if(Number.isNaN(c)){r._emitHttpError(n,a,"tus: invalid or missing offset value");return}var h=Number.parseInt(a.getHeader("Upload-Length"),10);if(Number.isNaN(h)&&!r.options.uploadLengthDeferred&&r.options.protocol===we){r._emitHttpError(n,a,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(c===h){r._emitProgress(h,h),r._emitSuccess(a);return}r._offset=c,r._performUpload();});}).catch(function(a){r._emitHttpError(n,null,"tus: failed to resume upload",a);});}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var o=this._addChunkToRequest(n);o.then(function(a){if(!ne(a.getStatus(),200)){r._emitHttpError(n,a,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,a);}).catch(function(a){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),a);});}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,a=this._offset+this.options.chunkSize;return r.setProgressHandler(function(u){n._emitProgress(o+u,n._size);}),this.options.protocol===we?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===he&&r.setHeader("Content-Type","application/partial-upload"),(a===Number.POSITIVE_INFINITY||a>this._size)&&!this.options.uploadLengthDeferred&&(a=this._size),this._source.slice(o,a).then(function(u){var c=u.value,h=u.done,m=c!=null&&c.size?c.size:0;n.options.uploadLengthDeferred&&h&&(n._size=n._offset+m,r.setHeader("Upload-Length","".concat(n._size)));var v=n._offset+m;return !n.options.uploadLengthDeferred&&h&&v!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(v," bytes"))):c===null?n._sendRequest(r):((n.options.protocol===Se||n.options.protocol===he)&&r.setHeader("Upload-Complete",h?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,c))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload();}},{key:"_openRequest",value:function(r,n){var o=Gt(r,n,this.options);return this._req=o,o}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n);}),this._urlStorageKey=null);}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(o){r._urlStorageKey=o;})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Kt(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Gt("DELETE",r,n);return Kt(o,null,n).then(function(a){if(a.getStatus()!==204)throw new Q("tus: unexpected response while terminating upload",null,o,a)}).catch(function(a){if(a instanceof Q||(a=new Q("tus: failed to terminate upload",a,o,null)),!Xt(a,0,n))throw a;var u=n.retryDelays[0],c=n.retryDelays.slice(1),h=re(re({},n),{},{retryDelays:c});return new Promise(function(m){return setTimeout(m,u)}).then(function(){return e.terminate(r,h)})})}}])})();function $t(e){return Object.entries(e).map(function(t){var r=Wt(t,2),n=r[0],o=r[1];return "".concat(n," ").concat(Ut.encode(String(o)))}).join(",")}function ne(e,t){return e>=t&&e<t+100}function Gt(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===Se?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===he?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},a=0,u=Object.entries(o);a<u.length;a++){var c=Wt(u[a],2),h=c[0],m=c[1];n.setHeader(h,m);}if(r.addRequestId){var v=Be();n.setHeader("X-Request-ID",v);}return n}function Kt(e,t,r){return qe.apply(this,arguments)}function qe(){return qe=on(ze().mark(function e(t,r,n){var o;return ze().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(typeof n.onBeforeRequest!="function"){u.next=3;break}return u.next=3,n.onBeforeRequest(t);case 3:return u.next=5,t.send(r);case 5:if(o=u.sent,typeof n.onAfterResponse!="function"){u.next=9;break}return u.next=9,n.onAfterResponse(t,o);case 9:return u.abrupt("return",o);case 10:case "end":return u.stop()}},e)})),qe.apply(this,arguments)}function yn(){var e=true;return typeof navigator<"u"&&navigator.onLine===false&&(e=false),e}function Xt(e,t,r){return r.retryDelays==null||t>=r.retryDelays.length||e.originalRequest==null?false:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(e,t,r):er(e)}function er(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return (!ne(t,400)||t===409||t===423)&&yn()}function Vt(e,t){return new Jt.default(t,e).toString()}function mn(e,t){for(var r=Math.floor(e/t),n=[],o=0;o<t;o++)n.push({start:r*o,end:r*(o+1)});return n[t-1].end=e,n}Qt.defaultOptions=dn;var Ee=Qt;var gn=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},xe=gn;function Me(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=n.response;t(o);},n.onerror=function(o){r(o);},n.open("GET",e),n.send();})}var vn=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},tr=vn;function $e(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var o=new Uint8Array(n.result);t({value:o});},n.onerror=function(o){r(o);},n.readAsArrayBuffer(e);})}function de(e){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(e)}function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,wn(n.key),n);}}function _n(e,t,r){return t&&rr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function wn(e){var t=Sn(e,"string");return de(t)=="symbol"?t:t+""}function Sn(e,t){if(de(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(de(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var Ge=(function(){function e(t){bn(this,e),this._file=t,this.size=t.size;}return _n(e,[{key:"slice",value:function(r,n){if(tr())return $e(this._file.slice(r,n));var o=this._file.slice(r,n),a=n>=this.size;return Promise.resolve({value:o,done:a})}},{key:"close",value:function(){}}])})();function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,On(n.key),n);}}function xn(e,t,r){return t&&nr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function On(e){var t=Un(e,"string");return ye(t)=="symbol"?t:t+""}function Un(e,t){if(ye(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ye(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}function or(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function Pn(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}var ir=(function(){function e(t){En(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=false;}return xn(e,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var o=this,a=n<=this._bufferOffset+or(this._buffer);if(this._done||a){var u=this._getDataFromBuffer(r,n),c=u==null?this._done:false;return Promise.resolve({value:u,done:c})}return this._reader.read().then(function(h){var m=h.value,v=h.done;return v?o._done=true:o._buffer===void 0?o._buffer=m:o._buffer=Pn(o._buffer,m),o._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var o=or(this._buffer)===0;return this._done&&o?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel();}}])})();function Y(e){"@babel/helpers - typeof";return Y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(e)}function Ke(){Ke=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(l,i,s){l[i]=s.value;},a=typeof Symbol=="function"?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function m(l,i,s){return Object.defineProperty(l,i,{value:s,enumerable:true,configurable:true,writable:true}),l[i]}try{m({},"");}catch{m=function(s,f,d){return s[f]=d};}function v(l,i,s,f){var d=i&&i.prototype instanceof F?i:F,p=Object.create(d.prototype),g=new $(f||[]);return o(p,"_invoke",{value:Pe(l,s,g)}),p}function y(l,i,s){try{return {type:"normal",arg:l.call(i,s)}}catch(f){return {type:"throw",arg:f}}}t.wrap=v;var C="suspendedStart",ae="suspendedYield",z="executing",j="completed",S={};function F(){}function R(){}function E(){}var T={};m(T,u,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(G([])));I&&I!==r&&n.call(I,u)&&(T=I);var D=E.prototype=F.prototype=Object.create(T);function se(l){["next","throw","return"].forEach(function(i){m(l,i,function(s){return this._invoke(i,s)});});}function N(l,i){function s(d,p,g,b){var _=y(l[d],l,p);if(_.type!=="throw"){var U=_.arg,x=U.value;return x&&Y(x)=="object"&&n.call(x,"__await")?i.resolve(x.__await).then(function(P){s("next",P,g,b);},function(P){s("throw",P,g,b);}):i.resolve(x).then(function(P){U.value=P,g(U);},function(P){return s("throw",P,g,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(p,g){function b(){return new i(function(_,U){s(p,g,_,U);})}return f=f?f.then(b,b):b()}});}function Pe(l,i,s){var f=C;return function(d,p){if(f===z)throw Error("Generator is already running");if(f===j){if(d==="throw")throw p;return {value:e,done:true}}for(s.method=d,s.arg=p;;){var g=s.delegate;if(g){var b=le(g,s);if(b){if(b===S)continue;return b}}if(s.method==="next")s.sent=s._sent=s.arg;else if(s.method==="throw"){if(f===C)throw f=j,s.arg;s.dispatchException(s.arg);}else s.method==="return"&&s.abrupt("return",s.arg);f=z;var _=y(l,i,s);if(_.type==="normal"){if(f=s.done?j:ae,_.arg===S)continue;return {value:_.arg,done:s.done}}_.type==="throw"&&(f=j,s.method="throw",s.arg=_.arg);}}}function le(l,i){var s=i.method,f=l.iterator[s];if(f===e)return i.delegate=null,s==="throw"&&l.iterator.return&&(i.method="return",i.arg=e,le(l,i),i.method==="throw")||s!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+s+"' method")),S;var d=y(f,l.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,S;var p=d.arg;return p?p.done?(i[l.resultName]=p.value,i.next=l.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,S):p:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,S)}function ke(l){var i={tryLoc:l[0]};1 in l&&(i.catchLoc=l[1]),2 in l&&(i.finallyLoc=l[2],i.afterLoc=l[3]),this.tryEntries.push(i);}function M(l){var i=l.completion||{};i.type="normal",delete i.arg,l.completion=i;}function $(l){this.tryEntries=[{tryLoc:"root"}],l.forEach(ke,this),this.reset(true);}function G(l){if(l||l===""){var i=l[u];if(i)return i.call(l);if(typeof l.next=="function")return l;if(!isNaN(l.length)){var s=-1,f=function d(){for(;++s<l.length;)if(n.call(l,s))return d.value=l[s],d.done=false,d;return d.value=e,d.done=true,d};return f.next=f}}throw new TypeError(Y(l)+" is not iterable")}return R.prototype=E,o(D,"constructor",{value:E,configurable:true}),o(E,"constructor",{value:R,configurable:true}),R.displayName=m(E,h,"GeneratorFunction"),t.isGeneratorFunction=function(l){var i=typeof l=="function"&&l.constructor;return !!i&&(i===R||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(l){return Object.setPrototypeOf?Object.setPrototypeOf(l,E):(l.__proto__=E,m(l,h,"GeneratorFunction")),l.prototype=Object.create(D),l},t.awrap=function(l){return {__await:l}},se(N.prototype),m(N.prototype,c,function(){return this}),t.AsyncIterator=N,t.async=function(l,i,s,f,d){d===void 0&&(d=Promise);var p=new N(v(l,i,s,f),d);return t.isGeneratorFunction(i)?p:p.next().then(function(g){return g.done?g.value:p.next()})},se(D),m(D,h,"Generator"),m(D,u,function(){return this}),m(D,"toString",function(){return "[object Generator]"}),t.keys=function(l){var i=Object(l),s=[];for(var f in i)s.push(f);return s.reverse(),function d(){for(;s.length;){var p=s.pop();if(p in i)return d.value=p,d.done=false,d}return d.done=true,d}},t.values=G,$.prototype={constructor:$,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=false,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var s in this)s.charAt(0)==="t"&&n.call(this,s)&&!isNaN(+s.slice(1))&&(this[s]=e);},stop:function(){this.done=true;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var s=this;function f(U,x){return g.type="throw",g.arg=i,s.next=U,x&&(s.method="next",s.arg=e),!!x}for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d],g=p.completion;if(p.tryLoc==="root")return f("end");if(p.tryLoc<=this.prev){var b=n.call(p,"catchLoc"),_=n.call(p,"finallyLoc");if(b&&_){if(this.prev<p.catchLoc)return f(p.catchLoc,true);if(this.prev<p.finallyLoc)return f(p.finallyLoc)}else if(b){if(this.prev<p.catchLoc)return f(p.catchLoc,true)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<p.finallyLoc)return f(p.finallyLoc)}}}},abrupt:function(i,s){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var p=d;break}}p&&(i==="break"||i==="continue")&&p.tryLoc<=s&&s<=p.finallyLoc&&(p=null);var g=p?p.completion:{};return g.type=i,g.arg=s,p?(this.method="next",this.next=p.finallyLoc,S):this.complete(g)},complete:function(i,s){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&s&&(this.next=s),S},finish:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),S}},catch:function(i){for(var s=this.tryEntries.length-1;s>=0;--s){var f=this.tryEntries[s];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var p=d.arg;M(f);}return p}}throw Error("illegal catch attempt")},delegateYield:function(i,s,f){return this.delegate={iterator:G(i),resultName:s,nextLoc:f},this.method==="next"&&(this.arg=e),S}},t}function ar(e,t,r,n,o,a,u){try{var c=e[a](u),h=c.value;}catch(m){r(m);return}c.done?t(h):Promise.resolve(h).then(n,o);}function kn(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function u(h){ar(a,n,o,u,c,"next",h);}function c(h){ar(a,n,o,u,c,"throw",h);}u(void 0);})}}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Cn(n.key),n);}}function Dn(e,t,r){return t&&sr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Cn(e){var t=Tn(e,"string");return Y(t)=="symbol"?t:t+""}function Tn(e,t){if(Y(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Y(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var lr=(function(){function e(){Rn(this,e);}return Dn(e,[{key:"openFile",value:(function(){var t=kn(Ke().mark(function n(o,a){var u;return Ke().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(xe()&&o&&typeof o.uri<"u")){h.next=11;break}return h.prev=1,h.next=4,Me(o.uri);case 4:return u=h.sent,h.abrupt("return",new Ge(u));case 8:throw h.prev=8,h.t0=h.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(h.t0));case 11:if(!(typeof o.slice=="function"&&typeof o.size<"u")){h.next=13;break}return h.abrupt("return",Promise.resolve(new Ge(o)));case 13:if(typeof o.read!="function"){h.next=18;break}if(a=Number(a),Number.isFinite(a)){h.next=17;break}return h.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return h.abrupt("return",Promise.resolve(new ir(o,a)));case 18:return h.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case "end":return h.stop()}},n,null,[[1,8]])}));function r(n,o){return t.apply(this,arguments)}return r})()}])})();function Xe(e,t){return xe()?Promise.resolve(jn(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function jn(e,t){var r=e.exif?An(JSON.stringify(e.exif)):"noexif";return ["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}function An(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t;}return t}function me(e){"@babel/helpers - typeof";return me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(e)}function Ve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ur(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,Ln(n.key),n);}}function We(e,t,r){return t&&ur(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function Ln(e){var t=Fn(e,"string");return me(t)=="symbol"?t:t+""}function Fn(e,t){if(me(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var fr=(function(){function e(){Ve(this,e);}return We(e,[{key:"createRequest",value:function(r,n){return new In(r,n)}},{key:"getName",value:function(){return "XHRHttpStack"}}])})();var In=(function(){function e(t,r){Ve(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,true),this._method=t,this._url=r,this._headers={};}return We(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n;}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded);});}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(o,a){r._xhr.onload=function(){o(new Nn(r._xhr));},r._xhr.onerror=function(u){a(u);},r._xhr.send(n);})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})(),Nn=(function(){function e(t){Ve(this,e),this._xhr=t;}return We(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})();function ge(e){"@babel/helpers - typeof";return ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ge(e)}function Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,zn(n.key),n);}}function Bn(e,t,r){return t&&cr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:false}),e}function zn(e){var t=qn(e,"string");return ge(t)=="symbol"?t:t+""}function qn(e,t){if(ge(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ge(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (String)(e)}var Ze=false;try{Ze="localStorage"in window,Oe="tusSupport",Ye=localStorage.getItem(Oe),localStorage.setItem(Oe,Ye),Ye===null&&localStorage.removeItem(Oe);}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Ze=false;else throw e}var Oe,Ye,pr=Ze,hr=(function(){function e(){Hn(this,e);}return Bn(e,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var o=Math.round(Math.random()*1e12),a="tus::".concat(r,"::").concat(o);return localStorage.setItem(a,JSON.stringify(n)),Promise.resolve(a)}},{key:"_findEntries",value:function(r){for(var n=[],o=0;o<localStorage.length;o++){var a=localStorage.key(o);if(a.indexOf(r)===0)try{var u=JSON.parse(localStorage.getItem(a));u.urlStorageKey=a,n.push(u);}catch{}}return n}}])})();function ie(e){"@babel/helpers - typeof";return ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(e)}function Mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false,n.configurable=true,"value"in n&&(n.writable=true),Object.defineProperty(e,vr(n.key),n);}}function $n(e,t,r){return r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:false}),e}function Gn(e,t,r){return t=Ue(t),Kn(e,gr()?Reflect.construct(t,r||[],Ue(e).constructor):t.apply(e,r))}function Kn(e,t){if(t&&(ie(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xn(e)}function Xn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (gr=function(){return !!e})()}function Ue(e){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ue(e)}function Vn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}}),Object.defineProperty(e,"prototype",{writable:false}),t&&Je(e,t);}function Je(e,t){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Je(e,t)}function yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yr(Object(r),true).forEach(function(n){Wn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function Wn(e,t,r){return t=vr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function vr(e){var t=Yn(e,"string");return ie(t)=="symbol"?t:t+""}function Yn(e,t){if(ie(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ie(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var mr=oe(oe({},Ee.defaultOptions),{},{httpStack:new fr,fileReader:new lr,urlStorage:pr?new hr:new st,fingerprint:Xe}),br=(function(e){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Mn(this,t),n=oe(oe({},mr),n),Gn(this,t,[r,n])}return Vn(t,e),$n(t,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=oe(oe({},mr),o),Ee.terminate(n,o)}}])})(Ee);exports.a=class w extends chunk2E5GLLOS_cjs.g{constructor(){super(...arguments);this.disableCompletion=false;this._progress=0;this._completed=false;this._dragging=false;this._error=null;this._hasErrorSlot=false;this.playableEmitted=false;this.languageController=new chunkKNLOZXCA_cjs.d(this);this.lastState="initial";this.lastProgress=-1;}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleActionClick),this.addEventListener("keydown",this.handleActionKeyDown),this.languageController.locale=this.locale||"en",this.updateHasErrorSlot(),typeof MutationObserver<"u"&&(this.slotObserver=new MutationObserver(()=>{this.updateHasErrorSlot();}),this.slotObserver.observe(this,{childList:true,subtree:true,attributes:true,attributeFilter:["slot"]})),this.embedChannel=chunkIBQULJZC_cjs.a.connect(this.token),this.embedChannel.upload_id&&(this._upload_id=this.embedChannel.upload_id),this.embedChannel.channel.on("initiate",({upload_id:r})=>{this._upload_id=r,this.embedChannel.upload_id=r,this.playableEmitted=false;}),this.embedChannel.channel.on("completed",this.completed.bind(this)),this.embedChannel.channel.on("rendition",this.rendition.bind(this)),this.embedChannel.channel.on("error",this.error.bind(this));}requestUpdate(r,n){super.requestUpdate(r,n),r==="locale"&&(this.languageController.locale=this.locale);}reset(){this._progress=0,this._completed=false,this._error=null,this.playableEmitted=false,this.currentEmbed=void 0,this.embedChannel.channel.push("reset",{});}disconnectedCallback(){chunkIBQULJZC_cjs.a.disconnect(this.embedChannel),this.removeEventListener("click",this.handleActionClick),this.removeEventListener("keydown",this.handleActionKeyDown),this.slotObserver?.disconnect(),this.slotObserver=void 0,super.disconnectedCallback();}handleDrop(r){r.preventDefault(),this._dragging=false;let n=r.dataTransfer;if(!n)return;let o=this.collectFilesFromDataTransfer(n);if(!o.length)return;this._error=null;let a=false;for(let u of o)this.isSupportedFile(u)?(a||(this._progress=1,a=true),this.upload(u)):this.handleUnsupportedFile(u);}handleForm(r){let n=r.target;if(n.files){n.files.length&&(this._error=null);let o=false;for(let a of n.files)this.isSupportedFile(a)?(o||(this._progress=1,o=true),this.upload(a)):this.handleUnsupportedFile(a);n.value="";}}upload(r){this.dispatchEvent(new CustomEvent("upload",{bubbles:true,composed:true,detail:{file:r}})),this._error=null;let n=new br(r,{endpoint:chunkEVKPEPYP_cjs.a.upload.endpoint,retryDelays:[0,3e3,5e3,1e4,2e4,6e4,6e4],metadata:{title:r.name,filetype:r.type,token:this.token,upload_id:this._upload_id},onError:o=>{console.log(o),this.dispatchEvent(new CustomEvent("failed",{bubbles:true,composed:true,detail:o}));},onProgress:(o,a)=>{let u=Math.round(o/a*100);u>this._progress&&(this._progress=u),this.dispatchEvent(new CustomEvent("progress",{bubbles:true,composed:true,detail:{progress:u}}));},onSuccess:()=>{this._progress=100,this.dispatchEvent(new CustomEvent("processing",{bubbles:true,composed:true}));},removeFingerprintOnSuccess:true});n.findPreviousUploads().then(o=>{o.length&&n.resumeFromPreviousUpload(o[0]),n.start();});}completed(r){this.currentEmbed=r?.embed,setTimeout(()=>{this.disableCompletion||(this._completed=true),this.dispatchEvent(new CustomEvent("completed",{bubbles:true,composed:true,detail:r}));},250);}rendition(r){!this.playableEmitted&&this.isPlayableRendition(r)&&(this.playableEmitted=true,setTimeout(()=>{this.dispatchEvent(new CustomEvent("playable",{bubbles:true,composed:true,detail:{embed:this.currentEmbed}}));},250)),this.dispatchEvent(new CustomEvent("rendition",{bubbles:true,composed:true,detail:r}));}error(r){console.warn(`[mave-upload] ${r.message}`),this._error={reason:"upload error",message:r.message},this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("error",{bubbles:true,detail:r}));}isPlayableRendition(r){return typeof r?.container=="string"&&r.container==="hls"&&r?.type==="video"}updateHasErrorSlot(r){let n=!!this.querySelector('[slot="error"]');this._hasErrorSlot!==n&&(this._hasErrorSlot=n);}render(){switch(this.currentState){case "error":return this.renderError();case "uploading":return this.renderUploading();case "processing":return this.renderProcessing();case "done":return this.renderDone();default:return this.renderInitial()}}styleOpacity(){return this.languageController.loaded?this._upload_id?{}:{pointerEvents:"none",opacity:"0.5"}:{pointerEvents:"none",opacity:"0"}}styleFont(){return this.font?{fontFamily:this.font}:{fontFamily:"system-ui"}}get currentState(){return this._error?"error":this._completed?"done":this._progress>=100&&this._progress>0?"processing":this._progress>0?"uploading":"initial"}openFileDialog(){this.fileInput&&!this.fileInput.disabled&&this.fileInput.click();}findActionTarget(r){for(let n of r.composedPath())if(n instanceof HTMLElement&&n.hasAttribute("data-mave-upload-select"))return n;return null}handleActionClick(r){this.findActionTarget(r)&&(r.preventDefault(),this.openFileDialog());}handleActionKeyDown(r){if(r.key!=="Enter"&&r.key!==" ")return;this.findActionTarget(r)&&(r.preventDefault(),this.openFileDialog());}blockSubmit(r){r.preventDefault();}collectFilesFromDataTransfer(r){let n=[];if(r.items&&r.items.length){for(let o of r.items){if(o.kind!=="file")continue;let a=o.getAsFile();a&&n.push(a);}if(n.length)return n}if(r.files&&r.files.length)for(let o of r.files)n.push(o);return n}hasSupportedFiles(r){let n=this.collectFilesFromDataTransfer(r);if(n.length)return n.some(a=>this.isSupportedFile(a));if(typeof navigator<"u"&&/^((?!chrome|crios|chromium|android).)*safari/i.test(navigator.userAgent))return true;if(r.items&&r.items.length)for(let a of r.items){if(a.kind!=="file")continue;let u=(a.type||"").toLowerCase();if(u.startsWith("video/")||u.startsWith("audio/"))return true}return false}handleDragEnter(r){r.preventDefault();let n=r.dataTransfer;if(!n){this._dragging=false;return}let o=this.hasSupportedFiles(n);n.dropEffect=o?"copy":"none",this._dragging=o;}handleDragOver(r){r.preventDefault();let n=r.dataTransfer;if(!n){this._dragging=false;return}let o=this.hasSupportedFiles(n);n.dropEffect=o?"copy":"none",this._dragging=o;}handleDragLeave(r){r.preventDefault();let n=r.currentTarget,o=r.relatedTarget;if(!n){this._dragging=false;return}(!o||!(o instanceof Node)||!n.contains(o))&&(this._dragging=false);}isSupportedFile(r){let n=(r.type||"").toLowerCase(),o=exports.a.getFileExtension(r);return n.startsWith("video/")?!o||exports.a.SUPPORTED_VIDEO_EXTENSIONS.has(o):n.startsWith("audio/")?!o||exports.a.SUPPORTED_AUDIO_EXTENSIONS.has(o):o?!!(exports.a.SUPPORTED_VIDEO_EXTENSIONS.has(o)||exports.a.SUPPORTED_AUDIO_EXTENSIONS.has(o)):false}static getFileExtension(r){let n=r.name||"",o=n.lastIndexOf(".");if(!(o===-1||o===n.length-1))return n.slice(o+1).toLowerCase()}handleUnsupportedFile(r){let n={file:r,reason:"unsupported type",allowedExtensions:{video:Array.from(exports.a.SUPPORTED_VIDEO_EXTENSIONS),audio:Array.from(exports.a.SUPPORTED_AUDIO_EXTENSIONS)}};this._error=n,this._progress=0,this._completed=false,this.dispatchEvent(new CustomEvent("invalid",{bubbles:true,composed:true,detail:{...n,message:chunkKNLOZXCA_cjs.a("unsupported file type")}}));}updated(r){super.updated(r);let n=this._progress||0,o=this.currentState;this.setAttribute("state",o),this.setAttribute("progress",`${n}`),this.toggleAttribute("drag-over",this._dragging),this.toggleAttribute("ready",!!this._upload_id&&this.languageController.loaded);let a=o!==this.lastState,u=n!==this.lastProgress,c=r.has("_dragging");(a||u||c)&&this.dispatchEvent(new CustomEvent("statechange",{bubbles:true,composed:true,detail:{state:o,progress:n,dragging:this._dragging,error:this._error}})),this.lastState=o,this.lastProgress=n;}renderInitial(){let r=this.color?this.color:"#1997FF",n=this.radius?this.radius:"16px";return chunk2E5GLLOS_cjs.a`<form
|
|
4
4
|
class="state state--initial"
|
|
5
5
|
style=${chunkQQDH35OW_cjs.a({...this.styleOpacity(),...this.styleFont()})}
|
|
6
6
|
@submit=${this.blockSubmit}
|
|
@@ -10,15 +10,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
10
10
|
@drop=${this.handleDrop}
|
|
11
11
|
>
|
|
12
12
|
<slot name="initial">
|
|
13
|
-
<div class="upload-default-title">${
|
|
14
|
-
<div class="upload-default-subtitle">${
|
|
13
|
+
<div class="upload-default-title">${chunkKNLOZXCA_cjs.a("drop video here")}</div>
|
|
14
|
+
<div class="upload-default-subtitle">${chunkKNLOZXCA_cjs.a("or browse your files")}</div>
|
|
15
15
|
<button
|
|
16
16
|
type="button"
|
|
17
17
|
data-mave-upload-select
|
|
18
18
|
class="upload-default-button"
|
|
19
19
|
style=${chunkQQDH35OW_cjs.a({background:r,borderRadius:n})}
|
|
20
20
|
>
|
|
21
|
-
${
|
|
21
|
+
${chunkKNLOZXCA_cjs.a("select file")}
|
|
22
22
|
</button>
|
|
23
23
|
</slot>
|
|
24
24
|
<input
|
|
@@ -59,16 +59,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
59
59
|
>
|
|
60
60
|
<div class="upload-default-progress-value" style="width: ${r}%;"></div>
|
|
61
61
|
</div>
|
|
62
|
-
<div class="upload-default-progress-label">${
|
|
62
|
+
<div class="upload-default-progress-label">${chunkKNLOZXCA_cjs.a("uploading...")}</div>
|
|
63
63
|
</div>
|
|
64
64
|
</slot>
|
|
65
65
|
</div>`}renderProcessing(){return chunk2E5GLLOS_cjs.a`<div class="state state--processing" style=${chunkQQDH35OW_cjs.a(this.styleFont())}>
|
|
66
66
|
<slot name="processing">
|
|
67
|
-
<div class="upload-default-status" role="status">${
|
|
67
|
+
<div class="upload-default-status" role="status">${chunkKNLOZXCA_cjs.a("just a minute...")}</div>
|
|
68
68
|
</slot>
|
|
69
69
|
</div>`}renderDone(){return chunk2E5GLLOS_cjs.a`<div class="state state--done" style=${chunkQQDH35OW_cjs.a(this.styleFont())}>
|
|
70
70
|
<slot name="done">
|
|
71
|
-
<div class="upload-default-status" role="status">${
|
|
71
|
+
<div class="upload-default-status" role="status">${chunkKNLOZXCA_cjs.a("done")}</div>
|
|
72
72
|
</slot>
|
|
73
73
|
</div>`}};exports.a.SUPPORTED_VIDEO_EXTENSIONS=new Set(["3g2","3gp","avi","mov","mp4","m4v","mkv","qt","ts","mts","m2t","m2ts","webm"]),exports.a.SUPPORTED_AUDIO_EXTENSIONS=new Set(["aac","amr","flac","m4a","m4b","m4p","mp3","ogg","wav"]),exports.a.styles=chunkNPP5B5PV_cjs.a`
|
|
74
74
|
:host {
|
|
@@ -203,7 +203,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
203
203
|
padding-bottom: 24px;
|
|
204
204
|
text-align: center;
|
|
205
205
|
}
|
|
206
|
-
`,chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"token",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"locale",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"color",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"font",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"radius",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a({type:Boolean})],exports.a.prototype,"disableCompletion",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_progress",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_upload_id",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_completed",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_dragging",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_error",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_hasErrorSlot",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.c("#mave-upload-input")],exports.a.prototype,"fileInput",2),exports.a=chunkJHSFSCC2_cjs.c([
|
|
206
|
+
`,chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"token",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"locale",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"color",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"font",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a()],exports.a.prototype,"radius",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.a({type:Boolean})],exports.a.prototype,"disableCompletion",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_progress",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_upload_id",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_completed",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_dragging",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_error",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.b()],exports.a.prototype,"_hasErrorSlot",2),chunkJHSFSCC2_cjs.c([chunkDL4BV5IH_cjs.c("#mave-upload-input")],exports.a.prototype,"fileInput",2),exports.a=chunkJHSFSCC2_cjs.c([chunkKNLOZXCA_cjs.b()],exports.a);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-upload")||window.customElements.define("mave-upload",exports.a));/*! Bundled license information:
|
|
207
207
|
|
|
208
208
|
tus-js-client/lib.esm/upload.js:
|
|
209
209
|
tus-js-client/lib.esm/browser/fileReader.js:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-
|
|
1
|
+
import {a as a$4}from'./chunk-YJOQHWVN.js';import {a as a$2}from'./chunk-B6P2GJBQ.js';import {c as c$1,a as a$1}from'./chunk-PTN427IG.js';import {g,a as a$3}from'./chunk-5PIHL662.js';import {a}from'./chunk-YPCQNE3R.js';import {c}from'./chunk-KA24PL7V.js';var n=class extends g{get backdrop(){return this._backdropColor||"black"}set backdrop(t){this._backdropColor!=t&&(this._backdropColor=t);}get backdropFilter(){return this._backdropFilter}set backdropFilter(t){this._backdropFilter!=t&&(this._backdropFilter=t);}get styles(){let t={"--backdrop":this.backdrop,"--backdrop-filter":this.backdropFilter};return a$2(t)}open(t){if(this._player=t,t.aspect_ratio){let[i,s]=t.aspect_ratio.split("/");this.style.setProperty("--frame-ratio-w",i),this.style.setProperty("--frame-ratio-h",s);}this.style.display="block";let o=i=>{this._frame.appendChild(t),setTimeout(()=>{this._dialog.showModal();},25),this._dialog.addEventListener("close",s=>{s.preventDefault(),this.close();},{once:true}),i(this);};return new Promise(i=>{if(this._dialog)o(i);else {let s=setInterval(()=>{this._dialog&&(o(i),clearInterval(s));},100);return}})}possibleClose(t){t.target!=this._player&&this.close();}close(){this._dialog.close(),this._backdrop.addEventListener("transitionend",()=>{this._frame.innerHTML="",this.dispatchEvent(new Event("closed",{bubbles:true}));},{once:true});}render(){return a$3`
|
|
2
2
|
<dialog style=${this.styles}>
|
|
3
3
|
<div class="backdrop"></div>
|
|
4
4
|
<div class="content" @click=${this.possibleClose}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkJ7OISSKU_cjs=require('./chunk-J7OISSKU.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var d=["default","synthwave","dolphin"],h={default:()=>import('./themes/default.cjs'),synthwave:()=>import('./themes/synthwave.cjs'),dolphin:()=>import('./themes/dolphin.cjs')};async function p(t){if(!d.includes(t))return;let n=!!chunkJ7OISSKU_cjs.a();if(!n){let c=h[t];if(c)try{return await c()}catch{}}let s=n?`./dist/themes/${t}.js`:`./themes/${t}.js`,e=new URL(s,(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-BCTXH32I.cjs', document.baseURI).href))).href;return l(e)}async function l(t){return import(t)}var m=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 t.instance.currentTheme=n,Promise.resolve(t.instance);t.instance.themes.push({name:n}),t.instance.currentTheme=n;try{if(typeof document<"u"&&!d.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&&!d.includes(n)){let{build:e}=await l(`${s}/${n}.js`);e(n,chunk2E5GLLOS_cjs.g,chunk2E5GLLOS_cjs.a,chunkNPP5B5PV_cjs.a);}else {let e=await p(n);if(e)e.build(n,chunk2E5GLLOS_cjs.g,chunk2E5GLLOS_cjs.a,chunkNPP5B5PV_cjs.a);else {let c=`./${chunkJ7OISSKU_cjs.a()}themes/${n}.js`,{build:u}=await l(c);u(n,chunk2E5GLLOS_cjs.g,chunk2E5GLLOS_cjs.a,chunkNPP5B5PV_cjs.a);}}}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 t.instance.currentTheme=s,Promise.resolve(t.instance);t.instance.themes.push({name:s}),t.instance.currentTheme=s;try{let{build:e}=await l(n);e(s,chunk2E5GLLOS_cjs.g,chunk2E5GLLOS_cjs.a,chunkNPP5B5PV_cjs.a);}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(t.instance)}static getTheme(){return t.instance?t.instance.currentTheme:""}};exports.a=m;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-P6SBZPDR.js';var c="lit-localize-status";var I=t=>typeof t!="string"&&"strTag"in t,p=(t,e,o)=>{let n=t[0];for(let r=1;r<t.length;r++)n+=e[o?o[r-1]:r-1],n+=t[r];return n};var d=(t=>I(t)?p(t.strings,t.values):t);var _=d,C=false;function E(t){if(C)throw new Error("lit-localize can only be configured once");_=t,C=true;}var w=class{constructor(e){this.__litLocalizeEventHandler=o=>{o.detail.status==="ready"&&this.host.requestUpdate();},this.host=e;}hostConnected(){window.addEventListener(c,this.__litLocalizeEventHandler);}hostDisconnected(){window.removeEventListener(c,this.__litLocalizeEventHandler);}},N=t=>t.addController(new w(t)),z=N;var W=()=>(t,e)=>(t.addInitializer(z),t);var u=class{constructor(){this.settled=false,this.promise=new Promise((e,o)=>{this._resolve=e,this._reject=o;});}resolve(e){this.settled=true,this._resolve(e);}reject(e){this.settled=true,this._reject(e);}};var i=[];for(let t=0;t<256;t++)i[t]=(t>>4&15).toString(16)+(t&15).toString(16);function A(t){let e=0,o=8997,n=0,r=33826,s=0,l=40164,L=0,f=52210;for(let v=0;v<t.length;v++)o^=t.charCodeAt(v),e=o*435,n=r*435,s=l*435,L=f*435,s+=o<<8,L+=r<<8,n+=e>>>16,o=e&65535,s+=n>>>16,r=n&65535,f=L+(s>>>16)&65535,l=s&65535;return i[f>>8]+i[f&255]+i[l>>8]+i[l&255]+i[r>>8]+i[r&255]+i[o>>8]+i[o&255]}var $="",b="h",O="s";function R(t,e){return (e?b:O)+A(typeof t=="string"?t:t.join($))}var j=new WeakMap,H=new Map;function P(t,e,o){if(t){let n=o?.id??k(e),r=t[n];if(r){if(typeof r=="string")return r;if("strTag"in r)return p(r.strings,e.values,r.values);{let s=j.get(r);return s===void 0&&(s=r.values,j.set(r,s)),{...r,values:s.map(l=>e.values[l])}}}}return d(e)}function k(t){let e=typeof t=="string"?t:t.strings,o=H.get(e);return o===void 0&&(o=R(e,typeof t!="string"&&!("strTag"in t)),H.set(e,o)),o}function S(t){window.dispatchEvent(new CustomEvent(c,{detail:t}));}var g="",y,U,h,T,V,a=new u;a.resolve();var m=0,q=t=>(E(((e,o)=>P(V,e,o))),g=U=t.sourceLocale,h=new Set(t.targetLocales),h.add(t.sourceLocale),T=t.loadLocale,{getLocale:X,setLocale:G}),X=()=>g,G=t=>{if(t===(y??g))return a.promise;if(!h||!T)throw new Error("Internal error");if(!h.has(t))throw new Error("Invalid locale code");m++;let e=m;return y=t,a.settled&&(a=new u),S({status:"loading",loadingLocale:t}),(t===U?Promise.resolve({templates:void 0}):T(t)).then(n=>{m===e&&(g=t,y=void 0,V=n.templates,S({status:"ready",readyLocale:t}),a.resolve());},n=>{m===e&&(S({status:"error",errorLocale:t,errorMessage:n.toString()}),a.reject(n));}),a.promise};var B={en:()=>import('./generated/locales/en.js'),nl:()=>import('./generated/locales/nl.js'),de:()=>import('./generated/locales/de.js'),fr:()=>import('./generated/locales/fr.js')};function J(t){return B[t]}async function D(t){let e=a$1();if(!e)return null;try{return await import(new URL(`./${e}generated/locales/${t}.js`,import.meta.url).href)}catch{return null}}var K=q({sourceLocale:"default",targetLocales:["en","nl","de","fr"],loadLocale:async t=>{if(a$1()){let n=await D(t);if(n)return n}let e=J(t);if(e)try{return await e()}catch(n){console.error(`[mave-player]: failed to load locale ${t}`,n);}let o=await D(t);return o||(console.log(`[mave-player]: locale not loaded for ${t}`),null)}}),M=false,F=class{constructor(e){this._onLoad=e=>{e.detail.status==="loading"?M=false:e.detail.status==="ready"&&(M=true),this.host.requestUpdate();};this.host=e,e.addController(this);}get loaded(){return M}set locale(e){this._locale!==e&&(K.setLocale(e),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/locale-status-event.js:
|
|
4
|
+
@lit/localize/internal/str-tag.js:
|
|
5
|
+
@lit/localize/internal/types.js:
|
|
6
|
+
@lit/localize/internal/default-msg.js:
|
|
7
|
+
@lit/localize/internal/localized-controller.js:
|
|
8
|
+
@lit/localize/internal/localized-decorator.js:
|
|
9
|
+
@lit/localize/internal/runtime-msg.js:
|
|
10
|
+
@lit/localize/init/runtime.js:
|
|
11
|
+
@lit/localize/init/transform.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2021 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*)
|
|
17
|
+
|
|
18
|
+
@lit/localize/internal/deferred.js:
|
|
19
|
+
@lit/localize/internal/id-generation.js:
|
|
20
|
+
@lit/localize/lit-localize.js:
|
|
21
|
+
(**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2020 Google LLC
|
|
24
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
+
*)
|
|
26
|
+
|
|
27
|
+
@lit/localize/internal/fnv1a64.js:
|
|
28
|
+
(**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2014 Travis Webb
|
|
31
|
+
* SPDX-License-Identifier: MIT
|
|
32
|
+
*)
|
|
33
|
+
*/export{_ as a,W as b,K as c,F as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkR6AMJOJL_cjs=require('./chunk-R6AMJOJL.cjs'),chunkTKJYRGEU_cjs=require('./chunk-TKJYRGEU.cjs'),chunkRQN3DXJB_cjs=require('./chunk-RQN3DXJB.cjs'),chunkDL4BV5IH_cjs=require('./chunk-DL4BV5IH.cjs'),chunk2E5GLLOS_cjs=require('./chunk-2E5GLLOS.cjs'),chunkNPP5B5PV_cjs=require('./chunk-NPP5B5PV.cjs'),chunkJHSFSCC2_cjs=require('./chunk-JHSFSCC2.cjs');var n,C,b,h,f,p,u=class extends chunkTKJYRGEU_cjs.a{constructor(){super(...arguments);chunkJHSFSCC2_cjs.e(this,n);this.order="newest";this.embedController=new chunkRQN3DXJB_cjs.b(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(e,o){super.requestUpdate(e,o),e==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}updated(){this.shadowRoot&&chunkR6AMJOJL_cjs.b(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(e){return this._collection?.videos?.some(o=>o.id===e)}getNextForEmbed(e){let o=chunkJHSFSCC2_cjs.g(this,n,C).call(this),t=o.findIndex(s=>s.id===e);if(t!==-1)return o[t+1]}render(){return chunk2E5GLLOS_cjs.a`
|
|
2
2
|
${this.embedController.render({pending:this.renderPending,error:e=>chunk2E5GLLOS_cjs.a`<p>${e instanceof Error?e.message:chunk2E5GLLOS_cjs.e}</p>`,complete:e=>{if(this._collection=e,!e)return this.renderPending();if(e.error)return console.warn(e.error);let o=this._slottedChildren.map(t=>{function s(){let l;return t.nodeName==="TEMPLATE"?l=t.content.cloneNode(true):l=t.cloneNode(true),l}if(t.getAttribute("name")=="list-title"){let l=s();return l.textContent=this._collection?.name,chunk2E5GLLOS_cjs.a`${l}`}if(t.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let l=s(),i=chunkJHSFSCC2_cjs.g(this,n,f).call(this,l,"root-link");return i&&(i.addEventListener("click",a=>{a.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),chunkJHSFSCC2_cjs.g(this,n,p).call(this,i)),chunk2E5GLLOS_cjs.a`${l}`}if(t.getAttribute("name")=="mave-list-folder"){let l=this._collection.collections?.map(i=>{let a=s(),m=chunkJHSFSCC2_cjs.g(this,n,f).call(this,a,"folder-link");return [t,m].forEach(d=>{d instanceof Element&&(d.addEventListener("click",g=>{g.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:i.id}),this.embedController.embed=i.id;}),chunkJHSFSCC2_cjs.g(this,n,p).call(this,d));}),chunkJHSFSCC2_cjs.g(this,n,h).call(this,a,"folder-title",i.name),typeof i.video_count=="number"&&chunkJHSFSCC2_cjs.g(this,n,h).call(this,a,"folder-count",i.video_count.toString()),chunk2E5GLLOS_cjs.a`${a}`});return chunk2E5GLLOS_cjs.a`${l}`}if(t.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(t.hasAttribute("name")?t.getAttribute("name"):"")&&t.nodeName=="TEMPLATE"){let l=chunkJHSFSCC2_cjs.g(this,n,C).call(this).map((i,a)=>{let m=s(),d=a+1;chunkJHSFSCC2_cjs.g(this,n,h).call(this,m,"item-title",i.name),chunkJHSFSCC2_cjs.g(this,n,h).call(this,m,"item-position",d.toString()),chunkJHSFSCC2_cjs.g(this,n,h).call(this,m,"item-duration",this.durationToTime(i.duration)),chunkJHSFSCC2_cjs.g(this,n,b).call(this,m,"mave-clip",i.id),chunkJHSFSCC2_cjs.g(this,n,b).call(this,m,"mave-player",i.id),chunkJHSFSCC2_cjs.g(this,n,b).call(this,m,"mave-img",i.id);let g=m.querySelector("mave-clip"),S=chunkJHSFSCC2_cjs.g(this,n,f).call(this,m,"item-title"),$=m.querySelector("mave-img");return [g,S,$,m].forEach(P=>{P?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:i.id,position:d});});}),chunk2E5GLLOS_cjs.a`${m}`});return chunk2E5GLLOS_cjs.a`${l}`}}).filter(t=>t);return chunk2E5GLLOS_cjs.a`${this._stylesheets} ${o}`}})}
|
|
3
3
|
`}renderPending(){return chunk2E5GLLOS_cjs.a`<slot style="display: none"></slot>`}};n=new WeakSet,C=function(){if(!this._collection)return [];let e=this._collection.videos;return this.order=="newest"&&(e=this._collection.videos?.sort((o,t)=>t.created-o.created)),this.order=="oldest"&&(e=this._collection.videos?.sort((o,t)=>o.created-t.created)),this.order=="az"&&(e=this._collection.videos?.sort((o,t)=>o.name.localeCompare(t.name))),this.order=="za"&&(e=this._collection.videos?.sort((o,t)=>t.name.localeCompare(o.name))),e},b=function(e,o,t){let s=e.querySelector(o);s&&(s.setAttribute("embed",t),chunkJHSFSCC2_cjs.g(this,n,p).call(this,s));},h=function(e,o,t){let s=chunkJHSFSCC2_cjs.g(this,n,f).call(this,e,o);s&&(s.textContent=t,chunkJHSFSCC2_cjs.g(this,n,p).call(this,s));},f=function(e,o){return e.querySelector(`[slot="${o}"], [data-slot="${o}"]`)},p=function(e){e&&(e.removeAttribute("slot"),e.removeAttribute("data-slot"));},u.styles=chunkNPP5B5PV_cjs.a`
|
|
4
4
|
:host {
|