text: /*! For license information please see waveform-playlist.js.LICENSE.txt */
  var WaveformPlaylist;(()=>{var t={8098:t=>{var e,n,r;t.exports=(n=String.prototype.split,r=/()??/.exec("")[1]===e,function(t,i,o){if("[object RegExp]"!==Object.prototype.toString.call(i))return n.call(t,i,o);var a,s,u,c,l=[],f=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),h=0;for(i=new RegExp(i.source,f+"g"),t+="",r||(a=new RegExp("^"+i.source+"$(?!\\s)",f)),o=o===e?-1>>>0:o>>>0;(s=i.exec(t))&&!((u=s.index+s[0].length)>h&&(l.push(t.slice(h,s.index)),!r&&s.length>1&&s[0].replace(a,(function(){for(var t=1;t<arguments.length-2;t++)arguments[t]===e&&(s[t]=e)})),s.length>1&&s.index<t.length&&Array.prototype.push.apply(l,s.slice(1)),c=s[0].length,h=u,l.length>=o));)i.lastIndex===s.index&&i.lastIndex++;return h===t.length?!c&&i.test("")||l.push(""):l.push(t.slice(h)),l.length>o?l.slice(0,o):l})},7296:(t,e,n)=>{"use strict";var r=n(1102),i=n(2307),o=n(4339),a=n(3957),s=n(3246);(t.exports=function(t,e){var n,i,u,c,l;return arguments.length<2||"string"!=typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=s.call(t,"c"),i=s.call(t,"e"),u=s.call(t,"w")):(n=u=!0,i=!1),l={value:e,configurable:n,enumerable:i,writable:u},c?o(a(c),l):l}).gs=function(t,e,n){var u,c,l,f;return"string"!=typeof t?(l=n,n=e,e=t,t=null):l=arguments[3],r(e)?i(e)?r(n)?i(n)||(l=n,n=void 0):n=void 0:(l=e,e=n=void 0):e=void 0,r(t)?(u=s.call(t,"c"),c=s.call(t,"e")):(u=!0,c=!1),f={get:e,set:n,configurable:u,enumerable:c},l?o(a(l),f):f}},817:t=>{"use strict";t.exports=function(){}},4339:(t,e,n)=>{"use strict";t.exports=n(1994)()?Object.assign:n(963)},1994: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")}},963:(t,e,n)=>{"use strict";var r=n(3450),i=n(1836),o=Math.max;t.exports=function(t,e){var n,a,s,u=o(arguments.length,2);for(t=Object(i(t)),s=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},a=1;a<u;++a)r(e=arguments[a]).forEach(s);if(void 0!==n)throw n;return t}},8349:(t,e,n)=>{"use strict";var r=n(817)();t.exports=function(t){return t!==r&&null!==t}},3450:(t,e,n)=>{"use strict";t.exports=n(3446)()?Object.keys:n(9177)},3446:t=>{"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},9177:(t,e,n)=>{"use strict";var r=n(8349),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},3957:(t,e,n)=>{"use strict";var r=n(8349),i=Array.prototype.forEach,o=Object.create,a=function(t,e){var n;for(n in t)e[n]=t[n]};t.exports=function(t){var e=o(null);return i.call(arguments,(function(t){r(t)&&a(Object(t),e)})),e}},79:t=>{"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},1836:(t,e,n)=>{"use strict";var r=n(8349);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},3246:(t,e,n)=>{"use strict";t.exports=n(8711)()?String.prototype.contains:n(2370)},8711:t=>{"use strict";var e="razdwatrzy";t.exports=function(){return"function"==typeof e.contains&&!0===e.contains("dwa")&&!1===e.contains("foo")}},2370:t=>{"use strict";var e=String.prototype.indexOf;t.exports=function(t){return e.call(this,t,arguments[1])>-1}},9401:(t,e,n)=>{"use strict";n(8625)("ev-store","7");var r="__EV_STORE_KEY@7";t.exports=function(t){var e=t[r];return e||(e=t[r]={}),e}},8709:(t,e,n)=>{"use strict";var r,i,o,a,s,u,c,l=n(7296),f=n(79),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,v=Object.defineProperty,y=Object.defineProperties,m=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var n,i;return f(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},s={on:r=function(t,e){var n;return f(e),m.call(this,"__ee__")?n=this.__ee__:(n=g.value=d(null),v(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i,off:o=function(t,e){var n,r,i,o;if(f(e),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:a=function(t){var e,n,r,i,o;if(m.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)h.call(r,this,o)}else switch(arguments.length){case 1:p.call(i,this);break;case 2:p.call(i,this,arguments[1]);break;case 3:p.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];h.call(i,this,o)}}},u={on:l(r),once:l(i),off:l(o),emit:l(a)},c=y({},u),t.exports=e=function(t){return null==t?d(c):y(Object(t),u)},e.methods=s},4571:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.linear=function(t,e){var n,r,i=new Float32Array(t),o=t-1;for(n=0;n<t;n++)r=n/o,i[n]=e>0?r:1-r;return i},e.exponential=function(t,e){var n,r,i=new Float32Array(t),o=t-1;for(n=0;n<t;n++)r=n/o,i[e>0?n:t-1-n]=Math.exp(2*r-1)/Math.exp(1);return i},e.sCurve=function(t,e){var n,r=new Float32Array(t),i=e>0?Math.PI/2:-Math.PI/2;for(n=0;n<t;++n)r[n]=Math.sin(Math.PI*n/t-i)/2+.5;return r},e.logarithmic=function(t,e,n){var r,i=new Float32Array(t),o=0;for(r=0;r<t;r++)o=r/t,i[n>0?r:t-1-r]=Math.log(1+e*o)/Math.log(1+e);return i}},9304:(t,e,n)=>{"use strict";e.h7=e.Y1=e.Hp=e.Jl=e.t$=e._h=void 0,e.L7=function(t,e,n,r){switch(e){case i:u.call(t,n,r);break;case o:l.call(t,n,r);break;case a:h.call(t,n,r);break;case s:d.call(t,n,r);break;default:throw new Error("Unsupported Fade type")}},e.Mt=function(t,e,n,r){switch(e){case i:c.call(t,n,r);break;case o:f.call(t,n,r);break;case a:p.call(t,n,r);break;case s:v.call(t,n,r);break;default:throw new Error("Unsupported Fade type")}};var r=n(4571),i=e._h="sCurve",o=e.t$="linear",a=e.Jl="exponential",s=e.Hp="logarithmic";function u(t,e){var n=(0,r.sCurve)(1e4,1);this.setValueCurveAtTime(n,t,e)}function c(t,e){var n=(0,r.sCurve)(1e4,-1);this.setValueCurveAtTime(n,t,e)}function l(t,e){this.linearRampToValueAtTime(0,t),this.linearRampToValueAtTime(1,t+e)}function f(t,e){this.linearRampToValueAtTime(1,t),this.linearRampToValueAtTime(0,t+e)}function h(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 d(t,e){var n=(0,r.logarithmic)(1e4,10,1);this.setValueCurveAtTime(n,t,e)}function v(t,e){var n=(0,r.logarithmic)(1e4,10,-1);this.setValueCurveAtTime(n,t,e)}e.Y1="FadeIn",e.h7="FadeOut"},474:(t,e,n)=>{var r,i=void 0!==n.g?n.g:"undefined"!=typeof window?window:{},o=n(444);"undefined"!=typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=o),t.exports=r},7051:(t,e,n)=>{"use strict";var r="undefined"!=typeof window?window:void 0!==n.g?n.g:{};t.exports=function(t,e){return t in r?r[t]:(r[t]=e,e)}},8625:(t,e,n)=>{"use strict";var r=n(7051);t.exports=function(t,e,n){var i="__INDIVIDUAL_ONE_VERSION_"+t,o=r(i+"_ENFORCE_SINGLETON",e);if(o!==e)throw new Error("Can only have one copy of "+t+".\nYou already have version "+o+" installed.\nThis means you cannot install version "+e);return r(i,n)}},1072:(t,e,n)=>{var r=!!(n.g===n.g.window&&n.g.URL&&n.g.Blob&&n.g.Worker);function i(t,e){var i,o=this;if(e=e||{},r)return i=t.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],new n.g.Worker(n.g.URL.createObjectURL(new n.g.Blob([i],{type:"text/javascript"})));this.self=e,this.self.postMessage=function(t){setTimeout((function(){o.onmessage({data:t})}),0)},setTimeout(t.bind(e,e),0)}i.prototype.postMessage=function(t){var e=this;setTimeout((function(){e.self.onmessage({data:t})}),0)},t.exports=i},4436:t=>{"use strict";t.exports=function(t){return"object"==typeof t&&null!==t}},2473:t=>{var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var i,o,a=Object.prototype,s=a.hasOwnProperty,u=a.toString,c=a.propertyIsEnumerable,l=(i=Object.keys,o=Object,function(t){return i(o(t))}),f=Math.max,h=!c.call({valueOf:1},"valueOf");function p(t,e,n){var r=t[e];s.call(t,e)&&y(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function d(t,r){return!!(r=null==r?e:r)&&("number"==typeof t||n.test(t))&&t>-1&&t%1==0&&t<r}function v(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||a)}function y(t,e){return t===e||t!=t&&e!=e}var m=Array.isArray;function g(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(t){var e=b(t)?u.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}function b(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var k,w=(k=function(t,e){if(h||v(e)||g(e))!function(t,e,n,r){n||(n={});for(var i=-1,o=e.length;++i<o;){var a=e[i];p(n,a,t[a])}}(e,function(t){return g(t)?function(t,e){var n=m(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&g(t)}(t)&&s.call(t,"callee")&&(!c.call(t,"callee")||"[object Arguments]"==u.call(t))}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!s.call(t,o)||i&&("length"==o||d(o,r))||n.push(o);return n}(t):function(t){if(!v(t))return l(t);var e=[];for(var n in Object(t))s.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}(e),t);else for(var n in e)s.call(e,n)&&p(t,n,e[n])},function(t,e){return e=f(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=f(n.length-e,0),a=Array(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=a,r(t,this,s)}}((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=k.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(t,e,n){if(!b(n))return!1;var r=typeof e;return!!("number"==r?g(n)&&d(e,n.length):"string"==r&&e in n)&&y(n[e],t)}(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var a=e[n];a&&k(t,a)}return t})));t.exports=w},6146:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",a="[object Function]",s="[object Object]",u=/^\[object .+?Constructor\]$/,c=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[o]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[a]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,p=f||h||Function("return this")(),d=e&&!e.nodeType&&e,v=d&&t&&!t.nodeType&&t,y=v&&v.exports===d,m=y&&f.process,g=function(){try{return v&&v.require&&v.require("util").types||m&&m.binding&&m.binding("util")}catch(t){}}(),b=g&&g.isTypedArray;function k(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var w,P,x,T=Array.prototype,S=Function.prototype,O=Object.prototype,_=p["__core-js_shared__"],E=S.toString,R=O.hasOwnProperty,j=(w=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",C=O.toString,A=E.call(Object),L=RegExp("^"+E.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=y?p.Buffer:void 0,I=p.Symbol,F=p.Uint8Array,G=(M&&M.allocUnsafe,P=Object.getPrototypeOf,x=Object,function(t){return P(x(t))}),D=Object.create,z=O.propertyIsEnumerable,V=T.splice,N=I?I.toStringTag:void 0,W=function(){try{var t=ct(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),U=M?M.isBuffer:void 0,q=Math.max,B=Date.now,H=ct(p,"Map"),X=ct(Object,"create"),$=function(){function t(){}return function(e){if(!wt(e))return{};if(D)return D(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Y(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Z(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function J(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function K(t){var e=this.__data__=new Z(t);this.size=e.size}function Q(t,e,n){(void 0!==n&&!dt(t[e],n)||void 0===n&&!(e in t))&&nt(t,e,n)}function tt(t,e,n){var r=t[e];R.call(t,e)&&dt(r,n)&&(void 0!==n||e in t)||nt(t,e,n)}function et(t,e){for(var n=t.length;n--;)if(dt(t[n][0],e))return n;return-1}function nt(t,e,n){"__proto__"==e&&W?W(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}Y.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},Y.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Y.prototype.get=function(t){var e=this.__data__;if(X){var n=e[t];return n===r?void 0:n}return R.call(e,t)?e[t]:void 0},Y.prototype.has=function(t){var e=this.__data__;return X?void 0!==e[t]:R.call(e,t)},Y.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=X&&void 0===e?r:e,this},Z.prototype.clear=function(){this.__data__=[],this.size=0},Z.prototype.delete=function(t){var e=this.__data__,n=et(e,t);return!(n<0||(n==e.length-1?e.pop():V.call(e,n,1),--this.size,0))},Z.prototype.get=function(t){var e=this.__data__,n=et(e,t);return n<0?void 0:e[n][1]},Z.prototype.has=function(t){return et(this.__data__,t)>-1},Z.prototype.set=function(t,e){var n=this.__data__,r=et(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},J.prototype.clear=function(){this.size=0,this.__data__={hash:new Y,map:new(H||Z),string:new Y}},J.prototype.delete=function(t){var e=ut(this,t).delete(t);return this.size-=e?1:0,e},J.prototype.get=function(t){return ut(this,t).get(t)},J.prototype.has=function(t){return ut(this,t).has(t)},J.prototype.set=function(t,e){var n=ut(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},K.prototype.clear=function(){this.__data__=new Z,this.size=0},K.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},K.prototype.get=function(t){return this.__data__.get(t)},K.prototype.has=function(t){return this.__data__.has(t)},K.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Z){var r=n.__data__;if(!H||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new J(r)}return n.set(t,e),this.size=n.size,this};function rt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?function(t){var e=R.call(t,N),n=t[N];try{t[N]=void 0;var r=!0}catch(t){}var i=C.call(t);return r&&(e?t[N]=n:delete t[N]),i}(t):function(t){return C.call(t)}(t)}function it(t){return Pt(t)&&rt(t)==o}function ot(t,e,n,r,i){t!==e&&function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var s=o[++r];if(!1===e(i[s],s,i))break}}(e,(function(o,a){if(i||(i=new K),wt(o))!function(t,e,n,r,i,o,a){var u=ht(t,n),c=ht(e,n),l=a.get(c);if(l)Q(t,n,l);else{var f,h,p,d,v,y=o?o(u,c,n+"",t,e,a):void 0,m=void 0===y;if(m){var g=yt(c),b=!g&&gt(c),k=!g&&!b&&xt(c);y=c,g||b||k?yt(u)?y=u:Pt(v=u)&&mt(v)?y=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(u):b?(m=!1,y=function(t,e){return t.slice()}(c)):k?(m=!1,d=new(p=(f=c).buffer).constructor(p.byteLength),new F(d).set(new F(p)),h=d,y=new f.constructor(h,f.byteOffset,f.length)):y=[]:function(t){if(!Pt(t)||rt(t)!=s)return!1;var e=G(t);if(null===e)return!0;var n=R.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&E.call(n)==A}(c)||vt(c)?(y=u,vt(u)?y=function(t){return function(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var s=e[o],u=void 0;void 0===u&&(u=t[s]),i?nt(n,s,u):tt(n,s,u)}return n}(t,St(t))}(u):wt(u)&&!bt(u)||(y=function(t){return"function"!=typeof t.constructor||ft(t)?{}:$(G(t))}(c))):m=!1}m&&(a.set(c,y),i(y,c,r,o,a),a.delete(c)),Q(t,n,y)}}(t,e,a,n,ot,r,i);else{var u=r?r(ht(t,a),o,a+"",t,e,i):void 0;void 0===u&&(u=o),Q(t,a,u)}}),St)}function at(t,e){return pt(function(t,e,n){return e=q(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=q(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=n(a),k(t,this,s)}}(t,e,Et),t+"")}function st(t,e,n,r,i,o){return wt(t)&&wt(e)&&(o.set(e,t),ot(t,e,void 0,st,o),o.delete(e)),t}function ut(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ct(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!wt(t)||function(t){return!!j&&j in t}(t))&&(bt(t)?L:u).test(function(t){if(null!=t){try{return E.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}(n)?n:void 0}function lt(t,e){var n=typeof t;return!!(e=null==e?i:e)&&("number"==n||"symbol"!=n&&c.test(t))&&t>-1&&t%1==0&&t<e}function ft(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||O)}function ht(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var pt=function(t){var e=0,n=0;return function(){var r=B(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(W?function(t,e){return W(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Et);function dt(t,e){return t===e||t!=t&&e!=e}var vt=it(function(){return arguments}())?it:function(t){return Pt(t)&&R.call(t,"callee")&&!z.call(t,"callee")},yt=Array.isArray;function mt(t){return null!=t&&kt(t.length)&&!bt(t)}var gt=U||function(){return!1};function bt(t){if(!wt(t))return!1;var e=rt(t);return e==a||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function kt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function wt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var xt=b?function(t){return function(e){return t(e)}}(b):function(t){return Pt(t)&&kt(t.length)&&!!l[rt(t)]},Tt=at((function(t){return t.push(void 0,st),k(_t,void 0,t)}));function St(t){return mt(t)?function(t,e){var n=yt(t),r=!n&&vt(t),i=!n&&!r&&gt(t),o=!n&&!r&&!i&&xt(t),a=n||r||i||o,s=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=s.length;for(var c in t)!e&&!R.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||lt(c,u))||s.push(c);return s}(t,!0):function(t){if(!wt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=ft(t),n=[];for(var r in t)("constructor"!=r||!e&&R.call(t,r))&&n.push(r);return n}(t)}var Ot,_t=(Ot=function(t,e,n,r){ot(t,e,n,r)},at((function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=Ot.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(t,e,n){if(!wt(n))return!1;var r=typeof e;return!!("number"==r?mt(n)&&lt(e,n.length):"string"==r&&e in n)&&dt(n[e],t)}(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var a=e[n];a&&Ot(t,a,n,i)}return t})));function Et(t){return t}t.exports=Tt},9052:t=>{var e,n,r=9007199254740991,i=/^(?:0|[1-9]\d*)$/,o=Object.prototype,a=o.hasOwnProperty,s=o.toString,u=o.propertyIsEnumerable,c=(e=Object.keys,n=Object,function(t){return e(n(t))});function l(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||i.test(t))&&t>-1&&t%1==0&&t<e}var f=Array.isArray;function h(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?s.call(t):"";return"[object Function]"==e||"[object GeneratorFunction]"==e}(t)}function p(t){return h(t)?function(t,e){var n=f(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&h(t)}(t)&&a.call(t,"callee")&&(!u.call(t,"callee")||"[object Arguments]"==s.call(t))}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!a.call(t,o)||i&&("length"==o||l(o,r))||n.push(o);return n}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||o))return c(t);var e,n,r=[];for(var i in Object(t))a.call(t,i)&&"constructor"!=i&&r.push(i);return r}(t)}function d(t){return t}t.exports=function(t,e){return t&&function(t,e){return t&&function(t,e,n){for(var r=-1,i=Object(t),o=n(t),a=o.length;a--;){var s=o[++r];if(!1===e(i[s],s,i))break}return t}(t,e,p)}(t,"function"==typeof e?e:d)}},5111:(t,e,n)=>{"use strict";var r=n(9666);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!r(t)}},4617:(t,e,n)=>{"use strict";var r=n(1102),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},2307:(t,e,n)=>{"use strict";var r=n(5111),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},9666:(t,e,n)=>{"use strict";var r=n(4617);t.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},1102:t=>{"use strict";t.exports=function(t){return null!=t}},1583:(t,e,n)=>{var r=n(5556);t.exports=r},3132:(t,e,n)=>{var r=n(7382);t.exports=r},542:(t,e,n)=>{var r=n(3123);t.exports=r},44:(t,e,n)=>{var r=n(2446);t.exports=r},8554:(t,e,n)=>{var r=n(4436),i=n(4270);function o(t,e,n,r){if(r){var o=r[e];if(i(o))o.unhook&&o.unhook(t,e,n);else if("attributes"===e)for(var a in o)t.removeAttribute(a);else if("style"===e)for(var s in o)t.style[s]="";else t[e]="string"==typeof o?"":null}}function a(t,e,n,i,o){var a=n?n[i]:void 0;if("attributes"!==i)if(a&&r(a)&&s(a)!==s(o))t[i]=o;else{r(t[i])||(t[i]={});var u="style"===i?"":void 0;for(var c in o){var l=o[c];t[i][c]=void 0===l?u:l}}else for(var f in o){var h=o[f];void 0===h?t.removeAttribute(f):t.setAttribute(f,h)}}function s(t){return Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__?t.__proto__:t.constructor?t.constructor.prototype:void 0}t.exports=function(t,e,n){for(var s in e){var u=e[s];void 0===u?o(t,s,u,n):i(u)?(o(t,s,u,n),u.hook&&u.hook(t,s,n?n[s]:void 0)):r(u)?a(t,0,n,s,u):t[s]=u}}},5556:(t,e,n)=>{var r=n(474),i=n(8554),o=n(9683),a=n(2592),s=n(7127),u=n(1575);t.exports=function t(e,n){var c=n&&n.document||r,l=n?n.warn:null;if(e=u(e).a,s(e))return e.init();if(a(e))return c.createTextNode(e.text);if(!o(e))return l&&l("Item is not a valid virtual dom node",e),null;var f=null===e.namespace?c.createElement(e.tagName):c.createElementNS(e.namespace,e.tagName),h=e.properties;i(f,h);for(var p=e.children,d=0;d<p.length;d++){var v=t(p[d],n);v&&f.appendChild(v)}return f}},476:t=>{var e={};function n(t,i,o,a,s){if(a=a||{},t){r(o,s,s)&&(a[s]=t);var u=i.children;if(u)for(var c=t.childNodes,l=0;l<i.children.length;l++){s+=1;var f=u[l]||e,h=s+(f.count||0);r(o,s,h)&&n(c[l],f,o,a,s),s=h}}return a}function r(t,e,n){if(0===t.length)return!1;for(var r,i,o=0,a=t.length-1;o<=a;){if(i=t[r=(a+o)/2>>0],o===a)return i>=e&&i<=n;if(i<e)o=r+1;else{if(!(i>n))return!0;a=r-1}}return!1}function i(t,e){return t>e?1:-1}t.exports=function(t,e,r,o){return r&&0!==r.length?(r.sort(i),n(t,e,r,o,0)):{}}},4345:(t,e,n)=>{var r=n(8554),i=n(7127),o=n(8248),a=n(9243);function s(t,e){"function"==typeof e.destroy&&i(e)&&e.destroy(t)}t.exports=function(t,e,n){var i,u,c=t.type,l=t.vNode,f=t.patch;switch(c){case o.REMOVE:return function(t,e){var n=t.parentNode;return n&&n.removeChild(t),s(t,e),null}(e,l);case o.INSERT:return function(t,e,n){var r=n.render(e,n);return t&&t.appendChild(r),t}(e,f,n);case o.VTEXT:return function(t,e,n,r){var i;if(3===t.nodeType)t.replaceData(0,t.length,n.text),i=t;else{var o=t.parentNode;i=r.render(n,r),o&&i!==t&&o.replaceChild(i,t)}return i}(e,0,f,n);case o.WIDGET:return function(t,e,n,r){var i,o=a(e,n);i=o?n.update(e,t)||t:r.render(n,r);var u=t.parentNode;return u&&i!==t&&u.replaceChild(i,t),o||s(t,e),i}(e,l,f,n);case o.VNODE:return function(t,e,n,r){var i=t.parentNode,o=r.render(n,r);return i&&o!==t&&i.replaceChild(o,t),o}(e,0,f,n);case o.ORDER:return function(t,e){for(var n,r,i,o=t.childNodes,a={},s=0;s<e.removes.length;s++)n=o[(r=e.removes[s]).from],r.key&&(a[r.key]=n),t.removeChild(n);for(var u=o.length,c=0;c<e.inserts.length;c++)n=a[(i=e.inserts[c]).key],t.insertBefore(n,i.to>=u++?null:o[i.to])}(e,f),e;case o.PROPS:return r(e,f,l.properties),e;case o.THUNK:return i=e,u=n.patch(e,f,n),i&&u&&i!==u&&i.parentNode&&i.parentNode.replaceChild(u,i),u;default:return e}}},2446:(t,e,n)=>{var r=n(474),i=n(8722),o=n(5556),a=n(476),s=n(4345);function u(t,e,n){var i=function(t){var e=[];for(var n in t)"a"!==n&&e.push(Number(n));return e}(e);if(0===i.length)return t;var o=a(t,e.a,i),s=t.ownerDocument;n.document||s===r||(n.document=s);for(var u=0;u<i.length;u++){var l=i[u];t=c(t,o[l],e[l],n)}return t}function c(t,e,n,r){if(!e)return t;var o;if(i(n))for(var a=0;a<n.length;a++)o=s(n[a],e,r),e===t&&(t=o);else o=s(n,e,r),e===t&&(t=o);return t}t.exports=function t(e,n,r){return(r=r||{}).patch=r.patch&&r.patch!==t?r.patch:u,r.render=r.render||o,r.patch(e,n,r)}},9243:(t,e,n)=>{var r=n(7127);t.exports=function(t,e){return!(!r(t)||!r(e))&&("name"in t&&"name"in e?t.id===e.id:t.init===e.init)}},2796:(t,e,n)=>{"use strict";var r=n(9401);function i(t){if(!(this instanceof i))return new i(t);this.value=t}t.exports=i,i.prototype.hook=function(t,e){r(t)[e.substr(3)]=this.value},i.prototype.unhook=function(t,e){r(t)[e.substr(3)]=void 0}},3726: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)}},3123:(t,e,n)=>{"use strict";var r=n(8722),i=n(9327),o=n(6181),a=n(9683),s=n(2592),u=n(7127),c=n(4270),l=n(5483),f=n(7303),h=n(3726),p=n(2796);function d(t,e,n,i){if("string"==typeof t)e.push(new o(t));else if("number"==typeof t)e.push(new o(String(t)));else if(v(t))e.push(t);else{if(!r(t)){if(null==t)return;throw s={foreignObject:t,parentVnode:{tagName:n,properties:i}},(u=new Error).type="virtual-hyperscript.unexpected.virtual-element",u.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+y(s.foreignObject)+".\nThe parent vnode is:\n"+y(s.parentVnode),u.foreignObject=s.foreignObject,u.parentVnode=s.parentVnode,u}for(var a=0;a<t.length;a++)d(t[a],e,n,i)}var s,u}function v(t){return a(t)||s(t)||u(t)||l(t)}function y(t){try{return JSON.stringify(t,null,"    ")}catch(e){return String(t)}}t.exports=function(t,e,n){var o,a,s,u,l,y=[];return!n&&("string"==typeof(l=e)||r(l)||v(l))&&(n=e,a={}),o=f(t,a=a||e||{}),a.hasOwnProperty("key")&&(s=a.key,a.key=void 0),a.hasOwnProperty("namespace")&&(u=a.namespace,a.namespace=void 0),"INPUT"!==o||u||!a.hasOwnProperty("value")||void 0===a.value||c(a.value)||(a.value=h(a.value)),function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if(c(n))continue;"ev-"===e.substr(0,3)&&(t[e]=p(n))}}(a),null!=n&&d(n,y,o,a),new i(o,a,y,s,u)}},7303:(t,e,n)=>{"use strict";var r=n(8098),i=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,o=/^\.|#/;t.exports=function(t,e){if(!t)return"DIV";var n,a,s,u,c=!e.hasOwnProperty("id"),l=r(t,i),f=null;for(o.test(l[1])&&(f="DIV"),u=0;u<l.length;u++)(a=l[u])&&(s=a.charAt(0),f?"."===s?(n=n||[]).push(a.substring(1,a.length)):"#"===s&&c&&(e.id=a.substring(1,a.length)):f=a);return n&&(e.className&&n.push(e.className),e.className=n.join(" ")),e.namespace?f:f.toUpperCase()}},1575:(t,e,n)=>{var r=n(9683),i=n(2592),o=n(7127),a=n(5483);function s(t,e){var n=t.vnode;if(n||(n=t.vnode=t.render(e)),!(r(n)||i(n)||o(n)))throw new Error("thunk did not return a valid node");return n}t.exports=function(t,e){var n=t,r=e;return a(e)&&(r=s(e,t)),a(t)&&(n=s(t,null)),{a:n,b:r}}},5483:t=>{t.exports=function(t){return t&&"Thunk"===t.type}},4270:t=>{t.exports=function(t){return t&&("function"==typeof t.hook&&!t.hasOwnProperty("hook")||"function"==typeof t.unhook&&!t.hasOwnProperty("unhook"))}},9683:(t,e,n)=>{var r=n(9289);t.exports=function(t){return t&&"VirtualNode"===t.type&&t.version===r}},2592:(t,e,n)=>{var r=n(9289);t.exports=function(t){return t&&"VirtualText"===t.type&&t.version===r}},7127:t=>{t.exports=function(t){return t&&"Widget"===t.type}},9289:t=>{t.exports="2"},9327:(t,e,n)=>{var r=n(9289),i=n(9683),o=n(7127),a=n(5483),s=n(4270);t.exports=l;var u={},c=[];function l(t,e,n,r,l){this.tagName=t,this.properties=e||u,this.children=n||c,this.key=null!=r?String(r):void 0,this.namespace="string"==typeof l?l:null;var f,h=n&&n.length||0,p=0,d=!1,v=!1,y=!1;for(var m in e)if(e.hasOwnProperty(m)){var g=e[m];s(g)&&g.unhook&&(f||(f={}),f[m]=g)}for(var b=0;b<h;b++){var k=n[b];i(k)?(p+=k.count||0,!d&&k.hasWidgets&&(d=!0),!v&&k.hasThunks&&(v=!0),y||!k.hooks&&!k.descendantHooks||(y=!0)):!d&&o(k)?"function"==typeof k.destroy&&(d=!0):!v&&a(k)&&(v=!0)}this.count=h+p,this.hasWidgets=d,this.hasThunks=v,this.hooks=f,this.descendantHooks=y}l.prototype.version=r,l.prototype.type="VirtualNode"},8248:(t,e,n)=>{var r=n(9289);function i(t,e,n){this.type=Number(t),this.vNode=e,this.patch=n}i.NONE=0,i.VTEXT=1,i.VNODE=2,i.WIDGET=3,i.PROPS=4,i.ORDER=5,i.INSERT=6,i.REMOVE=7,i.THUNK=8,t.exports=i,i.prototype.version=r,i.prototype.type="VirtualPatch"},6181:(t,e,n)=>{var r=n(9289);function i(t){this.text=String(t)}t.exports=i,i.prototype.version=r,i.prototype.type="VirtualText"},2416:(t,e,n)=>{var r=n(4436),i=n(4270);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,n){var a;for(var s in e){s in n||((a=a||{})[s]=void 0);var u=e[s],c=n[s];if(u!==c)if(r(u)&&r(c))if(o(c)!==o(u))(a=a||{})[s]=c;else if(i(c))(a=a||{})[s]=c;else{var l=t(u,c);l&&((a=a||{})[s]=l)}else(a=a||{})[s]=c}for(var f in n)f in e||((a=a||{})[f]=n[f]);return a}},7382:(t,e,n)=>{var r=n(8722),i=n(8248),o=n(9683),a=n(2592),s=n(7127),u=n(5483),c=n(1575),l=n(2416);function f(t,e){var n={a:t};return h(t,e,n,0),n}function h(t,e,n,r){if(t!==e){var c=n[r],f=!1;if(u(t)||u(e))v(t,e,n,r);else if(null==e)s(t)||(p(t,n,r),c=n[r]),c=b(c,new i(i.REMOVE,t,e));else if(o(e))if(o(t))if(t.tagName===e.tagName&&t.namespace===e.namespace&&t.key===e.key){var d=l(t.properties,e.properties);d&&(c=b(c,new i(i.PROPS,t,d))),c=function(t,e,n,r,a){for(var s=t.children,u=function(t,e){var n=g(e),r=n.keys,i=n.free;if(i.length===e.length)return{children:e,moves:null};var o=g(t),a=o.keys;if(o.free.length===t.length)return{children:e,moves:null};for(var s=[],u=0,c=i.length,l=0,f=0;f<t.length;f++){var h,p=t[f];p.key?r.hasOwnProperty(p.key)?(h=r[p.key],s.push(e[h])):(h=f-l++,s.push(null)):u<c?(h=i[u++],s.push(e[h])):(h=f-l++,s.push(null))}for(var d=u>=i.length?e.length:i[u],v=0;v<e.length;v++){var y=e[v];y.key?a.hasOwnProperty(y.key)||s.push(y):v>=d&&s.push(y)}for(var b,k=s.slice(),w=0,P=[],x=[],T=0;T<e.length;){var S=e[T];for(b=k[w];null===b&&k.length;)P.push(m(k,w,null)),b=k[w];b&&b.key===S.key?(w++,T++):S.key?(b&&b.key&&r[b.key]!==T+1?(P.push(m(k,w,b.key)),(b=k[w])&&b.key===S.key?w++:x.push({key:S.key,to:T})):x.push({key:S.key,to:T}),T++):b&&b.key&&P.push(m(k,w,b.key))}for(;w<k.length;)b=k[w],P.push(m(k,w,b&&b.key));return P.length!==l||x.length?{children:s,moves:{removes:P,inserts:x}}:{children:s,moves:null}}(s,e.children),c=u.children,l=s.length,f=c.length,p=l>f?l:f,d=0;d<p;d++){var v=s[d],y=c[d];a+=1,v?h(v,y,n,a):y&&(r=b(r,new i(i.INSERT,null,y))),o(v)&&v.count&&(a+=v.count)}return u.moves&&(r=b(r,new i(i.ORDER,t,u.moves))),r}(t,e,n,c,r)}else c=b(c,new i(i.VNODE,t,e)),f=!0;else c=b(c,new i(i.VNODE,t,e)),f=!0;else a(e)?a(t)?t.text!==e.text&&(c=b(c,new i(i.VTEXT,t,e))):(c=b(c,new i(i.VTEXT,t,e)),f=!0):s(e)&&(s(t)||(f=!0),c=b(c,new i(i.WIDGET,t,e)));c&&(n[r]=c),f&&p(t,n,r)}}function p(t,e,n){y(t,e,n),d(t,e,n)}function d(t,e,n){if(s(t))"function"==typeof t.destroy&&(e[n]=b(e[n],new i(i.REMOVE,t,null)));else if(o(t)&&(t.hasWidgets||t.hasThunks))for(var r=t.children,a=r.length,c=0;c<a;c++){var l=r[c];d(l,e,n+=1),o(l)&&l.count&&(n+=l.count)}else u(t)&&v(t,null,e,n)}function v(t,e,n,r){var o=c(t,e),a=f(o.a,o.b);(function(t){for(var e in t)if("a"!==e)return!0;return!1})(a)&&(n[r]=new i(i.THUNK,null,a))}function y(t,e,n){if(o(t)){if(t.hooks&&(e[n]=b(e[n],new i(i.PROPS,t,function(t){var e={};for(var n in t)e[n]=void 0;return e}(t.hooks)))),t.descendantHooks||t.hasThunks)for(var r=t.children,a=r.length,s=0;s<a;s++){var c=r[s];y(c,e,n+=1),o(c)&&c.count&&(n+=c.count)}}else u(t)&&v(t,null,e,n)}function m(t,e,n){return t.splice(e,1),{from:e,key:n}}function g(t){for(var e={},n=[],r=t.length,i=0;i<r;i++){var o=t[i];o.key?e[o.key]=i:n.push(i)}return{keys:e,free:n}}function b(t,e){return t?(r(t)?t.push(e):t=[t,e],t):e}t.exports=f},6385:t=>{"use strict";function e(t){for(var e,n=1/0,r=-1/0,i=0,o=t.length;i<o;i++)n>(e=t[i])&&(n=e),r<e&&(r=e);return{min:n,max:r}}function n(t,e){var n=Math.pow(2,e-1),r=t<0?t*n:t*(n-1);return Math.max(-n,Math.min(n-1,r))}function r(t,r,o){var a,s,u,c,l,f,h=t.length,p=Math.ceil(h/r),d=i(o,2*p);for(a=0;a<p;a++)s=a*r,u=(a+1)*r>h?h:(a+1)*r,l=n((f=e(t.subarray(s,u))).min,o),c=n(f.max,o),d[2*a]=l,d[2*a+1]=c;return d}function i(t,e){return new(new Function(`return Int${t}Array`)())(e)}function o(t,e){return"number"==typeof t?t:e}t.exports=function(t,e,n,a,s,u){if(e=o(e,1e3),u=o(u,16),null==n&&(n=!0),[8,16,32].indexOf(u)<0)throw new Error("Invalid number of bits specified for peaks.");var c,l,f=t.numberOfChannels,h=[];if(a=o(a,0),s=o(s,t.length),void 0===t.subarray)for(c=0;c<f;c++)l=t.getChannelData(c).subarray(a,s),h.push(r(l,e,u));else h.push(r(t.subarray(a,s),e,u));return n&&h.length>1&&(h=function(t,e){var n,r,o=t.length,a=1/o,s=t[0].length/2,u=0,c=0,l=i(e,2*s);for(c=0;c<s;c++){for(n=0,r=0,u=0;u<o;u++)n+=a*t[u][2*c],r+=a*t[u][2*c+1];l[2*c]=n,l[2*c+1]=r}return[l]}(h,u)),{length:h[0].length/2,data:h,bits:u}}},8722:t=>{var e=Array.isArray,n=Object.prototype.toString;t.exports=e||function(t){return"[object Array]"===n.call(t)}},444:()=>{}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={id:r,loaded:!1,exports:{}};return t[r](o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.r(r),n.d(r,{default:()=>$t,init:()=>Xt});var t=n(6146),e=n.n(t),i=n(1583),o=n.n(i),a=n(8709),s=n.n(a),u=n(542),c=n.n(u),l=n(3132),f=n.n(l),h=n(44),p=n.n(h),d=n(1072),v=n.n(d);function y(t,e){return Math.ceil(t*e)}function m(t,e,n){return t*e/n}function g(t,e,n){return Math.ceil(t*n/e)}function b(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var w=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s()();b(this,t),this.src=e,this.ac=n,this.audioRequestState=0,this.ee=r}var e,n;return e=t,(n=[{key:"setStateChange",value:function(t){this.audioRequestState=t,this.ee.emit("audiorequeststatechange",this.audioRequestState,this.src)}},{key:"fileProgress",value:function(t){var e=0;0===this.audioRequestState&&this.setStateChange(1),t.lengthComputable&&(e=t.loaded/t.total*100),this.ee.emit("loadprogress",e,this.src)}},{key:"fileLoad",value:function(t){var e=this,n=t.target.response||t.target.result;return this.setStateChange(2),new Promise((function(t,r){e.ac.decodeAudioData(n,(function(n){e.audioBuffer=n,e.setStateChange(3),t(n)}),(function(t){r(null===t?Error("MediaDecodeAudioDataUnknownContentType"):t)}))}))}}])&&k(e.prototype,n),t}();function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function S(t,e,n){return(S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=E(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function O(t,e){return(O=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _(t,e){return!e||"object"!==P(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function E(t){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var R=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&O(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=E(r);if(i){var n=E(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return _(this,t)});function a(){return x(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"load",value:function(){var t=this;return new Promise((function(e,n){if(t.src.type.match(/audio.*/)||t.src.type.match(/video\/ogg/)){var r=new FileReader;r.readAsArrayBuffer(t.src),r.addEventListener("progress",(function(e){S(E(a.prototype),"fileProgress",t).call(t,e)})),r.addEventListener("load",(function(r){S(E(a.prototype),"fileLoad",t).call(t,r).then((function(t){e(t)})).catch(n)})),r.addEventListener("error",n)}else n(Error("Unsupported file type ".concat(t.src.type)))}))}}])&&T(e.prototype,n),a}(w);function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function L(t,e){return(L=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function M(t,e){return!e||"object"!==j(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function I(t){return(I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var F=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&L(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=I(r);if(i){var n=I(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return M(this,t)});function a(){return C(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"load",value:function(){return Promise.resolve(this.src)}}])&&A(e.prototype,n),a}(w);function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function V(t,e,n){return(V="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=U(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function W(t,e){return!e||"object"!==G(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function U(t){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var q=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&N(t,e)}(a,t);var e,n,r,i,o=(r=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=U(r);if(i){var n=U(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return W(this,t)});function a(){return D(this,a),o.apply(this,arguments)}return e=a,(n=[{key:"load",value:function(){var t=this;return new Promise((function(e,n){var r=new XMLHttpRequest;r.open("GET",t.src,!0),r.responseType="arraybuffer",r.send(),r.addEventListener("progress",(function(e){V(U(a.prototype),"fileProgress",t).call(t,e)})),r.addEventListener("load",(function(r){V(U(a.prototype),"fileLoad",t).call(t,r).then((function(t){e(t)})).catch(n)})),r.addEventListener("error",(function(){n(Error("Track ".concat(t.src," failed to load")))}))}))}}])&&z(e.prototype,n),a}(w);function B(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var H=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n;return e=t,n=[{key:"createLoader",value:function(t,e,n){if(t instanceof Blob)return new R(t,e,n);if(t instanceof AudioBuffer)return new F(t,e,n);if("string"==typeof t)return new q(t,e,n);throw new Error("Unsupported src type")}}],null&&B(e.prototype,null),n&&B(e,n),t}();function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var $=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.playlist=e}var e,n;return e=t,(n=[{key:"hook",value:function(t){var e=this.playlist;if(!e.isScrolling){var n=t;if(e.isAutomaticScroll){var r=t.getBoundingClientRect(),i=e.controls.show?e.controls.width:0,o=m(r.width-i,e.samplesPerPixel,e.sampleRate),a=e.isPlaying()?e.playbackSeconds:e.getTimeSelection().start;(a<e.scrollLeft||a>=e.scrollLeft+o)&&(e.scrollLeft=Math.min(a,e.duration-o))}var s=g(e.scrollLeft,e.samplesPerPixel,e.sampleRate);n.scrollLeft=s}}}])&&X(e.prototype,n),t}();function Y(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Z=function(){function t(e,n,r,i,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tickInfo=e,this.offset=n,this.samplesPerPixel=r,this.duration=i,this.colors=o}var e,n;return e=t,(n=[{key:"hook",value:function(t,e,n){var r=this;if(void 0===n||n.offset!==this.offset||n.duration!==this.duration||n.samplesPerPixel!==this.samplesPerPixel){var i=t.width,o=t.height,a=t.getContext("2d");a.clearRect(0,0,i,o),a.fillStyle=this.colors.timeColor,Object.keys(this.tickInfo).forEach((function(t){var e=r.tickInfo[t],n=o-e;a.fillRect(t,n,1,e)}))}}}])&&Y(e.prototype,n),t}();function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}const Q=function(){function t(e,n,r,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0;J(this,t),this.duration=e,this.offset=n,this.samplesPerPixel=r,this.sampleRate=i,this.marginLeft=o,this.colors=a,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}}}var e,n,r;return e=t,r=[{key:"formatTime",value:function(t){var e=t/1e3,n=e%60,r=(e-n)/60;return n<10&&(n="0".concat(n)),"".concat(r,":").concat(n)}}],(n=[{key:"getScaleInfo",value:function(t){var e=Object.keys(this.timeinfo).map((function(t){return parseInt(t,10)}));e=e.sort((function(t,e){return t-e}));for(var n=0;n<e.length;n+=1)if(t<=e[n])return this.timeinfo[e[n]];return this.timeinfo[e[0]]}},{key:"render",value:function(){for(var e=g(this.duration,this.samplesPerPixel,this.sampleRate),n=this.sampleRate/this.samplesPerPixel,r=g(this.offset,this.samplesPerPixel,this.sampleRate),i=this.getScaleInfo(this.samplesPerPixel),o={},a=[],s=e+r,u=0,l=0;l<s;l+=n*i.secondStep){var f=Math.floor(l),h=f-r;f>=r&&(i.marker&&u%i.marker==0?(a.push(c()("div.time",{attributes:{style:"position: absolute; left: ".concat(h,"px;")}},[t.formatTime(u)])),o[h]=10):i.bigStep&&u%i.bigStep==0?o[h]=5:i.smallStep&&u%i.smallStep==0&&(o[h]=2)),u+=1e3*i.secondStep}return c()("div.playlist-time-scale",{attributes:{style:"position: relative; left: 0; right: 0; margin-left: ".concat(this.marginLeft,"px;")}},[a,c()("canvas",{attributes:{width:e,height:30,style:"position: absolute; left: 0; right: 0; top: 0; bottom: 0;"},hook:new Z(o,this.offset,this.samplesPerPixel,this.duration,this.colors)})])}}])&&K(e.prototype,n),r&&K(e,r),t}();var tt,et=n(2473),nt=n.n(et),rt=n(9052),it=n.n(rt),ot=new Uint8Array(16);function at(){if(!tt&&!(tt="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 tt(ot)}const st=/^(?:[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,ut=function(t){return"string"==typeof t&&st.test(t)};for(var ct=[],lt=0;lt<256;++lt)ct.push((lt+256).toString(16).substr(1));const ft=function(t,e,n){var r=(t=t||{}).random||(t.rng||at)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ct[t[e+0]]+ct[t[e+1]]+ct[t[e+2]]+ct[t[e+3]]+"-"+ct[t[e+4]]+ct[t[e+5]]+"-"+ct[t[e+6]]+ct[t[e+7]]+"-"+ct[t[e+8]]+ct[t[e+9]]+"-"+ct[t[e+10]]+ct[t[e+11]]+ct[t[e+12]]+ct[t[e+13]]+ct[t[e+14]]+ct[t[e+15]]).toLowerCase();if(!ut(n))throw TypeError("Stringified UUID is invalid");return n}(r)};var ht=n(6385),pt=n.n(ht),dt=n(9304);function vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}const kt={cursor:function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.track=e}var e,n,r;return e=t,r=[{key:"getClass",value:function(){return".state-cursor"}},{key:"getEvents",value:function(){return["click"]}}],(n=[{key:"setup",value:function(t,e){this.samplesPerPixel=t,this.sampleRate=e}},{key:"click",value:function(t){t.preventDefault();var e=m(t.offsetX,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",e,e,this.track)}}])&&vt(e.prototype,n),r&&vt(e,r),t}(),select:function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.track=e,this.active=!1}var e,n,r;return e=t,r=[{key:"getClass",value:function(){return".state-select"}},{key:"getEvents",value:function(){return["mousedown","mousemove","mouseup","mouseleave"]}}],(n=[{key:"setup",value:function(t,e){this.samplesPerPixel=t,this.sampleRate=e}},{key:"emitSelection",value:function(t){var e=Math.min(t,this.startX),n=Math.max(t,this.startX),r=m(e,this.samplesPerPixel,this.sampleRate),i=m(n,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",r,i,this.track)}},{key:"complete",value:function(t){this.emitSelection(t),this.active=!1}},{key:"mousedown",value:function(t){t.preventDefault(),this.active=!0,this.startX=t.offsetX;var e=m(this.startX,this.samplesPerPixel,this.sampleRate);this.track.ee.emit("select",e,e,this.track)}},{key:"mousemove",value:function(t){this.active&&(t.preventDefault(),this.emitSelection(t.offsetX))}},{key:"mouseup",value:function(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}},{key:"mouseleave",value:function(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}}])&&yt(e.prototype,n),r&&yt(e,r),t}(),shift:function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.track=e,this.active=!1}var e,n,r;return e=t,r=[{key:"getClass",value:function(){return".state-shift"}},{key:"getEvents",value:function(){return["mousedown","mousemove","mouseup","mouseleave"]}}],(n=[{key:"setup",value:function(t,e){this.samplesPerPixel=t,this.sampleRate=e}},{key:"emitShift",value:function(t){var e=m(t-this.prevX,this.samplesPerPixel,this.sampleRate);this.prevX=t,this.track.ee.emit("shift",e,this.track)}},{key:"complete",value:function(t){this.emitShift(t),this.active=!1}},{key:"mousedown",value:function(t){t.preventDefault(),this.active=!0,this.el=t.target,this.prevX=t.offsetX}},{key:"mousemove",value:function(t){this.active&&(t.preventDefault(),this.emitShift(t.offsetX))}},{key:"mouseup",value:function(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}},{key:"mouseleave",value:function(t){this.active&&(t.preventDefault(),this.complete(t.offsetX))}}])&&mt(e.prototype,n),r&&mt(e,r),t}(),fadein:function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.track=e}var e,n,r;return e=t,r=[{key:"getClass",value:function(){return".state-fadein"}},{key:"getEvents",value:function(){return["click"]}}],(n=[{key:"setup",value:function(t,e){this.samplesPerPixel=t,this.sampleRate=e}},{key:"click",value:function(t){var e=m(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)}}])&&gt(e.prototype,n),r&&gt(e,r),t}(),fadeout:function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.track=e}var e,n,r;return e=t,r=[{key:"getClass",value:function(){return".state-fadeout"}},{key:"getEvents",value:function(){return["click"]}}],(n=[{key:"setup",value:function(t,e){this.samplesPerPixel=t,this.sampleRate=e}},{key:"click",value:function(t){var e=m(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)}}])&&bt(e.prototype,n),r&&bt(e,r),t}()};function wt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}const Pt=function(){function t(e,n,r,i,o,a,s,u){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.peaks=e,this.offset=n,this.color=i,this.bits=r,this.scale=o,this.height=a,this.barWidth=s,this.barGap=u}var e,n,r;return e=t,r=[{key:"drawFrame",value:function(t,e,n,r,i,o,a){var s=Math.abs(r*e),u=Math.abs(i*e);t.fillRect(n,0,o,e-u),t.fillRect(n,e+s,o,e-s),0!==a&&t.fillRect(n+o,0,a,2*e)}}],(n=[{key:"hook",value:function(e,n,r){if(void 0===r||r.peaks!==this.peaks||r.scale!==this.scale||r.height!==this.height){var i=this.scale,o=e.width/i,a=e.getContext("2d"),s=e.height/i/2,u=Math.pow(2,this.bits-1),c=this.barWidth,l=this.barGap,f=c+l;a.clearRect(0,0,e.width,e.height),a.save(),a.fillStyle=this.color,a.scale(i,i);for(var h=0;h<o;h+=f){var p=this.peaks[2*(h+this.offset)]/u,d=this.peaks[2*(h+this.offset)+1]/u;t.drawFrame(a,s,h,p,d,c,l)}a.restore()}}}])&&wt(e.prototype,n),r&&wt(e,r),t}();var xt=n(4571);function Tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}const St=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.shape=n,this.duration=r,this.samplesPerPixel=i}var e,n,r;return e=t,r=[{key:"createCurve",value:function(t,e,n){var r,i;switch(e){case dt.Y1:r=1;break;case dt.h7:r=-1;break;default:throw new Error("Unsupported fade type.")}switch(t){case dt._h:i=(0,xt.sCurve)(n,r);break;case dt.t$:i=(0,xt.linear)(n,r);break;case dt.Jl:i=(0,xt.exponential)(n,r);break;case dt.Hp:i=(0,xt.logarithmic)(n,10,r);break;default:throw new Error("Unsupported fade shape")}return i}}],(n=[{key:"hook",value:function(e,n,r){if(void 0===r||r.shape!==this.shape||r.type!==this.type||r.duration!==this.duration||r.samplesPerPixel!==this.samplesPerPixel){var i=e.getContext("2d"),o=e.width,a=e.height,s=t.createCurve(this.shape,this.type,o),u=s.length,c=a-s[0]*a;i.clearRect(0,0,e.width,e.height),i.save(),i.strokeStyle="black",i.beginPath(),i.moveTo(0,c);for(var l=1;l<u;l+=1)c=a-s[l]*a,i.lineTo(l,c);i.stroke(),i.restore()}}}])&&Tt(e.prototype,n),r&&Tt(e,r),t}();function Ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var _t=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gain=e}var e,n;return e=t,(n=[{key:"hook",value:function(t){t.value=100*this.gain,t.title="".concat(Math.round(100*this.gain),"% volume")}}])&&Ot(e.prototype,n),t}();function Et(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Rt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stereoPan=e}var e,n;return e=t,(n=[{key:"hook",value:function(t){var e;t.value=100*this.stereoPan,e=0===this.stereoPan?"Center":this.stereoPan<0?"Left":"Right";var n="".concat(Math.abs(Math.round(100*this.stereoPan)),"% ");t.title="Pan: ".concat(0!==this.stereoPan?n:"").concat(e)}}])&&Et(e.prototype,n),t}();function jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Ct=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),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}var e,n;return e=t,(n=[{key:"setEventEmitter",value:function(t){this.ee=t}},{key:"setName",value:function(t){this.name=t}},{key:"setCustomClass",value:function(t){this.customClass=t}},{key:"setWaveOutlineColor",value:function(t){this.waveOutlineColor=t}},{key:"setCues",value:function(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}},{key:"trim",value:function(t,e){var n=this.getStartTime(),r=this.getEndTime(),i=this.cueIn-n;if(n<=t&&r>=t||n<=e&&r>=e){var o=t<n?n:t,a=e>r?r:e;this.setCues(o+i,a+i),t>n&&this.setStartTime(t)}}},{key:"setStartTime",value:function(t){this.startTime=t,this.endTime=t+this.duration}},{key:"setPlayout",value:function(t){this.playout=t}},{key:"setOfflinePlayout",value:function(t){this.offlinePlayout=t}},{key:"setEnabledStates",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={cursor:!0,fadein:!0,fadeout:!0,select:!0,shift:!0};this.enabledStates=nt()({},e,t)}},{key:"setFadeIn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"logarithmic";if(t>this.duration)throw new Error("Invalid Fade In");var n={shape:e,start:0,end:t};this.fadeIn&&(this.removeFade(this.fadeIn),this.fadeIn=void 0),this.fadeIn=this.saveFade(dt.Y1,n.shape,n.start,n.end)}},{key:"setFadeOut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"logarithmic";if(t>this.duration)throw new Error("Invalid Fade Out");var n={shape:e,start:this.duration-t,end:this.duration};this.fadeOut&&(this.removeFade(this.fadeOut),this.fadeOut=void 0),this.fadeOut=this.saveFade(dt.h7,n.shape,n.start,n.end)}},{key:"saveFade",value:function(t,e,n,r){var i=ft();return this.fades[i]={type:t,shape:e,start:n,end:r},i}},{key:"removeFade",value:function(t){delete this.fades[t]}},{key:"setBuffer",value:function(t){this.buffer=t}},{key:"setPeakData",value:function(t){this.peakData=t}},{key:"calculatePeaks",value:function(t,e){var n=y(this.cueIn,e),r=y(this.cueOut,e);this.setPeaks(pt()(this.buffer,t,this.peakData.mono,n,r))}},{key:"setPeaks",value:function(t){this.peaks=t}},{key:"setState",value:function(t){if(this.state=t,this.state&&this.enabledStates[this.state]){var e=kt[this.state];this.stateObj=new e(this)}else this.stateObj=void 0}},{key:"getStartTime",value:function(){return this.startTime}},{key:"getEndTime",value:function(){return this.endTime}},{key:"getDuration",value:function(){return this.duration}},{key:"isPlaying",value:function(){return this.playout.isPlaying()}},{key:"setShouldPlay",value:function(t){this.playout.setShouldPlay(t)}},{key:"setGainLevel",value:function(t){this.gain=t,this.playout.setVolumeGainLevel(t)}},{key:"setMasterGainLevel",value:function(t){this.playout.setMasterGainLevel(t)}},{key:"setStereoPanValue",value:function(t){this.stereoPan=t,this.playout.setStereoPanValue(t)}},{key:"schedulePlay",value:function(t,e,n,r){var i,o,a=t,s=n?n-e:void 0,u=nt()({},{shouldPlay:!0,masterGain:1,isOffline:!1},r),c=u.isOffline?this.offlinePlayout:this.playout;if(this.endTime<=e||s&&e+s<this.startTime)return Promise.resolve();this.startTime>=e?(i=0,a+=this.startTime-e,n?(s-=this.startTime-e,o=Math.min(s,this.duration)):o=this.duration):(i=e-this.startTime,o=n?Math.min(s,this.duration-i):this.duration-i),i+=this.cueIn;var l=e-this.startTime,f=c.setUpSource();return it()(this.fades,(function(e){var n,r;if(l<e.end)switch(l<=e.start?(n=t+(e.start-l),r=e.end-e.start):l>e.start&&l<e.end&&(n=t-(l-e.start),r=e.end-e.start),e.type){case dt.Y1:c.applyFadeIn(n,r,e.shape);break;case dt.h7:c.applyFadeOut(n,r,e.shape);break;default:throw new Error("Invalid fade type saved on track.")}})),c.setVolumeGainLevel(this.gain),c.setShouldPlay(u.shouldPlay),c.setMasterGainLevel(u.masterGain),c.setStereoPanValue(this.stereoPan),c.play(a,i,o),f}},{key:"scheduleStop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.playout.stop(t)}},{key:"renderOverlay",value:function(t){var e=this,n=g(t.playlistLength,t.resolution,t.sampleRate),r={attributes:{style:"position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: ".concat(n,"px; z-index: 9;")}},i="";if(this.stateObj){this.stateObj.setup(t.resolution,t.sampleRate);var o=kt[this.state];o.getEvents().forEach((function(t){r["on".concat(t)]=e.stateObj[t].bind(e.stateObj)})),i=o.getClass()}return c()("div.playlist-overlay".concat(i),r)}},{key:"renderControls",value:function(t){var e=this,n=t.muted?".active":"",r=t.soloed?".active":"",i=t.collapsed,o=this.peaks.data.length,a=t.controls.widgets,s=c()("button.btn.btn-danger.btn-xs.track-remove",{attributes:{type:"button",title:"Remove track"},onclick:function(){e.ee.emit("removeTrack",e)}},[c()("i.fas.fa-times")]),u=c()("span",[this.name]),l=c()("button.btn.btn-info.btn-xs.track-collapse",{attributes:{type:"button",title:i?"Expand track":"Collapse track"},onclick:function(){e.ee.emit("changeTrackView",e,{collapsed:!i})}},[c()("i.fas.".concat(i?"fa-caret-down":"fa-caret-up"))]),f=[];a.remove&&f.push(s),f.push(u),a.collapse&&f.push(l);var h=[c()("div.track-header",f)];return i||(a.muteOrSolo&&h.push(c()("div.btn-group",[c()("button.btn.btn-outline-dark.btn-xs.btn-mute".concat(n),{attributes:{type:"button"},onclick:function(){e.ee.emit("mute",e)}},["Mute"]),c()("button.btn.btn-outline-dark.btn-xs.btn-solo".concat(r),{onclick:function(){e.ee.emit("solo",e)}},["Solo"])])),a.volume&&h.push(c()("label.volume",[c()("input.volume-slider",{attributes:{"aria-label":"Track volume control",type:"range",min:0,max:100,value:100},hook:new _t(this.gain),oninput:function(t){e.ee.emit("volumechange",t.target.value,e)}})])),a.stereoPan&&h.push(c()("label.stereopan",[c()("input.stereopan-slider",{attributes:{"aria-label":"Track stereo pan control",type:"range",min:-100,max:100,value:100},hook:new Rt(this.stereoPan),oninput:function(t){e.ee.emit("stereopan",t.target.value/100,e)}})]))),c()("div.controls",{attributes:{style:"height: ".concat(o*t.height,"px; width: ").concat(t.controls.width,"px; position: absolute; left: 0; z-index: 10;")}},h)}},{key:"render",value:function(t){var e=this,n=this.peaks.length,r=g(t.playbackSeconds,t.resolution,t.sampleRate),i=g(this.startTime,t.resolution,t.sampleRate),o=g(this.endTime,t.resolution,t.sampleRate),a=0,s=this.peaks.data.length,u=Math.floor(window.devicePixelRatio);r>0&&r>i&&(a=r<o?r-i:n);var l=[c()("div.cursor",{attributes:{style:"position: absolute; width: 1px; margin: 0; padding: 0; top: 0; left: ".concat(r,"px; bottom: 0; z-index: 5;")}})],f=Object.keys(this.peaks.data).map((function(r){for(var o=[c()("div.channel-progress",{attributes:{style:"position: absolute; width: ".concat(a,"px; height: ").concat(t.height,"px; z-index: 2;")}})],s=0,l=n,f=e.peaks.data[r];l>0;){var h=Math.min(l,1e3),p=e.waveOutlineColor?e.waveOutlineColor:t.colors.waveOutlineColor;o.push(c()("canvas",{attributes:{width:h*u,height:t.height*u,style:"float: left; position: relative; margin: 0; padding: 0; z-index: 3; width: ".concat(h,"px; height: ").concat(t.height,"px;")},hook:new Pt(f,s,e.peaks.bits,p,u,t.height,t.barWidth,t.barGap)})),l-=h,s+=1e3}if(e.fadeIn){var d=e.fades[e.fadeIn],v=g(d.end-d.start,t.resolution,t.sampleRate);o.push(c()("div.wp-fade.wp-fadein",{attributes:{style:"position: absolute; height: ".concat(t.height,"px; width: ").concat(v,"px; top: 0; left: 0; z-index: 4;")}},[c()("canvas",{attributes:{width:v,height:t.height},hook:new St(d.type,d.shape,d.end-d.start,t.resolution)})]))}if(e.fadeOut){var y=e.fades[e.fadeOut],m=g(y.end-y.start,t.resolution,t.sampleRate);o.push(c()("div.wp-fade.wp-fadeout",{attributes:{style:"position: absolute; height: ".concat(t.height,"px; width: ").concat(m,"px; top: 0; right: 0; z-index: 4;")}},[c()("canvas",{attributes:{width:m,height:t.height},hook:new St(y.type,y.shape,y.end-y.start,t.resolution)})]))}return c()("div.channel.channel-".concat(r),{attributes:{style:"height: ".concat(t.height,"px; width: ").concat(n,"px; top: ").concat(r*t.height,"px; left: ").concat(i,"px; position: absolute; margin: 0; padding: 0; z-index: 1;")}},o)}));if(l.push(f),l.push(this.renderOverlay(t)),!0===t.isActive){var h=g(t.timeSelection.start,t.resolution,t.sampleRate),p=g(t.timeSelection.end,t.resolution,t.sampleRate)-h+1,d=p>1?".segment":".point";l.push(c()("div.selection".concat(d),{attributes:{style:"position: absolute; width: ".concat(p,"px; bottom: 0; top: 0; left: ").concat(h,"px; z-index: 4;")}}))}var v=c()("div.waveform",{attributes:{style:"height: ".concat(s*t.height,"px; position: relative;")}},l),y=[],m=0;t.controls.show&&(y.push(this.renderControls(t)),m=t.controls.width),y.push(v);var b=t.shouldPlay?"":".silent",k=void 0===this.customClass?"":".".concat(this.customClass);return c()("div.channel-wrapper".concat(b).concat(k),{attributes:{style:"margin-left: ".concat(m,"px; height: ").concat(t.height*s,"px;")}},y)}},{key:"getTrackDetails",value:function(){var t={src:this.src,start:this.startTime,end:this.endTime,name:this.name,customClass:this.customClass,cuein:this.cueIn,cueout:this.cueOut,stereoPan:this.stereoPan,gain:this.gain};if(this.fadeIn){var e=this.fades[this.fadeIn];t.fadeIn={shape:e.shape,duration:e.end-e.start}}if(this.fadeOut){var n=this.fades[this.fadeOut];t.fadeOut={shape:n.shape,duration:n.end-n.start}}return t}}])&&jt(e.prototype,n),t}();function At(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Lt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ac=e,this.gain=1,this.buffer=n,this.destination=this.ac.destination,this.ac.createStereoPanner=e.createStereoPanner||e.createPanner}var e,n;return e=t,(n=[{key:"applyFade",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"logarithmic";if(t===dt.Y1)(0,dt.L7)(this.fadeGain.gain,r,e,n);else{if(t!==dt.h7)throw new Error("Unsupported fade type");(0,dt.Mt)(this.fadeGain.gain,r,e,n)}}},{key:"applyFadeIn",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"logarithmic";this.applyFade(dt.Y1,t,e,n)}},{key:"applyFadeOut",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"logarithmic";this.applyFade(dt.h7,t,e,n)}},{key:"isPlaying",value:function(){return void 0!==this.source}},{key:"getDuration",value:function(){return this.buffer.duration}},{key:"setAudioContext",value:function(t){this.ac=t,this.ac.createStereoPanner=t.createStereoPanner||t.createPanner,this.destination=this.ac.destination}},{key:"setUpSource",value:function(){var t=this;this.source=this.ac.createBufferSource(),this.source.buffer=this.buffer;var e=new Promise((function(e){t.source.onended=function(){t.source.disconnect(),t.fadeGain.disconnect(),t.volumeGain.disconnect(),t.shouldPlayGain.disconnect(),t.panner.disconnect(),t.masterGain.disconnect(),t.source=void 0,t.fadeGain=void 0,t.volumeGain=void 0,t.shouldPlayGain=void 0,t.panner=void 0,t.masterGain=void 0,e()}}));return this.fadeGain=this.ac.createGain(),this.volumeGain=this.ac.createGain(),this.shouldPlayGain=this.ac.createGain(),this.masterGain=this.ac.createGain(),this.panner=this.ac.createStereoPanner(),this.source.connect(this.fadeGain),this.fadeGain.connect(this.volumeGain),this.volumeGain.connect(this.shouldPlayGain),this.shouldPlayGain.connect(this.masterGain),this.masterGain.connect(this.panner),this.panner.connect(this.destination),e}},{key:"setVolumeGainLevel",value:function(t){this.volumeGain&&(this.volumeGain.gain.value=t)}},{key:"setShouldPlay",value:function(t){this.shouldPlayGain&&(this.shouldPlayGain.gain.value=t?1:0)}},{key:"setMasterGainLevel",value:function(t){this.masterGain&&(this.masterGain.gain.value=t)}},{key:"setStereoPanValue",value:function(t){var e=void 0===t?0:t;this.panner&&(void 0!==this.panner.pan?this.panner.pan.value=e:(this.panner.panningModel="equalpower",this.panner.setPosition(e,0,1-Math.abs(e))))}},{key:"play",value:function(t,e,n){this.source.start(t,e,n)}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.source&&this.source.stop(t)}}])&&At(e.prototype,n),t}();function Mt(t){return{id:t.id||ft(),start:Number(t.begin)||0,end:Number(t.end)||0,lines:t.lines||[""],lang:t.language||"en"}}function It(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Gt=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};It(this,t),this.playlist=e,this.data=r,this.active=!1,this.ondragover=function(t){n.active&&(t.preventDefault(),n.emitDrag(t.clientX))}}var e,n,r;return e=t,r=[{key:"getClass",value:function(){return".shift"}},{key:"getEvents",value:function(){return["dragstart","dragend"]}}],(n=[{key:"emitDrag",value:function(t){var e=t-this.prevX;if(e){var n=m(e,this.playlist.samplesPerPixel,this.playlist.sampleRate);this.prevX=t,this.playlist.ee.emit("dragged",n,this.data)}}},{key:"complete",value:function(){this.active=!1,document.removeEventListener("dragover",this.ondragover)}},{key:"dragstart",value:function(t){var e=t;this.active=!0,this.prevX=t.clientX,e.dataTransfer.dropEffect="move",e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",""),document.addEventListener("dragover",this.ondragover)}},{key:"dragend",value:function(t){this.active&&(t.preventDefault(),this.complete())}}])&&Ft(e.prototype,n),r&&Ft(e,r),t}(),Dt=function(){};Dt.prototype.hook=function(t){var e=t.querySelector(".current");if(e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect().top-n.top;t.scrollTop+=r}};const zt=Dt;function Vt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}const Wt=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;Vt(this,t),this.playlist=e,this.marginLeft=s,this.resizeHandlers=[],this.editable=i,this.annotations=n.map((function(t){return Mt(t)})),this.setupInteractions(),this.controls=r,this.setupEE(e.ee),this.playlist.isContinuousPlay=a,this.playlist.linkEndpoints=o,this.length=this.annotations.length}var e,n;return e=t,(n=[{key:"setupInteractions",value:function(){var t=this;this.annotations.forEach((function(e,n){var r=new Gt(t.playlist,{direction:"left",index:n}),i=new Gt(t.playlist,{direction:"right",index:n});t.resizeHandlers.push(r),t.resizeHandlers.push(i)}))}},{key:"setupEE",value:function(t){var e=this;return t.on("dragged",(function(t,n){var r=n.index,i=e.annotations,o=i[r];if("left"===n.direction){var a=o.start;o.start+=t,o.start<0&&(o.start=0),r&&i[r-1].end>o.start&&(i[r-1].end=o.start),e.playlist.linkEndpoints&&r&&i[r-1].end===a&&(i[r-1].end=o.start)}else{var s=o.end;o.end+=t,o.end>e.playlist.duration&&(o.end=e.playlist.duration),r<i.length-1&&i[r+1].start<o.end&&(i[r+1].start=o.end),e.playlist.linkEndpoints&&r<i.length-1&&i[r+1].start===s&&(i[r+1].start=o.end)}e.playlist.drawRequest()})),t.on("continuousplay",(function(t){e.playlist.isContinuousPlay=t})),t.on("linkendpoints",(function(t){e.playlist.linkEndpoints=t})),t.on("annotationsrequest",(function(){e.export()})),t}},{key:"export",value:function(){var t=this.annotations.map((function(t){return e=t,{begin:String(e.start.toFixed(3)),end:String(e.end.toFixed(3)),id:String(e.id),language:e.lang,lines:e.lines};var e})),e="data:text/json;charset=utf-8,".concat(encodeURIComponent(JSON.stringify(t))),n=document.createElement("a");document.body.appendChild(n),n.href=e,n.download="annotations.json",n.click(),document.body.removeChild(n)}},{key:"renderResizeLeft",value:function(t){var e=Gt.getEvents(),n={attributes:{style:"position: absolute; height: 30px; width: 10px; top: 0; left: -2px",draggable:!0}},r=this.resizeHandlers[2*t];return e.forEach((function(t){n["on".concat(t)]=r[t].bind(r)})),c()("div.resize-handle.resize-w",n)}},{key:"renderResizeRight",value:function(t){var e=Gt.getEvents(),n={attributes:{style:"position: absolute; height: 30px; width: 10px; top: 0; right: -2px",draggable:!0}},r=this.resizeHandlers[2*t+1];return e.forEach((function(t){n["on".concat(t)]=r[t].bind(r)})),c()("div.resize-handle.resize-e",n)}},{key:"renderControls",value:function(t,e){var n=this,r=this;return this.controls.map((function(i){return c()("i.".concat(i.class),{attributes:{title:i.title},onclick:function(){i.action(t,e,r.annotations,{linkEndpoints:r.playlist.linkEndpoints}),n.setupInteractions(),r.playlist.drawRequest()}})}))}},{key:"render",value:function(){var t=this,e=c()("div.annotations-boxes",{attributes:{style:"height: 30px; position: relative; margin-left: ".concat(this.marginLeft,"px;")}},this.annotations.map((function(e,n){var r=t.playlist.samplesPerPixel,i=t.playlist.sampleRate,o=i/r,a=g(t.playlist.scrollLeft,r,i),s=Math.floor(e.start*o-a),u=Math.ceil(e.end*o-e.start*o);return c()("div.annotation-box",{attributes:{style:"position: absolute; height: 30px; width: ".concat(u,"px; left: ").concat(s,"px"),"data-id":e.id}},[t.renderResizeLeft(n),c()("span.id",{onclick:function(){var e=t.annotations[n].start,r=t.annotations[n].end;t.playlist.isContinuousPlay?(t.playlist.seek(e,e),t.playlist.ee.emit("play",e)):(t.playlist.seek(e,r),t.playlist.ee.emit("play",e,r))}},[e.id]),t.renderResizeRight(n)])}))),n=c()("div.annotations-boxes-wrapper",{attributes:{style:"overflow: hidden;"}},[e]),r=c()("div.annotations-text",{hook:new zt},this.annotations.map((function(e,n){var r=function(t){function e(t,e){var n=parseInt(t/3600,10)%24,r=parseInt(t/60,10)%60,i=(t%60).toFixed(e),o=n<10?"0".concat(n):n,a=r<10?"0".concat(r):r,s=i<10?"0".concat(i):i;return"".concat(o,":").concat(a,":").concat(s)}return{seconds:function(t){return t.toFixed(0)},thousandths:function(t){return t.toFixed(3)},"hh:mm:ss":function(t){return e(t,0)},"hh:mm:ss.u":function(t){return e(t,1)},"hh:mm:ss.uu":function(t){return e(t,2)},"hh:mm:ss.uuu":function(t){return e(t,3)}}[t]}(t.playlist.durationFormat),i=r(e.start),o=r(e.end),a="";t.playlist.isPlaying()&&t.playlist.playbackSeconds>=e.start&&t.playlist.playbackSeconds<=e.end&&(a=".current");var s={attributes:{contenteditable:!0},oninput:function(t){e.lines=[t.target.innerText]},onkeypress:function(t){13!==t.which&&13!==t.keyCode||(t.target.blur(),t.preventDefault())}},u=t.editable?s:{};return c()("div.annotation".concat(a),[c()("span.annotation-id",[e.id]),c()("span.annotation-start",[i]),c()("span.annotation-end",[o]),c()("span.annotation-lines",u,[e.lines]),c()("span.annotation-actions",t.renderControls(e,n))])})));return c()("div.annotations",[n,r])}}])&&Nt(e.prototype,n),t}();function Ut(){function t(t){for(var e,n=1/0,r=-1/0,i=0;i<t.length;i+=1)n>(e=t[i])&&(n=e),r<e&&(r=e);return{min:n,max:r}}function e(t,e){var n=Math.pow(2,e-1),r=t<0?t*n:t*n-1;return Math.max(-n,Math.min(n-1,r))}function n(n,r,i){for(var o,a,s,u,c,l=n.length,f=Math.ceil(l/r),h=new(self["Int".concat(i,"Array")])(2*f),p=0;p<f;p+=1)o=p*r,a=(p+1)*r>l?l:(p+1)*r,u=e((c=t(n.subarray(o,a))).min,i),s=e(c.max,i),h[2*p]=u,h[2*p+1]=s;return h}onmessage=function(t){var e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e4,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if([8,16,32].indexOf(r)<0)throw new Error("Invalid number of bits specified for peaks.");var i=[],o=0,a=t.length;i.push(n(t.subarray(o,a),e,r));var s=i[0].length/2;return{bits:r,length:s,data:i}}(t.data.samples,t.data.samplesPerPixel);postMessage(e)}}function qt(){var t,e=0,n=[],r=[];function i(t,e,n){for(var r=0;r<n.length;r+=1)t.setUint8(e+r,n.charCodeAt(r))}function o(t,e,n){for(var r=e,i=0;i<n.length;i+=1,r+=2){var o=Math.max(-1,Math.min(1,n[i]));t.setInt16(r,o<0?32768*o:32767*o,!0)}}function a(t,e){for(var n=new Float32Array(e),r=0,i=0;i<t.length;i+=1)n.set(t[i],r),r+=t[i].length;return n}onmessage=function(s){switch(s.data.command){case"init":h=s.data.config,t=h.sampleRate;break;case"record":f=s.data.buffer,n.push(f[0]),r.push(f[1]),e+=f[0].length;break;case"exportWAV":u=s.data.type,c=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=new ArrayBuffer(44+2*e.length),a=new DataView(r);return i(a,0,"RIFF"),a.setUint32(4,32+2*e.length,!0),i(a,8,"WAVE"),i(a,12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,n?1:2,!0),a.setUint32(24,t,!0),a.setUint32(28,4*t,!0),a.setUint16(32,4,!0),a.setUint16(34,16,!0),i(a,36,"data"),a.setUint32(40,2*e.length,!0),o(a,44,e),a}(function(t,e){for(var n=t.length+e.length,r=new Float32Array(n),i=0,o=0;i<n;)r[i+=1]=t[o],r[i+=1]=e[o],o+=1;return r}(a(n,e),a(r,e))),l=new Blob([c],{type:u}),postMessage(l);break;case"clear":e=0,n=[],r=[];break;default:throw new Error("Unknown export worker command")}var u,c,l,f,h}}function Bt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Ht=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tracks=[],this.soloedTracks=[],this.mutedTracks=[],this.collapsedTracks=[],this.playoutPromises=[],this.cursor=0,this.playbackSeconds=0,this.duration=0,this.scrollLeft=0,this.scrollTimer=void 0,this.showTimescale=!1,this.isScrolling=!1,this.fadeType="logarithmic",this.masterGain=1,this.annotations=[],this.durationFormat="hh:mm:ss.uuu",this.isAutomaticScroll=!1,this.resetDrawTimer=void 0}var n,r;return n=t,(r=[{key:"initExporter",value:function(){this.exportWorker=new(v())(qt)}},{key:"initRecorder",value:function(t){var e=this;this.mediaRecorder=new MediaRecorder(t),this.mediaRecorder.onstart=function(){var t=new Ct;t.setName("Recording"),t.setEnabledStates(),t.setEventEmitter(e.ee),e.recordingTrack=t,e.tracks.push(t),e.chunks=[],e.working=!1},this.mediaRecorder.ondataavailable=function(t){if(e.chunks.push(t.data),!e.working){var n=new Blob(e.chunks,{type:"audio/ogg; codecs=opus"});H.createLoader(n,e.ac).load().then((function(t){e.recorderWorker.postMessage({samples:t.getChannelData(0),samplesPerPixel:e.samplesPerPixel}),e.recordingTrack.setCues(0,t.duration),e.recordingTrack.setBuffer(t),e.recordingTrack.setPlayout(new Lt(e.ac,t)),e.adjustDuration()})).catch((function(){e.working=!1})),e.working=!0}},this.mediaRecorder.onstop=function(){e.chunks=[],e.working=!1},this.recorderWorker=new(v())(Ut),this.recorderWorker.onmessage=function(t){e.recordingTrack.setPeaks(t.data),e.working=!1,e.drawRequest()}}},{key:"setShowTimeScale",value:function(t){this.showTimescale=t}},{key:"setMono",value:function(t){this.mono=t}},{key:"setExclSolo",value:function(t){this.exclSolo=t}},{key:"setSeekStyle",value:function(t){this.seekStyle=t}},{key:"getSeekStyle",value:function(){return this.seekStyle}},{key:"setSampleRate",value:function(t){this.sampleRate=t}},{key:"setSamplesPerPixel",value:function(t){this.samplesPerPixel=t}},{key:"setAudioContext",value:function(t){this.ac=t}},{key:"setControlOptions",value:function(t){this.controls=t}},{key:"setWaveHeight",value:function(t){this.waveHeight=t}},{key:"setCollapsedWaveHeight",value:function(t){this.collapsedWaveHeight=t}},{key:"setColors",value:function(t){this.colors=t}},{key:"setBarWidth",value:function(t){this.barWidth=t}},{key:"setBarGap",value:function(t){this.barGap=t}},{key:"setAnnotations",value:function(t){var e=this.controls.show?this.controls.width:0;this.annotationList=new Wt(this,t.annotations,t.controls,t.editable,t.linkEndpoints,t.isContinuousPlay,e)}},{key:"setEventEmitter",value:function(t){this.ee=t}},{key:"getEventEmitter",value:function(){return this.ee}},{key:"setUpEventEmitter",value:function(){var t=this,e=this.ee;e.on("automaticscroll",(function(e){t.isAutomaticScroll=e})),e.on("durationformat",(function(e){t.durationFormat=e,t.drawRequest()})),e.on("select",(function(e,n,r){t.isPlaying()?(t.lastSeeked=e,t.pausedAt=void 0,t.restartPlayFrom(e)):(t.seek(e,n,r),t.ee.emit("timeupdate",e),t.drawRequest())})),e.on("startaudiorendering",(function(e){t.startOfflineRender(e)})),e.on("statechange",(function(e){t.setState(e),t.drawRequest()})),e.on("shift",(function(e,n){n.setStartTime(n.getStartTime()+e),t.adjustDuration(),t.drawRequest()})),e.on("record",(function(){t.record()})),e.on("play",(function(e,n){t.play(e,n)})),e.on("pause",(function(){t.pause()})),e.on("stop",(function(){t.stop()})),e.on("rewind",(function(){t.rewind()})),e.on("fastforward",(function(){t.fastForward()})),e.on("clear",(function(){t.clear().then((function(){t.drawRequest()}))})),e.on("solo",(function(e){t.soloTrack(e),t.adjustTrackPlayout(),t.drawRequest()})),e.on("mute",(function(e){t.muteTrack(e),t.adjustTrackPlayout(),t.drawRequest()})),e.on("removeTrack",(function(e){t.removeTrack(e),t.adjustTrackPlayout(),t.drawRequest()})),e.on("changeTrackView",(function(e,n){t.collapseTrack(e,n),t.drawRequest()})),e.on("volumechange",(function(e,n){n.setGainLevel(e/100),t.drawRequest()})),e.on("mastervolumechange",(function(e){t.masterGain=e/100,t.tracks.forEach((function(e){e.setMasterGainLevel(t.masterGain)}))})),e.on("fadein",(function(e,n){n.setFadeIn(e,t.fadeType),t.drawRequest()})),e.on("fadeout",(function(e,n){n.setFadeOut(e,t.fadeType),t.drawRequest()})),e.on("stereopan",(function(e,n){n.setStereoPanValue(e),t.drawRequest()})),e.on("fadetype",(function(e){t.fadeType=e})),e.on("newtrack",(function(e){t.load([{src:e,name:e.name}])})),e.on("trim",(function(){var e=t.getActiveTrack(),n=t.getTimeSelection();e.trim(n.start,n.end),e.calculatePeaks(t.samplesPerPixel,t.sampleRate),t.setTimeSelection(0,0),t.drawRequest()})),e.on("zoomin",(function(){var e=Math.max(0,t.zoomIndex-1),n=t.zoomLevels[e];n!==t.samplesPerPixel&&(t.setZoom(n),t.drawRequest())})),e.on("zoomout",(function(){var e=Math.min(t.zoomLevels.length-1,t.zoomIndex+1),n=t.zoomLevels[e];n!==t.samplesPerPixel&&(t.setZoom(n),t.drawRequest())})),e.on("scroll",(function(){t.isScrolling=!0,t.drawRequest(),clearTimeout(t.scrollTimer),t.scrollTimer=setTimeout((function(){t.isScrolling=!1}),200)}))}},{key:"load",value:function(t){var e=this,n=t.map((function(t){return H.createLoader(t.src,e.ac,e.ee).load()}));return Promise.all(n).then((function(n){e.ee.emit("audiosourcesloaded");var r=n.map((function(n,r){var i=t[r],o=i.name||"Untitled",a=i.start||0,s=i.states||{},u=i.fadeIn,c=i.fadeOut,l=i.cuein||0,f=i.cueout||n.duration,h=i.gain||1,p=i.muted||!1,d=i.soloed||!1,v=i.selected,y=i.peaks||{type:"WebAudio",mono:e.mono},m=i.customClass||void 0,g=i.waveOutlineColor||void 0,b=i.stereoPan||0,k=new Lt(e.ac,n),w=new Ct;return w.src=i.src,w.setBuffer(n),w.setName(o),w.setEventEmitter(e.ee),w.setEnabledStates(s),w.setCues(l,f),w.setCustomClass(m),w.setWaveOutlineColor(g),void 0!==u&&w.setFadeIn(u.duration,u.shape),void 0!==c&&w.setFadeOut(c.duration,c.shape),void 0!==v&&(e.setActiveTrack(w),e.setTimeSelection(v.start,v.end)),void 0!==y&&w.setPeakData(y),w.setState(e.getState()),w.setStartTime(a),w.setPlayout(k),w.setGainLevel(h),w.setStereoPanValue(b),p&&e.muteTrack(w),d&&e.soloTrack(w),w.calculatePeaks(e.samplesPerPixel,e.sampleRate),w}));e.tracks=e.tracks.concat(r),e.adjustDuration(),e.draw(e.render()),e.ee.emit("audiosourcesrendered")})).catch((function(t){e.ee.emit("audiosourceserror",t)}))}},{key:"setActiveTrack",value:function(t){this.activeTrack=t}},{key:"getActiveTrack",value:function(){return this.activeTrack}},{key:"isSegmentSelection",value:function(){return this.timeSelection.start!==this.timeSelection.end}},{key:"setTimeSelection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;this.timeSelection={start:t,end:void 0===e?t:e},this.cursor=t}},{key:"startOfflineRender",value:function(t){var e=this;if(!this.isRendering){this.isRendering=!0,this.offlineAudioContext=new OfflineAudioContext(2,44100*this.duration,44100);var n=this.offlineAudioContext.currentTime;this.tracks.forEach((function(t){t.setOfflinePlayout(new Lt(e.offlineAudioContext,t.buffer)),t.schedulePlay(n,0,0,{shouldPlay:e.shouldTrackPlay(t),masterGain:1,isOffline:!0})})),this.offlineAudioContext.startRendering().then((function(n){if("buffer"===t)return e.ee.emit("audiorenderingfinished",t,n),void(e.isRendering=!1);"wav"===t&&(e.exportWorker.postMessage({command:"init",config:{sampleRate:44100}}),e.exportWorker.onmessage=function(n){e.ee.emit("audiorenderingfinished",t,n.data),e.isRendering=!1,e.exportWorker.postMessage({command:"clear"})},e.exportWorker.postMessage({command:"record",buffer:[n.getChannelData(0),n.getChannelData(1)]}),e.exportWorker.postMessage({command:"exportWAV",type:"audio/wav"}))})).catch((function(t){throw t}))}}},{key:"getTimeSelection",value:function(){return this.timeSelection}},{key:"setState",value:function(t){this.state=t,this.tracks.forEach((function(e){e.setState(t)}))}},{key:"getState",value:function(){return this.state}},{key:"setZoomIndex",value:function(t){this.zoomIndex=t}},{key:"setZoomLevels",value:function(t){this.zoomLevels=t}},{key:"setZoom",value:function(t){var e=this;this.samplesPerPixel=t,this.zoomIndex=this.zoomLevels.indexOf(t),this.tracks.forEach((function(n){n.calculatePeaks(t,e.sampleRate)}))}},{key:"muteTrack",value:function(t){var e=this.mutedTracks.indexOf(t);e>-1?this.mutedTracks.splice(e,1):this.mutedTracks.push(t)}},{key:"soloTrack",value:function(t){var e=this.soloedTracks.indexOf(t);e>-1?this.soloedTracks.splice(e,1):this.exclSolo?this.soloedTracks=[t]:this.soloedTracks.push(t)}},{key:"collapseTrack",value:function(t,e){if(e.collapsed)this.collapsedTracks.push(t);else{var n=this.collapsedTracks.indexOf(t);n>-1&&this.collapsedTracks.splice(n,1)}}},{key:"removeTrack",value:function(t){t.isPlaying()&&t.scheduleStop(),[this.mutedTracks,this.soloedTracks,this.collapsedTracks,this.tracks].forEach((function(e){var n=e.indexOf(t);n>-1&&e.splice(n,1)}))}},{key:"adjustTrackPlayout",value:function(){var t=this;this.tracks.forEach((function(e){e.setShouldPlay(t.shouldTrackPlay(e))}))}},{key:"adjustDuration",value:function(){this.duration=this.tracks.reduce((function(t,e){return Math.max(t,e.getEndTime())}),0)}},{key:"shouldTrackPlay",value:function(t){var e;return this.soloedTracks.length>0?(e=!1,this.soloedTracks.indexOf(t)>-1&&(e=!0)):(e=!0,this.mutedTracks.indexOf(t)>-1&&(e=!1)),e}},{key:"isPlaying",value:function(){return this.tracks.reduce((function(t,e){return t||e.isPlaying()}),!1)}},{key:"getCurrentTime",value:function(){return(this.lastSeeked||this.pausedAt||this.cursor)+this.getElapsedTime()}},{key:"getElapsedTime",value:function(){return this.ac.currentTime-this.lastPlay}},{key:"setMasterGain",value:function(t){this.ee.emit("mastervolumechange",t)}},{key:"restartPlayFrom",value:function(t,e){return this.stopAnimation(),this.tracks.forEach((function(t){t.scheduleStop()})),Promise.all(this.playoutPromises).then(this.play.bind(this,t,e))}},{key:"play",value:function(t,e){var n=this;clearTimeout(this.resetDrawTimer);var r=this.ac.currentTime,i=this.getTimeSelection(),o=[],a=t||this.pausedAt||this.cursor,s=e;return!s&&i.end!==i.start&&i.end>a&&(s=i.end),this.isPlaying()?this.restartPlayFrom(a,s):(this.tracks.forEach((function(t){t.setState("cursor"),o.push(t.schedulePlay(r,a,s,{shouldPlay:n.shouldTrackPlay(t),masterGain:n.masterGain}))})),this.lastPlay=r,this.playoutPromises=o,this.startAnimation(a),Promise.all(this.playoutPromises))}},{key:"pause",value:function(){return this.isPlaying()?(this.pausedAt=this.getCurrentTime(),this.playbackReset()):Promise.all(this.playoutPromises)}},{key:"stop",value:function(){return this.mediaRecorder&&"recording"===this.mediaRecorder.state&&this.mediaRecorder.stop(),this.pausedAt=void 0,this.playbackSeconds=0,this.playbackReset()}},{key:"playbackReset",value:function(){var t=this;return this.lastSeeked=void 0,this.stopAnimation(),this.tracks.forEach((function(e){e.scheduleStop(),e.setState(t.getState())})),this.drawRequest(),Promise.all(this.playoutPromises)}},{key:"rewind",value:function(){var t=this;return this.stop().then((function(){t.scrollLeft=0,t.ee.emit("select",0,0)}))}},{key:"fastForward",value:function(){var t=this;return this.stop().then((function(){t.viewDuration<t.duration?t.scrollLeft=t.duration-t.viewDuration:t.scrollLeft=0,t.ee.emit("select",t.duration,t.duration)}))}},{key:"clear",value:function(){var t=this;return this.stop().then((function(){t.tracks=[],t.soloedTracks=[],t.mutedTracks=[],t.playoutPromises=[],t.cursor=0,t.playbackSeconds=0,t.duration=0,t.scrollLeft=0,t.seek(0,0,void 0)}))}},{key:"record",value:function(){var t=this,e=[];this.mediaRecorder.start(300),this.tracks.forEach((function(n){n.setState("none"),e.push(n.schedulePlay(t.ac.currentTime,0,void 0,{shouldPlay:t.shouldTrackPlay(n)}))})),this.playoutPromises=e}},{key:"startAnimation",value:function(t){var e=this;this.lastDraw=this.ac.currentTime,this.animationRequest=window.requestAnimationFrame((function(){e.updateEditor(t)}))}},{key:"stopAnimation",value:function(){window.cancelAnimationFrame(this.animationRequest),this.lastDraw=void 0}},{key:"seek",value:function(t,e,n){this.isPlaying()?(this.lastSeeked=t,this.pausedAt=void 0,this.restartPlayFrom(t)):(this.setActiveTrack(n||this.tracks[0]),this.pausedAt=t,this.setTimeSelection(t,e),"fill"===this.getSeekStyle()&&(this.playbackSeconds=t))}},{key:"updateEditor",value:function(t){var e=this,n=this.ac.currentTime,r=this.getTimeSelection(),i=t||this.cursor,o=n-this.lastDraw;if(this.isPlaying()){var a=i+o;this.ee.emit("timeupdate",a),this.animationRequest=window.requestAnimationFrame((function(){e.updateEditor(a)})),this.playbackSeconds=a,this.draw(this.render()),this.lastDraw=n}else i+o>=(this.isSegmentSelection()?r.end:this.duration)&&this.ee.emit("finished"),this.stopAnimation(),this.resetDrawTimer=setTimeout((function(){e.pausedAt=void 0,e.lastSeeked=void 0,e.setState(e.getState()),e.playbackSeconds=0,e.draw(e.render())}),0)}},{key:"drawRequest",value:function(){var t=this;window.requestAnimationFrame((function(){t.draw(t.render())}))}},{key:"draw",value:function(t){var e=f()(this.tree,t);this.rootNode=p()(this.rootNode,e),this.tree=t,this.viewDuration=m(this.rootNode.clientWidth-this.controls.width,this.samplesPerPixel,this.sampleRate)}},{key:"getTrackRenderData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={height:this.waveHeight,resolution:this.samplesPerPixel,sampleRate:this.sampleRate,controls:this.controls,isActive:!1,timeSelection:this.getTimeSelection(),playlistLength:this.duration,playbackSeconds:this.playbackSeconds,colors:this.colors,barWidth:this.barWidth,barGap:this.barGap};return e()({},t,n)}},{key:"isActiveTrack",value:function(t){var e=this.getActiveTrack();return!this.isSegmentSelection()||e===t}},{key:"renderAnnotations",value:function(){return this.annotationList.render()}},{key:"renderTimeScale",value:function(){var t=this.controls.show?this.controls.width:0;return new Q(this.duration,this.scrollLeft,this.samplesPerPixel,this.sampleRate,t,this.colors).render()}},{key:"renderTrackSection",value:function(){var t=this,e=this.tracks.map((function(e){var n=t.collapsedTracks.indexOf(e)>-1;return e.render(t.getTrackRenderData({isActive:t.isActiveTrack(e),shouldPlay:t.shouldTrackPlay(e),soloed:t.soloedTracks.indexOf(e)>-1,muted:t.mutedTracks.indexOf(e)>-1,collapsed:n,height:n?t.collapsedWaveHeight:t.waveHeight,barGap:t.barGap,barWidth:t.barWidth}))}));return c()("div.playlist-tracks",{attributes:{style:"overflow: auto;"},onscroll:function(e){t.scrollLeft=m(e.target.scrollLeft,t.samplesPerPixel,t.sampleRate),t.ee.emit("scroll")},hook:new $(this)},e)}},{key:"render",value:function(){var t=[];return this.showTimescale&&t.push(this.renderTimeScale()),t.push(this.renderTrackSection()),this.annotationList.length&&t.push(this.renderAnnotations()),c()("div.playlist",{attributes:{style:"overflow: hidden; position: relative;"}},t)}},{key:"getInfo",value:function(){var t=[];return this.tracks.forEach((function(e){t.push(e.getTrackDetails())})),t}}])&&Bt(n.prototype,r),t}();function Xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s()();if(void 0===t.container)throw new Error("DOM element container must be given.");window.OfflineAudioContext=window.OfflineAudioContext||window.webkitOfflineAudioContext,window.AudioContext=window.AudioContext||window.webkitAudioContext;var r=new window.AudioContext,i={ac:r,sampleRate:r.sampleRate,samplesPerPixel:4096,mono:!0,fadeType:"logarithmic",exclSolo:!1,timescale:!1,controls:{show:!1,width:150,widgets:{muteOrSolo:!0,volume:!0,stereoPan:!0,collapse:!0,remove:!0}},colors:{waveOutlineColor:"white",timeColor:"grey",fadeColor:"black"},seekStyle:"line",waveHeight:128,collapsedWaveHeight:30,barWidth:1,barGap:0,state:"cursor",zoomLevels:[512,1024,2048,4096],annotationList:{annotations:[],controls:[],editable:!1,linkEndpoints:!1,isContinuousPlay:!1},isAutomaticScroll:!1},a=e()({},t,i),u=a.zoomLevels.indexOf(a.samplesPerPixel);if(-1===u)throw new Error("initial samplesPerPixel must be included in array zoomLevels");var c=new Ht;c.setSampleRate(a.sampleRate),c.setSamplesPerPixel(a.samplesPerPixel),c.setAudioContext(a.ac),c.setEventEmitter(n),c.setUpEventEmitter(),c.setTimeSelection(0,0),c.setState(a.state),c.setControlOptions(a.controls),c.setWaveHeight(a.waveHeight),c.setCollapsedWaveHeight(a.collapsedWaveHeight),c.setColors(a.colors),c.setZoomLevels(a.zoomLevels),c.setZoomIndex(u),c.setMono(a.mono),c.setExclSolo(a.exclSolo),c.setShowTimeScale(a.timescale),c.setSeekStyle(a.seekStyle),c.setAnnotations(a.annotationList),c.setBarGap(a.barGap),c.setBarWidth(a.barWidth),c.isAutomaticScroll=a.isAutomaticScroll,c.isContinuousPlay=a.isContinuousPlay,c.linkedEndpoints=a.linkedEndpoints;var l=c.render(),f=o()(l);return a.container.appendChild(f),c.tree=l,c.rootNode=f,c}function $t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s()();return Xt(t,e)}})(),WaveformPlaylist=r})();