Socket
Socket
Sign inDemoInstall

@api.video/video-uploader

Package Overview
Dependencies
1
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.4 to 1.1.5

4

CHANGELOG.md
# Changelog
All changes to this project will be documented in this file.
## [1.1.5] - 2023-10-26
- Add cancel() methods
- Add part number in progressive upload onProgress()
## [1.1.4] - 2023-08-21

@@ -5,0 +9,0 @@ - Include `mp4` in VideoUploadResponse type

2

dist/index.js

@@ -1,1 +0,1 @@

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(()=>(()=>{var t={7633:(t,e,r)=>{r(9170),r(6992),r(1539),r(8674),r(7922),r(4668),r(7727),r(8783);var n=r(857);t.exports=n.Promise},9662:(t,e,r)=>{var n=r(614),o=r(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a function")}},9483:(t,e,r)=>{var n=r(4411),o=r(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a constructor")}},6077:(t,e,r)=>{var n=r(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},1223:(t,e,r)=>{var n=r(5112),o=r(30),i=r(3070).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:o(null)}),t.exports=function(t){s[a][t]=!0}},5787:(t,e,r)=>{var n=r(7976),o=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw o("Incorrect invocation")}},9670:(t,e,r)=>{var n=r(111),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not an object")}},1318:(t,e,r)=>{var n=r(5656),o=r(1400),i=r(6244),a=function(t){return function(e,r,a){var s,u=n(e),c=i(u),f=o(a,c);if(t&&r!=r){for(;c>f;)if((s=u[f++])!=s)return!0}else for(;c>f;f++)if((t||f in u)&&u[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},206:(t,e,r)=>{var n=r(1702);t.exports=n([].slice)},7072:(t,e,r)=>{var n=r(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r}},4326:(t,e,r)=>{var n=r(84),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,r)=>{var n=r(1694),o=r(614),i=r(4326),a=r(5112)("toStringTag"),s=Object,u="Arguments"==i(function(){return arguments}());t.exports=n?i:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?r:u?i(e):"Object"==(n=i(e))&&o(e.callee)?"Arguments":n}},9920:(t,e,r)=>{var n=r(2597),o=r(3887),i=r(1236),a=r(3070);t.exports=function(t,e,r){for(var s=o(e),u=a.f,c=i.f,f=0;f<s.length;f++){var l=s[f];n(t,l)||r&&n(r,l)||u(t,l,c(e,l))}}},8544:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},6178:t=>{t.exports=function(t,e){return{value:t,done:e}}},8880:(t,e,r)=>{var n=r(9781),o=r(3070),i=r(9114);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8052:(t,e,r)=>{var n=r(614),o=r(3070),i=r(6339),a=r(3072);t.exports=function(t,e,r,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:e;if(n(r)&&i(r,c,s),s.global)u?t[e]=r:a(e,r);else{try{s.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t}},3072:(t,e,r)=>{var n=r(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},9781:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:t=>{var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},317:(t,e,r)=>{var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(t,e,r)=>{var n=r(317)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},7871:(t,e,r)=>{var n=r(3823),o=r(5268);t.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},3823:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1528:(t,e,r)=>{var n=r(8113),o=r(7854);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},6833:(t,e,r)=>{var n=r(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(t,e,r)=>{var n=r(4326),o=r(7854);t.exports="process"==n(o.process)},1036:(t,e,r)=>{var n=r(8113);t.exports=/web0s(?!.*chrome)/i.test(n)},8113:(t,e,r)=>{var n=r(5005);t.exports=n("navigator","userAgent")||""},7392:(t,e,r)=>{var n,o,i=r(7854),a=r(8113),s=i.process,u=i.Deno,c=s&&s.versions||u&&u.version,f=c&&c.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1060:(t,e,r)=>{var n=r(1702),o=Error,i=n("".replace),a=String(o("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,u=s.test(a);t.exports=function(t,e){if(u&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,s,"");return t}},2914:(t,e,r)=>{var n=r(7293),o=r(9114);t.exports=!n((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},2109:(t,e,r)=>{var n=r(7854),o=r(1236).f,i=r(8880),a=r(8052),s=r(3072),u=r(9920),c=r(4705);t.exports=function(t,e){var r,f,l,p,h,v=t.target,d=t.global,y=t.stat;if(r=d?n:y?n[v]||s(v,{}):(n[v]||{}).prototype)for(f in e){if(p=e[f],l=t.dontCallGetSet?(h=o(r,f))&&h.value:r[f],!c(d?f:v+(y?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;u(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(r,f,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2104:(t,e,r)=>{var n=r(4374),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},9974:(t,e,r)=>{var n=r(1702),o=r(9662),i=r(4374),a=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},4374:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,r)=>{var n=r(4374),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,e,r)=>{var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),u=s&&"something"===function(){}.name,c=s&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},84:(t,e,r)=>{var n=r(4374),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=function(t){return n?a(t):function(){return i.apply(t,arguments)}}},1702:(t,e,r)=>{var n=r(4326),o=r(84);t.exports=function(t){if("Function"===n(t))return o(t)}},5005:(t,e,r)=>{var n=r(7854),o=r(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t]):n[t]&&n[t][e]}},1246:(t,e,r)=>{var n=r(648),o=r(8173),i=r(8554),a=r(7497),s=r(5112)("iterator");t.exports=function(t){if(!i(t))return o(t,s)||o(t,"@@iterator")||a[n(t)]}},4121:(t,e,r)=>{var n=r(6916),o=r(9662),i=r(9670),a=r(6330),s=r(1246),u=TypeError;t.exports=function(t,e){var r=arguments.length<2?s(t):e;if(o(r))return i(n(r,t));throw u(a(t)+" is not iterable")}},8173:(t,e,r)=>{var n=r(9662),o=r(8554);t.exports=function(t,e){var r=t[e];return o(r)?void 0:n(r)}},7854:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(t,e,r)=>{var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},842:(t,e,r)=>{var n=r(7854);t.exports=function(t,e){var r=n.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))}},490:(t,e,r)=>{var n=r(5005);t.exports=n("document","documentElement")},4664:(t,e,r)=>{var n=r(9781),o=r(7293),i=r(317);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,r)=>{var n=r(1702),o=r(7293),i=r(4326),a=Object,s=n("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?s(t,""):a(t)}:a},2788:(t,e,r)=>{var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},8340:(t,e,r)=>{var n=r(111),o=r(8880);t.exports=function(t,e){n(e)&&"cause"in e&&o(t,"cause",e.cause)}},9909:(t,e,r)=>{var n,o,i,a=r(4811),s=r(7854),u=r(111),c=r(8880),f=r(2597),l=r(5465),p=r(6200),h=r(3501),v="Object already initialized",d=s.TypeError,y=s.WeakMap;if(a||l.state){var b=l.state||(l.state=new y);b.get=b.get,b.has=b.has,b.set=b.set,n=function(t,e){if(b.has(t))throw d(v);return e.facade=t,b.set(t,e),e},o=function(t){return b.get(t)||{}},i=function(t){return b.has(t)}}else{var g=p("state");h[g]=!0,n=function(t,e){if(f(t,g))throw d(v);return e.facade=t,c(t,g,e),e},o=function(t){return f(t,g)?t[g]:{}},i=function(t){return f(t,g)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=o(e)).type!==t)throw d("Incompatible receiver, "+t+" required");return r}}}},7659:(t,e,r)=>{var n=r(5112),o=r(7497),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},614:(t,e,r)=>{var n=r(4154),o=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},4411:(t,e,r)=>{var n=r(1702),o=r(7293),i=r(614),a=r(648),s=r(5005),u=r(2788),c=function(){},f=[],l=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),v=!p.exec(c),d=function(t){if(!i(t))return!1;try{return l(c,f,t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!h(p,u(t))}catch(t){return!0}};y.sham=!0,t.exports=!l||o((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?y:d},4705:(t,e,r)=>{var n=r(7293),o=r(614),i=/#|\.prototype\./,a=function(t,e){var r=u[s(t)];return r==f||r!=c&&(o(e)?n(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},8554:t=>{t.exports=function(t){return null==t}},111:(t,e,r)=>{var n=r(614),o=r(4154),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===i}:function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},2190:(t,e,r)=>{var n=r(5005),o=r(614),i=r(7976),a=r(3307),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return o(e)&&i(e.prototype,s(t))}},408:(t,e,r)=>{var n=r(9974),o=r(6916),i=r(9670),a=r(6330),s=r(7659),u=r(6244),c=r(7976),f=r(4121),l=r(1246),p=r(9212),h=TypeError,v=function(t,e){this.stopped=t,this.result=e},d=v.prototype;t.exports=function(t,e,r){var y,b,g,m,w,x,S,P=r&&r.that,E=!(!r||!r.AS_ENTRIES),O=!(!r||!r.IS_RECORD),_=!(!r||!r.IS_ITERATOR),T=!(!r||!r.INTERRUPTED),k=n(e,P),j=function(t){return y&&p(y,"normal",t),new v(!0,t)},A=function(t){return E?(i(t),T?k(t[0],t[1],j):k(t[0],t[1])):T?k(t,j):k(t)};if(O)y=t.iterator;else if(_)y=t;else{if(!(b=l(t)))throw h(a(t)+" is not iterable");if(s(b)){for(g=0,m=u(t);m>g;g++)if((w=A(t[g]))&&c(d,w))return w;return new v(!1)}y=f(t,b)}for(x=O?t.next:y.next;!(S=o(x,y)).done;){try{w=A(S.value)}catch(t){p(y,"throw",t)}if("object"==typeof w&&w&&c(d,w))return w}return new v(!1)}},9212:(t,e,r)=>{var n=r(6916),o=r(9670),i=r(8173);t.exports=function(t,e,r){var a,s;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw r;return r}a=n(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw r;if(s)throw a;return o(a),r}},3061:(t,e,r)=>{"use strict";var n=r(3383).IteratorPrototype,o=r(30),i=r(9114),a=r(8003),s=r(7497),u=function(){return this};t.exports=function(t,e,r,c){var f=e+" Iterator";return t.prototype=o(n,{next:i(+!c,r)}),a(t,f,!1,!0),s[f]=u,t}},1656:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(1913),a=r(6530),s=r(614),u=r(3061),c=r(9518),f=r(7674),l=r(8003),p=r(8880),h=r(8052),v=r(5112),d=r(7497),y=r(3383),b=a.PROPER,g=a.CONFIGURABLE,m=y.IteratorPrototype,w=y.BUGGY_SAFARI_ITERATORS,x=v("iterator"),S="keys",P="values",E="entries",O=function(){return this};t.exports=function(t,e,r,a,v,y,_){u(r,e,a);var T,k,j,A=function(t){if(t===v&&U)return U;if(!w&&t in C)return C[t];switch(t){case S:case P:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},I=e+" Iterator",R=!1,C=t.prototype,N=C[x]||C["@@iterator"]||v&&C[v],U=!w&&N||A(v),L="Array"==e&&C.entries||N;if(L&&(T=c(L.call(new t)))!==Object.prototype&&T.next&&(i||c(T)===m||(f?f(T,m):s(T[x])||h(T,x,O)),l(T,I,!0,!0),i&&(d[I]=O)),b&&v==P&&N&&N.name!==P&&(!i&&g?p(C,"name",P):(R=!0,U=function(){return o(N,this)})),v)if(k={values:A(P),keys:y?U:A(S),entries:A(E)},_)for(j in k)(w||R||!(j in C))&&h(C,j,k[j]);else n({target:e,proto:!0,forced:w||R},k);return i&&!_||C[x]===U||h(C,x,U,{name:v}),d[e]=U,k}},3383:(t,e,r)=>{"use strict";var n,o,i,a=r(7293),s=r(614),u=r(111),c=r(30),f=r(9518),l=r(8052),p=r(5112),h=r(1913),v=p("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=f(f(i)))!==Object.prototype&&(n=o):d=!0),!u(n)||a((function(){var t={};return n[v].call(t)!==t}))?n={}:h&&(n=c(n)),s(n[v])||l(n,v,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},7497:t=>{t.exports={}},6244:(t,e,r)=>{var n=r(7466);t.exports=function(t){return n(t.length)}},6339:(t,e,r)=>{var n=r(7293),o=r(614),i=r(2597),a=r(9781),s=r(6530).CONFIGURABLE,u=r(2788),c=r(9909),f=c.enforce,l=c.get,p=Object.defineProperty,h=a&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),v=String(String).split("String"),d=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!i(t,"name")||s&&t.name!==e)&&(a?p(t,"name",{value:e,configurable:!0}):t.name=e),h&&r&&i(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?a&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=f(t);return i(n,"source")||(n.source=v.join("string"==typeof e?e:"")),t};Function.prototype.toString=d((function(){return o(this)&&l(this).source||u(this)}),"toString")},4758:t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},5948:(t,e,r)=>{var n,o,i,a,s,u,c,f,l=r(7854),p=r(9974),h=r(1236).f,v=r(261).set,d=r(6833),y=r(1528),b=r(1036),g=r(5268),m=l.MutationObserver||l.WebKitMutationObserver,w=l.document,x=l.process,S=l.Promise,P=h(l,"queueMicrotask"),E=P&&P.value;E||(n=function(){var t,e;for(g&&(t=x.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?a():i=void 0,t}}i=void 0,t&&t.enter()},d||g||b||!m||!w?!y&&S&&S.resolve?((c=S.resolve(void 0)).constructor=S,f=p(c.then,c),a=function(){f(n)}):g?a=function(){x.nextTick(n)}:(v=p(v,l),a=function(){v(n)}):(s=!0,u=w.createTextNode(""),new m(n).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),t.exports=E||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},8523:(t,e,r)=>{"use strict";var n=r(9662),o=TypeError,i=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw o("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new i(t)}},6277:(t,e,r)=>{var n=r(1340);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},30:(t,e,r)=>{var n,o=r(9670),i=r(6048),a=r(748),s=r(3501),u=r(490),c=r(317),f=r(6200)("IE_PROTO"),l=function(){},p=function(t){return"<script>"+t+"<\/script>"},h=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&n?h(n):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):h(n);for(var r=a.length;r--;)delete v.prototype[a[r]];return v()};s[f]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(l.prototype=o(t),r=new l,l.prototype=null,r[f]=t):r=v(),void 0===e?r:i.f(r,e)}},6048:(t,e,r)=>{var n=r(9781),o=r(3353),i=r(3070),a=r(9670),s=r(5656),u=r(1956);e.f=n&&!o?Object.defineProperties:function(t,e){a(t);for(var r,n=s(e),o=u(e),c=o.length,f=0;c>f;)i.f(t,r=o[f++],n[r]);return t}},3070:(t,e,r)=>{var n=r(9781),o=r(4664),i=r(3353),a=r(9670),s=r(4948),u=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor;e.f=n?i?function(t,e,r){if(a(t),e=s(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=f(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return c(t,e,r)}:c:function(t,e,r){if(a(t),e=s(e),a(r),o)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw u("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},1236:(t,e,r)=>{var n=r(9781),o=r(6916),i=r(5296),a=r(9114),s=r(5656),u=r(4948),c=r(2597),f=r(4664),l=Object.getOwnPropertyDescriptor;e.f=n?l:function(t,e){if(t=s(t),e=u(e),f)try{return l(t,e)}catch(t){}if(c(t,e))return a(!o(i.f,t,e),t[e])}},8006:(t,e,r)=>{var n=r(6324),o=r(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},9518:(t,e,r)=>{var n=r(2597),o=r(614),i=r(7908),a=r(6200),s=r(8544),u=a("IE_PROTO"),c=Object,f=c.prototype;t.exports=s?c.getPrototypeOf:function(t){var e=i(t);if(n(e,u))return e[u];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof c?f:null}},7976:(t,e,r)=>{var n=r(1702);t.exports=n({}.isPrototypeOf)},6324:(t,e,r)=>{var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,s=r(3501),u=n([].push);t.exports=function(t,e){var r,n=i(t),c=0,f=[];for(r in n)!o(s,r)&&o(n,r)&&u(f,r);for(;e.length>c;)o(n,r=e[c++])&&(~a(f,r)||u(f,r));return f}},1956:(t,e,r)=>{var n=r(6324),o=r(748);t.exports=Object.keys||function(t){return n(t,o)}},5296:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},7674:(t,e,r)=>{var n=r(1702),o=r(9670),i=r(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return o(r),i(n),e?t(r,n):r.__proto__=n,r}}():void 0)},288:(t,e,r)=>{"use strict";var n=r(1694),o=r(648);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,e,r)=>{var n=r(6916),o=r(614),i=r(111),a=TypeError;t.exports=function(t,e){var r,s;if("string"===e&&o(r=t.toString)&&!i(s=n(r,t)))return s;if(o(r=t.valueOf)&&!i(s=n(r,t)))return s;if("string"!==e&&o(r=t.toString)&&!i(s=n(r,t)))return s;throw a("Can't convert object to primitive value")}},3887:(t,e,r)=>{var n=r(5005),o=r(1702),i=r(8006),a=r(5181),s=r(9670),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(s(t)),r=a.f;return r?u(e,r(t)):e}},857:(t,e,r)=>{var n=r(7854);t.exports=n},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},3702:(t,e,r)=>{var n=r(7854),o=r(2492),i=r(614),a=r(4705),s=r(2788),u=r(5112),c=r(7871),f=r(3823),l=r(1913),p=r(7392),h=o&&o.prototype,v=u("species"),d=!1,y=i(n.PromiseRejectionEvent),b=a("Promise",(function(){var t=s(o),e=t!==String(o);if(!e&&66===p)return!0;if(l&&(!h.catch||!h.finally))return!0;if(!p||p<51||!/native code/.test(t)){var r=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[v]=n,!(d=r.then((function(){}))instanceof n))return!0}return!e&&(c||f)&&!y}));t.exports={CONSTRUCTOR:b,REJECTION_EVENT:y,SUBCLASSING:d}},2492:(t,e,r)=>{var n=r(7854);t.exports=n.Promise},9478:(t,e,r)=>{var n=r(9670),o=r(111),i=r(8523);t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var r=i.f(t);return(0,r.resolve)(e),r.promise}},612:(t,e,r)=>{var n=r(2492),o=r(7072),i=r(3702).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},8572:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},4488:(t,e,r)=>{var n=r(8554),o=TypeError;t.exports=function(t){if(n(t))throw o("Can't call method on "+t);return t}},6340:(t,e,r)=>{"use strict";var n=r(5005),o=r(3070),i=r(5112),a=r(9781),s=i("species");t.exports=function(t){var e=n(t),r=o.f;a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},8003:(t,e,r)=>{var n=r(3070).f,o=r(2597),i=r(5112)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:e})}},6200:(t,e,r)=>{var n=r(2309),o=r(9711),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,r)=>{var n=r(7854),o=r(3072),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},2309:(t,e,r)=>{var n=r(1913),o=r(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.5",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:(t,e,r)=>{var n=r(9670),o=r(9483),i=r(8554),a=r(5112)("species");t.exports=function(t,e){var r,s=n(t).constructor;return void 0===s||i(r=n(s)[a])?e:o(r)}},8710:(t,e,r)=>{var n=r(1702),o=r(9303),i=r(1340),a=r(4488),s=n("".charAt),u=n("".charCodeAt),c=n("".slice),f=function(t){return function(e,r){var n,f,l=i(a(e)),p=o(r),h=l.length;return p<0||p>=h?t?"":void 0:(n=u(l,p))<55296||n>56319||p+1===h||(f=u(l,p+1))<56320||f>57343?t?s(l,p):n:t?c(l,p,p+2):f-56320+(n-55296<<10)+65536}};t.exports={codeAt:f(!1),charAt:f(!0)}},6293:(t,e,r)=>{var n=r(7392),o=r(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},261:(t,e,r)=>{var n,o,i,a,s=r(7854),u=r(2104),c=r(9974),f=r(614),l=r(2597),p=r(7293),h=r(490),v=r(206),d=r(317),y=r(8053),b=r(6833),g=r(5268),m=s.setImmediate,w=s.clearImmediate,x=s.process,S=s.Dispatch,P=s.Function,E=s.MessageChannel,O=s.String,_=0,T={};try{n=s.location}catch(t){}var k=function(t){if(l(T,t)){var e=T[t];delete T[t],e()}},j=function(t){return function(){k(t)}},A=function(t){k(t.data)},I=function(t){s.postMessage(O(t),n.protocol+"//"+n.host)};m&&w||(m=function(t){y(arguments.length,1);var e=f(t)?t:P(t),r=v(arguments,1);return T[++_]=function(){u(e,void 0,r)},o(_),_},w=function(t){delete T[t]},g?o=function(t){x.nextTick(j(t))}:S&&S.now?o=function(t){S.now(j(t))}:E&&!b?(a=(i=new E).port2,i.port1.onmessage=A,o=c(a.postMessage,a)):s.addEventListener&&f(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(I)?(o=I,s.addEventListener("message",A,!1)):o="onreadystatechange"in d("script")?function(t){h.appendChild(d("script")).onreadystatechange=function(){h.removeChild(this),k(t)}}:function(t){setTimeout(j(t),0)}),t.exports={set:m,clear:w}},1400:(t,e,r)=>{var n=r(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},5656:(t,e,r)=>{var n=r(8361),o=r(4488);t.exports=function(t){return n(o(t))}},9303:(t,e,r)=>{var n=r(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},7466:(t,e,r)=>{var n=r(9303),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:(t,e,r)=>{var n=r(4488),o=Object;t.exports=function(t){return o(n(t))}},7593:(t,e,r)=>{var n=r(6916),o=r(111),i=r(2190),a=r(8173),s=r(2140),u=r(5112),c=TypeError,f=u("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var r,u=a(t,f);if(u){if(void 0===e&&(e="default"),r=n(u,t,e),!o(r)||i(r))return r;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},4948:(t,e,r)=>{var n=r(7593),o=r(2190);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},1694:(t,e,r)=>{var n={};n[r(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},1340:(t,e,r)=>{var n=r(648),o=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:(t,e,r)=>{var n=r(1702),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,e,r)=>{var n=r(6293);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,e,r)=>{var n=r(9781),o=r(7293);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw e("Not enough arguments");return t}},4811:(t,e,r)=>{var n=r(7854),o=r(614),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},5112:(t,e,r)=>{var n=r(7854),o=r(2309),i=r(2597),a=r(9711),s=r(6293),u=r(3307),c=o("wks"),f=n.Symbol,l=f&&f.for,p=u?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(c,t)||!s&&"string"!=typeof c[t]){var e="Symbol."+t;s&&i(f,t)?c[t]=f[t]:c[t]=u&&l?l(e):p(e)}return c[t]}},6967:(t,e,r)=>{"use strict";var n=r(2109),o=r(7976),i=r(9518),a=r(7674),s=r(9920),u=r(30),c=r(8880),f=r(9114),l=r(1060),p=r(8340),h=r(408),v=r(6277),d=r(5112),y=r(2914),b=d("toStringTag"),g=Error,m=[].push,w=function(t,e){var r,n=arguments.length>2?arguments[2]:void 0,s=o(x,this);a?r=a(g(),s?i(this):x):(r=s?this:u(x),c(r,b,"Error")),void 0!==e&&c(r,"message",v(e)),y&&c(r,"stack",l(r.stack,1)),p(r,n);var f=[];return h(t,m,{that:f}),c(r,"errors",f),r};a?a(w,g):s(w,g,{name:!0});var x=w.prototype=u(g.prototype,{constructor:f(1,w),message:f(1,""),name:f(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:w})},9170:(t,e,r)=>{r(6967)},6992:(t,e,r)=>{"use strict";var n=r(5656),o=r(1223),i=r(7497),a=r(9909),s=r(3070).f,u=r(1656),c=r(6178),f=r(1913),l=r(9781),p="Array Iterator",h=a.set,v=a.getterFor(p);t.exports=u(Array,"Array",(function(t,e){h(this,{type:p,target:n(t),index:0,kind:e})}),(function(){var t=v(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,c(void 0,!0)):c("keys"==r?n:"values"==r?e[n]:[n,e[n]],!1)}),"values");var d=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!f&&l&&"values"!==d.name)try{s(d,"name",{value:"values"})}catch(t){}},1539:(t,e,r)=>{var n=r(1694),o=r(8052),i=r(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},7922:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),u=r(408);n({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=a.f(e),n=r.resolve,c=r.reject,f=s((function(){var r=i(e.resolve),a=[],s=0,c=1;u(t,(function(t){var i=s++,u=!1;c++,o(r,e,t).then((function(t){u||(u=!0,a[i]={status:"fulfilled",value:t},--c||n(a))}),(function(t){u||(u=!0,a[i]={status:"rejected",reason:t},--c||n(a))}))})),--c||n(a)}));return f.error&&c(f.value),r.promise}})},821:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),u=r(408);n({target:"Promise",stat:!0,forced:r(612)},{all:function(t){var e=this,r=a.f(e),n=r.resolve,c=r.reject,f=s((function(){var r=i(e.resolve),a=[],s=0,f=1;u(t,(function(t){var i=s++,u=!1;f++,o(r,e,t).then((function(t){u||(u=!0,a[i]=t,--f||n(a))}),c)})),--f||n(a)}));return f.error&&c(f.value),r.promise}})},4668:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(5005),s=r(8523),u=r(2534),c=r(408),f="No one promise resolved";n({target:"Promise",stat:!0},{any:function(t){var e=this,r=a("AggregateError"),n=s.f(e),l=n.resolve,p=n.reject,h=u((function(){var n=i(e.resolve),a=[],s=0,u=1,h=!1;c(t,(function(t){var i=s++,c=!1;u++,o(n,e,t).then((function(t){c||h||(h=!0,l(t))}),(function(t){c||h||(c=!0,a[i]=t,--u||p(new r(a,f)))}))})),--u||p(new r(a,f))}));return h.error&&p(h.value),n.promise}})},4164:(t,e,r)=>{"use strict";var n=r(2109),o=r(1913),i=r(3702).CONSTRUCTOR,a=r(2492),s=r(5005),u=r(614),c=r(8052),f=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&u(a)){var l=s("Promise").prototype.catch;f.catch!==l&&c(f,"catch",l,{unsafe:!0})}},3401:(t,e,r)=>{"use strict";var n,o,i,a=r(2109),s=r(1913),u=r(5268),c=r(7854),f=r(6916),l=r(8052),p=r(7674),h=r(8003),v=r(6340),d=r(9662),y=r(614),b=r(111),g=r(5787),m=r(6707),w=r(261).set,x=r(5948),S=r(842),P=r(2534),E=r(8572),O=r(9909),_=r(2492),T=r(3702),k=r(8523),j="Promise",A=T.CONSTRUCTOR,I=T.REJECTION_EVENT,R=T.SUBCLASSING,C=O.getterFor(j),N=O.set,U=_&&_.prototype,L=_,M=U,D=c.TypeError,z=c.document,B=c.process,F=k.f,H=F,V=!!(z&&z.createEvent&&c.dispatchEvent),K="unhandledrejection",G=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},q=function(t,e){var r,n,o,i=e.value,a=1==e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,l=t.domain;try{s?(a||(2===e.rejection&&J(e),e.rejection=1),!0===s?r=i:(l&&l.enter(),r=s(i),l&&(l.exit(),o=!0)),r===t.promise?c(D("Promise-chain cycle")):(n=G(r))?f(n,r,u,c):u(r)):c(i)}catch(t){l&&!o&&l.exit(),c(t)}},Z=function(t,e){t.notified||(t.notified=!0,x((function(){for(var r,n=t.reactions;r=n.get();)q(r,t);t.notified=!1,e&&!t.rejection&&X(t)})))},W=function(t,e,r){var n,o;V?((n=z.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),c.dispatchEvent(n)):n={promise:e,reason:r},!I&&(o=c["on"+t])?o(n):t===K&&S("Unhandled promise rejection",r)},X=function(t){f(w,c,(function(){var e,r=t.facade,n=t.value;if(Y(t)&&(e=P((function(){u?B.emit("unhandledRejection",n,r):W(K,r,n)})),t.rejection=u||Y(t)?2:1,e.error))throw e.value}))},Y=function(t){return 1!==t.rejection&&!t.parent},J=function(t){f(w,c,(function(){var e=t.facade;u?B.emit("rejectionHandled",e):W("rejectionhandled",e,t.value)}))},Q=function(t,e,r){return function(n){t(e,n,r)}},$=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Z(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw D("Promise can't be resolved itself");var n=G(e);n?x((function(){var r={done:!1};try{f(n,e,Q(tt,r,t),Q($,r,t))}catch(e){$(r,e,t)}})):(t.value=e,t.state=1,Z(t,!1))}catch(e){$({done:!1},e,t)}}};if(A&&(M=(L=function(t){g(this,M),d(t),f(n,this);var e=C(this);try{t(Q(tt,e),Q($,e))}catch(t){$(e,t)}}).prototype,(n=function(t){N(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=l(M,"then",(function(t,e){var r=C(this),n=F(m(this,L));return r.parent=!0,n.ok=!y(t)||t,n.fail=y(e)&&e,n.domain=u?B.domain:void 0,0==r.state?r.reactions.add(n):x((function(){q(n,r)})),n.promise})),o=function(){var t=new n,e=C(t);this.promise=t,this.resolve=Q(tt,e),this.reject=Q($,e)},k.f=F=function(t){return t===L||void 0===t?new o(t):H(t)},!s&&y(_)&&U!==Object.prototype)){i=U.then,R||l(U,"then",(function(t,e){var r=this;return new L((function(t,e){f(i,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete U.constructor}catch(t){}p&&p(U,M)}a({global:!0,constructor:!0,wrap:!0,forced:A},{Promise:L}),h(L,j,!1,!0),v(j)},7727:(t,e,r)=>{"use strict";var n=r(2109),o=r(1913),i=r(2492),a=r(7293),s=r(5005),u=r(614),c=r(6707),f=r(9478),l=r(8052),p=i&&i.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){p.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,s("Promise")),r=u(t);return this.then(r?function(r){return f(e,t()).then((function(){return r}))}:t,r?function(r){return f(e,t()).then((function(){throw r}))}:t)}}),!o&&u(i)){var h=s("Promise").prototype.finally;p.finally!==h&&l(p,"finally",h,{unsafe:!0})}},8674:(t,e,r)=>{r(3401),r(821),r(4164),r(6027),r(683),r(6294)},6027:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),u=r(408);n({target:"Promise",stat:!0,forced:r(612)},{race:function(t){var e=this,r=a.f(e),n=r.reject,c=s((function(){var a=i(e.resolve);u(t,(function(t){o(a,e,t).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},683:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(8523);n({target:"Promise",stat:!0,forced:r(3702).CONSTRUCTOR},{reject:function(t){var e=i.f(this);return o(e.reject,void 0,t),e.promise}})},6294:(t,e,r)=>{"use strict";var n=r(2109),o=r(5005),i=r(1913),a=r(2492),s=r(3702).CONSTRUCTOR,u=r(9478),c=o("Promise"),f=i&&!s;n({target:"Promise",stat:!0,forced:i||s},{resolve:function(t){return u(f&&this===c?a:this,t)}})},8783:(t,e,r)=>{"use strict";var n=r(8710).charAt,o=r(1340),i=r(9909),a=r(1656),s=r(6178),u="String Iterator",c=i.set,f=i.getterFor(u);a(String,"String",(function(t){c(this,{type:u,string:o(t),index:0})}),(function(){var t,e=f(this),r=e.string,o=e.index;return o>=r.length?s(void 0,!0):(t=n(r,o),e.index+=t.length,s(t,!1))}))},3948:(t,e,r)=>{var n=r(7854),o=r(8324),i=r(8509),a=r(6992),s=r(8880),u=r(5112),c=u("iterator"),f=u("toStringTag"),l=a.values,p=function(t,e){if(t){if(t[c]!==l)try{s(t,c,l)}catch(e){t[c]=l}if(t[f]||s(t,f,e),o[e])for(var r in a)if(t[r]!==a[r])try{s(t,r,a[r])}catch(e){t[r]=a[r]}}};for(var h in o)p(n[h]&&n[h].prototype,h);p(i,"DOMTokenList")},1150:(t,e,r)=>{var n=r(7633);r(3948),t.exports=n},6909:function(t,e){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};e.__esModule=!0,e.AbstractUploader=e.DEFAULT_RETRY_STRATEGY=e.DEFAULT_API_HOST=e.DEFAULT_RETRIES=e.MAX_CHUNK_SIZE=e.DEFAULT_CHUNK_SIZE=e.MIN_CHUNK_SIZE=void 0,e.MIN_CHUNK_SIZE=5242880,e.DEFAULT_CHUNK_SIZE=52428800,e.MAX_CHUNK_SIZE=134217728,e.DEFAULT_RETRIES=6,e.DEFAULT_API_HOST="ws.api.video";var i="";try{i="1.1.4"}catch(t){}e.DEFAULT_RETRY_STRATEGY=function(t){return function(e,r){return r.status&&r.status>=400&&r.status<500||e>=t?null:Math.floor(200+2e3*e*(e+1))}};var a=function(){function t(r){if(this.headers={},this.onProgressCallbacks=[],this.onPlayableCallbacks=[],this.apiHost=r.apiHost||e.DEFAULT_API_HOST,r.hasOwnProperty("uploadToken")){var n=r;n.videoId&&(this.videoId=n.videoId),this.uploadEndpoint="https://".concat(this.apiHost,"/upload?token=").concat(n.uploadToken)}else if(r.hasOwnProperty("accessToken")){var o=r;if(!o.videoId)throw new Error("'videoId' is missing");this.refreshToken=o.refreshToken,this.uploadEndpoint="https://".concat(this.apiHost,"/videos/").concat(o.videoId,"/source"),this.headers.Authorization="Bearer ".concat(o.accessToken)}else{if(!r.hasOwnProperty("apiKey"))throw new Error("You must provide either an accessToken, an uploadToken or an API key");var a=r;if(!a.videoId)throw new Error("'videoId' is missing");this.uploadEndpoint="https://".concat(this.apiHost,"/videos/").concat(a.videoId,"/source"),this.headers.Authorization="Basic ".concat(btoa(a.apiKey+":"))}this.headers["AV-Origin-Client"]="typescript-uploader:"+i,this.retries=r.retries||e.DEFAULT_RETRIES,this.retryStrategy=r.retryStrategy||(0,e.DEFAULT_RETRY_STRATEGY)(this.retries),r.origin&&(r.origin.application&&(t.validateOrigin("application",r.origin.application),this.headers["AV-Origin-App"]="".concat(r.origin.application.name,":").concat(r.origin.application.version)),r.origin.sdk&&(t.validateOrigin("sdk",r.origin.sdk),this.headers["AV-Origin-Sdk"]="".concat(r.origin.sdk.name,":").concat(r.origin.sdk.version)))}return t.prototype.onProgress=function(t){this.onProgressCallbacks.push(t)},t.prototype.onPlayable=function(t){this.onPlayableCallbacks.push(t)},t.prototype.waitForPlayable=function(t){var e;return n(this,void 0,void 0,(function(){var r,n;return o(this,(function(o){switch(o.label){case 0:r=null===(e=t.assets)||void 0===e?void 0:e.hls,o.label=1;case 1:return[4,this.sleep(500)];case 2:return o.sent(),[4,fetch(r)];case 3:return 202===(n=o.sent()).status?[3,1]:[4,n.text()];case 4:return 0===o.sent().length?[3,1]:[3,5];case 5:return this.onPlayableCallbacks.forEach((function(e){return e(t)})),[2]}}))}))},t.prototype.parseErrorResponse=function(t){try{var e=JSON.parse(t.response);return r({status:t.status,raw:t.response},e)}catch(t){}return{status:t.status,raw:t.response,reason:"UNKWOWN"}},t.prototype.apiResponseToVideoUploadResponse=function(t){var e=r(r({},t),{_public:t.public,publishedAt:t.publishedAt?new Date(t.publishedAt):void 0,createdAt:t.createdAt?new Date(t.createdAt):void 0,updatedAt:t.updatedAt?new Date(t.updatedAt):void 0});return delete e.public,e},t.prototype.sleep=function(t){return new Promise((function(e,r){setTimeout((function(){return e()}),t)}))},t.prototype.xhrWithRetrier=function(t){var e=this;return this.withRetrier((function(){return e.createXhrPromise(t)}))},t.prototype.createFormData=function(t,e,r,n){var o=r||n?t.slice(r,n):t,i=new FormData;return this.videoId&&i.append("videoId",this.videoId),i.append("file",o,e),i},t.prototype.doRefreshToken=function(){var t=this;return new Promise((function(e,r){var n=new window.XMLHttpRequest;n.open("POST","https://".concat(t.apiHost,"/auth/refresh"));for(var o=0,i=Object.keys(t.headers);o<i.length;o++){var a=i[o];"Authorization"!==a&&n.setRequestHeader(a,t.headers[a])}n.onreadystatechange=function(e){4===n.readyState&&n.status>=400&&r(t.parseErrorResponse(n))},n.onload=function(o){var i=JSON.parse(n.response);if(i.refresh_token&&i.access_token)return t.headers.Authorization="Bearer ".concat(i.access_token),t.refreshToken=i.refresh_token,void e();r(t.parseErrorResponse(n))},n.send(JSON.stringify({refreshToken:t.refreshToken}))}))},t.prototype.createXhrPromise=function(t){var e=this;return new Promise((function(r,n){var o=new window.XMLHttpRequest;o.open("POST","".concat(e.uploadEndpoint),!0),t.parts&&o.setRequestHeader("Content-Range","part ".concat(t.parts.currentPart,"/").concat(t.parts.totalParts));for(var i=0,a=Object.keys(e.headers);i<a.length;i++){var s=a[i];o.setRequestHeader(s,e.headers[s])}t.onProgress&&(o.upload.onprogress=function(e){return t.onProgress(e)}),o.onreadystatechange=function(i){if(4===o.readyState){if(401===o.status&&e.refreshToken)return e.doRefreshToken().then((function(){return e.createXhrPromise(t)})).then((function(t){return r(t)})).catch((function(t){return n(t)}));if(o.status>=400)return void n(e.parseErrorResponse(o))}},o.onerror=function(t){n({status:void 0,raw:void 0,reason:"NETWORK_ERROR"})},o.ontimeout=function(t){n({status:void 0,raw:void 0,reason:"NETWORK_TIMEOUT"})},o.onload=function(t){o.status<400&&r(e.apiResponseToVideoUploadResponse(JSON.parse(o.response)))},o.send(t.body)}))},t.prototype.withRetrier=function(t){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(r){return[2,new Promise((function(r,i){return n(e,void 0,void 0,(function(){var e,n,a,s;return o(this,(function(o){switch(o.label){case 0:e=0,o.label=1;case 1:o.label=2;case 2:return o.trys.push([2,4,,6]),[4,t()];case 3:return n=o.sent(),r(n),[2];case 4:return a=o.sent(),null===(s=this.retryStrategy(e,a))?(i(a),[2]):(console.log("video upload: ".concat(a.reason||"ERROR",", will be retried in ").concat(s," ms")),[4,this.sleep(s)]);case 5:return o.sent(),e++,[3,6];case 6:return[3,1];case 7:return[2]}}))}))}))]}))}))},t.validateOrigin=function(t,e){if(!e.name)throw new Error("".concat(t," name is required"));if(!e.version)throw new Error("".concat(t," version is required"));if(!/^[\w-]{1,50}$/.test(e.name))throw new Error("Invalid ".concat(t," name value. Allowed characters: A-Z, a-z, 0-9, '-', '_'. Max length: 50."));if(!/^\d{1,3}(\.\d{1,3}(\.\d{1,3})?)?$/.test(e.version))throw new Error("Invalid ".concat(t," version value. The version should match the xxx[.yyy][.zzz] pattern."))},t}();e.AbstractUploader=a},3607:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]});e.__esModule=!0,e.MAX_CHUNK_SIZE=e.MIN_CHUNK_SIZE=e.ProgressiveUploader=e.VideoUploader=void 0,n(e,r(3368),"VideoUploader"),n(e,r(9213),"ProgressiveUploader");var o=r(6909);n(e,o,"MIN_CHUNK_SIZE"),n(e,o,"MAX_CHUNK_SIZE")},9213:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};e.__esModule=!0,e.ProgressiveUploader=void 0;var s=r(6909),u=r(3828),c=function(t){function e(e){var r,n=this;return(n=t.call(this,e)||this).currentPartNum=1,n.currentPartBlobs=[],n.currentPartBlobsSize=0,n.queue=new u.PromiseQueue,n.preventEmptyParts=e.preventEmptyParts||!1,n.fileName=e.videoName||"file",n.mergeSmallPartsBeforeUpload=null===(r=e.mergeSmallPartsBeforeUpload)||void 0===r||r,n}return o(e,t),e.prototype.uploadPart=function(t){var e,r=this;if(!this.mergeSmallPartsBeforeUpload&&t.size<s.MIN_CHUNK_SIZE)throw new Error("Each part must have a minimal size of 5MB. The current part has a size of ".concat(this.currentPartBlobsSize/1024/1024,"MB."));return this.currentPartBlobsSize+=t.size,this.currentPartBlobs.push(t),this.preventEmptyParts&&this.currentPartBlobsSize-t.size>=s.MIN_CHUNK_SIZE||!this.preventEmptyParts&&this.currentPartBlobsSize>=s.MIN_CHUNK_SIZE||!this.mergeSmallPartsBeforeUpload?(this.preventEmptyParts?(e=this.currentPartBlobs.slice(0,-1),this.currentPartBlobs=this.currentPartBlobs.slice(-1),this.currentPartBlobsSize=0===this.currentPartBlobs.length?0:this.currentPartBlobs[0].size):(e=this.currentPartBlobs,this.currentPartBlobs=[],this.currentPartBlobsSize=0),this.queue.add((function(){if(e.length>0){var t=r.upload(new Blob(e)).then((function(t){return r.videoId=t.videoId,t}));return r.currentPartNum++,t}return new Promise((function(t){return t()}))}))):Promise.resolve()},e.prototype.uploadLastPart=function(t){return i(this,void 0,void 0,(function(){var e,r=this;return a(this,(function(n){switch(n.label){case 0:return this.currentPartBlobs.push(t),[4,this.queue.add((function(){return r.upload(new Blob(r.currentPartBlobs),!0)}))];case 1:return e=n.sent(),this.onPlayableCallbacks.length>0&&this.waitForPlayable(e),[2,e]}}))}))},e.prototype.upload=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var r,n=this;return a(this,(function(o){return r=t.size,[2,this.xhrWithRetrier({body:this.createFormData(t,this.fileName),parts:{currentPart:this.currentPartNum,totalParts:e?this.currentPartNum:"*"},onProgress:function(t){return n.onProgressCallbacks.forEach((function(e){return e({uploadedBytes:t.loaded,totalBytes:r})}))}})]}))}))},e}(s.AbstractUploader);e.ProgressiveUploader=c},3828:(t,e)=>{"use strict";e.__esModule=!0,e.PromiseQueue=void 0;var r=function(){function t(){this.working=!1,this.queue=[]}return t.prototype.add=function(t){var e=this;return new Promise((function(r,n){var o={provider:t,callback:function(t,e){return e?n(e):r(t)}};e.queue=e.queue.concat(o),e.working||(e.working=!0,e.dequeue())}))},t.prototype.dequeue=function(){var t=this;if(0!==this.queue.length){var e=this.queue.shift();e.provider.call(this).then((function(r){e.callback(r),t.dequeue()})).catch((function(r){e.callback(void 0,r),t.dequeue()}))}else this.working=!1},t}();e.PromiseQueue=r},3368:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};e.__esModule=!0,e.VideoUploader=void 0;var s=r(6909),u=function(t){function e(e){var r=t.call(this,e)||this;if(!e.file)throw new Error("'file' is missing");if(e.chunkSize&&(e.chunkSize<s.MIN_CHUNK_SIZE||e.chunkSize>s.MAX_CHUNK_SIZE))throw new Error("Invalid chunk size. Minimal allowed value: ".concat(s.MIN_CHUNK_SIZE/1024/1024,"MB, maximum allowed value: ").concat(s.MAX_CHUNK_SIZE/1024/1024,"MB."));return r.chunkSize=e.chunkSize||s.DEFAULT_CHUNK_SIZE,r.file=e.file,r.fileSize=r.file.size,r.fileName=e.videoName||r.file.name,r.chunksCount=Math.ceil(r.fileSize/r.chunkSize),r.maxVideoDuration=e.maxVideoDuration,r}return o(e,t),e.prototype.upload=function(){return i(this,void 0,void 0,(function(){var t,e,r;return a(this,(function(n){switch(n.label){case 0:if(void 0!==this.maxVideoDuration&&!document)throw Error("document is undefined. Impossible to use the maxVideoDuration option. Remove it and try again.");return(t=void 0!==this.maxVideoDuration)?[4,this.isVideoTooLong()]:[3,2];case 1:t=n.sent(),n.label=2;case 2:if(t)throw Error("The submitted video is too long.");r=0,n.label=3;case 3:return r<this.chunksCount?[4,this.uploadCurrentChunk(r)]:[3,6];case 4:e=n.sent(),this.videoId=e.videoId,n.label=5;case 5:return r++,[3,3];case 6:return this.onPlayableCallbacks.length>0&&this.waitForPlayable(e),[2,e]}}))}))},e.prototype.isVideoTooLong=function(){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(e){return[2,new Promise((function(e){var r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=function(){window.URL.revokeObjectURL(r.src),e(r.duration>t.maxVideoDuration)},r.src=URL.createObjectURL(t.file)}))]}))}))},e.prototype.uploadCurrentChunk=function(t){var e=this,r=t*this.chunkSize,n=(t+1)*this.chunkSize,o=n>this.fileSize?this.fileSize:n,i=Math.ceil(this.fileSize/this.chunkSize);return this.xhrWithRetrier({onProgress:function(n){return e.onProgressCallbacks.forEach((function(o){return o(function(n){return{uploadedBytes:n.loaded+r,totalBytes:e.fileSize,chunksCount:e.chunksCount,chunksBytes:e.chunkSize,currentChunk:t+1,currentChunkUploadedBytes:n.loaded}}(n))}))},body:this.createFormData(this.file,this.fileName,r,o),parts:{currentPart:t+1,totalParts:i}})},e}(s.AbstractUploader);e.VideoUploader=u}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(1150),r(3607)})()));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(this,(()=>(()=>{var t={7633:(t,e,r)=>{r(9170),r(6992),r(1539),r(8674),r(7922),r(4668),r(7727),r(8783);var n=r(857);t.exports=n.Promise},9662:(t,e,r)=>{var n=r(614),o=r(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a function")}},9483:(t,e,r)=>{var n=r(4411),o=r(6330),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a constructor")}},6077:(t,e,r)=>{var n=r(614),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},1223:(t,e,r)=>{var n=r(5112),o=r(30),i=r(3070).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&i(s,a,{configurable:!0,value:o(null)}),t.exports=function(t){s[a][t]=!0}},5787:(t,e,r)=>{var n=r(7976),o=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw o("Incorrect invocation")}},9670:(t,e,r)=>{var n=r(111),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not an object")}},1318:(t,e,r)=>{var n=r(5656),o=r(1400),i=r(6244),a=function(t){return function(e,r,a){var s,c=n(e),u=i(c),l=o(a,u);if(t&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},206:(t,e,r)=>{var n=r(1702);t.exports=n([].slice)},7072:(t,e,r)=>{var n=r(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r}},4326:(t,e,r)=>{var n=r(84),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},648:(t,e,r)=>{var n=r(1694),o=r(614),i=r(4326),a=r(5112)("toStringTag"),s=Object,c="Arguments"==i(function(){return arguments}());t.exports=n?i:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?r:c?i(e):"Object"==(n=i(e))&&o(e.callee)?"Arguments":n}},9920:(t,e,r)=>{var n=r(2597),o=r(3887),i=r(1236),a=r(3070);t.exports=function(t,e,r){for(var s=o(e),c=a.f,u=i.f,l=0;l<s.length;l++){var f=s[l];n(t,f)||r&&n(r,f)||c(t,f,u(e,f))}}},8544:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},6178:t=>{t.exports=function(t,e){return{value:t,done:e}}},8880:(t,e,r)=>{var n=r(9781),o=r(3070),i=r(9114);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},8052:(t,e,r)=>{var n=r(614),o=r(3070),i=r(6339),a=r(3072);t.exports=function(t,e,r,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:e;if(n(r)&&i(r,u,s),s.global)c?t[e]=r:a(e,r);else{try{s.unsafe?t[e]&&(c=!0):delete t[e]}catch(t){}c?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t}},3072:(t,e,r)=>{var n=r(7854),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},9781:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:t=>{var e="object"==typeof document&&document.all,r=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:r}},317:(t,e,r)=>{var n=r(7854),o=r(111),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(t,e,r)=>{var n=r(317)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},7871:(t,e,r)=>{var n=r(3823),o=r(5268);t.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},3823:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},1528:(t,e,r)=>{var n=r(8113),o=r(7854);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},6833:(t,e,r)=>{var n=r(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(t,e,r)=>{var n=r(4326),o=r(7854);t.exports="process"==n(o.process)},1036:(t,e,r)=>{var n=r(8113);t.exports=/web0s(?!.*chrome)/i.test(n)},8113:(t,e,r)=>{var n=r(5005);t.exports=n("navigator","userAgent")||""},7392:(t,e,r)=>{var n,o,i=r(7854),a=r(8113),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1060:(t,e,r)=>{var n=r(1702),o=Error,i=n("".replace),a=String(o("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);t.exports=function(t,e){if(c&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,s,"");return t}},2914:(t,e,r)=>{var n=r(7293),o=r(9114);t.exports=!n((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},2109:(t,e,r)=>{var n=r(7854),o=r(1236).f,i=r(8880),a=r(8052),s=r(3072),c=r(9920),u=r(4705);t.exports=function(t,e){var r,l,f,p,h,v=t.target,d=t.global,y=t.stat;if(r=d?n:y?n[v]||s(v,{}):(n[v]||{}).prototype)for(l in e){if(p=e[l],f=t.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!u(d?l:v+(y?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;c(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(r,l,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2104:(t,e,r)=>{var n=r(4374),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},9974:(t,e,r)=>{var n=r(1702),o=r(9662),i=r(4374),a=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},4374:(t,e,r)=>{var n=r(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,e,r)=>{var n=r(4374),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},6530:(t,e,r)=>{var n=r(9781),o=r(2597),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},84:(t,e,r)=>{var n=r(4374),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=function(t){return n?a(t):function(){return i.apply(t,arguments)}}},1702:(t,e,r)=>{var n=r(4326),o=r(84);t.exports=function(t){if("Function"===n(t))return o(t)}},5005:(t,e,r)=>{var n=r(7854),o=r(614),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t]):n[t]&&n[t][e]}},1246:(t,e,r)=>{var n=r(648),o=r(8173),i=r(8554),a=r(7497),s=r(5112)("iterator");t.exports=function(t){if(!i(t))return o(t,s)||o(t,"@@iterator")||a[n(t)]}},4121:(t,e,r)=>{var n=r(6916),o=r(9662),i=r(9670),a=r(6330),s=r(1246),c=TypeError;t.exports=function(t,e){var r=arguments.length<2?s(t):e;if(o(r))return i(n(r,t));throw c(a(t)+" is not iterable")}},8173:(t,e,r)=>{var n=r(9662),o=r(8554);t.exports=function(t,e){var r=t[e];return o(r)?void 0:n(r)}},7854:(t,e,r)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},2597:(t,e,r)=>{var n=r(1702),o=r(7908),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},3501:t=>{t.exports={}},842:(t,e,r)=>{var n=r(7854);t.exports=function(t,e){var r=n.console;r&&r.error&&(1==arguments.length?r.error(t):r.error(t,e))}},490:(t,e,r)=>{var n=r(5005);t.exports=n("document","documentElement")},4664:(t,e,r)=>{var n=r(9781),o=r(7293),i=r(317);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(t,e,r)=>{var n=r(1702),o=r(7293),i=r(4326),a=Object,s=n("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?s(t,""):a(t)}:a},2788:(t,e,r)=>{var n=r(1702),o=r(614),i=r(5465),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},8340:(t,e,r)=>{var n=r(111),o=r(8880);t.exports=function(t,e){n(e)&&"cause"in e&&o(t,"cause",e.cause)}},9909:(t,e,r)=>{var n,o,i,a=r(4811),s=r(7854),c=r(111),u=r(8880),l=r(2597),f=r(5465),p=r(6200),h=r(3501),v="Object already initialized",d=s.TypeError,y=s.WeakMap;if(a||f.state){var b=f.state||(f.state=new y);b.get=b.get,b.has=b.has,b.set=b.set,n=function(t,e){if(b.has(t))throw d(v);return e.facade=t,b.set(t,e),e},o=function(t){return b.get(t)||{}},i=function(t){return b.has(t)}}else{var g=p("state");h[g]=!0,n=function(t,e){if(l(t,g))throw d(v);return e.facade=t,u(t,g,e),e},o=function(t){return l(t,g)?t[g]:{}},i=function(t){return l(t,g)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!c(e)||(r=o(e)).type!==t)throw d("Incompatible receiver, "+t+" required");return r}}}},7659:(t,e,r)=>{var n=r(5112),o=r(7497),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},614:(t,e,r)=>{var n=r(4154),o=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},4411:(t,e,r)=>{var n=r(1702),o=r(7293),i=r(614),a=r(648),s=r(5005),c=r(2788),u=function(){},l=[],f=s("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),v=!p.exec(u),d=function(t){if(!i(t))return!1;try{return f(u,l,t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!h(p,c(t))}catch(t){return!0}};y.sham=!0,t.exports=!f||o((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?y:d},4705:(t,e,r)=>{var n=r(7293),o=r(614),i=/#|\.prototype\./,a=function(t,e){var r=c[s(t)];return r==l||r!=u&&(o(e)?n(e):!!e)},s=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},8554:t=>{t.exports=function(t){return null==t}},111:(t,e,r)=>{var n=r(614),o=r(4154),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===i}:function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},2190:(t,e,r)=>{var n=r(5005),o=r(614),i=r(7976),a=r(3307),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return o(e)&&i(e.prototype,s(t))}},408:(t,e,r)=>{var n=r(9974),o=r(6916),i=r(9670),a=r(6330),s=r(7659),c=r(6244),u=r(7976),l=r(4121),f=r(1246),p=r(9212),h=TypeError,v=function(t,e){this.stopped=t,this.result=e},d=v.prototype;t.exports=function(t,e,r){var y,b,g,m,w,x,S,P=r&&r.that,E=!(!r||!r.AS_ENTRIES),O=!(!r||!r.IS_RECORD),_=!(!r||!r.IS_ITERATOR),T=!(!r||!r.INTERRUPTED),k=n(e,P),j=function(t){return y&&p(y,"normal",t),new v(!0,t)},C=function(t){return E?(i(t),T?k(t[0],t[1],j):k(t[0],t[1])):T?k(t,j):k(t)};if(O)y=t.iterator;else if(_)y=t;else{if(!(b=f(t)))throw h(a(t)+" is not iterable");if(s(b)){for(g=0,m=c(t);m>g;g++)if((w=C(t[g]))&&u(d,w))return w;return new v(!1)}y=l(t,b)}for(x=O?t.next:y.next;!(S=o(x,y)).done;){try{w=C(S.value)}catch(t){p(y,"throw",t)}if("object"==typeof w&&w&&u(d,w))return w}return new v(!1)}},9212:(t,e,r)=>{var n=r(6916),o=r(9670),i=r(8173);t.exports=function(t,e,r){var a,s;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw r;return r}a=n(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw r;if(s)throw a;return o(a),r}},3061:(t,e,r)=>{"use strict";var n=r(3383).IteratorPrototype,o=r(30),i=r(9114),a=r(8003),s=r(7497),c=function(){return this};t.exports=function(t,e,r,u){var l=e+" Iterator";return t.prototype=o(n,{next:i(+!u,r)}),a(t,l,!1,!0),s[l]=c,t}},1656:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(1913),a=r(6530),s=r(614),c=r(3061),u=r(9518),l=r(7674),f=r(8003),p=r(8880),h=r(8052),v=r(5112),d=r(7497),y=r(3383),b=a.PROPER,g=a.CONFIGURABLE,m=y.IteratorPrototype,w=y.BUGGY_SAFARI_ITERATORS,x=v("iterator"),S="keys",P="values",E="entries",O=function(){return this};t.exports=function(t,e,r,a,v,y,_){c(r,e,a);var T,k,j,C=function(t){if(t===v&&U)return U;if(!w&&t in I)return I[t];switch(t){case S:case P:case E:return function(){return new r(this,t)}}return function(){return new r(this)}},A=e+" Iterator",R=!1,I=t.prototype,N=I[x]||I["@@iterator"]||v&&I[v],U=!w&&N||C(v),L="Array"==e&&I.entries||N;if(L&&(T=u(L.call(new t)))!==Object.prototype&&T.next&&(i||u(T)===m||(l?l(T,m):s(T[x])||h(T,x,O)),f(T,A,!0,!0),i&&(d[A]=O)),b&&v==P&&N&&N.name!==P&&(!i&&g?p(I,"name",P):(R=!0,U=function(){return o(N,this)})),v)if(k={values:C(P),keys:y?U:C(S),entries:C(E)},_)for(j in k)(w||R||!(j in I))&&h(I,j,k[j]);else n({target:e,proto:!0,forced:w||R},k);return i&&!_||I[x]===U||h(I,x,U,{name:v}),d[e]=U,k}},3383:(t,e,r)=>{"use strict";var n,o,i,a=r(7293),s=r(614),c=r(111),u=r(30),l=r(9518),f=r(8052),p=r(5112),h=r(1913),v=p("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):d=!0),!c(n)||a((function(){var t={};return n[v].call(t)!==t}))?n={}:h&&(n=u(n)),s(n[v])||f(n,v,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},7497:t=>{t.exports={}},6244:(t,e,r)=>{var n=r(7466);t.exports=function(t){return n(t.length)}},6339:(t,e,r)=>{var n=r(7293),o=r(614),i=r(2597),a=r(9781),s=r(6530).CONFIGURABLE,c=r(2788),u=r(9909),l=u.enforce,f=u.get,p=Object.defineProperty,h=a&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),v=String(String).split("String"),d=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!i(t,"name")||s&&t.name!==e)&&(a?p(t,"name",{value:e,configurable:!0}):t.name=e),h&&r&&i(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?a&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=l(t);return i(n,"source")||(n.source=v.join("string"==typeof e?e:"")),t};Function.prototype.toString=d((function(){return o(this)&&f(this).source||c(this)}),"toString")},4758:t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},5948:(t,e,r)=>{var n,o,i,a,s,c,u,l,f=r(7854),p=r(9974),h=r(1236).f,v=r(261).set,d=r(6833),y=r(1528),b=r(1036),g=r(5268),m=f.MutationObserver||f.WebKitMutationObserver,w=f.document,x=f.process,S=f.Promise,P=h(f,"queueMicrotask"),E=P&&P.value;E||(n=function(){var t,e;for(g&&(t=x.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?a():i=void 0,t}}i=void 0,t&&t.enter()},d||g||b||!m||!w?!y&&S&&S.resolve?((u=S.resolve(void 0)).constructor=S,l=p(u.then,u),a=function(){l(n)}):g?a=function(){x.nextTick(n)}:(v=p(v,f),a=function(){v(n)}):(s=!0,c=w.createTextNode(""),new m(n).observe(c,{characterData:!0}),a=function(){c.data=s=!s})),t.exports=E||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},8523:(t,e,r)=>{"use strict";var n=r(9662),o=TypeError,i=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw o("Bad Promise constructor");e=t,r=n})),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new i(t)}},6277:(t,e,r)=>{var n=r(1340);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},30:(t,e,r)=>{var n,o=r(9670),i=r(6048),a=r(748),s=r(3501),c=r(490),u=r(317),l=r(6200)("IE_PROTO"),f=function(){},p=function(t){return"<script>"+t+"<\/script>"},h=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e;v="undefined"!=typeof document?document.domain&&n?h(n):((e=u("iframe")).style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):h(n);for(var r=a.length;r--;)delete v.prototype[a[r]];return v()};s[l]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(f.prototype=o(t),r=new f,f.prototype=null,r[l]=t):r=v(),void 0===e?r:i.f(r,e)}},6048:(t,e,r)=>{var n=r(9781),o=r(3353),i=r(3070),a=r(9670),s=r(5656),c=r(1956);e.f=n&&!o?Object.defineProperties:function(t,e){a(t);for(var r,n=s(e),o=c(e),u=o.length,l=0;u>l;)i.f(t,r=o[l++],n[r]);return t}},3070:(t,e,r)=>{var n=r(9781),o=r(4664),i=r(3353),a=r(9670),s=r(4948),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor;e.f=n?i?function(t,e,r){if(a(t),e=s(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=l(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return u(t,e,r)}:u:function(t,e,r){if(a(t),e=s(e),a(r),o)try{return u(t,e,r)}catch(t){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},1236:(t,e,r)=>{var n=r(9781),o=r(6916),i=r(5296),a=r(9114),s=r(5656),c=r(4948),u=r(2597),l=r(4664),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=s(t),e=c(e),l)try{return f(t,e)}catch(t){}if(u(t,e))return a(!o(i.f,t,e),t[e])}},8006:(t,e,r)=>{var n=r(6324),o=r(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},9518:(t,e,r)=>{var n=r(2597),o=r(614),i=r(7908),a=r(6200),s=r(8544),c=a("IE_PROTO"),u=Object,l=u.prototype;t.exports=s?u.getPrototypeOf:function(t){var e=i(t);if(n(e,c))return e[c];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof u?l:null}},7976:(t,e,r)=>{var n=r(1702);t.exports=n({}.isPrototypeOf)},6324:(t,e,r)=>{var n=r(1702),o=r(2597),i=r(5656),a=r(1318).indexOf,s=r(3501),c=n([].push);t.exports=function(t,e){var r,n=i(t),u=0,l=[];for(r in n)!o(s,r)&&o(n,r)&&c(l,r);for(;e.length>u;)o(n,r=e[u++])&&(~a(l,r)||c(l,r));return l}},1956:(t,e,r)=>{var n=r(6324),o=r(748);t.exports=Object.keys||function(t){return n(t,o)}},5296:(t,e)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},7674:(t,e,r)=>{var n=r(1702),o=r(9670),i=r(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return o(r),i(n),e?t(r,n):r.__proto__=n,r}}():void 0)},288:(t,e,r)=>{"use strict";var n=r(1694),o=r(648);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2140:(t,e,r)=>{var n=r(6916),o=r(614),i=r(111),a=TypeError;t.exports=function(t,e){var r,s;if("string"===e&&o(r=t.toString)&&!i(s=n(r,t)))return s;if(o(r=t.valueOf)&&!i(s=n(r,t)))return s;if("string"!==e&&o(r=t.toString)&&!i(s=n(r,t)))return s;throw a("Can't convert object to primitive value")}},3887:(t,e,r)=>{var n=r(5005),o=r(1702),i=r(8006),a=r(5181),s=r(9670),c=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(s(t)),r=a.f;return r?c(e,r(t)):e}},857:(t,e,r)=>{var n=r(7854);t.exports=n},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},3702:(t,e,r)=>{var n=r(7854),o=r(2492),i=r(614),a=r(4705),s=r(2788),c=r(5112),u=r(7871),l=r(3823),f=r(1913),p=r(7392),h=o&&o.prototype,v=c("species"),d=!1,y=i(n.PromiseRejectionEvent),b=a("Promise",(function(){var t=s(o),e=t!==String(o);if(!e&&66===p)return!0;if(f&&(!h.catch||!h.finally))return!0;if(!p||p<51||!/native code/.test(t)){var r=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((r.constructor={})[v]=n,!(d=r.then((function(){}))instanceof n))return!0}return!e&&(u||l)&&!y}));t.exports={CONSTRUCTOR:b,REJECTION_EVENT:y,SUBCLASSING:d}},2492:(t,e,r)=>{var n=r(7854);t.exports=n.Promise},9478:(t,e,r)=>{var n=r(9670),o=r(111),i=r(8523);t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var r=i.f(t);return(0,r.resolve)(e),r.promise}},612:(t,e,r)=>{var n=r(2492),o=r(7072),i=r(3702).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},8572:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=e},4488:(t,e,r)=>{var n=r(8554),o=TypeError;t.exports=function(t){if(n(t))throw o("Can't call method on "+t);return t}},6340:(t,e,r)=>{"use strict";var n=r(5005),o=r(3070),i=r(5112),a=r(9781),s=i("species");t.exports=function(t){var e=n(t),r=o.f;a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},8003:(t,e,r)=>{var n=r(3070).f,o=r(2597),i=r(5112)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:e})}},6200:(t,e,r)=>{var n=r(2309),o=r(9711),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},5465:(t,e,r)=>{var n=r(7854),o=r(3072),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},2309:(t,e,r)=>{var n=r(1913),o=r(5465);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.5",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.5/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:(t,e,r)=>{var n=r(9670),o=r(9483),i=r(8554),a=r(5112)("species");t.exports=function(t,e){var r,s=n(t).constructor;return void 0===s||i(r=n(s)[a])?e:o(r)}},8710:(t,e,r)=>{var n=r(1702),o=r(9303),i=r(1340),a=r(4488),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(t){return function(e,r){var n,l,f=i(a(e)),p=o(r),h=f.length;return p<0||p>=h?t?"":void 0:(n=c(f,p))<55296||n>56319||p+1===h||(l=c(f,p+1))<56320||l>57343?t?s(f,p):n:t?u(f,p,p+2):l-56320+(n-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},6293:(t,e,r)=>{var n=r(7392),o=r(7293);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},261:(t,e,r)=>{var n,o,i,a,s=r(7854),c=r(2104),u=r(9974),l=r(614),f=r(2597),p=r(7293),h=r(490),v=r(206),d=r(317),y=r(8053),b=r(6833),g=r(5268),m=s.setImmediate,w=s.clearImmediate,x=s.process,S=s.Dispatch,P=s.Function,E=s.MessageChannel,O=s.String,_=0,T={};try{n=s.location}catch(t){}var k=function(t){if(f(T,t)){var e=T[t];delete T[t],e()}},j=function(t){return function(){k(t)}},C=function(t){k(t.data)},A=function(t){s.postMessage(O(t),n.protocol+"//"+n.host)};m&&w||(m=function(t){y(arguments.length,1);var e=l(t)?t:P(t),r=v(arguments,1);return T[++_]=function(){c(e,void 0,r)},o(_),_},w=function(t){delete T[t]},g?o=function(t){x.nextTick(j(t))}:S&&S.now?o=function(t){S.now(j(t))}:E&&!b?(a=(i=new E).port2,i.port1.onmessage=C,o=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(A)?(o=A,s.addEventListener("message",C,!1)):o="onreadystatechange"in d("script")?function(t){h.appendChild(d("script")).onreadystatechange=function(){h.removeChild(this),k(t)}}:function(t){setTimeout(j(t),0)}),t.exports={set:m,clear:w}},1400:(t,e,r)=>{var n=r(9303),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},5656:(t,e,r)=>{var n=r(8361),o=r(4488);t.exports=function(t){return n(o(t))}},9303:(t,e,r)=>{var n=r(4758);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},7466:(t,e,r)=>{var n=r(9303),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},7908:(t,e,r)=>{var n=r(4488),o=Object;t.exports=function(t){return o(n(t))}},7593:(t,e,r)=>{var n=r(6916),o=r(111),i=r(2190),a=r(8173),s=r(2140),c=r(5112),u=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var r,c=a(t,l);if(c){if(void 0===e&&(e="default"),r=n(c,t,e),!o(r)||i(r))return r;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},4948:(t,e,r)=>{var n=r(7593),o=r(2190);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},1694:(t,e,r)=>{var n={};n[r(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},1340:(t,e,r)=>{var n=r(648),o=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},9711:(t,e,r)=>{var n=r(1702),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3307:(t,e,r)=>{var n=r(6293);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,e,r)=>{var n=r(9781),o=r(7293);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw e("Not enough arguments");return t}},4811:(t,e,r)=>{var n=r(7854),o=r(614),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},5112:(t,e,r)=>{var n=r(7854),o=r(2309),i=r(2597),a=r(9711),s=r(6293),c=r(3307),u=o("wks"),l=n.Symbol,f=l&&l.for,p=c?l:l&&l.withoutSetter||a;t.exports=function(t){if(!i(u,t)||!s&&"string"!=typeof u[t]){var e="Symbol."+t;s&&i(l,t)?u[t]=l[t]:u[t]=c&&f?f(e):p(e)}return u[t]}},6967:(t,e,r)=>{"use strict";var n=r(2109),o=r(7976),i=r(9518),a=r(7674),s=r(9920),c=r(30),u=r(8880),l=r(9114),f=r(1060),p=r(8340),h=r(408),v=r(6277),d=r(5112),y=r(2914),b=d("toStringTag"),g=Error,m=[].push,w=function(t,e){var r,n=arguments.length>2?arguments[2]:void 0,s=o(x,this);a?r=a(g(),s?i(this):x):(r=s?this:c(x),u(r,b,"Error")),void 0!==e&&u(r,"message",v(e)),y&&u(r,"stack",f(r.stack,1)),p(r,n);var l=[];return h(t,m,{that:l}),u(r,"errors",l),r};a?a(w,g):s(w,g,{name:!0});var x=w.prototype=c(g.prototype,{constructor:l(1,w),message:l(1,""),name:l(1,"AggregateError")});n({global:!0,constructor:!0,arity:2},{AggregateError:w})},9170:(t,e,r)=>{r(6967)},6992:(t,e,r)=>{"use strict";var n=r(5656),o=r(1223),i=r(7497),a=r(9909),s=r(3070).f,c=r(1656),u=r(6178),l=r(1913),f=r(9781),p="Array Iterator",h=a.set,v=a.getterFor(p);t.exports=c(Array,"Array",(function(t,e){h(this,{type:p,target:n(t),index:0,kind:e})}),(function(){var t=v(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,u(void 0,!0)):u("keys"==r?n:"values"==r?e[n]:[n,e[n]],!1)}),"values");var d=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==d.name)try{s(d,"name",{value:"values"})}catch(t){}},1539:(t,e,r)=>{var n=r(1694),o=r(8052),i=r(288);n||o(Object.prototype,"toString",i,{unsafe:!0})},7922:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0},{allSettled:function(t){var e=this,r=a.f(e),n=r.resolve,u=r.reject,l=s((function(){var r=i(e.resolve),a=[],s=0,u=1;c(t,(function(t){var i=s++,c=!1;u++,o(r,e,t).then((function(t){c||(c=!0,a[i]={status:"fulfilled",value:t},--u||n(a))}),(function(t){c||(c=!0,a[i]={status:"rejected",reason:t},--u||n(a))}))})),--u||n(a)}));return l.error&&u(l.value),r.promise}})},821:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0,forced:r(612)},{all:function(t){var e=this,r=a.f(e),n=r.resolve,u=r.reject,l=s((function(){var r=i(e.resolve),a=[],s=0,l=1;c(t,(function(t){var i=s++,c=!1;l++,o(r,e,t).then((function(t){c||(c=!0,a[i]=t,--l||n(a))}),u)})),--l||n(a)}));return l.error&&u(l.value),r.promise}})},4668:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(5005),s=r(8523),c=r(2534),u=r(408),l="No one promise resolved";n({target:"Promise",stat:!0},{any:function(t){var e=this,r=a("AggregateError"),n=s.f(e),f=n.resolve,p=n.reject,h=c((function(){var n=i(e.resolve),a=[],s=0,c=1,h=!1;u(t,(function(t){var i=s++,u=!1;c++,o(n,e,t).then((function(t){u||h||(h=!0,f(t))}),(function(t){u||h||(u=!0,a[i]=t,--c||p(new r(a,l)))}))})),--c||p(new r(a,l))}));return h.error&&p(h.value),n.promise}})},4164:(t,e,r)=>{"use strict";var n=r(2109),o=r(1913),i=r(3702).CONSTRUCTOR,a=r(2492),s=r(5005),c=r(614),u=r(8052),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&c(a)){var f=s("Promise").prototype.catch;l.catch!==f&&u(l,"catch",f,{unsafe:!0})}},3401:(t,e,r)=>{"use strict";var n,o,i,a=r(2109),s=r(1913),c=r(5268),u=r(7854),l=r(6916),f=r(8052),p=r(7674),h=r(8003),v=r(6340),d=r(9662),y=r(614),b=r(111),g=r(5787),m=r(6707),w=r(261).set,x=r(5948),S=r(842),P=r(2534),E=r(8572),O=r(9909),_=r(2492),T=r(3702),k=r(8523),j="Promise",C=T.CONSTRUCTOR,A=T.REJECTION_EVENT,R=T.SUBCLASSING,I=O.getterFor(j),N=O.set,U=_&&_.prototype,L=_,M=U,D=u.TypeError,z=u.document,B=u.process,F=k.f,H=F,V=!!(z&&z.createEvent&&u.dispatchEvent),K="unhandledrejection",G=function(t){var e;return!(!b(t)||!y(e=t.then))&&e},q=function(t,e){var r,n,o,i=e.value,a=1==e.state,s=a?t.ok:t.fail,c=t.resolve,u=t.reject,f=t.domain;try{s?(a||(2===e.rejection&&J(e),e.rejection=1),!0===s?r=i:(f&&f.enter(),r=s(i),f&&(f.exit(),o=!0)),r===t.promise?u(D("Promise-chain cycle")):(n=G(r))?l(n,r,c,u):c(r)):u(i)}catch(t){f&&!o&&f.exit(),u(t)}},Z=function(t,e){t.notified||(t.notified=!0,x((function(){for(var r,n=t.reactions;r=n.get();)q(r,t);t.notified=!1,e&&!t.rejection&&X(t)})))},W=function(t,e,r){var n,o;V?((n=z.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),u.dispatchEvent(n)):n={promise:e,reason:r},!A&&(o=u["on"+t])?o(n):t===K&&S("Unhandled promise rejection",r)},X=function(t){l(w,u,(function(){var e,r=t.facade,n=t.value;if(Y(t)&&(e=P((function(){c?B.emit("unhandledRejection",n,r):W(K,r,n)})),t.rejection=c||Y(t)?2:1,e.error))throw e.value}))},Y=function(t){return 1!==t.rejection&&!t.parent},J=function(t){l(w,u,(function(){var e=t.facade;c?B.emit("rejectionHandled",e):W("rejectionhandled",e,t.value)}))},Q=function(t,e,r){return function(n){t(e,n,r)}},$=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Z(t,!0))},tt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw D("Promise can't be resolved itself");var n=G(e);n?x((function(){var r={done:!1};try{l(n,e,Q(tt,r,t),Q($,r,t))}catch(e){$(r,e,t)}})):(t.value=e,t.state=1,Z(t,!1))}catch(e){$({done:!1},e,t)}}};if(C&&(M=(L=function(t){g(this,M),d(t),l(n,this);var e=I(this);try{t(Q(tt,e),Q($,e))}catch(t){$(e,t)}}).prototype,(n=function(t){N(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=f(M,"then",(function(t,e){var r=I(this),n=F(m(this,L));return r.parent=!0,n.ok=!y(t)||t,n.fail=y(e)&&e,n.domain=c?B.domain:void 0,0==r.state?r.reactions.add(n):x((function(){q(n,r)})),n.promise})),o=function(){var t=new n,e=I(t);this.promise=t,this.resolve=Q(tt,e),this.reject=Q($,e)},k.f=F=function(t){return t===L||void 0===t?new o(t):H(t)},!s&&y(_)&&U!==Object.prototype)){i=U.then,R||f(U,"then",(function(t,e){var r=this;return new L((function(t,e){l(i,r,t,e)})).then(t,e)}),{unsafe:!0});try{delete U.constructor}catch(t){}p&&p(U,M)}a({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:L}),h(L,j,!1,!0),v(j)},7727:(t,e,r)=>{"use strict";var n=r(2109),o=r(1913),i=r(2492),a=r(7293),s=r(5005),c=r(614),u=r(6707),l=r(9478),f=r(8052),p=i&&i.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){p.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=u(this,s("Promise")),r=c(t);return this.then(r?function(r){return l(e,t()).then((function(){return r}))}:t,r?function(r){return l(e,t()).then((function(){throw r}))}:t)}}),!o&&c(i)){var h=s("Promise").prototype.finally;p.finally!==h&&f(p,"finally",h,{unsafe:!0})}},8674:(t,e,r)=>{r(3401),r(821),r(4164),r(6027),r(683),r(6294)},6027:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(9662),a=r(8523),s=r(2534),c=r(408);n({target:"Promise",stat:!0,forced:r(612)},{race:function(t){var e=this,r=a.f(e),n=r.reject,u=s((function(){var a=i(e.resolve);c(t,(function(t){o(a,e,t).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},683:(t,e,r)=>{"use strict";var n=r(2109),o=r(6916),i=r(8523);n({target:"Promise",stat:!0,forced:r(3702).CONSTRUCTOR},{reject:function(t){var e=i.f(this);return o(e.reject,void 0,t),e.promise}})},6294:(t,e,r)=>{"use strict";var n=r(2109),o=r(5005),i=r(1913),a=r(2492),s=r(3702).CONSTRUCTOR,c=r(9478),u=o("Promise"),l=i&&!s;n({target:"Promise",stat:!0,forced:i||s},{resolve:function(t){return c(l&&this===u?a:this,t)}})},8783:(t,e,r)=>{"use strict";var n=r(8710).charAt,o=r(1340),i=r(9909),a=r(1656),s=r(6178),c="String Iterator",u=i.set,l=i.getterFor(c);a(String,"String",(function(t){u(this,{type:c,string:o(t),index:0})}),(function(){var t,e=l(this),r=e.string,o=e.index;return o>=r.length?s(void 0,!0):(t=n(r,o),e.index+=t.length,s(t,!1))}))},3948:(t,e,r)=>{var n=r(7854),o=r(8324),i=r(8509),a=r(6992),s=r(8880),c=r(5112),u=c("iterator"),l=c("toStringTag"),f=a.values,p=function(t,e){if(t){if(t[u]!==f)try{s(t,u,f)}catch(e){t[u]=f}if(t[l]||s(t,l,e),o[e])for(var r in a)if(t[r]!==a[r])try{s(t,r,a[r])}catch(e){t[r]=a[r]}}};for(var h in o)p(n[h]&&n[h].prototype,h);p(i,"DOMTokenList")},1150:(t,e,r)=>{var n=r(7633);r(3948),t.exports=n},6909:function(t,e){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};e.__esModule=!0,e.AbstractUploader=e.DEFAULT_RETRY_STRATEGY=e.DEFAULT_API_HOST=e.DEFAULT_RETRIES=e.MAX_CHUNK_SIZE=e.DEFAULT_CHUNK_SIZE=e.MIN_CHUNK_SIZE=void 0,e.MIN_CHUNK_SIZE=5242880,e.DEFAULT_CHUNK_SIZE=52428800,e.MAX_CHUNK_SIZE=134217728,e.DEFAULT_RETRIES=6,e.DEFAULT_API_HOST="ws.api.video";var i="";try{i="1.1.5"}catch(t){}e.DEFAULT_RETRY_STRATEGY=function(t){return function(e,r){return r.status&&r.status>=400&&r.status<500||e>=t?null:Math.floor(200+2e3*e*(e+1))}};var a=function(){function t(r){if(this.headers={},this.onProgressCallbacks=[],this.onPlayableCallbacks=[],this.abortControllers={},this.apiHost=r.apiHost||e.DEFAULT_API_HOST,r.hasOwnProperty("uploadToken")){var n=r;n.videoId&&(this.videoId=n.videoId),this.uploadEndpoint="https://".concat(this.apiHost,"/upload?token=").concat(n.uploadToken)}else if(r.hasOwnProperty("accessToken")){var o=r;if(!o.videoId)throw new Error("'videoId' is missing");this.refreshToken=o.refreshToken,this.uploadEndpoint="https://".concat(this.apiHost,"/videos/").concat(o.videoId,"/source"),this.headers.Authorization="Bearer ".concat(o.accessToken)}else{if(!r.hasOwnProperty("apiKey"))throw new Error("You must provide either an accessToken, an uploadToken or an API key");var a=r;if(!a.videoId)throw new Error("'videoId' is missing");this.uploadEndpoint="https://".concat(this.apiHost,"/videos/").concat(a.videoId,"/source"),this.headers.Authorization="Basic ".concat(btoa(a.apiKey+":"))}this.headers["AV-Origin-Client"]="typescript-uploader:"+i,this.retries=r.retries||e.DEFAULT_RETRIES,this.retryStrategy=r.retryStrategy||(0,e.DEFAULT_RETRY_STRATEGY)(this.retries),r.origin&&(r.origin.application&&(t.validateOrigin("application",r.origin.application),this.headers["AV-Origin-App"]="".concat(r.origin.application.name,":").concat(r.origin.application.version)),r.origin.sdk&&(t.validateOrigin("sdk",r.origin.sdk),this.headers["AV-Origin-Sdk"]="".concat(r.origin.sdk.name,":").concat(r.origin.sdk.version)))}return t.prototype.onProgress=function(t){this.onProgressCallbacks.push(t)},t.prototype.onPlayable=function(t){this.onPlayableCallbacks.push(t)},t.prototype.waitForPlayable=function(t){var e;return n(this,void 0,void 0,(function(){var r,n;return o(this,(function(o){switch(o.label){case 0:r=null===(e=t.assets)||void 0===e?void 0:e.hls,o.label=1;case 1:return[4,this.sleep(500)];case 2:return o.sent(),[4,fetch(r)];case 3:return 202===(n=o.sent()).status?[3,1]:[4,n.text()];case 4:return 0===o.sent().length?[3,1]:[3,5];case 5:return this.onPlayableCallbacks.forEach((function(e){return e(t)})),[2]}}))}))},t.prototype.parseErrorResponse=function(t){try{var e=JSON.parse(t.response);return r({status:t.status,raw:t.response},e)}catch(t){}return{status:t.status,raw:t.response,reason:"UNKWOWN"}},t.prototype.apiResponseToVideoUploadResponse=function(t){var e=r(r({},t),{_public:t.public,publishedAt:t.publishedAt?new Date(t.publishedAt):void 0,createdAt:t.createdAt?new Date(t.createdAt):void 0,updatedAt:t.updatedAt?new Date(t.updatedAt):void 0});return delete e.public,e},t.prototype.sleep=function(t){return new Promise((function(e,r){setTimeout((function(){return e()}),t)}))},t.prototype.xhrWithRetrier=function(t){var e=this;return this.withRetrier((function(r){return e.createXhrPromise(t,r)}))},t.prototype.createFormData=function(t,e,r,n){var o=r||n?t.slice(r,n):t,i=new FormData;return this.videoId&&i.append("videoId",this.videoId),i.append("file",o,e),i},t.prototype.doRefreshToken=function(){var t=this;return new Promise((function(e,r){var n=new window.XMLHttpRequest;n.open("POST","https://".concat(t.apiHost,"/auth/refresh"));for(var o=0,i=Object.keys(t.headers);o<i.length;o++){var a=i[o];"Authorization"!==a&&n.setRequestHeader(a,t.headers[a])}n.onreadystatechange=function(e){4===n.readyState&&n.status>=400&&r(t.parseErrorResponse(n))},n.onload=function(o){var i=JSON.parse(n.response);if(i.refresh_token&&i.access_token)return t.headers.Authorization="Bearer ".concat(i.access_token),t.refreshToken=i.refresh_token,void e();r(t.parseErrorResponse(n))},n.send(JSON.stringify({refreshToken:t.refreshToken}))}))},t.prototype.createXhrPromise=function(t,e){var r=this;return new Promise((function(n,o){var i=new window.XMLHttpRequest;i.open("POST","".concat(r.uploadEndpoint),!0),e.signal.addEventListener("abort",(function(){i.abort(),o({status:void 0,raw:void 0,reason:"ABORTED"})})),t.parts&&i.setRequestHeader("Content-Range","part ".concat(t.parts.currentPart,"/").concat(t.parts.totalParts));for(var a=0,s=Object.keys(r.headers);a<s.length;a++){var c=s[a];i.setRequestHeader(c,r.headers[c])}t.onProgress&&(i.upload.onprogress=function(e){return t.onProgress(e)}),i.onreadystatechange=function(a){if(4===i.readyState){if(401===i.status&&r.refreshToken)return r.doRefreshToken().then((function(){return r.createXhrPromise(t,e)})).then((function(t){return n(t)})).catch((function(t){return o(t)}));if(i.status>=400)return void o(r.parseErrorResponse(i))}},i.onerror=function(t){o({status:void 0,raw:void 0,reason:"NETWORK_ERROR"})},i.ontimeout=function(t){o({status:void 0,raw:void 0,reason:"NETWORK_TIMEOUT"})},i.onload=function(t){i.status<400&&n(r.apiResponseToVideoUploadResponse(JSON.parse(i.response)))},i.send(t.body)}))},t.prototype.withRetrier=function(t){var e=this,r=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),i=new AbortController;return this.abortControllers[r]=i,{cancel:function(){e.abortControllers[r].abort(),delete e.abortControllers[r]},result:new Promise((function(r,a){return n(e,void 0,void 0,(function(){var e,n,s,c;return o(this,(function(o){switch(o.label){case 0:e=0,o.label=1;case 1:o.label=2;case 2:return o.trys.push([2,4,,6]),[4,t(i)];case 3:return n=o.sent(),r(n),[2];case 4:return"ABORTED"===(s=o.sent()).reason||null===(c=this.retryStrategy(e,s))?(a(s),[2]):(console.log("video upload: ".concat(s.reason||"ERROR",", will be retried in ").concat(c," ms")),[4,this.sleep(c)]);case 5:return o.sent(),e++,[3,6];case 6:return[3,1];case 7:return[2]}}))}))}))}},t.validateOrigin=function(t,e){if(!e.name)throw new Error("".concat(t," name is required"));if(!e.version)throw new Error("".concat(t," version is required"));if(!/^[\w-]{1,50}$/.test(e.name))throw new Error("Invalid ".concat(t," name value. Allowed characters: A-Z, a-z, 0-9, '-', '_'. Max length: 50."));if(!/^\d{1,3}(\.\d{1,3}(\.\d{1,3})?)?$/.test(e.version))throw new Error("Invalid ".concat(t," version value. The version should match the xxx[.yyy][.zzz] pattern."))},t}();e.AbstractUploader=a},3607:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]});e.__esModule=!0,e.MAX_CHUNK_SIZE=e.MIN_CHUNK_SIZE=e.ProgressiveUploader=e.VideoUploader=void 0,n(e,r(3368),"VideoUploader"),n(e,r(9213),"ProgressiveUploader");var o=r(6909);n(e,o,"MIN_CHUNK_SIZE"),n(e,o,"MAX_CHUNK_SIZE")},9213:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};e.__esModule=!0,e.ProgressiveUploader=void 0;var s=r(6909),c=r(3828),u=function(t){function e(e){var r,n=this;return(n=t.call(this,e)||this).currentPartNum=1,n.currentPartBlobs=[],n.currentPartBlobsSize=0,n.queue=new c.PromiseQueue,n.canceled=!1,n.preventEmptyParts=e.preventEmptyParts||!1,n.fileName=e.videoName||"file",n.mergeSmallPartsBeforeUpload=null===(r=e.mergeSmallPartsBeforeUpload)||void 0===r||r,n}return o(e,t),e.prototype.uploadPart=function(t){var e,r=this;if(!this.mergeSmallPartsBeforeUpload&&t.size<s.MIN_CHUNK_SIZE)throw new Error("Each part must have a minimal size of 5MB. The current part has a size of ".concat(this.currentPartBlobsSize/1024/1024,"MB."));return this.currentPartBlobsSize+=t.size,this.currentPartBlobs.push(t),this.preventEmptyParts&&this.currentPartBlobsSize-t.size>=s.MIN_CHUNK_SIZE||!this.preventEmptyParts&&this.currentPartBlobsSize>=s.MIN_CHUNK_SIZE||!this.mergeSmallPartsBeforeUpload?(this.preventEmptyParts?(e=this.currentPartBlobs.slice(0,-1),this.currentPartBlobs=this.currentPartBlobs.slice(-1),this.currentPartBlobsSize=0===this.currentPartBlobs.length?0:this.currentPartBlobs[0].size):(e=this.currentPartBlobs,this.currentPartBlobs=[],this.currentPartBlobsSize=0),this.queue.add((function(){if(e.length>0){var t=r.upload(new Blob(e));r.currentChunkCancel=t.cancel;var n=t.result.then((function(t){return r.videoId=t.videoId,t}));return r.currentPartNum++,n}return new Promise((function(t){return t()}))}))):Promise.resolve()},e.prototype.cancel=function(){this.canceled=!0,this.currentChunkCancel&&this.currentChunkCancel()},e.prototype.uploadLastPart=function(t){return i(this,void 0,void 0,(function(){var e,r=this;return a(this,(function(n){switch(n.label){case 0:return this.currentPartBlobs.push(t),[4,this.queue.add((function(){var t=r.upload(new Blob(r.currentPartBlobs),!0);return r.currentChunkCancel=t.cancel,t.result}))];case 1:return e=n.sent(),this.onPlayableCallbacks.length>0&&this.waitForPlayable(e),[2,e]}}))}))},e.prototype.upload=function(t,e){var r=this;void 0===e&&(e=!1);var n=t.size,o=this.currentPartNum;if(this.canceled)throw new Error("Upload canceled");return this.xhrWithRetrier({body:this.createFormData(t,this.fileName),parts:{currentPart:o,totalParts:e?o:"*"},onProgress:function(t){return r.onProgressCallbacks.forEach((function(e){return e({part:o,uploadedBytes:t.loaded,totalBytes:n})}))}})},e}(s.AbstractUploader);e.ProgressiveUploader=u},3828:(t,e)=>{"use strict";e.__esModule=!0,e.PromiseQueue=void 0;var r=function(){function t(){this.working=!1,this.queue=[]}return t.prototype.add=function(t){var e=this;return new Promise((function(r,n){var o={provider:t,callback:function(t,e){return e?n(e):r(t)}};e.queue=e.queue.concat(o),e.working||(e.working=!0,e.dequeue())}))},t.prototype.dequeue=function(){var t=this;if(0!==this.queue.length){var e=this.queue.shift();e.provider.call(this).then((function(r){e.callback(r),t.dequeue()})).catch((function(r){e.callback(void 0,r),t.dequeue()}))}else this.working=!1},t}();e.PromiseQueue=r},3368:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},a=this&&this.__generator||function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};e.__esModule=!0,e.VideoUploader=void 0;var s=r(6909),c=function(t){function e(e){var r=t.call(this,e)||this;if(r.canceled=!1,!e.file)throw new Error("'file' is missing");if(e.chunkSize&&(e.chunkSize<s.MIN_CHUNK_SIZE||e.chunkSize>s.MAX_CHUNK_SIZE))throw new Error("Invalid chunk size. Minimal allowed value: ".concat(s.MIN_CHUNK_SIZE/1024/1024,"MB, maximum allowed value: ").concat(s.MAX_CHUNK_SIZE/1024/1024,"MB."));return r.chunkSize=e.chunkSize||s.DEFAULT_CHUNK_SIZE,r.file=e.file,r.fileSize=r.file.size,r.fileName=e.videoName||r.file.name,r.chunksCount=Math.ceil(r.fileSize/r.chunkSize),r.maxVideoDuration=e.maxVideoDuration,r}return o(e,t),e.prototype.upload=function(){return i(this,void 0,void 0,(function(){var t,e,r,n;return a(this,(function(o){switch(o.label){case 0:if(void 0!==this.maxVideoDuration&&!document)throw Error("document is undefined. Impossible to use the maxVideoDuration option. Remove it and try again.");return(t=void 0!==this.maxVideoDuration)?[4,this.isVideoTooLong()]:[3,2];case 1:t=o.sent(),o.label=2;case 2:if(t)throw Error("The submitted video is too long.");r=0,o.label=3;case 3:return r<this.chunksCount&&!this.canceled?(n=this.uploadCurrentChunk(r),this.currentChunkCancel=n.cancel,[4,n.result]):[3,6];case 4:e=o.sent(),this.videoId=e.videoId,o.label=5;case 5:return r++,[3,3];case 6:return this.onPlayableCallbacks.length>0&&this.waitForPlayable(e),[2,e]}}))}))},e.prototype.cancel=function(){this.canceled=!0,this.currentChunkCancel&&this.currentChunkCancel()},e.prototype.isVideoTooLong=function(){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(e){return[2,new Promise((function(e){var r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=function(){window.URL.revokeObjectURL(r.src),e(r.duration>t.maxVideoDuration)},r.src=URL.createObjectURL(t.file)}))]}))}))},e.prototype.uploadCurrentChunk=function(t){var e=this,r=t*this.chunkSize,n=(t+1)*this.chunkSize,o=n>this.fileSize?this.fileSize:n,i=Math.ceil(this.fileSize/this.chunkSize);return this.xhrWithRetrier({onProgress:function(n){return e.onProgressCallbacks.forEach((function(o){return o(function(n){return{uploadedBytes:n.loaded+r,totalBytes:e.fileSize,chunksCount:e.chunksCount,chunksBytes:e.chunkSize,currentChunk:t+1,currentChunkUploadedBytes:n.loaded}}(n))}))},body:this.createFormData(this.file,this.fileName,r,o),parts:{currentPart:t+1,totalParts:i}})},e}(s.AbstractUploader);e.VideoUploader=c}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(1150),r(3607)})()));

@@ -76,2 +76,6 @@ export declare const MIN_CHUNK_SIZE: number;

};
export interface CancelableOperation<T> {
cancel: () => void;
result: Promise<T>;
}
export declare const DEFAULT_RETRY_STRATEGY: (maxRetries: number) => (retryCount: number, error: VideoUploadError) => number | null;

@@ -90,2 +94,5 @@ export declare abstract class AbstractUploader<T> {

protected retryStrategy: RetryStrategy;
protected abortControllers: {
[id: string]: AbortController;
};
constructor(options: CommonOptions & (WithAccessToken | WithUploadToken | WithApiKey));

@@ -98,3 +105,3 @@ onProgress(cb: (e: T) => void): void;

protected sleep(duration: number): Promise<void>;
protected xhrWithRetrier(params: HXRRequestParams): Promise<VideoUploadResponse>;
protected xhrWithRetrier(params: HXRRequestParams): CancelableOperation<VideoUploadResponse>;
protected createFormData(file: Blob, fileName: string, startByte?: number, endByte?: number): FormData;

@@ -101,0 +108,0 @@ doRefreshToken(): Promise<void>;

@@ -13,10 +13,7 @@ import { AbstractUploader, CommonOptions, VideoUploadResponse, WithAccessToken, WithApiKey, WithUploadToken } from "./abstract-uploader";

export interface ProgressiveUploadProgressEvent {
part: number;
uploadedBytes: number;
totalBytes: number;
}
export interface ProgressiveProgressEvent {
uploadedBytes: number;
totalBytes: number;
}
export declare class ProgressiveUploader extends AbstractUploader<ProgressiveProgressEvent> {
export declare class ProgressiveUploader extends AbstractUploader<ProgressiveUploadProgressEvent> {
private currentPartNum;

@@ -29,6 +26,9 @@ private currentPartBlobs;

private mergeSmallPartsBeforeUpload;
private currentChunkCancel?;
private canceled;
constructor(options: ProgressiveUploaderOptionsWithAccessToken | ProgressiveUploaderOptionsWithUploadToken | ProgressiveUploaderOptionsWithApiKey);
uploadPart(file: Blob): Promise<VideoUploadResponse | void>;
cancel(): void;
uploadLastPart(file: Blob): Promise<VideoUploadResponse>;
private upload;
}

@@ -28,4 +28,7 @@ import { AbstractUploader, CommonOptions, VideoUploadResponse, WithAccessToken, WithApiKey, WithUploadToken } from "./abstract-uploader";

private maxVideoDuration?;
private currentChunkCancel?;
private canceled;
constructor(options: VideoUploaderOptionsWithAccessToken | VideoUploaderOptionsWithUploadToken | VideoUploaderOptionsWithApiKey);
upload(): Promise<VideoUploadResponse>;
cancel(): void;
private isVideoTooLong;

@@ -32,0 +35,0 @@ private uploadCurrentChunk;

{
"name": "@api.video/video-uploader",
"version": "1.1.4",
"version": "1.1.5",
"description": "api.video video uploader",

@@ -5,0 +5,0 @@ "repository": {

@@ -30,2 +30,3 @@ [![badge](https://img.shields.io/twitter/follow/api_video?style=social)](https://twitter.com/intent/follow?screen_name=api_video) &nbsp; [![badge](https://img.shields.io/github/stars/apivideo/api.video-typescript-uploader?style=social)](https://github.com/apivideo/api.video-typescript-uploader) &nbsp; [![badge](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.api.video)](https://community.api.video)

- [`onProgress()`](#onprogress)
- [`cancel()`](#cancel)
- [`onPlayable()`](#onplayable)

@@ -43,2 +44,3 @@ - [Documentation - Progressive upload](#documentation---progressive-upload)

- [`onProgress()`](#onprogress-1)
- [`cancel()`](#cancel-1)
- [`onPlayable()`](#onplayable-1)

@@ -236,2 +238,7 @@

### `cancel()`
The cancel() method cancels the upload. It takes no parameter.
**Example**

@@ -364,2 +371,3 @@

- totalBytes (number): total size of the file
- part (number): index of the part being uploaded

@@ -374,5 +382,10 @@ **Example**

console.log(`total size of the file: ${event.totalBytes}.`);
console.log(`current part: ${event.part}.`);
});
```
### `cancel()`
The cancel() method cancels the upload. It takes no parameter.
### `onPlayable()`

@@ -379,0 +392,0 @@

@@ -35,3 +35,6 @@ export const MIN_CHUNK_SIZE = 1024 * 1024 * 5; // 5mb

type RetryStrategy = (retryCount: number, error: VideoUploadError) => number | null;
type RetryStrategy = (
retryCount: number,
error: VideoUploadError,
) => number | null;

@@ -76,3 +79,3 @@ interface Origin {

raw: string;
}
};

@@ -83,5 +86,10 @@ type HXRRequestParams = {

totalParts: number | "*";
},
};
onProgress?: (e: ProgressEvent) => void;
body: Document | XMLHttpRequestBodyInit | null;
};
export interface CancelableOperation<T> {
cancel: () => void;
result: Promise<T>;
}

@@ -99,7 +107,10 @@

return (retryCount: number, error: VideoUploadError) => {
if ((error.status && error.status >= 400 && error.status < 500) || retryCount >= maxRetries) {
if (
(error.status && error.status >= 400 && error.status < 500) ||
retryCount >= maxRetries
) {
return null;
}
return Math.floor(200 + 2000 * retryCount * (retryCount + 1));
}
};
};

@@ -117,4 +128,7 @@

protected retryStrategy: RetryStrategy;
protected abortControllers: { [id: string]: AbortController } = {};
constructor(options: CommonOptions & (WithAccessToken | WithUploadToken | WithApiKey)) {
constructor(
options: CommonOptions & (WithAccessToken | WithUploadToken | WithApiKey),
) {
this.apiHost = options.apiHost || DEFAULT_API_HOST;

@@ -128,3 +142,2 @@

this.uploadEndpoint = `https://${this.apiHost}/upload?token=${optionsWithUploadToken.uploadToken}`;
} else if (options.hasOwnProperty("accessToken")) {

@@ -144,18 +157,30 @@ const optionsWithAccessToken = options as WithAccessToken;

this.uploadEndpoint = `https://${this.apiHost}/videos/${optionsWithApiKey.videoId}/source`;
this.headers.Authorization = `Basic ${btoa(optionsWithApiKey.apiKey + ":")}`;
this.headers.Authorization = `Basic ${btoa(
optionsWithApiKey.apiKey + ":",
)}`;
} else {
throw new Error(`You must provide either an accessToken, an uploadToken or an API key`);
throw new Error(
`You must provide either an accessToken, an uploadToken or an API key`,
);
}
this.headers["AV-Origin-Client"] = "typescript-uploader:" + PACKAGE_VERSION;
this.retries = options.retries || DEFAULT_RETRIES;
this.retryStrategy = options.retryStrategy || DEFAULT_RETRY_STRATEGY(this.retries);
this.retryStrategy =
options.retryStrategy || DEFAULT_RETRY_STRATEGY(this.retries);
if (options.origin) {
if (options.origin.application) {
AbstractUploader.validateOrigin("application", options.origin.application);
this.headers["AV-Origin-App"] = `${options.origin.application.name}:${options.origin.application.version}`;
AbstractUploader.validateOrigin(
"application",
options.origin.application,
);
this.headers[
"AV-Origin-App"
] = `${options.origin.application.name}:${options.origin.application.version}`;
}
if (options.origin.sdk) {
AbstractUploader.validateOrigin("sdk", options.origin.sdk);
this.headers["AV-Origin-Sdk"] = `${options.origin.sdk.name}:${options.origin.sdk.version}`;
this.headers[
"AV-Origin-Sdk"
] = `${options.origin.sdk.name}:${options.origin.sdk.version}`;
}

@@ -181,7 +206,7 @@ }

if(hlsRes.status === 202) {
if (hlsRes.status === 202) {
continue;
}
if((await hlsRes.text()).length === 0) {
if ((await hlsRes.text()).length === 0) {
continue;

@@ -193,4 +218,4 @@ }

this.onPlayableCallbacks.forEach(cb => cb(video));
};
this.onPlayableCallbacks.forEach((cb) => cb(video));
}

@@ -204,4 +229,4 @@ protected parseErrorResponse(xhr: XMLHttpRequest): VideoUploadError {

raw: xhr.response,
...parsedResponse
}
...parsedResponse,
};
} catch (e) {

@@ -215,10 +240,14 @@ // empty

reason: "UNKWOWN",
}
};
}
protected apiResponseToVideoUploadResponse(response: any): VideoUploadResponse {
protected apiResponseToVideoUploadResponse(
response: any,
): VideoUploadResponse {
const res = {
...response,
_public: response.public,
publishedAt: response.publishedAt ? new Date(response.publishedAt) : undefined,
publishedAt: response.publishedAt
? new Date(response.publishedAt)
: undefined,
createdAt: response.createdAt ? new Date(response.createdAt) : undefined,

@@ -234,14 +263,20 @@ updatedAt: response.updatedAt ? new Date(response.updatedAt) : undefined,

setTimeout(() => resolve(), duration);
})
});
}
protected xhrWithRetrier(params: HXRRequestParams): Promise<VideoUploadResponse> {
return this.withRetrier(() => this.createXhrPromise(params))
protected xhrWithRetrier(
params: HXRRequestParams,
): CancelableOperation<VideoUploadResponse> {
return this.withRetrier((abortController: AbortController) =>
this.createXhrPromise(params, abortController),
);
}
protected createFormData(file: Blob, fileName: string, startByte?: number, endByte?: number): FormData {
const chunk = (startByte || endByte)
? file.slice(startByte, endByte)
: file;
protected createFormData(
file: Blob,
fileName: string,
startByte?: number,
endByte?: number,
): FormData {
const chunk = startByte || endByte ? file.slice(startByte, endByte) : file;
const chunkForm = new FormData();

@@ -260,3 +295,4 @@ if (this.videoId) {

for (const headerName of Object.keys(this.headers)) {
if (headerName !== "Authorization") xhr.setRequestHeader(headerName, this.headers[headerName]);
if (headerName !== "Authorization")
xhr.setRequestHeader(headerName, this.headers[headerName]);
}

@@ -267,3 +303,3 @@ xhr.onreadystatechange = (_) => {

}
}
};
xhr.onload = (_) => {

@@ -279,13 +315,29 @@ const response = JSON.parse(xhr.response);

};
xhr.send(JSON.stringify({
refreshToken: this.refreshToken
}));
xhr.send(
JSON.stringify({
refreshToken: this.refreshToken,
}),
);
});
}
private createXhrPromise(params: HXRRequestParams): Promise<VideoUploadResponse> {
private createXhrPromise(
params: HXRRequestParams,
abortController: AbortController,
): Promise<VideoUploadResponse> {
return new Promise((resolve, reject) => {
const xhr = new window.XMLHttpRequest();
xhr.open("POST", `${this.uploadEndpoint}`, true);
abortController.signal.addEventListener("abort", () => {
xhr.abort();
reject({
status: undefined,
raw: undefined,
reason: "ABORTED",
});
});
if (params.parts) {
xhr.setRequestHeader("Content-Range", `part ${params.parts.currentPart}/${params.parts.totalParts}`);
xhr.setRequestHeader(
"Content-Range",
`part ${params.parts.currentPart}/${params.parts.totalParts}`,
);
}

@@ -299,7 +351,8 @@ for (const headerName of Object.keys(this.headers)) {

xhr.onreadystatechange = (_) => {
if (xhr.readyState === 4) { // DONE
if (xhr.readyState === 4) {
// DONE
if (xhr.status === 401 && this.refreshToken) {
return this.doRefreshToken()
.then(() => this.createXhrPromise(params))
.then(res => resolve(res))
.then(() => this.createXhrPromise(params, abortController))
.then((res) => resolve(res))
.catch((e) => reject(e));

@@ -318,3 +371,3 @@ } else if (xhr.status >= 400) {

});
}
};
xhr.ontimeout = (e) => {

@@ -326,6 +379,8 @@ reject({

});
}
};
xhr.onload = (_) => {
if (xhr.status < 400) {
resolve(this.apiResponseToVideoUploadResponse(JSON.parse(xhr.response)));
resolve(
this.apiResponseToVideoUploadResponse(JSON.parse(xhr.response)),
);
}

@@ -337,22 +392,48 @@ };

private async withRetrier(fn: () => Promise<VideoUploadResponse>): Promise<VideoUploadResponse> {
return new Promise(async (resolve, reject) => {
let retriesCount = 0;
while (true) {
try {
const res = await fn();
resolve(res);
return;
} catch (e: any) {
const retryDelay = this.retryStrategy(retriesCount, e);
if (retryDelay === null) {
reject(e);
private withRetrier(
fn: (abortController: AbortController) => Promise<VideoUploadResponse>,
): CancelableOperation<VideoUploadResponse> {
// generate a unique random id for this upload
const id =
Math.random().toString(36).substring(2, 15) +
Math.random().toString(36).substring(2, 15);
const abortController = new AbortController();
this.abortControllers[id] = abortController;
const promise = new Promise<VideoUploadResponse>(
async (resolve, reject) => {
let retriesCount = 0;
while (true) {
try {
const res = await fn(abortController);
resolve(res);
return;
} catch (e: any) {
if (e.reason === "ABORTED") {
reject(e);
return;
}
const retryDelay = this.retryStrategy(retriesCount, e);
if (retryDelay === null) {
reject(e);
return;
}
console.log(
`video upload: ${e.reason || "ERROR"
}, will be retried in ${retryDelay} ms`,
);
await this.sleep(retryDelay);
retriesCount++;
}
console.log(`video upload: ${e.reason || "ERROR"}, will be retried in ${retryDelay} ms`);
await this.sleep(retryDelay);
retriesCount++;
}
}
});
},
);
return {
cancel: () => {
this.abortControllers[id].abort();
delete this.abortControllers[id];
},
result: promise,
};
}

@@ -369,3 +450,3 @@

throw new Error(
`Invalid ${type} name value. Allowed characters: A-Z, a-z, 0-9, '-', '_'. Max length: 50.`
`Invalid ${type} name value. Allowed characters: A-Z, a-z, 0-9, '-', '_'. Max length: 50.`,
);

@@ -375,3 +456,3 @@ }

throw new Error(
`Invalid ${type} version value. The version should match the xxx[.yyy][.zzz] pattern.`
`Invalid ${type} version value. The version should match the xxx[.yyy][.zzz] pattern.`,
);

@@ -378,0 +459,0 @@ }

@@ -1,2 +0,11 @@

import { AbstractUploader, CommonOptions, MIN_CHUNK_SIZE, VideoUploadResponse, WithAccessToken, WithApiKey, WithUploadToken } from "./abstract-uploader";
import {
AbstractUploader,
CancelableOperation,
CommonOptions,
MIN_CHUNK_SIZE,
VideoUploadResponse,
WithAccessToken,
WithApiKey,
WithUploadToken,
} from "./abstract-uploader";
import { PromiseQueue } from "./promise-queue";

@@ -9,7 +18,17 @@

export interface ProgressiveUploaderOptionsWithUploadToken extends ProgressiveUploadCommonOptions, CommonOptions, WithUploadToken { }
export interface ProgressiveUploaderOptionsWithAccessToken extends ProgressiveUploadCommonOptions, CommonOptions, WithAccessToken { }
export interface ProgressiveUploaderOptionsWithApiKey extends ProgressiveUploadCommonOptions, CommonOptions, WithApiKey { }
export interface ProgressiveUploaderOptionsWithUploadToken
extends ProgressiveUploadCommonOptions,
CommonOptions,
WithUploadToken { }
export interface ProgressiveUploaderOptionsWithAccessToken
extends ProgressiveUploadCommonOptions,
CommonOptions,
WithAccessToken { }
export interface ProgressiveUploaderOptionsWithApiKey
extends ProgressiveUploadCommonOptions,
CommonOptions,
WithApiKey { }
export interface ProgressiveUploadProgressEvent {
part: number;
uploadedBytes: number;

@@ -19,8 +38,3 @@ totalBytes: number;

export interface ProgressiveProgressEvent {
uploadedBytes: number;
totalBytes: number;
}
export class ProgressiveUploader extends AbstractUploader<ProgressiveProgressEvent> {
export class ProgressiveUploader extends AbstractUploader<ProgressiveUploadProgressEvent> {
private currentPartNum = 1;

@@ -33,8 +47,16 @@ private currentPartBlobs: Blob[] = [];

private mergeSmallPartsBeforeUpload: boolean;
private currentChunkCancel?: () => void;
private canceled = false;
constructor(options: ProgressiveUploaderOptionsWithAccessToken | ProgressiveUploaderOptionsWithUploadToken | ProgressiveUploaderOptionsWithApiKey) {
constructor(
options:
| ProgressiveUploaderOptionsWithAccessToken
| ProgressiveUploaderOptionsWithUploadToken
| ProgressiveUploaderOptionsWithApiKey,
) {
super(options);
this.preventEmptyParts = options.preventEmptyParts || false;
this.fileName = options.videoName || 'file';
this.mergeSmallPartsBeforeUpload = options.mergeSmallPartsBeforeUpload ?? true;
this.fileName = options.videoName || "file";
this.mergeSmallPartsBeforeUpload =
options.mergeSmallPartsBeforeUpload ?? true;
}

@@ -44,3 +66,6 @@

if (!this.mergeSmallPartsBeforeUpload && file.size < MIN_CHUNK_SIZE) {
throw new Error(`Each part must have a minimal size of 5MB. The current part has a size of ${this.currentPartBlobsSize / 1024 / 1024}MB.`)
throw new Error(
`Each part must have a minimal size of 5MB. The current part has a size of ${this.currentPartBlobsSize / 1024 / 1024
}MB.`,
);
}

@@ -50,11 +75,17 @@ this.currentPartBlobsSize += file.size;

if ((this.preventEmptyParts && (this.currentPartBlobsSize - file.size >= MIN_CHUNK_SIZE))
|| (!this.preventEmptyParts && (this.currentPartBlobsSize >= MIN_CHUNK_SIZE))
|| (!this.mergeSmallPartsBeforeUpload)) {
if (
(this.preventEmptyParts &&
this.currentPartBlobsSize - file.size >= MIN_CHUNK_SIZE) ||
(!this.preventEmptyParts &&
this.currentPartBlobsSize >= MIN_CHUNK_SIZE) ||
!this.mergeSmallPartsBeforeUpload
) {
let toSend: any[];
if(this.preventEmptyParts) {
if (this.preventEmptyParts) {
toSend = this.currentPartBlobs.slice(0, -1);
this.currentPartBlobs = this.currentPartBlobs.slice(-1);
this.currentPartBlobsSize = this.currentPartBlobs.length === 0 ? 0 : this.currentPartBlobs[0].size;
this.currentPartBlobsSize =
this.currentPartBlobs.length === 0
? 0
: this.currentPartBlobs[0].size;
} else {

@@ -68,3 +99,5 @@ toSend = this.currentPartBlobs;

if (toSend.length > 0) {
const promise = this.upload(new Blob(toSend)).then(res => {
const cancelableOperation = this.upload(new Blob(toSend));
this.currentChunkCancel = cancelableOperation.cancel;
const promise = cancelableOperation.result.then((res) => {
this.videoId = res.videoId;

@@ -76,3 +109,3 @@ return res;

}
return new Promise(resolve => resolve());
return new Promise((resolve) => resolve());
});

@@ -83,7 +116,21 @@ }

public cancel(): void {
this.canceled = true;
if (this.currentChunkCancel) {
this.currentChunkCancel();
}
}
public async uploadLastPart(file: Blob): Promise<VideoUploadResponse> {
this.currentPartBlobs.push(file);
const res = await this.queue.add(() => this.upload(new Blob(this.currentPartBlobs), true));
const res = await this.queue.add(() => {
const cancelableOperation = this.upload(
new Blob(this.currentPartBlobs),
true,
);
this.currentChunkCancel = cancelableOperation.cancel;
return cancelableOperation.result;
});
if(this.onPlayableCallbacks.length > 0) {
if (this.onPlayableCallbacks.length > 0) {
this.waitForPlayable(res!);

@@ -95,17 +142,29 @@ }

private async upload(file: Blob, isLast: boolean = false): Promise<VideoUploadResponse> {
private upload(
file: Blob,
isLast: boolean = false,
): CancelableOperation<VideoUploadResponse> {
const fileSize = file.size;
const currentPartNum = this.currentPartNum;
if (this.canceled) {
throw new Error("Upload canceled");
}
return this.xhrWithRetrier({
body: this.createFormData(file, this.fileName),
parts: {
currentPart: this.currentPartNum,
totalParts: isLast ? this.currentPartNum : '*'
currentPart: currentPartNum,
totalParts: isLast ? currentPartNum : "*",
},
onProgress: (event: ProgressEvent) => this.onProgressCallbacks.forEach(cb => cb({
uploadedBytes: event.loaded,
totalBytes: fileSize,
})),
})
onProgress: (event: ProgressEvent) =>
this.onProgressCallbacks.forEach((cb) =>
cb({
part: currentPartNum,
uploadedBytes: event.loaded,
totalBytes: fileSize,
}),
),
});
}
}
}

@@ -1,2 +0,13 @@

import { AbstractUploader, CommonOptions, DEFAULT_CHUNK_SIZE, MAX_CHUNK_SIZE, MIN_CHUNK_SIZE, VideoUploadResponse, WithAccessToken, WithApiKey, WithUploadToken } from "./abstract-uploader";
import {
AbstractUploader,
CancelableOperation,
CommonOptions,
DEFAULT_CHUNK_SIZE,
MAX_CHUNK_SIZE,
MIN_CHUNK_SIZE,
VideoUploadResponse,
WithAccessToken,
WithApiKey,
WithUploadToken,
} from "./abstract-uploader";

@@ -9,5 +20,14 @@ interface UploadOptions {

export interface VideoUploaderOptionsWithUploadToken extends CommonOptions, UploadOptions, WithUploadToken { }
export interface VideoUploaderOptionsWithAccessToken extends CommonOptions, UploadOptions, WithAccessToken { }
export interface VideoUploaderOptionsWithApiKey extends CommonOptions, UploadOptions, WithApiKey { }
export interface VideoUploaderOptionsWithUploadToken
extends CommonOptions,
UploadOptions,
WithUploadToken { }
export interface VideoUploaderOptionsWithAccessToken
extends CommonOptions,
UploadOptions,
WithAccessToken { }
export interface VideoUploaderOptionsWithApiKey
extends CommonOptions,
UploadOptions,
WithApiKey { }

@@ -30,4 +50,11 @@ export interface UploadProgressEvent {

private maxVideoDuration?: number;
private currentChunkCancel?: () => void;
private canceled = false;
constructor(options: VideoUploaderOptionsWithAccessToken | VideoUploaderOptionsWithUploadToken | VideoUploaderOptionsWithApiKey) {
constructor(
options:
| VideoUploaderOptionsWithAccessToken
| VideoUploaderOptionsWithUploadToken
| VideoUploaderOptionsWithApiKey
) {
super(options);

@@ -39,4 +66,10 @@

if (options.chunkSize && (options.chunkSize < MIN_CHUNK_SIZE || options.chunkSize > MAX_CHUNK_SIZE)) {
throw new Error(`Invalid chunk size. Minimal allowed value: ${MIN_CHUNK_SIZE / 1024 / 1024}MB, maximum allowed value: ${MAX_CHUNK_SIZE / 1024 / 1024}MB.`);
if (
options.chunkSize &&
(options.chunkSize < MIN_CHUNK_SIZE || options.chunkSize > MAX_CHUNK_SIZE)
) {
throw new Error(
`Invalid chunk size. Minimal allowed value: ${MIN_CHUNK_SIZE / 1024 / 1024
}MB, maximum allowed value: ${MAX_CHUNK_SIZE / 1024 / 1024}MB.`
);
}

@@ -53,17 +86,20 @@

public async upload(): Promise<VideoUploadResponse> {
if (this.maxVideoDuration !== undefined && !document) {
throw Error('document is undefined. Impossible to use the maxVideoDuration option. Remove it and try again.')
throw Error(
"document is undefined. Impossible to use the maxVideoDuration option. Remove it and try again."
);
}
if (this.maxVideoDuration !== undefined && await this.isVideoTooLong()) {
if (this.maxVideoDuration !== undefined && (await this.isVideoTooLong())) {
throw Error(`The submitted video is too long.`);
}
let res: VideoUploadResponse;
for (let i = 0; i < this.chunksCount; i++) {
res = await this.uploadCurrentChunk(i);
for (let i = 0; i < this.chunksCount && !this.canceled; i++) {
const cancelableOperation = this.uploadCurrentChunk(i);
this.currentChunkCancel = cancelableOperation.cancel;
res = await cancelableOperation.result;
this.videoId = res.videoId;
}
if(this.onPlayableCallbacks.length > 0) {
if (this.onPlayableCallbacks.length > 0) {
this.waitForPlayable(res!);

@@ -75,21 +111,33 @@ }

public cancel(): void {
this.canceled = true;
if (this.currentChunkCancel) {
this.currentChunkCancel();
}
}
private async isVideoTooLong(): Promise<boolean> {
return new Promise(resolve => {
const video = document.createElement('video');
video.preload = 'metadata';
return new Promise((resolve) => {
const video = document.createElement("video");
video.preload = "metadata";
video.onloadedmetadata = () => {
window.URL.revokeObjectURL(video.src);
resolve(video.duration > this.maxVideoDuration!)
}
resolve(video.duration > this.maxVideoDuration!);
};
video.src = URL.createObjectURL(this.file);
})
});
}
private uploadCurrentChunk(chunkNumber: number): Promise<VideoUploadResponse> {
private uploadCurrentChunk(
chunkNumber: number
): CancelableOperation<VideoUploadResponse> {
const firstByte = chunkNumber * this.chunkSize;
const computedLastByte = (chunkNumber + 1) * this.chunkSize;
const lastByte = (computedLastByte > this.fileSize ? this.fileSize : computedLastByte);
const lastByte =
computedLastByte > this.fileSize ? this.fileSize : computedLastByte;
const chunksCount = Math.ceil(this.fileSize / this.chunkSize);
const progressEventToUploadProgressEvent = (event: ProgressEvent): UploadProgressEvent => {
const progressEventToUploadProgressEvent = (
event: ProgressEvent
): UploadProgressEvent => {
return {

@@ -106,10 +154,13 @@ uploadedBytes: event.loaded + firstByte,

return this.xhrWithRetrier({
onProgress: (event) => this.onProgressCallbacks.forEach(cb => cb(progressEventToUploadProgressEvent(event))),
onProgress: (event) =>
this.onProgressCallbacks.forEach((cb) =>
cb(progressEventToUploadProgressEvent(event))
),
body: this.createFormData(this.file, this.fileName, firstByte, lastByte),
parts: {
currentPart: chunkNumber + 1,
totalParts: chunksCount
}
totalParts: chunksCount,
},
});
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc