waveform-playlist
Version:
Multiple track web audio editor and player with waveform preview
2 lines • 80 kB
JavaScript
/*! For license information please see waveform-playlist.umd.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("WaveformPlaylist",[],e):"object"==typeof exports?exports.WaveformPlaylist=e():t.WaveformPlaylist=e()}(this,(function(){return(()=>{var t={6824:t=>{t.exports=function(t){var e,s=String.prototype.split,i=/()??/.exec("")[1]===t;return e=function(e,r,n){if("[object RegExp]"!==Object.prototype.toString.call(r))return s.call(e,r,n);var a,o,l,c,h=[],u=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.extended?"x":"")+(r.sticky?"y":""),d=0;r=new RegExp(r.source,u+"g");for(e+="",i||(a=new RegExp("^"+r.source+"$(?!\\s)",u)),n=n===t?-1>>>0:n>>>0;(o=r.exec(e))&&!((l=o.index+o[0].length)>d&&(h.push(e.slice(d,o.index)),!i&&o.length>1&&o[0].replace(a,(function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===t&&(o[e]=t)})),o.length>1&&o.index<e.length&&Array.prototype.push.apply(h,o.slice(1)),c=o[0].length,d=l,h.length>=n));)r.lastIndex===o.index&&r.lastIndex++;return d===e.length?!c&&r.test("")||h.push(""):h.push(e.slice(d)),h.length>n?h.slice(0,n):h},e}()},1804:(t,e,s)=>{"use strict";var i=s(5618),r=s(7205),n=s(7191),a=s(5516),o=s(9981),l=t.exports=function(t,e){var s,r,l,c,h;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],i(t)?(s=o.call(t,"c"),r=o.call(t,"e"),l=o.call(t,"w")):(s=l=!0,r=!1),h={value:e,configurable:s,enumerable:r,writable:l},c?n(a(c),h):h};l.gs=function(t,e,s){var l,c,h,u;return"string"!=typeof t?(h=s,s=e,e=t,t=null):h=arguments[3],i(e)?r(e)?i(s)?r(s)||(h=s,s=void 0):s=void 0:(h=e,e=s=void 0):e=void 0,i(t)?(l=o.call(t,"c"),c=o.call(t,"e")):(l=!0,c=!1),u={get:e,set:s,configurable:l,enumerable:c},h?n(a(h),u):u}},430:t=>{"use strict";t.exports=function(){}},7191:(t,e,s)=>{"use strict";t.exports=s(6560)()?Object.assign:s(7346)},6560:t=>{"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},7346:(t,e,s)=>{"use strict";var i=s(5103),r=s(2745),n=Math.max;t.exports=function(t,e){var s,a,o,l=n(arguments.length,2);for(t=Object(r(t)),o=function(i){try{t[i]=e[i]}catch(t){s||(s=t)}},a=1;a<l;++a)i(e=arguments[a]).forEach(o);if(void 0!==s)throw s;return t}},6914:(t,e,s)=>{"use strict";var i=s(430)();t.exports=function(t){return t!==i&&null!==t}},5103:(t,e,s)=>{"use strict";t.exports=s(7446)()?Object.keys:s(6137)},7446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},6137:(t,e,s)=>{"use strict";var i=s(6914),r=Object.keys;t.exports=function(t){return r(i(t)?Object(t):t)}},5516:(t,e,s)=>{"use strict";var i=s(6914),r=Array.prototype.forEach,n=Object.create,a=function(t,e){var s;for(s in t)e[s]=t[s]};t.exports=function(t){var e=n(null);return r.call(arguments,(function(t){i(t)&&a(Object(t),e)})),e}},1290:t=>{"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},2745:(t,e,s)=>{"use strict";var i=s(6914);t.exports=function(t){if(!i(t))throw new TypeError("Cannot use null or undefined");return t}},9981:(t,e,s)=>{"use strict";t.exports=s(3591)()?String.prototype.contains:s(6042)},3591:t=>{"use strict";var e="razdwatrzy";t.exports=function(){return"function"==typeof e.contains&&(!0===e.contains("dwa")&&!1===e.contains("foo"))}},6042:t=>{"use strict";var e=String.prototype.indexOf;t.exports=function(t){return e.call(this,t,arguments[1])>-1}},8832:(t,e,s)=>{"use strict";s(4167)("ev-store","7");var i="__EV_STORE_KEY@7";t.exports=function(t){var e=t[i];e||(e=t[i]={});return e}},8370:(t,e,s)=>{"use strict";var i,r,n,a,o,l,c,h=s(1804),u=s(1290),d=Function.prototype.apply,p=Function.prototype.call,f=Object.create,m=Object.defineProperty,v=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var s,r;return u(e),r=this,i.call(this,t,s=function(){n.call(r,t,s),d.call(e,this,arguments)}),s.__eeOnceListener__=e,this},a=function(t){var e,s,i,r,n;if(g.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(s=arguments.length,n=new Array(s-1),e=1;e<s;++e)n[e-1]=arguments[e];for(r=r.slice(),e=0;i=r[e];++e)d.call(i,this,n)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(s=arguments.length,n=new Array(s-1),e=1;e<s;++e)n[e-1]=arguments[e];d.call(r,this,n)}},o={on:i=function(t,e){var s;return u(e),g.call(this,"__ee__")?s=this.__ee__:(s=y.value=f(null),m(this,"__ee__",y),y.value=null),s[t]?"object"==typeof s[t]?s[t].push(e):s[t]=[s[t],e]:s[t]=e,this},once:r,off:n=function(t,e){var s,i,r,n;if(u(e),!g.call(this,"__ee__"))return this;if(!(s=this.__ee__)[t])return this;if("object"==typeof(i=s[t]))for(n=0;r=i[n];++n)r!==e&&r.__eeOnceListener__!==e||(2===i.length?s[t]=i[n?0:1]:i.splice(n,1));else i!==e&&i.__eeOnceListener__!==e||delete s[t];return this},emit:a},l={on:h(i),once:h(r),off:h(n),emit:h(a)},c=v({},l),t.exports=e=function(t){return null==t?f(c):v(Object(t),l)},e.methods=o},6226:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.linear=function(t,e){var s,i,r=new Float32Array(t),n=t-1;for(s=0;s<t;s++)i=s/n,r[s]=e>0?i:1-i;return r},e.exponential=function(t,e){var s,i,r=new Float32Array(t),n=t-1;for(s=0;s<t;s++)i=s/n,r[e>0?s:t-1-s]=Math.exp(2*i-1)/Math.exp(1);return r},e.sCurve=function(t,e){var s,i=new Float32Array(t),r=e>0?Math.PI/2:-Math.PI/2;for(s=0;s<t;++s)i[s]=Math.sin(Math.PI*s/t-r)/2+.5;return i},e.logarithmic=function(t,e,s){var i,r=new Float32Array(t),n=0;for(i=0;i<t;i++)n=i/t,r[s>0?i:t-1-i]=Math.log(1+e*n)/Math.log(1+e);return r}},1114:(t,e,s)=>{"use strict";e.h7=e.Y1=e.Hp=e.Jl=e.t$=e._h=void 0,e.L7=function(t,e,s,i){switch(e){case r:l.call(t,s,i);break;case n:h.call(t,s,i);break;case a:d.call(t,s,i);break;case o:f.call(t,s,i);break;default:throw new Error("Unsupported Fade type")}},e.Mt=function(t,e,s,i){switch(e){case r:c.call(t,s,i);break;case n:u.call(t,s,i);break;case a:p.call(t,s,i);break;case o:m.call(t,s,i);break;default:throw new Error("Unsupported Fade type")}};var i=s(6226),r=e._h="sCurve",n=e.t$="linear",a=e.Jl="exponential",o=e.Hp="logarithmic";e.Y1="FadeIn",e.h7="FadeOut";function l(t,e){var s=(0,i.sCurve)(1e4,1);this.setValueCurveAtTime(s,t,e)}function c(t,e){var s=(0,i.sCurve)(1e4,-1);this.setValueCurveAtTime(s,t,e)}function h(t,e){this.linearRampToValueAtTime(0,t),this.linearRampToValueAtTime(1,t+e)}function u(t,e){this.linearRampToValueAtTime(1,t),this.linearRampToValueAtTime(0,t+e)}function d(t,e){this.exponentialRampToValueAtTime(.01,t),this.exponentialRampToValueAtTime(1,t+e)}function p(t,e){this.exponentialRampToValueAtTime(1,t),this.exponentialRampToValueAtTime(.01,t+e)}function f(t,e){var s=(0,i.logarithmic)(1e4,10,1);this.setValueCurveAtTime(s,t,e)}function m(t,e){var s=(0,i.logarithmic)(1e4,10,-1);this.setValueCurveAtTime(s,t,e)}},9144:(t,e,s)=>{var i,r=void 0!==s.g?s.g:"undefined"!=typeof window?window:{},n=s(5893);"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=n),t.exports=i},8070:(t,e,s)=>{"use strict";var i="undefined"!=typeof window?window:void 0!==s.g?s.g:{};t.exports=function(t,e){if(t in i)return i[t];return i[t]=e,e}},4167:(t,e,s)=>{"use strict";var i=s(8070);t.exports=function(t,e,s){var r="__INDIVIDUAL_ONE_VERSION_"+t,n=i(r+"_ENFORCE_SINGLETON",e);if(n!==e)throw new Error("Can only have one copy of "+t+".\nYou already have version "+n+" installed.\nThis means you cannot install version "+e);return i(r,s)}},849:(t,e,s)=>{var i=!!(s.g===s.g.window&&s.g.URL&&s.g.Blob&&s.g.Worker);function r(t,e){var r,n=this;if(e=e||{},i)return r=t.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],new s.g.Worker(s.g.URL.createObjectURL(new s.g.Blob([r],{type:"text/javascript"})));this.self=e,this.self.postMessage=function(t){setTimeout((function(){n.onmessage({data:t})}),0)},setTimeout(t.bind(e,e),0)}r.prototype.postMessage=function(t){var e=this;setTimeout((function(){e.self.onmessage({data:t})}),0)},t.exports=r},6240:t=>{"use strict";t.exports=function(t){return"object"==typeof t&&null!==t}},1730:t=>{var e=9007199254740991,s="[object Arguments]",i="[object Function]",r="[object GeneratorFunction]",n=/^(?:0|[1-9]\d*)$/;function a(t,e,s){switch(s.length){case 0:return t.call(e);case 1:return t.call(e,s[0]);case 2:return t.call(e,s[0],s[1]);case 3:return t.call(e,s[0],s[1],s[2])}return t.apply(e,s)}var o,l,c=Object.prototype,h=c.hasOwnProperty,u=c.toString,d=c.propertyIsEnumerable,p=(o=Object.keys,l=Object,function(t){return o(l(t))}),f=Math.max,m=!d.call({valueOf:1},"valueOf");function v(t,e){var i=w(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&x(t)}(t)&&h.call(t,"callee")&&(!d.call(t,"callee")||u.call(t)==s)}(t)?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],r=i.length,n=!!r;for(var a in t)!e&&!h.call(t,a)||n&&("length"==a||y(a,r))||i.push(a);return i}function g(t,e,s){var i=t[e];h.call(t,e)&&k(i,s)&&(void 0!==s||e in t)||(t[e]=s)}function y(t,s){return!!(s=null==s?e:s)&&("number"==typeof t||n.test(t))&&t>-1&&t%1==0&&t<s}function b(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||c)}function k(t,e){return t===e||t!=t&&e!=e}var w=Array.isArray;function x(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(t){var e=P(t)?u.call(t):"";return e==i||e==r}(t)}function P(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var S,T=(S=function(t,e){if(m||b(e)||x(e))!function(t,e,s,i){s||(s={});for(var r=-1,n=e.length;++r<n;){var a=e[r],o=i?i(s[a],t[a],a,s,t):void 0;g(s,a,void 0===o?t[a]:o)}}(e,function(t){return x(t)?v(t):function(t){if(!b(t))return p(t);var e=[];for(var s in Object(t))h.call(t,s)&&"constructor"!=s&&e.push(s);return e}(t)}(e),t);else for(var s in e)h.call(e,s)&&g(t,s,e[s])},function(t,e){return e=f(void 0===e?t.length-1:e,0),function(){for(var s=arguments,i=-1,r=f(s.length-e,0),n=Array(r);++i<r;)n[i]=s[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=s[i];return o[e]=n,a(t,this,o)}}((function(t,e){var s=-1,i=e.length,r=i>1?e[i-1]:void 0,n=i>2?e[2]:void 0;for(r=S.length>3&&"function"==typeof r?(i--,r):void 0,n&&function(t,e,s){if(!P(s))return!1;var i=typeof e;return!!("number"==i?x(s)&&y(e,s.length):"string"==i&&e in s)&&k(s[e],t)}(e[0],e[1],n)&&(r=i<3?void 0:r,i=1),t=Object(t);++s<i;){var a=e[s];a&&S(t,a,s,r)}return t})));t.exports=T},2098:(t,e,s)=>{t=s.nmd(t);var i="__lodash_hash_undefined__",r=9007199254740991,n="[object Arguments]",a="[object Function]",o="[object Object]",l=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,h={};h["[object Float32Array]"]=h["[object Float64Array]"]=h["[object Int8Array]"]=h["[object Int16Array]"]=h["[object Int32Array]"]=h["[object Uint8Array]"]=h["[object Uint8ClampedArray]"]=h["[object Uint16Array]"]=h["[object Uint32Array]"]=!0,h[n]=h["[object Array]"]=h["[object ArrayBuffer]"]=h["[object Boolean]"]=h["[object DataView]"]=h["[object Date]"]=h["[object Error]"]=h[a]=h["[object Map]"]=h["[object Number]"]=h[o]=h["[object RegExp]"]=h["[object Set]"]=h["[object String]"]=h["[object WeakMap]"]=!1;var u="object"==typeof s.g&&s.g&&s.g.Object===Object&&s.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=u||d||Function("return this")(),f=e&&!e.nodeType&&e,m=f&&t&&!t.nodeType&&t,v=m&&m.exports===f,g=v&&u.process,y=function(){try{var t=m&&m.require&&m.require("util").types;return t||g&&g.binding&&g.binding("util")}catch(t){}}(),b=y&&y.isTypedArray;function k(t,e,s){switch(s.length){case 0:return t.call(e);case 1:return t.call(e,s[0]);case 2:return t.call(e,s[0],s[1]);case 3:return t.call(e,s[0],s[1],s[2])}return t.apply(e,s)}var w,x,P,S=Array.prototype,T=Function.prototype,_=Object.prototype,O=p["__core-js_shared__"],E=T.toString,R=_.hasOwnProperty,A=(w=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",j=_.toString,C=E.call(Object),G=RegExp("^"+E.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?p.Buffer:void 0,L=p.Symbol,I=p.Uint8Array,F=M?M.allocUnsafe:void 0,$=(x=Object.getPrototypeOf,P=Object,function(t){return x(P(t))}),D=Object.create,z=_.propertyIsEnumerable,N=S.splice,V=L?L.toStringTag:void 0,W=function(){try{var t=vt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),U=M?M.isBuffer:void 0,q=Math.max,H=Date.now,B=vt(p,"Map"),X=vt(Object,"create"),Y=function(){function t(){}return function(e){if(!Et(e))return{};if(D)return D(e);t.prototype=e;var s=new t;return t.prototype=void 0,s}}();function Z(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function J(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function K(t){var e=-1,s=null==t?0:t.length;for(this.clear();++e<s;){var i=t[e];this.set(i[0],i[1])}}function Q(t){var e=this.__data__=new J(t);this.size=e.size}function tt(t,e){var s=Pt(t),i=!s&&xt(t),r=!s&&!i&&Tt(t),n=!s&&!i&&!r&&At(t),a=s||i||r||n,o=a?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],l=o.length;for(var c in t)!e&&!R.call(t,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||n&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gt(c,l))||o.push(c);return o}function et(t,e,s){(void 0!==s&&!wt(t[e],s)||void 0===s&&!(e in t))&&rt(t,e,s)}function st(t,e,s){var i=t[e];R.call(t,e)&&wt(i,s)&&(void 0!==s||e in t)||rt(t,e,s)}function it(t,e){for(var s=t.length;s--;)if(wt(t[s][0],e))return s;return-1}function rt(t,e,s){"__proto__"==e&&W?W(t,e,{configurable:!0,enumerable:!0,value:s,writable:!0}):t[e]=s}Z.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},Z.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Z.prototype.get=function(t){var e=this.__data__;if(X){var s=e[t];return s===i?void 0:s}return R.call(e,t)?e[t]:void 0},Z.prototype.has=function(t){var e=this.__data__;return X?void 0!==e[t]:R.call(e,t)},Z.prototype.set=function(t,e){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=X&&void 0===e?i:e,this},J.prototype.clear=function(){this.__data__=[],this.size=0},J.prototype.delete=function(t){var e=this.__data__,s=it(e,t);return!(s<0)&&(s==e.length-1?e.pop():N.call(e,s,1),--this.size,!0)},J.prototype.get=function(t){var e=this.__data__,s=it(e,t);return s<0?void 0:e[s][1]},J.prototype.has=function(t){return it(this.__data__,t)>-1},J.prototype.set=function(t,e){var s=this.__data__,i=it(s,t);return i<0?(++this.size,s.push([t,e])):s[i][1]=e,this},K.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(B||J),string:new Z}},K.prototype.delete=function(t){var e=mt(this,t).delete(t);return this.size-=e?1:0,e},K.prototype.get=function(t){return mt(this,t).get(t)},K.prototype.has=function(t){return mt(this,t).has(t)},K.prototype.set=function(t,e){var s=mt(this,t),i=s.size;return s.set(t,e),this.size+=s.size==i?0:1,this},Q.prototype.clear=function(){this.__data__=new J,this.size=0},Q.prototype.delete=function(t){var e=this.__data__,s=e.delete(t);return this.size=e.size,s},Q.prototype.get=function(t){return this.__data__.get(t)},Q.prototype.has=function(t){return this.__data__.has(t)},Q.prototype.set=function(t,e){var s=this.__data__;if(s instanceof J){var i=s.__data__;if(!B||i.length<199)return i.push([t,e]),this.size=++s.size,this;s=this.__data__=new K(i)}return s.set(t,e),this.size=s.size,this};var nt,at=function(t,e,s){for(var i=-1,r=Object(t),n=s(t),a=n.length;a--;){var o=n[nt?a:++i];if(!1===e(r[o],o,r))break}return t};function ot(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":V&&V in Object(t)?function(t){var e=R.call(t,V),s=t[V];try{t[V]=void 0;var i=!0}catch(t){}var r=j.call(t);i&&(e?t[V]=s:delete t[V]);return r}(t):function(t){return j.call(t)}(t)}function lt(t){return Rt(t)&&ot(t)==n}function ct(t){return!(!Et(t)||function(t){return!!A&&A in t}(t))&&(_t(t)?G:l).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ht(t){if(!Et(t))return function(t){var e=[];if(null!=t)for(var s in Object(t))e.push(s);return e}(t);var e=yt(t),s=[];for(var i in t)("constructor"!=i||!e&&R.call(t,i))&&s.push(i);return s}function ut(t,e,s,i,r){t!==e&&at(e,(function(n,a){if(r||(r=new Q),Et(n))!function(t,e,s,i,r,n,a){var l=bt(t,s),c=bt(e,s),h=a.get(c);if(h)return void et(t,s,h);var u=n?n(l,c,s+"",t,e,a):void 0,d=void 0===u;if(d){var p=Pt(c),f=!p&&Tt(c),m=!p&&!f&&At(c);u=c,p||f||m?Pt(l)?u=l:Rt(k=l)&&St(k)?u=function(t,e){var s=-1,i=t.length;e||(e=Array(i));for(;++s<i;)e[s]=t[s];return e}(l):f?(d=!1,u=function(t,e){if(e)return t.slice();var s=t.length,i=F?F(s):new t.constructor(s);return t.copy(i),i}(c,!0)):m?(d=!1,v=c,g=!0?(y=v.buffer,b=new y.constructor(y.byteLength),new I(b).set(new I(y)),b):v.buffer,u=new v.constructor(g,v.byteOffset,v.length)):u=[]:function(t){if(!Rt(t)||ot(t)!=o)return!1;var e=$(t);if(null===e)return!0;var s=R.call(e,"constructor")&&e.constructor;return"function"==typeof s&&s instanceof s&&E.call(s)==C}(c)||xt(c)?(u=l,xt(l)?u=function(t){return function(t,e,s,i){var r=!s;s||(s={});var n=-1,a=e.length;for(;++n<a;){var o=e[n],l=i?i(s[o],t[o],o,s,t):void 0;void 0===l&&(l=t[o]),r?rt(s,o,l):st(s,o,l)}return s}(t,Ct(t))}(l):Et(l)&&!_t(l)||(u=function(t){return"function"!=typeof t.constructor||yt(t)?{}:Y($(t))}(c))):d=!1}var v,g,y,b;var k;d&&(a.set(c,u),r(u,c,i,n,a),a.delete(c));et(t,s,u)}(t,e,a,s,ut,i,r);else{var l=i?i(bt(t,a),n,a+"",t,e,r):void 0;void 0===l&&(l=n),et(t,a,l)}}),Ct)}function dt(t,e){return kt(function(t,e,s){return e=q(void 0===e?t.length-1:e,0),function(){for(var i=arguments,r=-1,n=q(i.length-e,0),a=Array(n);++r<n;)a[r]=i[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=i[r];return o[e]=s(a),k(t,this,o)}}(t,e,Lt),t+"")}var pt=W?function(t,e){return W(t,"toString",{configurable:!0,enumerable:!1,value:(s=e,function(){return s}),writable:!0});var s}:Lt;function ft(t,e,s,i,r,n){return Et(t)&&Et(e)&&(n.set(e,t),ut(t,e,void 0,ft,n),n.delete(e)),t}function mt(t,e){var s,i,r=t.__data__;return("string"==(i=typeof(s=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==s:null===s)?r["string"==typeof e?"string":"hash"]:r.map}function vt(t,e){var s=function(t,e){return null==t?void 0:t[e]}(t,e);return ct(s)?s:void 0}function gt(t,e){var s=typeof t;return!!(e=null==e?r:e)&&("number"==s||"symbol"!=s&&c.test(t))&&t>-1&&t%1==0&&t<e}function yt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_)}function bt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var kt=function(t){var e=0,s=0;return function(){var i=H(),r=16-(i-s);if(s=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(pt);function wt(t,e){return t===e||t!=t&&e!=e}var xt=lt(function(){return arguments}())?lt:function(t){return Rt(t)&&R.call(t,"callee")&&!z.call(t,"callee")},Pt=Array.isArray;function St(t){return null!=t&&Ot(t.length)&&!_t(t)}var Tt=U||function(){return!1};function _t(t){if(!Et(t))return!1;var e=ot(t);return e==a||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ot(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Et(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Rt(t){return null!=t&&"object"==typeof t}var At=b?function(t){return function(e){return t(e)}}(b):function(t){return Rt(t)&&Ot(t.length)&&!!h[ot(t)]};var jt=dt((function(t){return t.push(void 0,ft),k(Mt,void 0,t)}));function Ct(t){return St(t)?tt(t,!0):ht(t)}var Gt,Mt=(Gt=function(t,e,s,i){ut(t,e,s,i)},dt((function(t,e){var s=-1,i=e.length,r=i>1?e[i-1]:void 0,n=i>2?e[2]:void 0;for(r=Gt.length>3&&"function"==typeof r?(i--,r):void 0,n&&function(t,e,s){if(!Et(s))return!1;var i=typeof e;return!!("number"==i?St(s)&>(e,s.length):"string"==i&&e in s)&&wt(s[e],t)}(e[0],e[1],n)&&(r=i<3?void 0:r,i=1),t=Object(t);++s<i;){var a=e[s];a&&Gt(t,a,s,r)}return t})));function Lt(t){return t}t.exports=jt},3520:t=>{var e=9007199254740991,s="[object Arguments]",i="[object Function]",r="[object GeneratorFunction]",n=/^(?:0|[1-9]\d*)$/;var a,o,l=Object.prototype,c=l.hasOwnProperty,h=l.toString,u=l.propertyIsEnumerable,d=(a=Object.keys,o=Object,function(t){return a(o(t))});function p(t,e){var i=y(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&b(t)}(t)&&c.call(t,"callee")&&(!u.call(t,"callee")||h.call(t)==s)}(t)?function(t,e){for(var s=-1,i=Array(t);++s<t;)i[s]=e(s);return i}(t.length,String):[],r=i.length,n=!!r;for(var a in t)!e&&!c.call(t,a)||n&&("length"==a||g(a,r))||i.push(a);return i}var f,m=function(t,e,s){for(var i=-1,r=Object(t),n=s(t),a=n.length;a--;){var o=n[f?a:++i];if(!1===e(r[o],o,r))break}return t};function v(t){if(s=(e=t)&&e.constructor,i="function"==typeof s&&s.prototype||l,e!==i)return d(t);var e,s,i,r=[];for(var n in Object(t))c.call(t,n)&&"constructor"!=n&&r.push(n);return r}function g(t,s){return!!(s=null==s?e:s)&&("number"==typeof t||n.test(t))&&t>-1&&t%1==0&&t<s}var y=Array.isArray;function b(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?h.call(t):"";return e==i||e==r}(t)}function k(t){return b(t)?p(t):v(t)}function w(t){return t}t.exports=function(t,e){return t&&function(t,e){return t&&m(t,e,k)}(t,"function"==typeof e?e:w)}},372:(t,e,s)=>{"use strict";var i=s(6060);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!i(t)}},3940:(t,e,s)=>{"use strict";var i=s(5618),r={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!i(t)&&hasOwnProperty.call(r,typeof t)}},7205:(t,e,s)=>{"use strict";var i=s(372),r=/^\s*class[\s{/}]/,n=Function.prototype.toString;t.exports=function(t){return!!i(t)&&!r.test(n.call(t))}},6060:(t,e,s)=>{"use strict";var i=s(3940);t.exports=function(t){if(!i(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},5618:t=>{"use strict";t.exports=function(t){return null!=t}},4935:(t,e,s)=>{var i=s(3513);t.exports=i},7921:(t,e,s)=>{var i=s(3072);t.exports=i},347:(t,e,s)=>{var i=s(8744);t.exports=i},9720:(t,e,s)=>{var i=s(6943);t.exports=i},6672:(t,e,s)=>{var i=s(6240),r=s(7265);function n(t,e,s,i){if(i){var n=i[e];if(r(n))n.unhook&&n.unhook(t,e,s);else if("attributes"===e)for(var a in n)t.removeAttribute(a);else if("style"===e)for(var o in n)t.style[o]="";else t[e]="string"==typeof n?"":null}}function a(t,e,s,r,n){var a=s?s[r]:void 0;if("attributes"!==r)if(a&&i(a)&&o(a)!==o(n))t[r]=n;else{i(t[r])||(t[r]={});var l="style"===r?"":void 0;for(var c in n){var h=n[c];t[r][c]=void 0===h?l:h}}else for(var u in n){var d=n[u];void 0===d?t.removeAttribute(u):t.setAttribute(u,d)}}function o(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}t.exports=function(t,e,s){for(var o in e){var l=e[o];void 0===l?n(t,o,l,s):r(l)?(n(t,o,l,s),l.hook&&l.hook(t,o,s?s[o]:void 0)):i(l)?a(t,e,s,o,l):t[o]=l}}},3513:(t,e,s)=>{var i=s(9144),r=s(6672),n=s(5170),a=s(6221),o=s(4097),l=s(6078);t.exports=function t(e,s){var c=s&&s.document||i,h=s?s.warn:null;if(e=l(e).a,o(e))return e.init();if(a(e))return c.createTextNode(e.text);if(!n(e))return h&&h("Item is not a valid virtual dom node",e),null;var u=null===e.namespace?c.createElement(e.tagName):c.createElementNS(e.namespace,e.tagName),d=e.properties;r(u,d);for(var p=e.children,f=0;f<p.length;f++){var m=t(p[f],s);m&&u.appendChild(m)}return u}},8992:t=>{var e={};function s(t,r,n,a,o){if(a=a||{},t){i(n,o,o)&&(a[o]=t);var l=r.children;if(l)for(var c=t.childNodes,h=0;h<r.children.length;h++){o+=1;var u=l[h]||e,d=o+(u.count||0);i(n,o,d)&&s(c[h],u,n,a,o),o=d}}return a}function i(t,e,s){if(0===t.length)return!1;for(var i,r,n=0,a=t.length-1;n<=a;){if(r=t[i=(a+n)/2>>0],n===a)return r>=e&&r<=s;if(r<e)n=i+1;else{if(!(r>s))return!0;a=i-1}}return!1}function r(t,e){return t>e?1:-1}t.exports=function(t,e,i,n){return i&&0!==i.length?(i.sort(r),s(t,e,i,n,0)):{}}},9120:(t,e,s)=>{var i=s(6672),r=s(4097),n=s(8057),a=s(6670);function o(t,e){"function"==typeof e.destroy&&r(e)&&e.destroy(t)}t.exports=function(t,e,s){var r=t.type,l=t.vNode,c=t.patch;switch(r){case n.REMOVE:return function(t,e){var s=t.parentNode;s&&s.removeChild(t);return o(t,e),null}(e,l);case n.INSERT:return function(t,e,s){var i=s.render(e,s);t&&t.appendChild(i);return t}(e,c,s);case n.VTEXT:return function(t,e,s,i){var r;if(3===t.nodeType)t.replaceData(0,t.length,s.text),r=t;else{var n=t.parentNode;r=i.render(s,i),n&&r!==t&&n.replaceChild(r,t)}return r}(e,0,c,s);case n.WIDGET:return function(t,e,s,i){var r,n=a(e,s);r=n?s.update(e,t)||t:i.render(s,i);var l=t.parentNode;l&&r!==t&&l.replaceChild(r,t);n||o(t,e);return r}(e,l,c,s);case n.VNODE:return function(t,e,s,i){var r=t.parentNode,n=i.render(s,i);r&&n!==t&&r.replaceChild(n,t);return n}(e,0,c,s);case n.ORDER:return function(t,e){for(var s,i,r,n=t.childNodes,a={},o=0;o<e.removes.length;o++)s=n[(i=e.removes[o]).from],i.key&&(a[i.key]=s),t.removeChild(s);for(var l=n.length,c=0;c<e.inserts.length;c++)s=a[(r=e.inserts[c]).key],t.insertBefore(s,r.to>=l++?null:n[r.to])}(e,c),e;case n.PROPS:return i(e,c,l.properties),e;case n.THUNK:return function(t,e){t&&e&&t!==e&&t.parentNode&&t.parentNode.replaceChild(e,t);return e}(e,s.patch(e,c,s));default:return e}}},6943:(t,e,s)=>{var i=s(9144),r=s(7362),n=s(3513),a=s(8992),o=s(9120);function l(t,e,s){var r=function(t){var e=[];for(var s in t)"a"!==s&&e.push(Number(s));return e}(e);if(0===r.length)return t;var n=a(t,e.a,r),o=t.ownerDocument;s.document||o===i||(s.document=o);for(var l=0;l<r.length;l++){var h=r[l];t=c(t,n[h],e[h],s)}return t}function c(t,e,s,i){if(!e)return t;var n;if(r(s))for(var a=0;a<s.length;a++)n=o(s[a],e,i),e===t&&(t=n);else n=o(s,e,i),e===t&&(t=n);return t}t.exports=function t(e,s,i){return(i=i||{}).patch=i.patch&&i.patch!==t?i.patch:l,i.render=i.render||n,i.patch(e,s,i)}},6670:(t,e,s)=>{var i=s(4097);t.exports=function(t,e){if(i(t)&&i(e))return"name"in t&&"name"in e?t.id===e.id:t.init===e.init;return!1}},6505:(t,e,s)=>{"use strict";var i=s(8832);function r(t){if(!(this instanceof r))return new r(t);this.value=t}t.exports=r,r.prototype.hook=function(t,e){i(t)[e.substr(3)]=this.value},r.prototype.unhook=function(t,e){i(t)[e.substr(3)]=void 0}},7199:t=>{"use strict";function e(t){if(!(this instanceof e))return new e(t);this.value=t}t.exports=e,e.prototype.hook=function(t,e){t[e]!==this.value&&(t[e]=this.value)}},8744:(t,e,s)=>{"use strict";var i=s(7362),r=s(4282),n=s(4268),a=s(5170),o=s(6221),l=s(4097),c=s(7265),h=s(6741),u=s(1948),d=s(7199),p=s(6505);function f(t,e,s,r){if("string"==typeof t)e.push(new n(t));else if("number"==typeof t)e.push(new n(String(t)));else if(m(t))e.push(t);else{if(!i(t)){if(null==t)return;throw o={foreignObject:t,parentVnode:{tagName:s,properties:r}},(l=new Error).type="virtual-hyperscript.unexpected.virtual-element",l.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+v(o.foreignObject)+".\nThe parent vnode is:\n"+v(o.parentVnode),l.foreignObject=o.foreignObject,l.parentVnode=o.parentVnode,l}for(var a=0;a<t.length;a++)f(t[a],e,s,r)}var o,l}function m(t){return a(t)||o(t)||l(t)||h(t)}function v(t){try{return JSON.stringify(t,null," ")}catch(e){return String(t)}}t.exports=function(t,e,s){var n,a,o,l,h=[];!s&&(v=e,"string"==typeof v||i(v)||m(v))&&(s=e,a={});var v;n=u(t,a=a||e||{}),a.hasOwnProperty("key")&&(o=a.key,a.key=void 0);a.hasOwnProperty("namespace")&&(l=a.namespace,a.namespace=void 0);"INPUT"!==n||l||!a.hasOwnProperty("value")||void 0===a.value||c(a.value)||(a.value=d(a.value));(function(t){for(var e in t)if(t.hasOwnProperty(e)){var s=t[e];if(c(s))continue;"ev-"===e.substr(0,3)&&(t[e]=p(s))}})(a),null!=s&&f(s,h,n,a);return new r(n,a,h,o,l)}},1948:(t,e,s)=>{"use strict";var i=s(6824),r=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,n=/^\.|#/;t.exports=function(t,e){if(!t)return"DIV";var s,a,o,l,c=!e.hasOwnProperty("id"),h=i(t,r),u=null;n.test(h[1])&&(u="DIV");for(l=0;l<h.length;l++)(a=h[l])&&(o=a.charAt(0),u?"."===o?(s=s||[]).push(a.substring(1,a.length)):"#"===o&&c&&(e.id=a.substring(1,a.length)):u=a);s&&(e.className&&s.push(e.className),e.className=s.join(" "));return e.namespace?u:u.toUpperCase()}},6078:(t,e,s)=>{var i=s(5170),r=s(6221),n=s(4097),a=s(6741);function o(t,e){var s=t.vnode;if(s||(s=t.vnode=t.render(e)),!(i(s)||r(s)||n(s)))throw new Error("thunk did not return a valid node");return s}t.exports=function(t,e){var s=t,i=e;a(e)&&(i=o(e,t));a(t)&&(s=o(t,null));return{a:s,b:i}}},6741:t=>{t.exports=function(t){return t&&"Thunk"===t.type}},7265:t=>{t.exports=function(t){return t&&("function"==typeof t.hook&&!t.hasOwnProperty("hook")||"function"==typeof t.unhook&&!t.hasOwnProperty("unhook"))}},5170:(t,e,s)=>{var i=s(9962);t.exports=function(t){return t&&"VirtualNode"===t.type&&t.version===i}},6221:(t,e,s)=>{var i=s(9962);t.exports=function(t){return t&&"VirtualText"===t.type&&t.version===i}},4097:t=>{t.exports=function(t){return t&&"Widget"===t.type}},9962:t=>{t.exports="2"},4282:(t,e,s)=>{var i=s(9962),r=s(5170),n=s(4097),a=s(6741),o=s(7265);t.exports=h;var l={},c=[];function h(t,e,s,i,h){this.tagName=t,this.properties=e||l,this.children=s||c,this.key=null!=i?String(i):void 0,this.namespace="string"==typeof h?h:null;var u,d=s&&s.length||0,p=0,f=!1,m=!1,v=!1;for(var g in e)if(e.hasOwnProperty(g)){var y=e[g];o(y)&&y.unhook&&(u||(u={}),u[g]=y)}for(var b=0;b<d;b++){var k=s[b];r(k)?(p+=k.count||0,!f&&k.hasWidgets&&(f=!0),!m&&k.hasThunks&&(m=!0),v||!k.hooks&&!k.descendantHooks||(v=!0)):!f&&n(k)?"function"==typeof k.destroy&&(f=!0):!m&&a(k)&&(m=!0)}this.count=d+p,this.hasWidgets=f,this.hasThunks=m,this.hooks=u,this.descendantHooks=v}h.prototype.version=i,h.prototype.type="VirtualNode"},8057:(t,e,s)=>{var i=s(9962);function r(t,e,s){this.type=Number(t),this.vNode=e,this.patch=s}r.NONE=0,r.VTEXT=1,r.VNODE=2,r.WIDGET=3,r.PROPS=4,r.ORDER=5,r.INSERT=6,r.REMOVE=7,r.THUNK=8,t.exports=r,r.prototype.version=i,r.prototype.type="VirtualPatch"},4268:(t,e,s)=>{var i=s(9962);function r(t){this.text=String(t)}t.exports=r,r.prototype.version=i,r.prototype.type="VirtualText"},9973:(t,e,s)=>{var i=s(6240),r=s(7265);function n(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}t.exports=function t(e,s){var a;for(var o in e){o in s||((a=a||{})[o]=void 0);var l=e[o],c=s[o];if(l!==c)if(i(l)&&i(c))if(n(c)!==n(l))(a=a||{})[o]=c;else if(r(c))(a=a||{})[o]=c;else{var h=t(l,c);h&&((a=a||{})[o]=h)}else(a=a||{})[o]=c}for(var u in s)u in e||((a=a||{})[u]=s[u]);return a}},3072:(t,e,s)=>{var i=s(7362),r=s(8057),n=s(5170),a=s(6221),o=s(4097),l=s(6741),c=s(6078),h=s(9973);function u(t,e){var s={a:t};return d(t,e,s,0),s}function d(t,e,s,i){if(t!==e){var c=s[i],u=!1;if(l(t)||l(e))m(t,e,s,i);else if(null==e)o(t)||(p(t,s,i),c=s[i]),c=b(c,new r(r.REMOVE,t,e));else if(n(e))if(n(t))if(t.tagName===e.tagName&&t.namespace===e.namespace&&t.key===e.key){var f=h(t.properties,e.properties);f&&(c=b(c,new r(r.PROPS,t,f))),c=function(t,e,s,i,a){for(var o=t.children,l=function(t,e){var s=y(e),i=s.keys,r=s.free;if(r.length===e.length)return{children:e,moves:null};var n=y(t),a=n.keys;if(n.free.length===t.length)return{children:e,moves:null};for(var o=[],l=0,c=r.length,h=0,u=0;u<t.length;u++){var d,p=t[u];p.key?i.hasOwnProperty(p.key)?(d=i[p.key],o.push(e[d])):(d=u-h++,o.push(null)):l<c?(d=r[l++],o.push(e[d])):(d=u-h++,o.push(null))}for(var f=l>=r.length?e.length:r[l],m=0;m<e.length;m++){var v=e[m];v.key?a.hasOwnProperty(v.key)||o.push(v):m>=f&&o.push(v)}for(var b,k=o.slice(),w=0,x=[],P=[],S=0;S<e.length;){var T=e[S];for(b=k[w];null===b&&k.length;)x.push(g(k,w,null)),b=k[w];b&&b.key===T.key?(w++,S++):T.key?(b&&b.key&&i[b.key]!==S+1?(x.push(g(k,w,b.key)),(b=k[w])&&b.key===T.key?w++:P.push({key:T.key,to:S})):P.push({key:T.key,to:S}),S++):b&&b.key&&x.push(g(k,w,b.key))}for(;w<k.length;)b=k[w],x.push(g(k,w,b&&b.key));if(x.length===h&&!P.length)return{children:o,moves:null};return{children:o,moves:{removes:x,inserts:P}}}(o,e.children),c=l.children,h=o.length,u=c.length,p=h>u?h:u,f=0;f<p;f++){var m=o[f],v=c[f];a+=1,m?d(m,v,s,a):v&&(i=b(i,new r(r.INSERT,null,v))),n(m)&&m.count&&(a+=m.count)}l.moves&&(i=b(i,new r(r.ORDER,t,l.moves)));return i}(t,e,s,c,i)}else c=b(c,new r(r.VNODE,t,e)),u=!0;else c=b(c,new r(r.VNODE,t,e)),u=!0;else a(e)?a(t)?t.text!==e.text&&(c=b(c,new r(r.VTEXT,t,e))):(c=b(c,new r(r.VTEXT,t,e)),u=!0):o(e)&&(o(t)||(u=!0),c=b(c,new r(r.WIDGET,t,e)));c&&(s[i]=c),u&&p(t,s,i)}}function p(t,e,s){v(t,e,s),f(t,e,s)}function f(t,e,s){if(o(t))"function"==typeof t.destroy&&(e[s]=b(e[s],new r(r.REMOVE,t,null)));else if(n(t)&&(t.hasWidgets||t.hasThunks))for(var i=t.children,a=i.length,c=0;c<a;c++){var h=i[c];f(h,e,s+=1),n(h)&&h.count&&(s+=h.count)}else l(t)&&m(t,null,e,s)}function m(t,e,s,i){var n=c(t,e),a=u(n.a,n.b);(function(t){for(var e in t)if("a"!==e)return!0;return!1})(a)&&(s[i]=new r(r.THUNK,null,a))}function v(t,e,s){if(n(t)){if(t.hooks&&(e[s]=b(e[s],new r(r.PROPS,t,function(t){var e={};for(var s in t)e[s]=void 0;return e}(t.hooks)))),t.descendantHooks||t.hasThunks)for(var i=t.children,a=i.length,o=0;o<a;o++){var c=i[o];v(c,e,s+=1),n(c)&&c.count&&(s+=c.count)}}else l(t)&&m(t,null,e,s)}function g(t,e,s){return t.splice(e,1),{from:e,key:s}}function y(t){for(var e={},s=[],i=t.length,r=0;r<i;r++){var n=t[r];n.key?e[n.key]=r:s.push(r)}return{keys:e,free:s}}function b(t,e){return t?(i(t)?t.push(e):t=[t,e],t):e}t.exports=u},4991:t=>{"use strict";function e(t){for(var e,s=1/0,i=-1/0,r=0,n=t.length;r<n;r++)s>(e=t[r])&&(s=e),i<e&&(i=e);return{min:s,max:i}}function s(t,e){var s=Math.pow(2,e-1),i=t<0?t*s:t*(s-1);return Math.max(-s,Math.min(s-1,i))}function i(t,i,n){var a,o,l,c,h,u,d=t.length,p=Math.ceil(d/i),f=r(n,2*p);for(a=0;a<p;a++)o=a*i,l=(a+1)*i>d?d:(a+1)*i,h=s((u=e(t.subarray(o,l))).min,n),c=s(u.max,n),f[2*a]=h,f[2*a+1]=c;return f}function r(t,e){return new(new Function(`return Int${t}Array`)())(e)}function n(t,e){return"number"==typeof t?t:e}t.exports=function(t,e,s,a,o,l){if(e=n(e,1e3),l=n(l,16),null==s&&(s=!0),[8,16,32].indexOf(l)<0)throw new Error("Invalid number of bits specified for peaks.");var c,h,u=t.numberOfChannels,d=[];if(a=n(a,0),o=n(o,t.length),void 0===t.subarray)for(c=0;c<u;c++)h=t.getChannelData(c).subarray(a,o),d.push(i(h,e,l));else d.push(i(t.subarray(a,o),e,l));return s&&d.length>1&&(d=function(t,e){var s,i,n=t.length,a=1/n,o=t[0].length/2,l=0,c=0,h=r(e,2*o);for(c=0;c<o;c++){for(s=0,i=0,l=0;l<n;l++)s+=a*t[l][2*c],i+=a*t[l][2*c+1];h[2*c]=s,h[2*c+1]=i}return[h]}(d,l)),{length:d[0].length/2,data:d,bits:l}}},7362:t=>{var e=Array.isArray,s=Object.prototype.toString;t.exports=e||function(t){return"[object Array]"===s.call(t)}},5893:()=>{}},e={};function s(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i](n,n.exports,s),n.loaded=!0,n.exports}s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";s.r(i),s.d(i,{default:()=>lt,init:()=>ot});var t=s(2098),e=s.n(t),r=s(4935),n=s.n(r),a=s(8370),o=s.n(a),l=s(347),c=s.n(l),h=s(7921),u=s.n(h),d=s(9720),p=s.n(d),f=s(849),m=s.n(f);function v(t,e){return Math.ceil(t*e)}function g(t,e,s){return t*e/s}function y(t,e,s){return Math.ceil(t*s/e)}const b=class{constructor(t,e,s=o()()){this.src=t,this.ac=e,this.audioRequestState=0,this.ee=s}setStateChange(t){this.audioRequestState=t,this.ee.emit("audiorequeststatechange",this.audioRequestState,this.src)}fileProgress(t){let e=0;0===this.audioRequestState&&this.setStateChange(1),t.lengthComputable&&(e=t.loaded/t.total*100),this.ee.emit("loadprogress",e,this.src)}fileLoad(t){const e=t.target.response||t.target.result;return this.setStateChange(2),new Promise(((t,s)=>{this.ac.decodeAudioData(e,(e=>{this.audioBuffer=e,this.setStateChange(3),t(e)}),(t=>{s(null===t?Error("MediaDecodeAudioDataUnknownContentType"):t)}))}))}},k=class extends b{load(){return new Promise(((t,e)=>{if(this.src.type.match(/audio.*/)||this.src.type.match(/video\/ogg/)){const s=new FileReader;s.readAsArrayBuffer(this.src),s.addEventListener("progress",(t=>{super.fileProgress(t)})),s.addEventListener("load",(s=>{super.fileLoad(s).then((e=>{t(e)})).catch(e)})),s.addEventListener("error",e)}else e(Error(`Unsupported file type ${this.src.type}`))}))}};class w extends b{load(){return Promise.resolve(this.src)}}const x=class extends b{load(){return new Promise(((t,e)=>{const s=new XMLHttpRequest;s.open("GET",this.src,!0),s.responseType="arraybuffer",s.send(),s.addEventListener("progress",(t=>{super.fileProgress(t)})),s.addEventListener("load",(s=>{super.fileLoad(s).then((e=>{t(e)})).catch(e)})),s.addEventListener("error",(()=>{e(Error(`Track ${this.src} failed to load`))}))}))}},P=class{static createLoader(t,e,s){if(t instanceof Blob)return new k(t,e,s);if(t instanceof AudioBuffer)return new w(t,e,s);if("string"==typeof t)return new x(t,e,s);throw new Error("Unsupported src type")}},S=class{constructor(t){this.playlist=t}hook(t){const e=this.playlist;if(!e.isScrolling){const s=t;if(e.isAutomaticScroll){const s=t.getBoundingClientRect(),i=e.controls.show?e.controls.width:0,r=g(s.width-i,e.samplesPerPixel,e.sampleRate),n=e.isPlaying()?e.playbackSeconds:e.getTimeSelection().start;(n<e.scrollLeft||n>=e.scrollLeft+r)&&(e.scrollLeft=Math.min(n,e.duration-r))}const i=y(e.scrollLeft,e.samplesPerPixel,e.sampleRate);s.scrollLeft=i}}},T=class{constructor(t,e,s,i,r){this.tickInfo=t,this.offset=e,this.samplesPerPixel=s,this.duration=i,this.colors=r}hook(t,e,s){if(void 0!==s&&s.offset===this.offset&&s.duration===this.duration&&s.samplesPerPixel===this.samplesPerPixel)return;const i=t.width,r=t.height,n=t.getContext("2d");n.clearRect(0,0,i,r),n.fillStyle=this.colors.timeColor,Object.keys(this.tickInfo).forEach((t=>{const e=this.tickInfo[t],s=r-e;n.fillRect(t,s,1,e)}))}};class _{constructor(t,e,s,i,r=0,n){this.duration=t,this.offset=e,this.samplesPerPixel=s,this.sampleRate=i,this.marginLeft=r,this.colors=n,this.timeinfo={2e4:{marker:3e4,bigStep:1e4,smallStep:5e3,secondStep:5},12e3:{marker:15e3,bigStep:5e3,smallStep:1e3,secondStep:1},1e4:{marker:1e4,bigStep:5e3,smallStep:1e3,secondStep:1},5e3:{marker:5e3,bigStep:1e3,smallStep:500,secondStep:.5},2500:{marker:2e3,bigStep:1e3,smallStep:500,secondStep:.5},1500:{marker:2e3,bigStep:1e3,smallStep:200,secondStep:.2},700:{marker:1e3,bigStep:500,smallStep:100,secondStep:.1}}}getScaleInfo(t){let e=Object.keys(this.timeinfo).map((t=>parseInt(t,10)));e=e.sort(((t,e)=>t-e));for(let s=0;s<e.length;s+=1)if(t<=e[s])return this.timeinfo[e[s]];return this.timeinfo[e[0]]}static formatTime(t){const e=t/1e3;let s=e%60;const i=(e-s)/60;return s<10&&(s=`0${s}`),`${i}:${s}`}render(){const t=y(this.duration,this.samplesPerPixel,this.sampleRate),e=this.sampleRate/this.samplesPerPixel,s=y(this.offset,this.samplesPerPixel,this.sampleRate),i=this.getScaleInfo(this.samplesPerPixel),r={},n=[],a=t+s;let o=0;for(let t=0;t<a;t+=e*i.secondStep){const e=Math.floor(t),a=e-s;e>=s&&(i.marker&&o%i.marker==0?(n.push(c()("div.time",{attributes:{style:`position: absolute; left: ${a}px;`}},[_.formatTime(o)])),r[a]=10):i.bigStep&&o%i.bigStep==0?r[a]=5:i.smallStep&&o%i.smallStep==0&&(r[a]=2)),o+=1e3*i.secondStep}return c()("div.playlist-time-scale",{attributes:{style:`position: relative; left: 0; right: 0; margin-left: ${this.marginLeft}px;`}},[n,c()("canvas",{attributes:{width:t,height:30,style:"position: absolute; left: 0; right: 0; top: 0; bottom: 0;"},hook:new T(r,this.offset,this.samplesPerPixel,this.duration,this.colors)})])}}const O=_;var E,R=s(1730),A=s.n(R),j=s(3520),C=s.n(j),G=new Uint8Array(16);function M(){if(!E&&!(E="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E(G)}const L=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const I=function(t){return"string"==typeof t&&L.test(t)};for(var F=[],$=0;$<256;++$)F.push(($+256).toString(16).substr(1));const D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=(F[t[e+0]]+F[t[e+1]]+F[t[e+2]]+F[t[e+3]]+"-"+F[t[e+4]]+F[t[e+5]]+"-"+F[t[e+6]]+F[t[e+7]]+"-"+F[t[e+8]]+F[t[e+9]]+"-"+F[t[e+10]]+F[t[e+11]]+F[t[e+12]]+F[t[e+13]]+F[t[e+14]]+F[t[e+15]]).toLowerCase();if(!I(s))throw TypeError("Stringified UUID is invalid");return s};const z=function(t,e,s){var i=(t=t||{}).random||(t.rng||M)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){s=s||0;for(var r=0;r<16;++r)e[s+r]=i[r];return e}return D(i)};var N=s(4991),V=s.n(N),W=s(1114);const U={cursor:class{constructor(t){this.track=t}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}click(t){t.preventDefault();const e=g(t.offsetX,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",e,e,this.track)}static getClass(){return".state-cursor"}static getEvents(){return["click"]}},select:class{constructor(t){this.track=t,this.active=!1}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}emitSelection(t){const e=Math.min(t,this.startX),s=Math.max(t,this.startX),i=g(e,this.samplesPerPixel,this.sampleRate),r=g(s,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",i,r,this.track)}complete(t){this.emitSelection(t),this.active=!1}mousedown(t){t.preventDefault(),this.active=!0,this.startX=t.offsetX;const e=g(this.startX,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",e,e,this.track)}mousemove(t){this.active&&(t.preventDefault(),this.emitSelection(t.offsetX))}mouseup(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}mouseleave(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}static getClass(){return".state-select"}static getEvents(){return["mousedown","mousemove","mouseup","mouseleave"]}},shift:class{constructor(t){this.track=t,this.active=!1}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}emitShift(t){const e=g(t-this.prevX,this.samplesPerPixel,this.sampleRate);this.prevX=t,this.track.ee.emit("shift",e,this.track)}complete(t){this.emitShift(t),this.active=!1}mousedown(t){t.preventDefault(),this.active=!0,this.el=t.target,this.prevX=t.offsetX}mousemove(t){this.active&&(t.preventDefault(),this.emitShift(t.offsetX))}mouseup(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}mouseleave(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}static getClass(){return".state-shift"}static getEvents(){return["mousedown","mousemove","mouseup","mouseleave"]}},fadein:class{constructor(t){this.track=t}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}click(t){const e=g(t.offsetX,this.samplesPerPixel,this.sampleRate);e>this.track.getStartTime()&&e<this.track.getEndTime()&&this.track.ee.emit("fadein",e-this.track.getStartTime(),this.track)}static getClass(){return".state-fadein"}static getEvents(){return["click"]}},fadeout:class{constructor(t){this.track=t}setup(t,e){this.samplesPerPixel=t,this.sampleRate=e}click(t){const e=g(t.offsetX,this.samplesPerPixel,this.sampleRate);e>this.track.getStartTime()&&e<this.track.getEndTime()&&this.track.ee.emit("fadeout",this.track.getEndTime()-e,this.track)}static getClass(){return".state-fadeout"}static getEvents(){return["click"]}}};class q{constructor(t,e,s,i,r,n,a,o){this.peaks=t,this.offset=e,this.color=i,this.bits=s,this.scale=r,this.height=n,this.barWidth=a,this.barGap=o}static drawFrame(t,e,s,i,r,n,a){const o=Math.abs(i*e),l=Math.abs(r*e);t.fillRect(s,0,n,e-l),t.fillRect(s,e+o,n,e-o),0!==a&&t.fillRect(s+n,0,a,2*e)}hook(t,e,s){if(void 0!==s&&s.peaks===this.peaks&&s.scale===this.scale&&s.height===this.height)return;const i=this.scale,r=t.width/i,n=t.getContext("2d"),a=t.height/i/2,o=2**(this.bits-1),l=this.barWidth,c=this.barGap,h=l+c;n.clearRect(0,0,t.width,t.height),n.save(),n.fillStyle=this.color,n.scale(i,i);for(let t=0;t<r;t+=h){const e=this.peaks[2*(t+this.offset)]/o,s=this.peaks[2*(t+this.offset)+1]/o;q.drawFrame(n,a,t,e,s,l,c)}n.restore()}}const H=q;var B=s(6226);class X{constructor(t,e,s,i){this.type=t,this.shape=e,this.duration=s,this.samplesPerPixel=i}static createCurve(t,e,s){let i,r;switch(e){case W.Y1:i=1;break;case W.h7:i=-1;break;default:throw new Error("Unsupported fade type.")}switch(t){case W._h:r=(0,B.sCurve)(s,i);break;case W.t$:r=(0,B.linear)(s,i);break;case W.Jl:r=(0,B.exponential)(s,i);break;case W.Hp:r=(0,B.logarithmic)(s,10,i);break;default:throw new Error("Unsupported fade shape")}return r}hook(t,e,s){if(void 0!==s&&s.shape===this.shape&&s.type===this.type&&s.duration===this.duration&&s.samplesPerPixel===this.samplesPerPixel)return;const i=t.getContext("2d"),r=t.width,n=t.height,a=X.createCurve(this.shape,this.type,r),o=a.length;let l=n-a[0]*n;i.clearRect(0,0,t.width,t.height),i.save(),i.strokeStyle="black",i.beginPath(),i.moveTo(0,l);for(let t=1;t<o;t+=1)l=n-a[t]*n,i.lineTo(t,l);i.stroke(),i.restore()}}const Y=X,Z=class{constructor(t){this.gain=t}hook(t){t.value=100*this.gain,t.title=`${Math.round(100*this.gain)}% volume`}},J=class{constructor(t){this.stereoPan=t}hook(t){let e;t.value=100*this.stereoPan,e=0===this.stereoPan?"Center":this.stereoPan<0?"Left":"Right";const s=`${Math.abs(Math.round(100*this.stereoPan))}% `;t.title=`Pan: ${0!==this.stereoPan?s:""}${e}`}},K=class{constructor(){this.name="Untitled",this.customClass=void 0,this.waveOutlineColor=void 0,this.gain=1,this.fades={},this.peakData={type:"WebAudio",mono:!1},this.cueIn=0,this.cueOut=0,this.duration=0,this.startTime=0,this.endTime=0,this.stereoPan=0}setEventEmitter(t){this.ee=t}setName(t){this.name=t}setCustomClass(t){this.customClass=t}setWaveOutlineColor(t){this.waveOutlineColor=t}setCues(t,e){if(e<t)throw new Error("cue out cannot be less than cue in");this.cueIn=t,this.cueOut=e,this.duration=this.cueOut-this.cueIn,this.endTime=this.startTime+this.duration}trim(t,e){const s=this.getStartTime(),i=this.getEndTime(),r=this.cueIn-s;if(s<=t&&i>=t||s<=e&&i>=e){const n=t<s?s:t,a=e>i?i:e;this.setCues(n+r,a+r),t>s&&this.setStartTime(t)}}setStartTime(t){this.startTime=t,this.endTime=t+this.duration}setPlayout(t){this.playout=t}setOfflinePlayout(t){this.offlinePlayout=t}setEnabledStates(t={}){this.enabledStates=A()({},{cursor:!0,fadein:!0,fadeout:!0,select:!0,shift:!0},t)}setFadeIn(t,e="logarithmic"){if(t>this.duration)throw new Error("Invalid Fade In");const s={shape:e,start:0,end:t};this.fadeIn&&(this.removeFade(this.fadeIn),this.fadeIn=void 0),this.fadeIn=this.saveFade(W.Y1,s.shape,s.start,s.end)}setFadeOut(t,e="logarithmic"){if(t>this.duration)throw new Error("Invalid Fade Out");const s={shape:e,start:this.duration-t,end:this.duration};this.fadeOut&&(this.removeFade(this.fadeOut),this.fadeOut=void 0),this.fadeOut=this.saveFade(W.h7,s.shape,s.start,s.end)}saveFade(t,e,s,i){const r=z();return this.fades[r]={type:t,shape:e,start:s,end:i},r}removeFade(t){delete this.fades[t]}setBuffer(t){this.buffer=t}setPeakData(t){this.peakData=t}calculatePeaks(t,e){const s=v(this.cueIn,e),i=v(this.cueOut,e);this.setPeaks(V()(this.buffer,t,this.peakData.mono,s,i))}setPeaks(t){this.peaks=t}setState(t){if(this.state=t,this.state&&this.enabledStates[this.state]){const t=U[this.state];this.stateObj=new t(this)}else this.stateObj=void 0}getStartTime(){return this.startTime}getEndTime(){return this.endTime}getDuration(){return this.duration}isPlaying(){return this.playout.isPlaying()}setShouldPlay(t){this.playout.setShouldPlay(t)}setGainLevel(t){this.gain=t,this.playout.setVolumeGainLevel(t)}setMasterGainLevel(t){this.playout.setMasterGainLevel(t)}setStereoPanValue(t){this.stereoPan=t,this.playout.setStereoPanValue(t)}setEffects(t){this.effectsGraph=t,this.playout.setEffects(t)}schedulePlay(t,e,s,i){let r,n,a=t,o=s?s-e:void 0;const l=A()({},{shouldPlay:!0,masterGain:1,isOffline:!1},i),c=l.isOffline?this.offlinePlayout:this.playout;if(this.endTime<=e||o&&e+o<this.startTime)return Promise.resolve();this.startTime>=e?(r=0,a+=this.startTime-e,s?(o-=this.startTime-e,n=Math.min(o,this.duration)):n=this.duration):(r=e-this.startTime,n=s?Math.min(o,this.duration-r):this.duration-r),r+=this.cueIn;const h=e-this.startTime,u=c.setUpSource();return C()(this.fades,(e=>{let s,i;if(h<e.end)switch(h<=e.start?(s=t+(e.start-h),i=e.end-e.start):h>e.start&&h<e.end&&(s=t-(h-e.start),i=e.end-e.start),e.type){case W.Y1:c.applyFadeIn(s,i,e.shape);break;case W.h7:c.applyFadeOut(s,i,e.shape);break;default:throw new Error("Invalid fade type saved on track.")}})),c.setVolumeGainLevel(this.gain),c.setShouldPlay(l.shouldPlay),c.setMasterGainLevel(l.masterGain),c.setStereoPanValue(this.stereoPan),c.play(a,r,n),u}scheduleStop(t=0){this.playout.stop(t)}renderOverlay(t){const e={attributes:{style:`position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: ${y(t.playlistLength,t.resolution,t.sampleRate)}px; z-index: 9;`}};let s="";if(this.stateObj){this.stateObj.setup(t.resolution,t.sampleR