(()=>{"use strict";function t(t,n){if(t.length===n)return t;const r=[];if(t.length>n){const e=Math.round(t.length/n);for(let n=0;n<t.length;n+=e)r.push(t[n])}else{const s=Math.ceil(n/t.length);for(const n of t)r.push(...e(n,s))}return s=r,l=n,o=e(t[t.length-1],n),s.length===l?s:s.length>l?s.slice(0,l):s.concat(o.slice(0,l-s.length));var s,l,o}function n(t,n,e){const r=Math.min(...t),s=Math.max(...t);return t.map((t=>function(t,n,e){return t*(e-n)+n}(function(t,n,e){const r=(t-n)/(e-n);return Number.isNaN(r)?0:r}(t,r,s),n,e)))}function e(t,n){return new Array(n).fill(t)}e(0,39);const r=self;r.addEventListener("message",(async e=>{const{seq:s,data:l}=e.data,o=n(function(n,e){if(n.length===e)return n;let r=[];if(n.length>e){for(;r.length>2*e||0===r.length;){r=[];for(let t=1;t<n.length-1;t+=2){const e=(n[t-1]+n[t+1]+n[t])/3;r.push(e)}n=r}return t(r,e)}return t(n,e)}(l.map((t=>Math.abs(t))),39),0,1);r.postMessage({seq:s,waveform:o})}))})();
//# sourceMappingURL=playback.worker.js.map