@exezt-/webamp 1.5.0-0x735 → 1.5.0-0x737

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ var r=n(121),i=n(105),a=n(106);function o(){return s.TYPED_ARRAY_SUPPORT?2147483
21
21
  object-assign
22
22
  (c) Sindre Sorhus
23
23
  @license MIT
24
- */var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,A,s=o(e),l=1;l<arguments.length;l++){for(var u in n=Object(arguments[l]))i.call(n,u)&&(s[u]=n[u]);if(r){A=r(n);for(var c=0;c<A.length;c++)a.call(n,A[c])&&(s[A[c]]=n[A[c]])}}return s}},function(e,t,n){"use strict";var r=n(47),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var a=Object.create(n(37));a.inherits=n(33);var o=n(110),A=n(56);a.inherits(c,o);for(var s=i(A.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=A.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),A.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),c.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){var r=n(82).Symbol;e.exports=r},function(e,t,n){"use strict";e.exports=n(66)},function(e,t,n){"use strict";var r=n(28),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},A={};function s(e){return r.isMemo(e)?o:A[e.$$typeof]||i}A[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},A[r.Memo]=o;var l=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var i=h(n);i&&i!==f&&e(t,i,r)}var o=u(n);c&&(o=o.concat(c(n)));for(var A=s(t),p=s(n),g=0;g<o.length;++g){var m=o[g];if(!(a[m]||r&&r[m]||p&&p[m]||A&&A[m])){var b=d(n,m);try{l(t,m,b)}catch(e){}}}}return t}},function(e,t,n){"use strict";(function(e,r){var i,a=n(39);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var o=Object(a.a)(i);t.a=o}).call(this,n(19),n(67)(e))},function(e,t,n){var r=n(69),i=n(70);e.exports={parser:r,creator:i}},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function A(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,l=[],u=!1,c=-1;function d(){u&&s&&(u=!1,s.length?l=s.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=A(d);u=!0;for(var t=l.length;t;){for(s=l,l=[];++c<t;)s&&s[c].run();c=-1,t=l.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||A(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),i=n.n(r),a=n(3);class o{constructor(e,t){var n,r;i()(this,"webamp",void 0),i()(this,"maxFileSize",20971520),i()(this,"applicationStorage",null===(n=window)||void 0===n||null===(r=n.Telegram)||void 0===r?void 0:r.WebApp.DeviceStorage),i()(this,"telegram",void 0),i()(this,"loadCustomTracks",e=>{var t;(null!==(t=this.webamp)&&void 0!==t?t:window.__webamp).setTracksToPlay(e)}),i()(this,"updateAppState",()=>{this.applicationStorage.setItem("app-state",JSON.stringify(this.webamp.__getSerializedState())),localStorage.setItem("app-state",JSON.stringify(this.webamp.__getSerializedState()))}),i()(this,"getTrackListFromYandexDisk",async e=>{fetch("https://cloud-api.yandex.net/v1/disk/public/resources?public_key="+encodeURIComponent(e),{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async e=>200===e.status?e.text():null).then(async t=>{if(null!==t){var n;const r=null===(n=JSON.parse(t))||void 0===n?void 0:n._embedded.items;let i=0;this.saveLastPlaylist(e);for(const e of r)0===i?this.webamp.setTracksToPlay([{defaultName:e.name,url:`${e.file}&public_key=${e.public_key}`}]):this.webamp.appendTracks([{defaultName:e.name,url:`${e.file}&public_key=${e.public_key}`}]),i++}})}),i()(this,"loadTrackFromYandexDisk",async e=>{let t=new URL(e.url).searchParams.get("public_key");await fetch(e.url,{method:"GET"}).then(e=>e).then(e=>fetch(e.url)).then(async e=>302===e.status?await fetch(`${e.headers.get("Location")}&public_key=${t}`):e).then(e=>{var t;console.log(e);const n=null===(t=e.body)||void 0===t?void 0:t.getReader();return new ReadableStream({start:e=>function t(){return null==n?void 0:n.read().then(({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()})}()})}).then(e=>new Response(e)).then(e=>e.blob()).then(e=>URL.createObjectURL(e)).then(t=>{let n=this.getAllTracks();this.replaceTrack(e,n)}).catch(e=>e)}),i()(this,"getCurrentTrack",()=>{let e=this.webamp.store.getState().playlist.currentTrack;return this.webamp.store.getState().tracks[e]}),i()(this,"getAllTracks",()=>this.webamp.store.getState().tracks),i()(this,"replaceTrack",(e,t)=>{let n=[];Object.entries(t).forEach(([t,r])=>{r.id===e.id?n.push(e):n.push(r)}),this.webamp.setTracksToPlay(n)}),i()(this,"saveLastPlaylist",e=>{this.applicationStorage.setItem("lastlist",e),document.cookie=`lastlist=${e}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; SameSite=None; secure`}),i()(this,"getCookie",e=>{const t=new RegExp(`(^| )${e}=([^;]+)`),n=document.cookie.match(t);if(n)return n[2]}),i()(this,"loadOptions",e=>{this.webamp.__loadSerializedState(e)}),i()(this,"loadOptions2",e=>{let t=0,n=e.media.volume,r=e.media.balance,i=[e.equalizer.sliders.preamp,e.equalizer.sliders[60],e.equalizer.sliders[170],e.equalizer.sliders[310],e.equalizer.sliders[600],e.equalizer.sliders[1e3],e.equalizer.sliders[3e3],e.equalizer.sliders[6e3],e.equalizer.sliders[12e3],e.equalizer.sliders[14e3],e.equalizer.sliders[16e3]],o=[60,170,310,600,1e3,3e3,6e3,12e3,14e3,16e3];this.webamp.store.dispatch({type:"SET_VOLUME",volume:Object(a.d)(n,0,100)}),this.webamp.store.dispatch({type:"SET_BALANCE",balance:r}),this.webamp.store.dispatch({type:"SET_BAND_VALUE",band:"preamp",value:e.equalizer.sliders.preamp});for(const e of o)this.webamp.store.dispatch({type:"SET_BAND_VALUE",band:e,value:i[t]}),t++;window.__webamp.store.getState().media.shuffle!==e.media.shuffle&&this.webamp.store.dispatch({type:"TOGGLE_SHUFFLE"}),window.__webamp.store.getState().media.repeat!==e.media.repeat&&this.webamp.store.dispatch({type:"TOGGLE_REPEAT"})}),setTimeout(()=>{if(!window.__webamp)throw new Error("Webamp __webamp is undefined!!");if(this.webamp=window.__webamp,void 0!==localStorage.getItem("app-state"))this.applicationStorage.getItem("app-state",(e,t)=>{this.loadOptions(JSON.parse(t))});else try{this.applicationStorage.getItem("app-state",(e,t)=>{this.loadOptions(JSON.parse(t))})}catch(e){console.log(e)}if(!1!==e){var t,n;let e;var r,i;if(console.error(this.applicationStorage.getItem),this.applicationStorage.getItem("lastlist",(t,n)=>{e=n,console.error(n)}),console.error(e),void 0!==e&&this.getTrackListFromYandexDisk(e),null!==(t=window)&&void 0!==t&&null!==(n=t.Telegram)&&void 0!==n&&n.WebApp)this.telegram=null===(r=window)||void 0===r||null===(i=r.Telegram)||void 0===i?void 0:i.WebApp,this.initializeTelegramWebAppEvents();else console.error("Telegram is undefined!! Skipping Telegram.WebApp event handler...");this.webamp.__onStateChange(()=>{this.updateAppState()}),this.initializeApplicationHandlers()}},1e3)}initializeTelegramWebAppEvents(){this.telegram.offEvent("deactivated",()=>{this.updateAppState()})}initializeApplicationHandlers(){["unload","beforeunload","pagehide"].forEach(e=>{window.addEventListener(e,()=>{this.updateAppState()})}),this.webamp.onTrackDidChange(()=>{console.log(this.webamp.store.getState()),this.updateAppState()}),this.webamp.onWillClose(()=>{this.updateAppState()}),this.webamp.onClose(()=>{this.updateAppState()}),this.webamp.onMinimize(()=>{this.updateAppState()}),this.webamp.store.dispatch({type:"ENABLE_MILKDROP",open:!1});["ended","playing","timeupdate","fileLoaded","waiting","stopWaiting"].forEach(e=>this.webamp.media.on(e,()=>{this.updateAppState()}))}}new o(!0)},function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),a=n(16),o=n(149),A=n(36);class s{static removeUnsyncBytes(e){let t=0,n=0;for(;t<e.length-1;)t!==n&&(e[n]=e[t]),t+=255===e[t]&&0===e[t+1]?2:1,n++;return t<e.length&&(e[n++]=e[t++]),e.slice(0,n)}static readFrameHeader(e,t){let n;switch(t){case 2:n={id:e.toString("ascii",0,3),length:i.UINT24_BE.get(e,3)};break;case 3:n={id:e.toString("ascii",0,4),length:i.UINT32_BE.get(e,4),flags:s.readFrameFlags(e.slice(8,10))};break;case 4:n={id:e.toString("ascii",0,4),length:A.ID3v2Token.UINT32SYNCSAFE.get(e,4),flags:s.readFrameFlags(e.slice(8,10))};break;default:throw new Error("Unexpected majorVer: "+t)}return n}static getFrameHeaderLength(e){switch(e){case 2:return 6;case 3:case 4:return 10;default:throw new Error("header versionIndex is incorrect")}}static readFrameFlags(e){return{status:{tag_alter_preservation:a.default.strtokBITSET.get(e,0,6),file_alter_preservation:a.default.strtokBITSET.get(e,0,5),read_only:a.default.strtokBITSET.get(e,0,4)},format:{grouping_identity:a.default.strtokBITSET.get(e,1,7),compression:a.default.strtokBITSET.get(e,1,3),encryption:a.default.strtokBITSET.get(e,1,2),unsynchronisation:a.default.strtokBITSET.get(e,1,1),data_length_indicator:a.default.strtokBITSET.get(e,1,0)}}}static readFrameData(e,t,n,r){switch(n){case 2:return o.default.readData(e,t.id,n,r);case 3:case 4:return t.flags.format.unsynchronisation&&(e=s.removeUnsyncBytes(e)),t.flags.format.data_length_indicator&&(e=e.slice(4,e.length)),o.default.readData(e,t.id,n,r);default:throw new Error("Unexpected majorVer: "+n)}}static makeDescriptionTagName(e,t){return e+(t?":"+t:"")}parse(e,t,n){return r(this,void 0,void 0,(function*(){this.tokenizer=t,this.metadata=e,this.options=n;const r=yield this.tokenizer.readToken(A.ID3v2Token.Header);if("ID3"!==r.fileIdentifier)throw new Error("expected ID3-header file-identifier 'ID3' was not found");return this.id3Header=r,this.headerType="ID3v2."+r.version.major,r.flags.isExtendedHeader?this.parseExtendedHeader():this.parseId3Data(r.size)}))}parseExtendedHeader(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(A.ID3v2Token.ExtendedHeader),t=e.size-A.ID3v2Token.ExtendedHeader.len;return t>0?this.parseExtendedHeaderData(t,e.size):this.parseId3Data(this.id3Header.size-e.size)}))}parseExtendedHeaderData(t,n){return r(this,void 0,void 0,(function*(){const r=e.alloc(t);return yield this.tokenizer.readBuffer(r,0,t),this.parseId3Data(this.id3Header.size-n)}))}parseId3Data(t){return r(this,void 0,void 0,(function*(){const n=e.alloc(t);yield this.tokenizer.readBuffer(n,0,t);for(const e of this.parseMetadata(n))if("TXXX"===e.id)for(const t of e.value.text)this.addTag(s.makeDescriptionTagName(e.id,e.value.description),t);else if("COM"===e.id)for(const t of e.value)this.addTag(s.makeDescriptionTagName(e.id,t.description),t.text);else if(Array.isArray(e.value))for(const t of e.value)this.addTag(e.id,t);else this.addTag(e.id,e.value)}))}addTag(e,t){this.metadata.addTag(this.headerType,e,t)}parseMetadata(e){let t=0;const n=[];for(;t!==e.length;){const r=s.getFrameHeaderLength(this.id3Header.version.major);if(t+r>e.length)break;const i=e.slice(t,t+=r),a=s.readFrameHeader(i,this.id3Header.version.major);if(""===a.id||"\0\0\0\0"===a.id||-1==="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.id[0]))break;const o=e.slice(t,t+=a.length),A=s.readFrameData(o,a,this.id3Header.version.major,!this.options.skipCovers);n.push({id:a.id,value:A})}return n}}t.ID3v2Parser=s}).call(this,n(11).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),i=n(16);!function(e){e[e.Other=0]="Other",e[e["32x32 pixels 'file icon' (PNG only)"]=1]="32x32 pixels 'file icon' (PNG only)",e[e["Other file icon"]=2]="Other file icon",e[e["Cover (front)"]=3]="Cover (front)",e[e["Cover (back)"]=4]="Cover (back)",e[e["Leaflet page"]=5]="Leaflet page",e[e["Media (e.g. label side of CD)"]=6]="Media (e.g. label side of CD)",e[e["Lead artist/lead performer/soloist"]=7]="Lead artist/lead performer/soloist",e[e["Artist/performer"]=8]="Artist/performer",e[e.Conductor=9]="Conductor",e[e["Band/Orchestra"]=10]="Band/Orchestra",e[e.Composer=11]="Composer",e[e["Lyricist/text writer"]=12]="Lyricist/text writer",e[e["Recording Location"]=13]="Recording Location",e[e["During recording"]=14]="During recording",e[e["During performance"]=15]="During performance",e[e["Movie/video screen capture"]=16]="Movie/video screen capture",e[e["A bright coloured fish"]=17]="A bright coloured fish",e[e.Illustration=18]="Illustration",e[e["Band/artist logotype"]=19]="Band/artist logotype",e[e["Publisher/Studio logotype"]=20]="Publisher/Studio logotype"}(t.AttachedPictureType||(t.AttachedPictureType={}));class a{}a.UINT32SYNCSAFE={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},a.Header={len:10,get:(e,t)=>({fileIdentifier:new r.StringType(3,"ascii").get(e,t),version:{major:r.INT8.get(e,t+3),revision:r.INT8.get(e,t+4)},flags:{raw:r.INT8.get(e,t+4),unsynchronisation:i.default.strtokBITSET.get(e,t+5,7),isExtendedHeader:i.default.strtokBITSET.get(e,t+5,6),expIndicator:i.default.strtokBITSET.get(e,t+5,5),footer:i.default.strtokBITSET.get(e,t+5,4)},size:a.UINT32SYNCSAFE.get(e,t+6)})},a.ExtendedHeader={len:10,get:(e,t)=>({size:r.UINT32_BE.get(e,t),extendedFlags:r.UINT16_BE.get(e,t+4),sizeOfPadding:r.UINT32_BE.get(e,t+6),crcDataPresent:i.default.strtokBITSET.get(e,t+4,31)})},t.ID3v2Token=a},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(11).Buffer)},function(e,t){e.exports={PRESET_VALUES:["hz60","hz170","hz310","hz600","hz1000","hz3000","hz6000","hz12000","hz14000","hz16000","preamp"],HEADER:"Winamp EQ library file v1.1"}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(14).compose;t.__esModule=!0,t.composeWithDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}},function(e){e.exports=JSON.parse('{"images":{"EQ_PREAMP_LINE":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHEAAAABCAYAAADpXEERAAAAE0lEQVQoU2Pcdfruf4ZRMKRDAAD1lwNjTqcaUQAAAABJRU5ErkJggg==","EQ_GRAPH_LINE_COLORS":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAATCAYAAABRC2cZAAAAR0lEQVQYV2O4rCT9n+F9kOJ/hvfViv8ZHkzSQCE2afxneH/HEJm49Nr0PwOYWPLIAkp0PjL4z1B41uQ/Q9QGnf8MWrPEIAQANWYwvnlToNIAAAAASUVORK5CYII="},"colors":["rgb(0,0,0)","rgb(24,33,41)","rgb(239,49,16)","rgb(206,41,16)","rgb(214,90,0)","rgb(214,102,0)","rgb(214,115,0)","rgb(198,123,8)","rgb(222,165,24)","rgb(214,181,33)","rgb(189,222,41)","rgb(148,222,33)","rgb(41,206,16)","rgb(50,190,16)","rgb(57,181,16)","rgb(49,156,8)","rgb(41,148,0)","rgb(24,132,8)","rgb(255,255,255)","rgb(214,214,222)","rgb(181,189,189)","rgb(160,170,175)","rgb(148,156,165)","rgb(150,150,150)"],"playlistStyle":{"normal":"#00FF00","current":"#FFFFFF","normalbg":"#000000","selectedbg":"#0000FF","font":"Arial"}}')},function(e,t,n){"use strict";function r(e,t){if(!(this instanceof r))return new r(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function i(e,t){return e<t?-1:e>t?1:0}e.exports=r,e.exports.default=r,r.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,n=this.compare,r=t[e];e>0;){var i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e<r;){var a=1+(e<<1),o=a+1,A=t[a];if(o<this.length&&n(t[o],A)<0&&(a=o,A=t[o]),n(A,i)>=0)break;t[e]=A,e=a}t[e]=i}}},function(e,t,n){var r=n(78),i=n(80),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},function(e){e.exports=JSON.parse('{"type":"Winamp EQ library file v1.1","presets":[{"name":"Classical","hz60":33,"hz170":33,"hz310":33,"hz600":33,"hz1000":33,"hz3000":33,"hz6000":20,"hz12000":20,"hz14000":20,"hz16000":16,"preamp":33},{"name":"Club","hz60":33,"hz170":33,"hz310":38,"hz600":42,"hz1000":42,"hz3000":42,"hz6000":38,"hz12000":33,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Dance","hz60":48,"hz170":44,"hz310":36,"hz600":32,"hz1000":32,"hz3000":22,"hz6000":20,"hz12000":20,"hz14000":32,"hz16000":32,"preamp":33},{"name":"Laptop speakers/headphones","hz60":40,"hz170":50,"hz310":41,"hz600":26,"hz1000":28,"hz3000":35,"hz6000":40,"hz12000":48,"hz14000":53,"hz16000":56,"preamp":33},{"name":"Large hall","hz60":49,"hz170":49,"hz310":42,"hz600":42,"hz1000":33,"hz3000":24,"hz6000":24,"hz12000":24,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Party","hz60":44,"hz170":44,"hz310":33,"hz600":33,"hz1000":33,"hz3000":33,"hz6000":33,"hz12000":33,"hz14000":44,"hz16000":44,"preamp":33},{"name":"Pop","hz60":29,"hz170":40,"hz310":44,"hz600":45,"hz1000":41,"hz3000":30,"hz6000":28,"hz12000":28,"hz14000":29,"hz16000":29,"preamp":33},{"name":"Reggae","hz60":33,"hz170":33,"hz310":31,"hz600":22,"hz1000":33,"hz3000":43,"hz6000":43,"hz12000":33,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Rock","hz60":45,"hz170":40,"hz310":23,"hz600":19,"hz1000":26,"hz3000":39,"hz6000":47,"hz12000":50,"hz14000":50,"hz16000":50,"preamp":33},{"name":"Soft","hz60":40,"hz170":35,"hz310":30,"hz600":28,"hz1000":30,"hz3000":39,"hz6000":46,"hz12000":48,"hz14000":50,"hz16000":52,"preamp":33},{"name":"Ska","hz60":28,"hz170":24,"hz310":25,"hz600":31,"hz1000":39,"hz3000":42,"hz6000":47,"hz12000":48,"hz14000":50,"hz16000":48,"preamp":33},{"name":"Full Bass","hz60":48,"hz170":48,"hz310":48,"hz600":42,"hz1000":35,"hz3000":25,"hz6000":18,"hz12000":15,"hz14000":14,"hz16000":14,"preamp":33},{"name":"Soft Rock","hz60":39,"hz170":39,"hz310":36,"hz600":31,"hz1000":25,"hz3000":23,"hz6000":26,"hz12000":31,"hz14000":37,"hz16000":47,"preamp":33},{"name":"Full Treble","hz60":16,"hz170":16,"hz310":16,"hz600":25,"hz1000":37,"hz3000":50,"hz6000":58,"hz12000":58,"hz14000":58,"hz16000":60,"preamp":33},{"name":"Full Bass & Treble","hz60":44,"hz170":42,"hz310":33,"hz600":20,"hz1000":24,"hz3000":35,"hz6000":46,"hz12000":50,"hz14000":52,"hz16000":52,"preamp":33},{"name":"Live","hz60":24,"hz170":33,"hz310":39,"hz600":41,"hz1000":42,"hz3000":42,"hz6000":39,"hz12000":37,"hz14000":37,"hz16000":36,"preamp":33},{"name":"Techno","hz60":45,"hz170":42,"hz310":33,"hz600":23,"hz1000":24,"hz3000":33,"hz6000":45,"hz12000":48,"hz14000":48,"hz16000":47,"preamp":33}]}')},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0}),t.convertAniBinaryToCSS=void 0;var a=n(99);t.convertAniBinaryToCSS=function(e,t){var n=function(e){var t,n=a.parseAni(e),r=null!==(t=n.rate)&&void 0!==t?t:n.images.map((function(){return n.metadata.iDispRate})),o=(l=r,l.reduce((function(e,t){return e+t}),0)),A=n.images.map((function(e){return{url:(n=e,t=n,r=window.btoa(String.fromCharCode.apply(String,i(t))),"data:image/x-win-bitmap;base64,"+r),percents:[]};var t,n,r})),s=0;var l;return r.forEach((function(e,t){var r=n.seq?n.seq[t]:t;A[r].percents.push(s/o*100),s+=e})),{duration:o*(1e3/60),frames:A}}(t),r="ani-cursor-"+A();return"\n @keyframes "+r+" {\n "+n.frames.map((function(e){var t=e.url;return e.percents.map((function(e){return e+"%"})).join(", ")+" { cursor: url("+t+"), auto; }"})).join("\n")+"\n }\n "+e+":hover {\n animation: "+r+" "+n.duration+"ms step-end infinite;\n }\n "};var o=0,A=function(){return o++}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(126),i=n(132);t.fromStream=function(e,t){return new r.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e){return new i.BufferTokenizer(e)}},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,A=arguments.length;switch(A){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(A-1),o=0;o<a.length;)a[o++]=arguments[o];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n(32))},function(e,t,n){var r=n(11),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(10),a=n(108),o=n(8),A=n(20),s=n(16),l=n(22),u=n(161),c=i("music-metadata:parser:APEv2");class d extends l.BasicParser{constructor(){super(...arguments),this.ape={}}static calculateDuration(e){let t=e.totalFrames>1?e.blocksPerFrame*(e.totalFrames-1):0;return t+=e.finalFrameBlocks,t/e.sampleRate}static parseTagHeader(t,n,i){return r(this,void 0,void 0,(function*(){if(n.fileSize&&n.fileSize-n.position<u.TagFooter.len)return void c("No APEv2 header found, end-of-file reached");const r=yield n.peekToken(u.TagFooter);if("APETAGEX"===r.ID){yield n.ignore(u.TagFooter.len);const e=yield n.readToken(u.TagField(r));d.parseTags(t,r,e,0,!i.skipCovers)}else if(c("APEv2 header not found at offset="+n.position),n.fileSize){const r=n.fileSize-n.position,a=e.alloc(r);return yield n.readBuffer(a),d.parseTagFooter(t,a,!i.skipCovers)}}))}static parseTagFooter(e,t,n){const r=u.TagFooter.get(t,t.length-u.TagFooter.len);A.equal(r.ID,"APETAGEX","APEv2 Footer preamble"),this.parseTags(e,r,t,t.length-r.size,n)}static parseTags(t,n,r,i,o){for(let A=0;A<n.fields;A++){const n=u.TagItemHeader.get(r,i);i+=u.TagItemHeader.len;let A=s.default.findZero(r,i,r.length);const l=r.toString("ascii",i,A);switch(i=A+1,n.flags.dataType){case u.DataType.text_utf8:{const e=r.toString("utf8",i,i+=n.size).split(/\x00/g);for(const n of e)t.addTag("APEv2",l,n);break}case u.DataType.binary:if(o){const o=r.slice(i,i+n.size);let u=0;A=s.default.findZero(o,u,o.length);const d=o.toString("utf8",u,A);u=A+1;const h=e.from(o.slice(u)),f=a(h);if(f)if(0===f.mime.indexOf("image/")){const e={description:d,data:h,format:f.mime};i+=n.size,t.addTag("APEv2",l,e)}else c("Unexpected binary tag of type': "+f.mime);else c("Failed to determine file type for binary tag: "+l)}break;case u.DataType.external_info:c("Ignore external info "+l);break;default:throw new Error("Unexpected data-type: "+n.flags.dataType)}}}parse(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(u.DescriptorParser);A.equal(e.ID,"MAC ","descriptor.ID"),this.ape.descriptor=e;const t=e.descriptorBytes-u.DescriptorParser.len,n=yield t>0?this.parseDescriptorExpansion(t):this.parseHeader();return yield this.tokenizer.readToken(new o.IgnoreType(n.forwardBytes)),d.parseTagHeader(this.metadata,this.tokenizer,this.options)}))}parseDescriptorExpansion(e){return r(this,void 0,void 0,(function*(){return yield this.tokenizer.readToken(new o.IgnoreType(e)),this.parseHeader()}))}parseHeader(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(u.Header);return this.metadata.setFormat("lossless",!0),this.metadata.setFormat("dataformat","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",e.bitsPerSample),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.channel),this.metadata.setFormat("duration",d.calculateDuration(e)),{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}))}}t.APEv2Parser=d}).call(this,n(11).Buffer)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(24),a=n(36),o=n(35),A=n(52),s=n(10),l=n(22),u=s("music-metadata:parser:ID3");class c extends l.BasicParser{constructor(){super(...arguments),this.id3parser=new o.ID3v2Parser}static startsWithID3v2Header(e){return r(this,void 0,void 0,(function*(){return"ID3"===(yield e.peekToken(a.ID3v2Token.Header)).fileIdentifier}))}parse(){return this.parseID3v2().catch(e=>{if(e.message!==i.endOfFile)throw e})}finalize(){}parseID3v2(){return r(this,void 0,void 0,(function*(){if(yield this.tryReadId3v2Headers(),u("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),yield this._parse(),this.options.skipPostHeaders&&this.metadata.hasAny())this.finalize();else{const e=new A.ID3v1Parser;yield e.init(this.metadata,this.tokenizer,this.options).parse(),this.finalize()}}))}tryReadId3v2Headers(){return r(this,void 0,void 0,(function*(){if("ID3"===(yield this.tokenizer.peekToken(a.ID3v2Token.Header)).fileIdentifier)return u("Found ID3v2 header, pos=%s",this.tokenizer.position),yield this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}))}}t.AbstractID3Parser=c},function(e,t,n){"use strict";n.r(t);var r=n(4),i=n.n(r),a=n(0),o=n(1),A=n.n(o),s=n(7),l=n.n(s),u=(n(63),A.a.createContext(null));var c=function(e){e()},d={notify:function(){}};function h(){var e=c,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var f=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=d,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=h())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=d)},e}();var p=function(e){var t=e.store,n=e.context,r=e.children,i=Object(o.useMemo)((function(){var e=new f(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),a=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=i.subscription;return e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[i,a]);var s=n||u;return A.a.createElement(s.Provider,{value:i},r)};n(29),n(28);var g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;var m=n(14);function b(){return Object(o.useContext)(u)}function E(e){void 0===e&&(e=u);var t=e===u?b:function(){return Object(o.useContext)(e)};return function(){return t().store}}var w=E();function y(e){void 0===e&&(e=u);var t=e===u?w:E(e);return function(){return t().dispatch}}var v=y(),k=function(e,t){return e===t};function S(e){void 0===e&&(e=u);var t=e===u?b:function(){return Object(o.useContext)(e)};return function(e,n){void 0===n&&(n=k);var r=t(),i=function(e,t,n,r){var i,a=Object(o.useReducer)((function(e){return e+1}),0)[1],A=Object(o.useMemo)((function(){return new f(n,r)}),[n,r]),s=Object(o.useRef)(),l=Object(o.useRef)(),u=Object(o.useRef)(),c=Object(o.useRef)(),d=n.getState();try{i=e!==l.current||d!==u.current||s.current?e(d):c.current}catch(e){throw s.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+s.current.stack+"\n\n"),e}return g((function(){l.current=e,u.current=d,c.current=i,s.current=void 0})),g((function(){function e(){try{var e=l.current(n.getState());if(t(e,c.current))return;c.current=e}catch(e){s.current=e}a()}return A.onStateChange=e,A.trySubscribe(),e(),function(){return A.tryUnsubscribe()}}),[n,A]),i}(e,n,r.store,r.subscription);return Object(o.useDebugValue)(i),i}}var I,O=S();function T(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}I=s.unstable_batchedUpdates,c=I;var C=T();C.withExtraArgument=T;var x=C,U=n(40);var B=n(3);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const _={trackOrder:[],currentTrack:null,lastSelectedIndex:null,selectedTracks:new Set};var D=(e=_,t)=>{switch(t.type){case"CLICKED_TRACK":return N(N({},e),{},{selectedTracks:new Set([e.trackOrder[t.index]]),lastSelectedIndex:t.index});case"CTRL_CLICKED_TRACK":{const i=e.trackOrder[t.index],a=new Set(e.selectedTracks);return r=i,(n=a).has(r)?n.delete(r):n.add(r),N(N({},e),{},{selectedTracks:a,lastSelectedIndex:t.index})}case"SHIFT_CLICKED_TRACK":if(null==e.lastSelectedIndex)return e;const i=t.index,a=Math.min(i,e.lastSelectedIndex),o=Math.max(i,e.lastSelectedIndex),A=new Set(e.trackOrder.slice(a,o+1));return N(N({},e),{},{selectedTracks:A});case"SELECT_ALL":return N(N({},e),{},{selectedTracks:new Set(e.trackOrder)});case"SELECT_ZERO":return N(N({},e),{},{selectedTracks:new Set});case"INVERT_SELECTION":return N(N({},e),{},{selectedTracks:new Set(e.trackOrder.filter(t=>!e.selectedTracks.has(t)))});case"REMOVE_ALL_TRACKS":return N(N({},e),{},{trackOrder:[],currentTrack:null,selectedTracks:new Set,lastSelectedIndex:null});case"REMOVE_TRACKS":const s=new Set(t.ids.map(Number)),{currentTrack:l}=e;return N(N({},e),{},{trackOrder:e.trackOrder.filter(e=>!s.has(e)),currentTrack:s.has(Number(l))?null:l,selectedTracks:new Set(Array.from(e.selectedTracks).filter(e=>s.has(e))),lastSelectedIndex:null});case"REVERSE_LIST":return N(N({},e),{},{trackOrder:[...e.trackOrder].reverse(),lastSelectedIndex:null});case"RANDOMIZE_LIST":return N(N({},e),{},{trackOrder:Object(B.A)(e.trackOrder)});case"SET_TRACK_ORDER":const{trackOrder:u}=t;return N(N({},e),{},{trackOrder:u});case"ADD_TRACK_FROM_URL":const c=null==t.atIndex?e.trackOrder.length:t.atIndex;return N(N({},e),{},{trackOrder:[...e.trackOrder.slice(0,c),Number(t.id),...e.trackOrder.slice(c)],lastSelectedIndex:null});case"PLAY_TRACK":case"BUFFER_TRACK":return N(N({},e),{},{currentTrack:t.id});case"DRAG_SELECTED":return N(N({},e),{},{trackOrder:Object(B.p)(e.trackOrder,t=>e.selectedTracks.has(e.trackOrder[t]),t.offset),lastSelectedIndex:null});default:return e}var n,r},L=n(9),j=n.n(L),R=n(2);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Q={focused:R.m.MAIN,positionsAreRelative:!0,genWindows:{[R.m.MAIN]:{title:"Main Window",size:[0,0],open:!0,shade:!1,canResize:!1,canShade:!0,canDouble:!0,hotkey:"Alt+W",position:{x:0,y:0}},[R.m.EQUALIZER]:{title:"Equalizer",size:[0,0],open:!0,shade:!1,canResize:!1,canShade:!0,canDouble:!0,hotkey:"Alt+G",position:{x:0,y:0}},[R.m.PLAYLIST]:{title:"Playlist Editor",size:[0,0],open:!0,shade:!1,canResize:!0,canShade:!0,canDouble:!1,hotkey:"Alt+E",position:{x:0,y:0}}},browserWindowSize:{width:0,height:0},windowOrder:[R.m.PLAYLIST,R.m.EQUALIZER,R.m.MILKDROP,R.m.MAIN]};function z(e){return{positionsAreRelative:e.positionsAreRelative,genWindows:B.t(e.genWindows,e=>({size:e.size,open:e.open,hidden:!1,shade:e.shade||!1,position:e.position})),focused:e.focused}}var V=(e=Q,t)=>{switch(t.type){case"ENABLE_MILKDROP":return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[R.m.MILKDROP]:{title:"Milkdrop",size:[0,0],open:t.open,shade:!1,canResize:!0,canShade:!1,canDouble:!1,position:{x:0,y:0}}})});case"SET_FOCUSED_WINDOW":let n=e.windowOrder;return null!=t.window&&(n=[...e.windowOrder.filter(e=>e!==t.window),t.window]),P(P({},e),{},{focused:t.window,windowOrder:n});case"TOGGLE_WINDOW_SHADE_MODE":const{canShade:r}=e.genWindows[t.windowId];if(!r)throw new Error("Tried to shade/unshade a window that cannot be shaded: "+t.windowId);return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},e.genWindows[t.windowId]),{},{shade:!e.genWindows[t.windowId].shade})})});case"TOGGLE_WINDOW":const i=e.genWindows[t.windowId];return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},i),{},{open:!i.open})})});case"CLOSE_WINDOW":return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},e.genWindows[t.windowId]),{},{open:!1})})});case"WINDOW_SIZE_CHANGED":const{canResize:a}=e.genWindows[t.windowId];if(!a)throw new Error("Tried to resize a window that cannot be resized: "+t.windowId);return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},e.genWindows[t.windowId]),{},{size:t.size})})});case"UPDATE_WINDOW_POSITIONS":return P(P({},e),{},{positionsAreRelative:!0!==t.absolute&&e.positionsAreRelative,genWindows:B.t(e.genWindows,(e,n)=>{const r=t.positions[n];return null==r?e:P(P({},e),{},{position:r})})});case"RESET_WINDOW_SIZES":return P(P({},e),{},{genWindows:B.t(e.genWindows,e=>P(P({},e),{},{size:[0,0]}))});case"LOAD_SERIALIZED_STATE":{const{genWindows:n,focused:r,positionsAreRelative:i}=t.serializedState.windows;return P(P({},e),{},{positionsAreRelative:i,genWindows:B.t(e.genWindows,(e,t)=>{const r=n[t];if(null==r)return e;const{hidden:i}=r,a=j()(r,["hidden"]);return P(P({},e),a)}),focused:r})}case"BROWSER_WINDOW_SIZE_CHANGED":return P(P({},e),{},{browserWindowSize:{height:t.height,width:t.width}});default:return e}};function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const K={timeMode:R.h.ELAPSED,timeElapsed:0,volume:Math.round(200/255*100),balance:0,shuffle:!1,repeat:!1,status:R.f.STOPPED};function H(e){const{volume:t,balance:n,shuffle:r,repeat:i}=e;return{volume:t,balance:n,shuffle:r,repeat:i}}var J=(e=K,t)=>{switch(t.type){case"PLAY":case"IS_PLAYING":return Y(Y({},e),{},{status:R.f.PLAYING});case"PAUSE":return Y(Y({},e),{},{status:R.f.PAUSED});case"STOP":case"IS_STOPPED":return Y(Y({},e),{},{status:R.f.STOPPED});case"TOGGLE_TIME_MODE":const n=e.timeMode===R.h.REMAINING?R.h.ELAPSED:R.h.REMAINING;return Y(Y({},e),{},{timeMode:n});case"UPDATE_TIME_ELAPSED":return Y(Y({},e),{},{timeElapsed:t.elapsed});case"SET_MEDIA":return Y({},e);case"SET_VOLUME":return Y(Y({},e),{},{volume:t.volume});case"SET_BALANCE":return Y(Y({},e),{},{balance:t.balance});case"TOGGLE_REPEAT":return Y(Y({},e),{},{repeat:!e.repeat});case"TOGGLE_SHUFFLE":return Y(Y({},e),{},{shuffle:!e.shuffle});case"LOAD_SERIALIZED_STATE":return Y(Y({},e),t.serializedState.media);default:return e}},q=n(5);function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const X={itemBackground:"rgb(0,0,0)",itemForeground:"rgb(0,255,0)",windowBackground:"rgb(56,55,87)",buttonText:"rgb(57,57,66)",windowText:"rgb(255,255,255)",divider:"rgb(117,116,139)",playlistSelection:"rgb(0,0,198)",listHeaderBackground:"rgb(72,72,120)",listHeaderText:"rgb(255,255,255)",listHeaderFrameTopAndLeft:"rgb(108,108,180)",listHeaderFrameBottomAndRight:"rgb(36,36,60)",listHeaderFramePressed:"rgb(18,18,30)",listHeaderDeadArea:"rgb(36,36,60)",scrollbarOne:"rgb(36,36,60)",scrollbarTwo:"rgb(36,36,60)",pressedScrollbarOne:"rgb(121,130,150)",pressedScrollbarTwo:"rgb(78,88,110)",scrollbarDeadArea:"rgb(36,36,60)",listTextHighlighted:"rgb(0,198,255)",listTextHighlightedBackground:"rgb(0,198,255)",listTextSelected:"rgb(0,198,255)",listTextSelectedBackground:"rgb(0,198,255)"},$={doubled:!1,marqueeStep:0,disableMarquee:!1,loading:!0,llama:!1,closed:!1,working:!1,skinImages:R.c.images,skinColors:R.c.colors,skinCursors:null,skinPlaylistStyle:null,skinRegion:{},visualizerStyle:0,dummyVizData:null,playlistScrollPosition:0,skinGenLetterWidths:null,skinGenExColors:X,additionalVisualizers:[],zIndex:0};var ee=(e=$,t)=>{switch(t.type){case"LOAD_DEFAULT_SKIN":{const{skinImages:t,skinColors:n,skinCursors:r,skinPlaylistStyle:i,skinRegion:a,skinGenLetterWidths:o,skinGenExColors:A}=$;return Z(Z({},e),{},{skinImages:t,skinColors:n,skinCursors:r,skinPlaylistStyle:i,skinRegion:a,skinGenLetterWidths:o,skinGenExColors:A})}case"TOGGLE_DOUBLESIZE_MODE":return Z(Z({},e),{},{doubled:!e.doubled});case"TOGGLE_LLAMA_MODE":return Z(Z({},e),{},{llama:!e.llama});case"STEP_MARQUEE":return e.disableMarquee?e:Z(Z({},e),{},{marqueeStep:e.marqueeStep+1});case"DISABLE_MARQUEE":return Z(Z({},e),{},{disableMarquee:!0});case"STOP_WORKING":return Z(Z({},e),{},{working:!1});case"START_WORKING":return Z(Z({},e),{},{working:!0});case"CLOSE_WINAMP":return Z(Z({},e),{},{closed:!0});case"OPEN_WINAMP":return Z(Z({},e),{},{closed:!1});case"LOADING":return Z(Z({},e),{},{loading:!0});case"LOADED":return Z(Z({},e),{},{loading:!1});case"SET_SKIN_DATA":const{data:n}=t;return Z(Z({},e),{},{loading:!1,skinImages:n.skinImages,skinColors:n.skinColors,skinPlaylistStyle:n.skinPlaylistStyle,skinCursors:n.skinCursors,skinRegion:n.skinRegion,skinGenLetterWidths:n.skinGenLetterWidths,skinGenExColors:n.skinGenExColors||X});case"TOGGLE_VISUALIZER_STYLE":return Z(Z({},e),{},{visualizerStyle:(e.visualizerStyle+1)%R.l.length});case"SET_PLAYLIST_SCROLL_POSITION":return Z(Z({},e),{},{playlistScrollPosition:t.position});case"SET_Z_INDEX":return Z(Z({},e),{},{zIndex:t.zIndex});case"SET_DUMMY_VIZ_DATA":return Z(Z({},e),{},{dummyVizData:t.data});case"LOAD_SERIALIZED_STATE":{const n=t.serializedState.display,{skinCursors:r}=n,i=j()(n,["skinCursors"]),a=e=>({type:"cur",url:e}),o=null==r?null:B.t(r,a);return Z(Z({},e),{},{skinCursors:o},i)}default:return e}};const te=e=>{const{visualizerStyle:t,doubled:n,llama:r,marqueeStep:i,skinImages:a,skinCursors:o,skinRegion:A,skinGenLetterWidths:s,skinColors:l,skinPlaylistStyle:u}=e;let c=null;return null!=o&&(c=B.t(o,e=>"cur"===e.type?e.url:void 0)),{visualizerStyle:t,doubled:n,llama:r,marqueeStep:i,skinImages:a,skinCursors:c,skinRegion:A,skinGenLetterWidths:s,skinColors:l,skinPlaylistStyle:u}},ne=Object(q.createSelector)(e=>e.visualizerStyle,e=>R.l[e]);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ae={focus:null,bandFocused:null,scrubPosition:0,userMessage:null};var oe=(e=ae,t)=>{switch(t.type){case"SET_FOCUS":return ie(ie({},e),{},{focus:t.input,bandFocused:null});case"SET_BAND_FOCUS":return ie(ie({},e),{},{focus:t.input,bandFocused:t.bandFocused});case"UNSET_FOCUS":return ie(ie({},e),{},{focus:null,bandFocused:null});case"SET_SCRUB_POSITION":return ie(ie({},e),{},{scrubPosition:t.position});case"SET_USER_MESSAGE":return ie(ie({},e),{},{userMessage:t.message});case"UNSET_USER_MESSAGE":return ie(ie({},e),{},{userMessage:null});default:return e}};function Ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const le={on:!0,auto:!1,sliders:{preamp:50,60:50,170:50,310:50,600:50,1e3:50,3e3:50,6e3:50,12e3:50,14e3:50,16e3:50}};var ue=(e=le,t)=>{switch(t.type){case"SET_BAND_VALUE":const n=se(se({},e.sliders),{},{[t.band]:t.value});return se(se({},e),{},{sliders:n});case"SET_EQ_ON":return se(se({},e),{},{on:!0});case"SET_EQ_OFF":return se(se({},e),{},{on:!1});case"SET_EQ_AUTO":return se(se({},e),{},{auto:t.value});case"LOAD_SERIALIZED_STATE":return t.serializedState.equalizer||e;default:return e}};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var he=(e={connected:!0},t)=>{switch(t.type){case"NETWORK_CONNECTED":return de(de({},e),{},{connected:!0});case"NETWORK_DISCONNECTED":return de(de({},e),{},{connected:!1});default:return e}};function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ge={availableSkins:[]};var me=(e=ge,t)=>{switch(t.type){case"SET_AVAILABLE_SKINS":return pe(pe({},e),{},{availableSkins:t.skins});default:return e}},be=n(21),Ee=n.n(be);async function we(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=n,r.readAsText(e)})}async function ye({accept:e,directory:t=!1}={accept:null,directory:!1}){return new Promise(n=>{const r=document.createElement("input");e&&r.setAttribute("accept",e),r.type="file",r.multiple=!0,r.webkitdirectory=t,r.directory=t,r.mozdirectory=t,r.value=null,r.addEventListener("change",e=>{const t=e.target.files;n(t)}),r.click()})}function ve(e){return"data:image/x-win-bitmap;base64,"+B.b(e)}function ke(e){if(function(e){return/^blob:/.test(e)}(e))return null;const t=e.split("/").pop();return null==t?null:t.split("#")[0].split("?")[0]}const Se=B.E(e=>{const{artist:t,title:n,defaultName:r,url:i}=e;if(t&&n)return`${t} - ${n}`;if(n)return n;if(r)return r;if(i){const e=ke(i);if(e)return e}return"???"});B.E(e=>{if(e.url){const t=ke(e.url);if(null!=t)return t}return e.defaultName?e.defaultName:"???"});function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Te={};var Ce=(e=Te,t)=>{var n;switch(t.type){case"ADD_TRACK_FROM_URL":return Oe(Oe({},e),{},{[t.id]:{id:t.id,defaultName:t.defaultName||null,duration:null!==(n=t.duration)&&void 0!==n?n:null,url:t.url,mediaTagsRequestStatus:R.g.INITIALIZED}});case"SET_MEDIA":{const n=Oe(Oe({},e[t.id]),{},{duration:t.length});return Oe(Oe({},e),{},{[t.id]:n})}case"MEDIA_TAG_REQUEST_INITIALIZED":return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},e[t.id]),{},{mediaTagsRequestStatus:R.g.INITIALIZED})});case"MEDIA_TAG_REQUEST_FAILED":return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},e[t.id]),{},{mediaTagsRequestStatus:R.g.FAILED})});case"SET_MEDIA_DURATION":return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},e[t.id]),{},{duration:t.duration})});case"SET_MEDIA_TAGS":const r=e[t.id],{sampleRate:i,bitrate:a,numberOfChannels:o,title:A,artist:s,album:l,albumArtUrl:u}=t,{kbps:c,khz:d,channels:h}=r;return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},r),{},{mediaTagsRequestStatus:R.g.COMPLETE,title:A,artist:s,album:l,albumArtUrl:u,kbps:null!=a?String(Math.round(a/1e3)):c,khz:null!=i?String(Math.round(i/1e3)):d,channels:null!=o?o:h})});default:return e}};let xe;function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFAULT=1]="DEFAULT",e[e.USER_PRESET=2]="USER_PRESET"}(xe||(xe={}));const Me={display:"WINDOW",overlay:!1,presetHistory:[],presets:[],currentPresetIndex:null,butterchurn:null,transitionType:xe.DEFAULT,randomize:!0,cycling:!0,message:null};var Ne=(e=Me,t)=>{switch(t.type){case"SET_MILKDROP_DESKTOP":return Be(Be({},e),{},{display:t.enabled?"DESKTOP":"WINDOW"});case"SET_MILKDROP_FULLSCREEN":return Be(Be({},e),{},{display:t.enabled?"FULLSCREEN":"WINDOW"});case"GOT_BUTTERCHURN":return Be(Be({},e),{},{butterchurn:t.butterchurn});case"GOT_BUTTERCHURN_PRESETS":return Be(Be({},e),{},{presets:e.presets.concat(t.presets)});case"PRESET_REQUESTED":return t.addToHistory?Be(Be({},e),{},{presetHistory:[...e.presetHistory,t.index]}):Be(Be({},e),{},{presetHistory:e.presetHistory.slice(0,-1)});case"RESOLVE_PRESET_AT_INDEX":const n=e.presets[t.index];return Be(Be({},e),{},{presets:B.y(e.presets,t.index,{type:"RESOLVED",name:n.name,preset:t.json})});case"SELECT_PRESET_AT_INDEX":return Be(Be({},e),{},{currentPresetIndex:t.index,transitionType:t.transitionType});case"TOGGLE_PRESET_OVERLAY":return Be(Be({},e),{},{overlay:!e.overlay});case"TOGGLE_RANDOMIZE_PRESETS":return Be(Be({},e),{},{randomize:!e.randomize});case"TOGGLE_PRESET_CYCLING":return Be(Be({},e),{},{cycling:!e.cycling});case"SCHEDULE_MILKDROP_MESSAGE":return Be(Be({},e),{},{message:{text:t.message,time:Date.now()}});default:return e}};var _e=Object(m.combineReducers)({userInput:oe,windows:V,display:ee,settings:me,equalizer:ue,playlist:D,media:J,network:he,tracks:Ce,milkdrop:Ne});function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?De(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const je={height:"2px",borderWidth:0,color:"gray",backgroundColor:"gray"},Re=e=>Object(a.jsx)("body",Le({},e)),Fe=e=>Object(a.jsx)("font",Le({},e)),Pe=e=>Object(a.jsx)("hr",Le({},e)),Qe=e=>Object(a.jsx)("div",Le({},e)),ze=e=>Object(a.jsx)("table",Le({},e)),Ve=e=>Object(a.jsxs)("html",{children:[Object(a.jsxs)("head",{children:[Object(a.jsx)("link",{rel:"stylesheet",href:"null"}),Object(a.jsx)("style",{type:"text/css",children:'\n body { background: #000040; }\n .para1 { margin-top: -42px; margin-left: 145px; margin-right: 10px; font-family: "font2, Arial"; font-size: 30px; line-height: 35px; text-align: left; color: #E1E1E1; }\n .para2 { margin-top: 15px; margin-left: 15px; margin-right: 50px; font-family: "font1, Arial Black"; font-size: 50px; line-height: 40px; text-align: left; color: #004080; }\n '}),Object(a.jsx)("title",{children:"Winamp Generated PlayList"})]}),Object(a.jsxs)(Re,{bgcolor:"#000080",topmargin:"0",leftmargin:"0",text:"#FFFFFF",children:[Object(a.jsxs)(Qe,{align:"center",children:[Object(a.jsx)(Qe,{className:"para2",align:"center",children:Object(a.jsx)("p",{children:"WINAMP"})}),Object(a.jsx)(Qe,{className:"para1",align:"center",children:Object(a.jsx)("p",{children:"playlist"})})]}),Object(a.jsx)(Pe,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:je}),Object(a.jsx)(Qe,{align:"right",children:Object(a.jsx)(ze,{border:"0",cellSpacing:"0",cellPadding:"0",width:"98%",children:Object(a.jsx)("tbody",{children:Object(a.jsx)("tr",{children:Object(a.jsxs)("td",{children:[Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.numberOfTracks}),Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:" track in playlist, average track length: "}),Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.averageTrackLength})]})}),Object(a.jsx)("br",{}),Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:"Playlist length: "}),Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.playlistLengthMinutes}),Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:" minutes "}),Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.playlistLengthSeconds}),Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:" second "}),Object(a.jsx)("br",{}),Object(a.jsxs)(Fe,{color:"#409FFF",face:"Arial",children:["Right-click ",Object(a.jsx)("a",{href:"./",children:"here"})," to save this HTML file."]})]})})]})})})})}),Object(a.jsxs)("blockquote",{children:[Object(a.jsx)("p",{children:Object(a.jsx)(Fe,{color:"#FFBF00",face:"Arial",children:Object(a.jsx)("big",{children:"Playlist files:"})})}),Object(a.jsx)("ul",{children:Object(a.jsx)(Fe,{face:"Arial",color:"#FFFFFF",children:Object(a.jsx)("small",{children:e.tracks.map(e=>Object(a.jsxs)("span",{children:[e,Object(a.jsx)("br",{})]},e))})})})]}),Object(a.jsx)(Pe,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:je})]})]}),Ge=e=>{return t=(e=>{const t=document.createElement("div");return Object(s.render)(Object(a.jsx)(Ve,Le({},e)),t),t.innerHTML})(e),"data:text/html;base64,"+window.btoa(t);var t},Ye=(e,t)=>{const n=(r=(t-50)/50*12,(Math.round(10*r)/10).toFixed(1));var r;var i;return`EQ: ${"preamp"===e?"Preamp":(i=e)<1e3?i+"HZ":i/1e3+"KHZ"} ${(e=>e>0?"+"+e:e.toString())(n)} DB`};function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Je=e=>e.equalizer.sliders,qe=Object(q.createSelector)(Je,e=>{const t={name:"Entry1",preamp:B.e(e.preamp)};R.a.forEach(n=>{t["hz"+n]=B.e(e[n])});return{presets:[t],type:"Winamp EQ library file v1.1"}}),We=e=>e.tracks,Ze=e=>t=>{var n;return null===(n=e.tracks[t])||void 0===n?void 0:n.url},Xe=e=>e.playlist.trackOrder,$e=Object(q.createSelector)(Xe,e=>e.length),et=Object(q.createSelector)(We,Xe,(e,t)=>t.filter(t=>e[t])),tt=Object(q.createSelector)(We,Xe,(e,t)=>t.map(t=>{const n=e[t];return{url:n.url,metaData:{artist:n.artist||"",title:n.title||"",album:n.album,albumArtUrl:n.albumArtUrl||""}}})),nt=Object(q.createSelector)(We,et,(e,t)=>t.map(t=>e[t])),rt=e=>e.playlist.selectedTracks,it=Object(q.createSelector)(nt,rt,(e,t)=>e.filter(e=>t.has(e.id))),at=e=>e.reduce((e,t)=>e+Number(t.duration),0),ot=Object(q.createSelector)(nt,at),At=Object(q.createSelector)(it,at),st=Object(q.createSelector)(ot,At,(e,t)=>`${B.j(t)}/${B.j(e)}`),lt=e=>{const{playlist:t}=e;return null==t.currentTrack?-1:t.trackOrder.indexOf(t.currentTrack)},ut=Object(q.createSelector)(lt,e=>e+1),ct=e=>e.playlist.currentTrack,dt=(e,t=1)=>{const{playlist:{trackOrder:n},media:{repeat:r,shuffle:i}}=e;if(i)return(e=>{const{playlist:{trackOrder:t,currentTrack:n}}=e;if(0===t.length)return null;let r;do{r=t[Math.floor(t.length*Math.random())]}while(r===n&&t.length>1);return r})(e);const a=$e(e);if(0===a)return null;const o=lt(e);let A=o+t;return r?(A%=a,A<0&&(A+=a),n[A]):o===a-1&&t>0||0===o&&t<0?null:(A=B.d(A,0,a-1),n[A])},ht=e=>e.windows.genWindows,ft=Object(q.createSelector)(ht,e=>t=>e[t].open),pt=Object(q.createSelector)((function(e){return"WINDOW"===e.milkdrop.display}),e=>t=>t===R.m.MILKDROP&&!e),gt=Object(q.createSelector)(ht,e=>t=>e[t].shade),mt=Object(q.createSelector)(ht,e=>t=>e[t].size),bt=Object(q.createSelector)(ht,e=>B.t(e,e=>e.position)),Et=Object(q.createSelector)(mt,e=>{const t=e("playlist");return Math.floor((58+R.n*t[1])/R.i)}),wt=Object(q.createSelector)($e,Et,(e,t)=>Math.max(0,e-t)),yt=e=>e.display.playlistScrollPosition,vt=Object(q.createSelector)(wt,yt,(e,t)=>0===e?0:Math.round(Math.round(e*t/100)/e*100)),kt=Object(q.createSelector)(yt,$e,Et,(e,t,n)=>{const r=Math.max(0,t-n);return B.w(e/100,r+1)}),St=Object(q.createSelector)(kt,Xe,Et,(e,t,n)=>t.slice(e,e+n));function It(e){return St(e).length===e.playlist.trackOrder.length}const Ot=Object(q.createSelector)(St,e=>t=>e.includes(t)),Tt=(Object(q.createSelector)(St,We,(e,t)=>e.map(e=>t[e])),e=>{const{playlist:t,tracks:n}=e;if(null==t.currentTrack)return null;const r=n[t.currentTrack];return r&&r.duration}),Ct=Object(q.createSelector)(We,e=>Object(q.defaultMemoize)(t=>((e,t=null)=>{if(null==t)return null;const n=e[t];return null==n?null:Se(n)})(e,t))),xt=Object(q.createSelector)(ct,Ct,(e,t)=>t(e)),Ut=e=>e.media.status,Bt=e=>e.media.status===R.f.PLAYING,Mt=Object(q.createSelector)(ct,We,(e,t)=>null==e?null:t[e]),Nt=Object(q.createSelector)(Bt,Mt,(e,t)=>e&&t&&t.mediaTagsRequestStatus!==R.g.INITIALIZED?t.id:null),_t=Object(q.createSelector)(Mt,e=>null==e?null:{url:e.url,metaData:{title:e.title||null,artist:e.artist||null,album:e.album||null,albumArtUrl:e.albumArtUrl||null}}),Dt=Object(q.createSelector)(ut,xt,(e,t)=>null==t?null:`${e}. ${t}`),Lt=Object(q.createSelector)(Dt,Tt,(e,t)=>null==e?null:`${e} (${B.j(t)})`),jt=e=>Xe(e).length,Rt=Object(q.createSelector)(We,e=>Object.values(e).reduce((e,t)=>e+(t.duration||0),0)),Ft=Object(q.createSelector)(jt,Rt,Xe,We,Ct,(e,t,n,r,i)=>Ge({numberOfTracks:e,averageTrackLength:B.j(t/e),playlistLengthMinutes:Math.floor(t/60),playlistLengthSeconds:Math.floor(t%60),tracks:n.map((e,t)=>`${t+1}. ${i(e)} (${B.j(r[e].duration)})`)}));function Pt(e,t){const[n,r]=e.size,i=t&&e.canDouble?2:1,a=116+r*R.n,o=R.p+n*R.o;return{height:(e.shade?14:a)*i,width:o*i}}function Qt(e){return e.windows.focused}function zt(e){return e.display.doubled}function Vt(e){return e.display.llama}function Gt(e){return e.display.zIndex}const Yt=Object(q.createSelector)(ht,zt,(e,t)=>B.t(e,e=>Pt(e,t))),Kt=Object(q.createSelector)(Yt,e=>t=>e[t]),Ht=Object(q.createSelector)(e=>e.windows.windowOrder,ht,(e,t)=>[R.m.MAIN,...e.filter(e=>e!==R.m.MAIN&&null!=t[e])]),Jt=Object(q.createSelector)(Yt,bt,Ht,(e,t,n)=>n.map(n=>He(He({key:n},e[n]),t[n]))),qt=Object(q.createSelector)(Jt,(function(e){const t={},n={};for(const r of e){const e=r.y+r.height;t[e]?t[e].push(r):t[e]=[r];const i=r.x+r.width;n[i]?n[i].push(r):n[i]=[r]}const r={};for(const i of e){const e={},a=i.y,o=i.x,A=t[a],s=n[o];if(A)for(const t of A){const n=t.x+t.width<i.x,r=t.x>i.x+i.width;if(!(n||r)){e.below=t.key;break}}if(s)for(const t of s){const n=t.y+t.height<i.y,r=t.y>i.y+i.height;if(!(n||r)){e.right=t.key;break}}r[i.key]=e}return r})),Wt={normal:"#00FF00",current:"#FFFFFF",normalbg:"#000000",selectedbg:"#0000C6",font:"Arial"};function Zt(e){return e.display.skinColors}const Xt=e=>e.display.skinPlaylistStyle||Wt,$t=e=>{const t=e.windows.genWindows[R.m.MILKDROP];return null!=t&&t.open?R.k.MILKDROP:ne(e.display)},en=e=>e.media.volume,tn=e=>e.media.balance,nn=e=>e.media.shuffle,rn=e=>e.media.repeat,an=Object(q.createSelector)(Mt,e=>null!=e&&e.channels||null),on=e=>e.media.timeElapsed;function An(e){return e.equalizer.on}function sn(e){return e.windows.browserWindowSize}const ln=Object(q.createSelector)(ht,e=>B.r(e,e=>e.open)),un=Object(q.createSelector)(ln,zt,(e,t)=>{let n=0;return B.t(e,e=>{const r={x:0,y:n};return n+=Pt(e,t).height,r})}),cn=e=>e.userInput.focus,dn=e=>e.userInput.scrubPosition,hn=e=>{if(null!=e.userInput.userMessage)return e.userInput.userMessage;switch(cn(e)){case"balance":return(e=>{if(0===e)return"Balance: Center";const t=e>0?"Right":"Left";return`Balance: ${Math.abs(e)}% ${t}`})(e.media.balance);case"volume":return`Volume: ${e.media.volume}%`;case"position":const t=Tt(e);return null==t?"Winamp 2.91":((e,t)=>`Seek to: ${B.j(e*t/100,!1)}/${B.j(e,!1)} (${t}%)`)(t,dn(e));case"double":return(e.display.doubled?"Disable":"Enable")+" doublesize mode";case"eq":const n=e.userInput.bandFocused;return null==n?"Winamp 2.91":Ye(n,e.equalizer.sliders[n])}if(null!=e.playlist.currentTrack){const t=Lt(e);return null==t?"Winamp 2.91":t}return"Winamp 2.91"},fn=Object(q.createSelector)(Mt,e=>null!=e&&e.kbps||null),pn=Object(q.createSelector)(Mt,e=>null!=e&&e.khz||null);function gn(e){return e.milkdrop.message}function mn(e){return"DESKTOP"===e.milkdrop.display}function bn(e){return"FULLSCREEN"===e.milkdrop.display}function En(e){return e.milkdrop.butterchurn}function wn(e){return e.milkdrop.transitionType}function yn(e){return e.milkdrop.currentPresetIndex}function vn(e){const t=yn(e);if(null==t)return null;const n=e.milkdrop.presets[t];return null==n||"UNRESOLVED"===n.type?null:n.preset}function kn(e){return e.milkdrop.presets.map(e=>e.name)}function Sn(e){return e.milkdrop.overlay}function In(e){return e.milkdrop.cycling}function On(e){return e.milkdrop.randomize}function Tn(e){return e.display.closed}function Cn(e){return e.display.skinRegion}const xn=Object(q.createSelector)((function(e){return e.display.skinImages.EQ_PREAMP_LINE}),async e=>null==e?null:B.n(e)),Un=Object(q.createSelector)((function(e){return e.display.skinImages.EQ_GRAPH_LINE_COLORS}),async e=>null==e?null:B.n(e));function Bn(e){return e.display.dummyVizData}function Mn(e){return e.display.marqueeStep}function Nn(e){return e.network.connected}function _n(e){return e.media.timeMode}function Dn(e){return e.display.loading}function Ln(e){return e.display.working}function jn(e){return e.settings.availableSkins}const Rn=e=>e.y,Fn=e=>e.y+e.height,Pn=e=>e.x,Qn=e=>e.x+e.width,zn=(e,t)=>Math.abs(e-t)<15,Vn=(e,t)=>{let n,r;var i,a;return a=t,Rn(i=e)<=Fn(a)+15&&Rn(a)<=Fn(i)+15&&(zn(Pn(e),Qn(t))?n=Qn(t):zn(Qn(e),Pn(t))?n=Pn(t)-e.width:zn(Pn(e),Pn(t))?n=Pn(t):zn(Qn(e),Qn(t))&&(n=Qn(t)-e.width)),((e,t)=>Pn(e)<=Qn(t)+15&&Pn(t)<=Qn(e)+15)(e,t)&&(zn(Rn(e),Fn(t))?r=Fn(t):zn(Fn(e),Rn(t))?r=Rn(t)-e.height:zn(Rn(e),Rn(t))?r=Rn(t):zn(Fn(e),Fn(t))&&(r=Fn(t)-e.height)),{x:n,y:r}},Gn=(e,t)=>{const n=Vn(e,t);return{x:void 0===n.x?0:n.x-e.x,y:void 0===n.y?0:n.y-e.y}};const Yn=(e,t)=>({x:e.x+t.x,y:e.y+t.y});function Kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jn(e){return(t,n)=>{const r=n(),i=qt(r),a=Yt(r);t(e);const o=Yt(n()),A={};for(const e of Object.keys(o)){const t=a[e],n=o[e];A[e]={height:n.height-t.height,width:n.width-t.width}}const s=function(e,t){const n={},r={};for(const t of Object.keys(e))n[t]={above:[],left:[]},r[t]={x:0,y:0};for(const[t,r]of Object.entries(e)){const{below:e,right:i}=r;null!=i&&n[i].left.push(t),null!=e&&n[e].above.push(t)}function i(e){const a=n[e],o=t[e];a.left.forEach(t=>{r[t].x+=o.width+r[e].x,i(t)})}function a(e){const i=n[e],o=t[e];i.above.forEach(t=>{r[t].y+=o.height+r[e].y,a(t)})}for(const[t,n]of Object.entries(e))null==n.below&&a(t),null==n.right&&i(t);return r}(i,A),l=bt(r);t(rr(B.t(l,(e,t)=>Yn(e,s[t]))))}}function qn(){return Jn({type:"TOGGLE_DOUBLESIZE_MODE"})}function Wn(){return Jn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"equalizer"})}function Zn(){return Jn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"main"})}function Xn(){return Jn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"playlist"})}function $n(e){return{type:"CLOSE_WINDOW",windowId:e}}function er(e){return{type:"SET_FOCUSED_WINDOW",window:e}}function tr(e,t){return{type:"WINDOW_SIZE_CHANGED",windowId:e,size:t}}function nr(e){return{type:"TOGGLE_WINDOW",windowId:e}}function rr(e,t){return{type:"UPDATE_WINDOW_POSITIONS",positions:e,absolute:t}}function ir(e){return(t,n)=>{const r=n(),i=Jt(r),a=ft(r),{top:o,left:A,width:s,height:l}=e,u=A+window.scrollX,c=o+window.scrollY,d=B.c(i.filter(e=>a(e.key)));if(null==d)return;const h=d.bottom-d.top,f=d.right-d.left,p=Math.ceil(u-d.left+(s-f)/2),g=Math.ceil(c-d.top+(l-h)/2);t(rr(i.reduce((e,t)=>Hn(Hn({},e),{},{[t.key]:{x:p+t.x,y:g+t.y}}),{}),!0))}}function ar(e){return t=>{t(Hn({type:"BROWSER_WINDOW_SIZE_CHANGED"},e)),t(Ar())}}function or(){return(e,t)=>{e(rr(un(t())))}}function Ar(){return(e,t)=>{const n=t(),r=Jt(n),i=ft(n),{height:a,width:o}=B.k(),A=B.c(r.filter(e=>i(e.key)));if(null==A)return;const s=bt(n);if(A.left>=0&&A.top>=0&&A.right<=o&&A.bottom<=a)return;const l=A.bottom-A.top;if(A.right-A.left<=o&&l<=a){let t=0,n=0;A.top<=0?t=A.top:A.bottom>a&&(t=A.bottom-a),A.left<=0?n=A.left:A.right>o&&(n=A.right-o);e(rr(B.t(s,e=>({x:e.x-n,y:e.y-t}))))}else e({type:"RESET_WINDOW_SIZES"}),e(or()),e(ir({left:window.scrollX,top:window.scrollY,width:window.innerWidth,height:window.innerHeight}))}}function sr(e){return{type:"PLAY_TRACK",id:e}}function lr(){return(e,t)=>{const n=t();n.media.status===R.f.STOPPED&&null==n.playlist.currentTrack&&0===n.playlist.trackOrder.length?e(Ni()):e({type:"PLAY"})}}function ur(){return(e,t)=>{const{status:n}=t().media;n===R.f.PLAYING?e({type:"PAUSE"}):e({type:"PLAY"})}}function cr(){return{type:"STOP"}}function dr(e){return(t,n)=>{const r=dt(n(),e);var i;null!=r?t((i=r,(e,t)=>{const n=t();e(Ut(n)===R.f.STOPPED?{type:"BUFFER_TRACK",id:i}:{type:"PLAY_TRACK",id:i})})):t({type:"IS_STOPPED"})}}function hr(){return dr(1)}function fr(){return dr(-1)}function pr(e){return function(t,n){const r=n(),i=Tt(r);null!=i&&t({type:"SEEK_TO_PERCENT_COMPLETE",percent:e/i*100})}}function gr(e){return function(t,n){t(pr(on(n())+e))}}function mr(e){return gr(-e)}function br(e){return{type:"SET_VOLUME",volume:Object(B.d)(e,0,100)}}function Er(e){return(t,n)=>t(br(n().media.volume+e))}function wr(e){return e.preventDefault(),(t,n)=>t(br(n().media.volume+e.deltaY))}function yr(e){return e=Object(B.d)(e,-100,100),Math.abs(e)<25&&(e=0),{type:"SET_BALANCE",balance:e}}function vr(){return{type:"TOGGLE_REPEAT"}}function kr(){return{type:"TOGGLE_SHUFFLE"}}function Sr(){return{type:"TOGGLE_TIME_MODE"}}function Ir(e){return e<55&&e>45?50:e}function Or(e,t){return{type:"SET_BAND_VALUE",band:e,value:Ir(t)}}function Tr(e){return t=>{Object.values(R.a).forEach(n=>{t({type:"SET_BAND_VALUE",value:e,band:n})})}}function Cr(){return Tr(100)}function xr(){return Tr(50)}function Ur(){return Tr(0)}function Br(e){return{type:"SET_BAND_VALUE",band:"preamp",value:Ir(e)}}function Mr(){return(e,t)=>{t().equalizer.on?e({type:"SET_EQ_OFF"}):e({type:"SET_EQ_ON"})}}function Nr(){return e=>{e({type:"SET_EQ_AUTO",value:!1})}}var _r=n(31);const Dr={a:[0,0],b:[0,1],c:[0,2],d:[0,3],e:[0,4],f:[0,5],g:[0,6],h:[0,7],i:[0,8],j:[0,9],k:[0,10],l:[0,11],m:[0,12],n:[0,13],o:[0,14],p:[0,15],q:[0,16],r:[0,17],s:[0,18],t:[0,19],u:[0,20],v:[0,21],w:[0,22],x:[0,23],y:[0,24],z:[0,25],'"':[0,26],"@":[0,27]," ":[0,30],0:[1,0],1:[1,1],2:[1,2],3:[1,3],4:[1,4],5:[1,5],6:[1,6],7:[1,7],8:[1,8],9:[1,9],[R.j]:[1,10],".":[1,11],":":[1,12],"(":[1,13],")":[1,14],"-":[1,15],"'":[1,16],"!":[1,17],_:[1,18],"+":[1,19],"\\":[1,20],"/":[1,21],"[":[1,22],"]":[1,23],"^":[1,24],"&":[1,25],"%":[1,26],",":[1,27],"=":[1,28],$:[1,29],"#":[1,30],"Å":[2,0],"Ö":[2,1],"Ä":[2,2],"?":[2,3],"*":[2,4],"<":[1,22],">":[1,23],"{":[1,22],"}":[1,23]},Lr=e=>"CHARACTER_"+e.charCodeAt(0),jr=[];for(const e in Dr)if(Dr.hasOwnProperty(e)){const t=Dr[e];jr.push({name:Lr(e),y:6*t[0],x:5*t[1],width:5,height:6})}var Rr={BALANCE:[{name:"MAIN_BALANCE_BACKGROUND",x:9,y:0,width:38,height:420},{name:"MAIN_BALANCE_THUMB",x:15,y:422,width:14,height:11},{name:"MAIN_BALANCE_THUMB_ACTIVE",x:0,y:422,width:14,height:11}],CBUTTONS:[{name:"MAIN_PREVIOUS_BUTTON",x:0,y:0,width:23,height:18},{name:"MAIN_PREVIOUS_BUTTON_ACTIVE",x:0,y:18,width:23,height:18},{name:"MAIN_PLAY_BUTTON",x:23,y:0,width:23,height:18},{name:"MAIN_PLAY_BUTTON_ACTIVE",x:23,y:18,width:23,height:18},{name:"MAIN_PAUSE_BUTTON",x:46,y:0,width:23,height:18},{name:"MAIN_PAUSE_BUTTON_ACTIVE",x:46,y:18,width:23,height:18},{name:"MAIN_STOP_BUTTON",x:69,y:0,width:23,height:18},{name:"MAIN_STOP_BUTTON_ACTIVE",x:69,y:18,width:23,height:18},{name:"MAIN_NEXT_BUTTON",x:92,y:0,width:23,height:18},{name:"MAIN_NEXT_BUTTON_ACTIVE",x:92,y:18,width:22,height:18},{name:"MAIN_EJECT_BUTTON",x:114,y:0,width:22,height:16},{name:"MAIN_EJECT_BUTTON_ACTIVE",x:114,y:16,width:22,height:16}],MAIN:[{name:"MAIN_WINDOW_BACKGROUND",x:0,y:0,width:275,height:116}],MONOSTER:[{name:"MAIN_STEREO",x:0,y:12,width:29,height:12},{name:"MAIN_STEREO_SELECTED",x:0,y:0,width:29,height:12},{name:"MAIN_MONO",x:29,y:12,width:27,height:12},{name:"MAIN_MONO_SELECTED",x:29,y:0,width:27,height:12}],NUMBERS:[{name:"NO_MINUS_SIGN",x:9,y:6,width:5,height:1},{name:"MINUS_SIGN",x:20,y:6,width:5,height:1},{name:"DIGIT_0",x:0,y:0,width:9,height:13},{name:"DIGIT_1",x:9,y:0,width:9,height:13},{name:"DIGIT_2",x:18,y:0,width:9,height:13},{name:"DIGIT_3",x:27,y:0,width:9,height:13},{name:"DIGIT_4",x:36,y:0,width:9,height:13},{name:"DIGIT_5",x:45,y:0,width:9,height:13},{name:"DIGIT_6",x:54,y:0,width:9,height:13},{name:"DIGIT_7",x:63,y:0,width:9,height:13},{name:"DIGIT_8",x:72,y:0,width:9,height:13},{name:"DIGIT_9",x:81,y:0,width:9,height:13}],NUMS_EX:[{name:"NO_MINUS_SIGN_EX",x:90,y:0,width:9,height:13},{name:"MINUS_SIGN_EX",x:99,y:0,width:9,height:13},{name:"DIGIT_0_EX",x:0,y:0,width:9,height:13},{name:"DIGIT_1_EX",x:9,y:0,width:9,height:13},{name:"DIGIT_2_EX",x:18,y:0,width:9,height:13},{name:"DIGIT_3_EX",x:27,y:0,width:9,height:13},{name:"DIGIT_4_EX",x:36,y:0,width:9,height:13},{name:"DIGIT_5_EX",x:45,y:0,width:9,height:13},{name:"DIGIT_6_EX",x:54,y:0,width:9,height:13},{name:"DIGIT_7_EX",x:63,y:0,width:9,height:13},{name:"DIGIT_8_EX",x:72,y:0,width:9,height:13},{name:"DIGIT_9_EX",x:81,y:0,width:9,height:13}],PLAYPAUS:[{name:"MAIN_PLAYING_INDICATOR",x:0,y:0,width:9,height:9},{name:"MAIN_PAUSED_INDICATOR",x:9,y:0,width:9,height:9},{name:"MAIN_STOPPED_INDICATOR",x:18,y:0,width:9,height:9},{name:"MAIN_NOT_WORKING_INDICATOR",x:36,y:0,width:9,height:9},{name:"MAIN_WORKING_INDICATOR",x:39,y:0,width:9,height:9}],PLEDIT:[{name:"PLAYLIST_TOP_TILE",x:127,y:21,width:25,height:20},{name:"PLAYLIST_TOP_LEFT_CORNER",x:0,y:21,width:25,height:20},{name:"PLAYLIST_TITLE_BAR",x:26,y:21,width:100,height:20},{name:"PLAYLIST_TOP_RIGHT_CORNER",x:153,y:21,width:25,height:20},{name:"PLAYLIST_TOP_TILE_SELECTED",x:127,y:0,width:25,height:20},{name:"PLAYLIST_TOP_LEFT_SELECTED",x:0,y:0,width:25,height:20},{name:"PLAYLIST_TITLE_BAR_SELECTED",x:26,y:0,width:100,height:20},{name:"PLAYLIST_TOP_RIGHT_CORNER_SELECTED",x:153,y:0,width:25,height:20},{name:"PLAYLIST_LEFT_TILE",x:0,y:42,width:12,height:29},{name:"PLAYLIST_RIGHT_TILE",x:31,y:42,width:20,height:29},{name:"PLAYLIST_BOTTOM_TILE",x:179,y:0,width:25,height:38},{name:"PLAYLIST_BOTTOM_LEFT_CORNER",x:0,y:72,width:125,height:38},{name:"PLAYLIST_BOTTOM_RIGHT_CORNER",x:126,y:72,width:150,height:38},{name:"PLAYLIST_VISUALIZER_BACKGROUND",x:205,y:0,width:75,height:38},{name:"PLAYLIST_SHADE_BACKGROUND",x:72,y:57,width:25,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_LEFT",x:72,y:42,width:25,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_RIGHT",x:99,y:57,width:50,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_RIGHT_SELECTED",x:99,y:42,width:50,height:14},{name:"PLAYLIST_SCROLL_HANDLE_SELECTED",x:61,y:53,width:8,height:18},{name:"PLAYLIST_SCROLL_HANDLE",x:52,y:53,width:8,height:18},{name:"PLAYLIST_ADD_URL",x:0,y:111,width:22,height:18},{name:"PLAYLIST_ADD_URL_SELECTED",x:23,y:111,width:22,height:18},{name:"PLAYLIST_ADD_DIR",x:0,y:130,width:22,height:18},{name:"PLAYLIST_ADD_DIR_SELECTED",x:23,y:130,width:22,height:18},{name:"PLAYLIST_ADD_FILE",x:0,y:149,width:22,height:18},{name:"PLAYLIST_ADD_FILE_SELECTED",x:23,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_ALL",x:54,y:111,width:22,height:18},{name:"PLAYLIST_REMOVE_ALL_SELECTED",x:77,y:111,width:22,height:18},{name:"PLAYLIST_CROP",x:54,y:130,width:22,height:18},{name:"PLAYLIST_CROP_SELECTED",x:77,y:130,width:22,height:18},{name:"PLAYLIST_REMOVE_SELECTED",x:54,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_SELECTED_SELECTED",x:77,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_MISC",x:54,y:168,width:22,height:18},{name:"PLAYLIST_REMOVE_MISC_SELECTED",x:77,y:168,width:22,height:18},{name:"PLAYLIST_INVERT_SELECTION",x:104,y:111,width:22,height:18},{name:"PLAYLIST_INVERT_SELECTION_SELECTED",x:127,y:111,width:22,height:18},{name:"PLAYLIST_SELECT_ZERO",x:104,y:130,width:22,height:18},{name:"PLAYLIST_SELECT_ZERO_SELECTED",x:127,y:130,width:22,height:18},{name:"PLAYLIST_SELECT_ALL",x:104,y:149,width:22,height:18},{name:"PLAYLIST_SELECT_ALL_SELECTED",x:127,y:149,width:22,height:18},{name:"PLAYLIST_SORT_LIST",x:154,y:111,width:22,height:18},{name:"PLAYLIST_SORT_LIST_SELECTED",x:177,y:111,width:22,height:18},{name:"PLAYLIST_FILE_INFO",x:154,y:130,width:22,height:18},{name:"PLAYLIST_FILE_INFO_SELECTED",x:177,y:130,width:22,height:18},{name:"PLAYLIST_MISC_OPTIONS",x:154,y:149,width:22,height:18},{name:"PLAYLIST_MISC_OPTIONS_SELECTED",x:177,y:149,width:22,height:18},{name:"PLAYLIST_NEW_LIST",x:204,y:111,width:22,height:18},{name:"PLAYLIST_NEW_LIST_SELECTED",x:227,y:111,width:22,height:18},{name:"PLAYLIST_SAVE_LIST",x:204,y:130,width:22,height:18},{name:"PLAYLIST_SAVE_LIST_SELECTED",x:227,y:130,width:22,height:18},{name:"PLAYLIST_LOAD_LIST",x:204,y:149,width:22,height:18},{name:"PLAYLIST_LOAD_LIST_SELECTED",x:227,y:149,width:22,height:18},{name:"PLAYLIST_ADD_MENU_BAR",x:48,y:111,width:3,height:54},{name:"PLAYLIST_REMOVE_MENU_BAR",x:100,y:111,width:3,height:72},{name:"PLAYLIST_SELECT_MENU_BAR",x:150,y:111,width:3,height:54},{name:"PLAYLIST_MISC_MENU_BAR",x:200,y:111,width:3,height:54},{name:"PLAYLIST_LIST_BAR",x:250,y:111,width:3,height:54},{name:"PLAYLIST_CLOSE_SELECTED",x:52,y:42,width:9,height:9},{name:"PLAYLIST_COLLAPSE_SELECTED",x:62,y:42,width:9,height:9},{name:"PLAYLIST_EXPAND_SELECTED",x:150,y:42,width:9,height:9}],EQ_EX:[{name:"EQ_SHADE_BACKGROUND_SELECTED",x:0,y:0,width:275,height:14},{name:"EQ_SHADE_BACKGROUND",x:0,y:15,width:275,height:14},{name:"EQ_SHADE_VOLUME_SLIDER_LEFT",x:1,y:30,width:3,height:7},{name:"EQ_SHADE_VOLUME_SLIDER_CENTER",x:4,y:30,width:3,height:7},{name:"EQ_SHADE_VOLUME_SLIDER_RIGHT",x:7,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_LEFT",x:11,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_CENTER",x:14,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_RIGHT",x:17,y:30,width:3,height:7},{name:"EQ_MAXIMIZE_BUTTON_ACTIVE",x:1,y:38,width:9,height:9},{name:"EQ_MINIMIZE_BUTTON_ACTIVE",x:1,y:47,width:9,height:9},{name:"EQ_SHADE_CLOSE_BUTTON",x:11,y:38,width:9,height:9},{name:"EQ_SHADE_CLOSE_BUTTON_ACTIVE",x:11,y:47,width:9,height:9}],EQMAIN:[{name:"EQ_WINDOW_BACKGROUND",x:0,y:0,width:275,height:116},{name:"EQ_TITLE_BAR",x:0,y:149,width:275,height:14},{name:"EQ_TITLE_BAR_SELECTED",x:0,y:134,width:275,height:14},{name:"EQ_SLIDER_BACKGROUND",x:13,y:164,width:209,height:129},{name:"EQ_SLIDER_THUMB",x:0,y:164,width:11,height:11},{name:"EQ_SLIDER_THUMB_SELECTED",x:0,y:176,width:11,height:11},{name:"EQ_CLOSE_BUTTON",x:0,y:116,width:9,height:9},{name:"EQ_CLOSE_BUTTON_ACTIVE",x:0,y:125,width:9,height:9},{name:"EQ_MAXIMIZE_BUTTON_ACTIVE_FALLBACK",x:254,y:152,width:9,height:9},{name:"EQ_ON_BUTTON",x:10,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_DEPRESSED",x:128,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_SELECTED",x:69,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_SELECTED_DEPRESSED",x:187,y:119,width:26,height:12},{name:"EQ_AUTO_BUTTON",x:36,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_DEPRESSED",x:154,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_SELECTED",x:95,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_SELECTED_DEPRESSED",x:213,y:119,width:32,height:12},{name:"EQ_GRAPH_BACKGROUND",x:0,y:294,width:113,height:19},{name:"EQ_GRAPH_LINE_COLORS",x:115,y:294,width:1,height:19},{name:"EQ_PRESETS_BUTTON",x:224,y:164,width:44,height:12},{name:"EQ_PRESETS_BUTTON_SELECTED",x:224,y:176,width:44,height:12},{name:"EQ_PREAMP_LINE",x:0,y:314,width:113,height:1}],POSBAR:[{name:"MAIN_POSITION_SLIDER_BACKGROUND",x:0,y:0,width:248,height:10},{name:"MAIN_POSITION_SLIDER_THUMB",x:248,y:0,width:29,height:10},{name:"MAIN_POSITION_SLIDER_THUMB_SELECTED",x:278,y:0,width:29,height:10}],SHUFREP:[{name:"MAIN_SHUFFLE_BUTTON",x:28,y:0,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_DEPRESSED",x:28,y:15,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_SELECTED",x:28,y:30,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED",x:28,y:45,width:47,height:15},{name:"MAIN_REPEAT_BUTTON",x:0,y:0,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_DEPRESSED",x:0,y:15,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_SELECTED",x:0,y:30,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED",x:0,y:45,width:28,height:15},{name:"MAIN_EQ_BUTTON",x:0,y:61,width:23,height:12},{name:"MAIN_EQ_BUTTON_SELECTED",x:0,y:73,width:23,height:12},{name:"MAIN_EQ_BUTTON_DEPRESSED",x:46,y:61,width:23,height:12},{name:"MAIN_EQ_BUTTON_DEPRESSED_SELECTED",x:46,y:73,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON",x:23,y:61,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_SELECTED",x:23,y:73,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_DEPRESSED",x:69,y:61,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED",x:69,y:73,width:23,height:12}],TEXT:jr,TITLEBAR:[{name:"MAIN_TITLE_BAR",x:27,y:15,width:275,height:14},{name:"MAIN_TITLE_BAR_SELECTED",x:27,y:0,width:275,height:14},{name:"MAIN_EASTER_EGG_TITLE_BAR",x:27,y:72,width:275,height:14},{name:"MAIN_EASTER_EGG_TITLE_BAR_SELECTED",x:27,y:57,width:275,height:14},{name:"MAIN_OPTIONS_BUTTON",x:0,y:0,width:9,height:9},{name:"MAIN_OPTIONS_BUTTON_DEPRESSED",x:0,y:9,width:9,height:9},{name:"MAIN_MINIMIZE_BUTTON",x:9,y:0,width:9,height:9},{name:"MAIN_MINIMIZE_BUTTON_DEPRESSED",x:9,y:9,width:9,height:9},{name:"MAIN_SHADE_BUTTON",x:0,y:18,width:9,height:9},{name:"MAIN_SHADE_BUTTON_DEPRESSED",x:9,y:18,width:9,height:9},{name:"MAIN_CLOSE_BUTTON",x:18,y:0,width:9,height:9},{name:"MAIN_CLOSE_BUTTON_DEPRESSED",x:18,y:9,width:9,height:9},{name:"MAIN_CLUTTER_BAR_BACKGROUND",x:304,y:0,width:8,height:43},{name:"MAIN_CLUTTER_BAR_BACKGROUND_DISABLED",x:312,y:0,width:8,height:43},{name:"MAIN_CLUTTER_BAR_BUTTON_O_SELECTED",x:304,y:47,width:8,height:8},{name:"MAIN_CLUTTER_BAR_BUTTON_A_SELECTED",x:312,y:55,width:8,height:7},{name:"MAIN_CLUTTER_BAR_BUTTON_I_SELECTED",x:320,y:62,width:8,height:7},{name:"MAIN_CLUTTER_BAR_BUTTON_D_SELECTED",x:328,y:69,width:8,height:8},{name:"MAIN_CLUTTER_BAR_BUTTON_V_SELECTED",x:336,y:77,width:8,height:7},{name:"MAIN_SHADE_BACKGROUND",x:27,y:42,width:275,height:14},{name:"MAIN_SHADE_BACKGROUND_SELECTED",x:27,y:29,width:275,height:14},{name:"MAIN_SHADE_BUTTON_SELECTED",x:0,y:27,width:9,height:9},{name:"MAIN_SHADE_BUTTON_SELECTED_DEPRESSED",x:9,y:27,width:9,height:9},{name:"MAIN_SHADE_POSITION_BACKGROUND",x:0,y:36,width:17,height:7},{name:"MAIN_SHADE_POSITION_THUMB",x:20,y:36,width:3,height:7},{name:"MAIN_SHADE_POSITION_THUMB_LEFT",x:17,y:36,width:3,height:7},{name:"MAIN_SHADE_POSITION_THUMB_RIGHT",x:23,y:36,width:3,height:7}],VOLUME:[{name:"MAIN_VOLUME_BACKGROUND",x:0,y:0,width:68,height:420},{name:"MAIN_VOLUME_THUMB",x:15,y:422,width:14,height:11},{name:"MAIN_VOLUME_THUMB_SELECTED",x:0,y:422,width:14,height:11}],GEN:[{name:"GEN_TOP_LEFT_SELECTED",x:0,y:0,width:25,height:20},{name:"GEN_TOP_LEFT_END_SELECTED",x:26,y:0,width:25,height:20},{name:"GEN_TOP_CENTER_FILL_SELECTED",x:52,y:0,width:25,height:20},{name:"GEN_TOP_RIGHT_END_SELECTED",x:78,y:0,width:25,height:20},{name:"GEN_TOP_LEFT_RIGHT_FILL_SELECTED",x:104,y:0,width:25,height:20},{name:"GEN_TOP_RIGHT_SELECTED",x:130,y:0,width:25,height:20},{name:"GEN_TOP_LEFT",x:0,y:21,width:25,height:20},{name:"GEN_TOP_LEFT_END",x:26,y:21,width:25,height:20},{name:"GEN_TOP_CENTER_FILL",x:52,y:21,width:25,height:20},{name:"GEN_TOP_RIGHT_END",x:78,y:21,width:25,height:20},{name:"GEN_TOP_LEFT_RIGHT_FILL",x:104,y:21,width:25,height:20},{name:"GEN_TOP_RIGHT",x:130,y:21,width:25,height:20},{name:"GEN_BOTTOM_LEFT",x:0,y:42,width:125,height:14},{name:"GEN_BOTTOM_RIGHT",x:0,y:57,width:125,height:14},{name:"GEN_BOTTOM_FILL",x:127,y:72,width:25,height:14},{name:"GEN_MIDDLE_LEFT",x:127,y:42,width:11,height:29},{name:"GEN_MIDDLE_LEFT_BOTTOM",x:158,y:42,width:11,height:24},{name:"GEN_MIDDLE_RIGHT",x:139,y:42,width:8,height:29},{name:"GEN_MIDDLE_RIGHT_BOTTOM",x:170,y:42,width:8,height:24},{name:"GEN_CLOSE_SELECTED",x:148,y:42,width:9,height:9}]};function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qr(e,t){return new RegExp(`^(.*[/\\\\])?${e}.(${t})$`,"i")}async function zr(e,t,n,r){const i=e.file(Qr(t,n));if(!i.length)return null;const a=i[i.length-1];try{return{contents:await a.async(r),name:a.name}}catch(e){return console.warn(`Failed to extract "${t}.${n}" from the skin archive.`),null}}async function Vr(e){try{return await window.createImageBitmap(e)}catch(t){try{return await function(e){return B.n(URL.createObjectURL(e))}(e)}catch(e){return null}}}function Gr(e,t){const n=document.createElement("canvas"),r=n.getContext("2d");if(null==r)throw new Error("Failed to get canvas context");const i={};return t.forEach(t=>{n.height=t.height,n.width=t.width,r.drawImage(e,-t.x,-t.y);const a=n.toDataURL();i[t.name]=a}),i}async function Yr(e,t){const n=await zr(e,t,"(png|bmp)","blob");if(!n)return null;const r="image/"+((e=>{const t=/\.([a-z]{3,4})$/i.exec(e);return t?t[1].toLowerCase():null})(n.name)||"*");return Vr(new Blob([n.contents],{type:r}))}const Kr="RIFF".split("").map(e=>e.charCodeAt(0));async function Hr(e,t){const n=await zr(e,t,"CUR","uint8array");if(null==n)return null;const r=n.contents;return i=r,Kr.every((e,t)=>i[t]===e)?{type:"ani",aniData:r}:{type:"cur",url:ve(r)};var i}async function Jr(e){const t=e.file(Qr("PLEDIT","txt"))[0];if(null==t)return R.c.playlistStyle;const n=await t.async("text");if(null==n)return R.c.playlistStyle;const r=n&&B.u(n).text;return r?(["normal","current","normalbg","selectedbg","mbFG","mbBG"].forEach(e=>{let t=r[e];t&&("#"!==t[0]&&(t="#"+t),r[e]=t.slice(0,7))}),Pr(Pr({},R.c.playlistStyle),r)):R.c.playlistStyle}async function qr(e){const t=await Yr(e,"GENEX");if(null==t)return null;const n=document.createElement("canvas"),r=n.getContext("2d");if(null==r)return null;n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const i=e=>`rgb(${r.getImageData(e,0,1,1).data.slice(0,3).join(",")})`;return{itemBackground:i(48),itemForeground:i(50),windowBackground:i(52),buttonText:i(54),windowText:i(56),divider:i(58),playlistSelection:i(60),listHeaderBackground:i(62),listHeaderText:i(64),listHeaderFrameTopAndLeft:i(66),listHeaderFrameBottomAndRight:i(68),listHeaderFramePressed:i(70),listHeaderDeadArea:i(72),scrollbarOne:i(74),scrollbarTwo:i(76),pressedScrollbarOne:i(78),pressedScrollbarTwo:i(80),scrollbarDeadArea:i(82),listTextHighlighted:i(84),listTextHighlightedBackground:i(86),listTextSelected:i(88),listTextSelectedBackground:i(90)}}function Wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wr(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Xr=e=>e.reduce((e,t)=>Object.assign(e,t),{}),$r=["CLOSE","EQCLOSE","EQNORMAL","EQSLID","EQTITLE","MAINMENU","MMENU","MIN","NORMAL","PCLOSE","PNORMAL","POSBAR","PSIZE","PTBAR","PVSCROLL","PWINBUT","PWSNORM","PWSSIZE","SONGNAME","TITLEBAR","VOLBAL","WINBUT","WSNORMAL","WSPOSBAR"];async function ei(e){const t=await zr(e,"VISCOLOR","txt","text");return t?Object(B.v)(t.contents):R.c.colors}async function ti(e){const t=await Promise.all(Object.keys(Rr).map(t=>async function(e,t){const n=await Yr(e,t);return null==n?{}:Gr(n,Rr[t])}(e,t)));return Xr(t)}async function ni(e){const t=await Promise.all($r.map(async t=>({[t]:await Hr(e,t)})));return Xr(t)}async function ri(e){const t=await zr(e,"REGION","txt","text");return t?function(e){const t=Object(B.u)(e),n={};return Object.keys(t).forEach(e=>{const{numpoints:r,pointlist:i}=t[e];if(!r||!i)return;const a=r.split(/\s*,\s*/).filter(e=>""!==e),o=function(e){const t=[];for(let n=0;n<e.length;n+=2)t.push(`${e[n]},${e[n+1]}`);return t}(i.split(/\s*[, ]\s*/).filter(e=>""!==e));let A=0;const s=a.map(e=>{const t=Number(e);if(t<3)return A+=t,null;const n=o.slice(A,A+t).join(" ");return n.length?(A+=t,n):null}).filter(e=>null!=e);s.length&&(n[e]=s)}),n}(t.contents):{}}async function ii(e){const t=await Yr(e,"GEN");if(null==t)return null;const n=document.createElement("canvas"),r=n.getContext("2d");n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const i=(e,t)=>{const i=t=>r.getImageData(t,e,1,1).data.join(",");let a=1;const o=i(0);return R.d.map(r=>{let A=a;for(;i(A)!==o&&A<n.width;)A++;const s={x:a,y:e,height:7,width:A-a,name:`${t}_${r}`};return a=A+1,s})},a={},o=[...i(88,"GEN_TEXT_SELECTED"),...i(96,"GEN_TEXT")];return o.forEach(e=>{a[e.name]=e.width}),[a,Gr(t,o)]}var ai=async function(e,t){const n=await t.loadAsync(e),[r,i,a,o,A,s,l]=await Promise.all([ei(n),Jr(n),ti(n),ni(n),ri(n),ii(n),qr(n)]),[u,c]=s||[null,{}];return{colors:r,playlistStyle:i,images:Zr(Zr({},a),c),genLetterWidths:u,cursors:o,region:A,genExColors:l}},oi=n(42),Ai=n.n(oi);function si(){return(e,t)=>{const n=t();if(0===it(n).length)return;const r=rt(n),{playlist:{trackOrder:i}}=n;e({type:"REMOVE_TRACKS",ids:i.filter(e=>!r.has(e))})}}function li(){return(e,t)=>{e({type:"REMOVE_TRACKS",ids:Array.from(rt(t()))})}}function ui(){return e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}}function ci(){return{type:"REVERSE_LIST"}}function di(){return{type:"RANDOMIZE_LIST"}}function hi(){return(e,t)=>{const n=t(),r=We(n);return e({type:"SET_TRACK_ORDER",trackOrder:Object(B.B)(Xe(n),e=>(""+r[e].title).toLowerCase())})}}function fi(e){return{type:"SET_PLAYLIST_SCROLL_POSITION",position:e}}function pi(e){return(t,n)=>{const r=n(),i=wt(r),a=kt(r);return t({type:"SET_PLAYLIST_SCROLL_POSITION",position:100*(i?Object(B.d)((a+e)/i,0,1):0)})}}function gi(e){return e.preventDefault(),(t,n)=>{const r=n();wt(r)&&e.stopPropagation();const i=r.playlist.trackOrder.length*R.i,a=e.deltaY/i*100;t({type:"SET_PLAYLIST_SCROLL_POSITION",position:Object(B.d)(r.display.playlistScrollPosition+a,0,100)})}}function mi(){return pi(-4)}function bi(){return pi(4)}function Ei(e){return(t,n)=>{const r=n(),i=We(r),a=Xe(r),o=rt(r),A=a.findIndex(e=>i[e]&&o.has(e));if(-1===A)return;const s=Object(B.g)(a,e=>i[e]&&o.has(e));if(-1===s)throw new Error("We found a first selected, but not a last selected.");const l=-A,u=a.length-1-s,c=Object(B.d)(e,l,u);0!==c&&t({type:"DRAG_SELECTED",offset:c})}}function wi(){return{type:"INVERT_SELECTION"}}function yi(){return{type:"SELECT_ZERO"}}function vi(){return{type:"SELECT_ALL"}}var ki=n(34);const Si=new class{constructor({threads:e}){this._queue=new Ai.a([],(e,t)=>e.priority()-t.priority()),this._availableThreads=e}push(e,t){const n={task:e,priority:t};return this._queue.push(n),setTimeout(()=>{this._run()},0),()=>{this._queue=this._queue.filter(e=>e!==n)}}_run(){for(;this._availableThreads>0;){if(0===this._queue.length)return;this._availableThreads--;const e=this._queue.pop().task();Ee()("function"==typeof e.then,"LoadQueue only supports loading Promises. Got "+e),e.then(()=>{this._availableThreads++,this._run()})}}}({threads:4});function Ii(e,t,n){return ji(Array.from(e).map(e=>({blob:e,defaultName:e.name})),t,n)}const Oi=new RegExp("(wsz|zip)$","i"),Ti=new RegExp("eqf$","i");function Ci(e,t=R.e.PLAY,n){return r=>{if(!(e.length<1)){if(1===e.length){const t=e[0];if(Oi.test(t.name))return void r(xi(t));if(Ti.test(t.name))return void r(function(e){return async t=>{const n=await async function(e){return Ee()(null!=e,"Attempt to get an ArrayBuffer without assigning a fileReference"),new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})}(e);t(Fi(Object(_r.parser)(n).presets[0]))}}(t))}r(Ii(e,t,n))}}}function xi(e){return async(t,n,{requireJSZip:r})=>{if(!r)return void alert("Webamp has not been configured to support custom skins.");let i;t({type:"LOADING"});try{i=await r()}catch(e){return console.error(e),t({type:"LOADED"}),void alert("Failed to load the skin parser.")}try{const n=await ai(e,i);t({type:"SET_SKIN_DATA",data:{skinImages:n.images,skinColors:n.colors,skinPlaylistStyle:n.playlistStyle,skinCursors:n.cursors,skinRegion:n.region,skinGenLetterWidths:n.genLetterWidths,skinGenExColors:n.genExColors}})}catch(e){console.error(e),t({type:"LOADED"}),alert("Failed to parse skin")}}}function Ui(e){return async t=>{t({type:"LOADING"});try{const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);t(xi(n.blob()))}catch(n){console.error(n),t({type:"LOADED"}),alert("Failed to download skin from "+e)}}}function Bi(e,t){return async n=>{var r;const i=await ye({accept:e});n({type:"OPENED_FILES",expectedType:t,count:i.length,firstFileName:null===(r=i[0])||void 0===r?void 0:r.name}),n(Ci(i))}}function Mi(){return Bi(".eqf","EQ")}function Ni(){return Bi(null,"MEDIA")}function _i(){return Bi(".zip, .wsz","SKIN")}function Di(e,t){return(n,r)=>{Si.push(async()=>{try{const r=await function(e){return Ee()("string"==typeof e,"Attempted to get the duration of media file without passing a url"),new Promise((t,n)=>{const r=document.createElement("audio");r.crossOrigin="anonymous";const i=()=>{t(r.duration),r.removeEventListener("durationchange",i),r.src=""};r.addEventListener("durationchange",i),r.addEventListener("error",e=>{n(e)}),r.src=e})}(e);n({type:"SET_MEDIA_DURATION",duration:r,id:t})}catch(e){}},()=>Ot(r())(t)?5:15)}}function Li(e,t=R.e.NONE,n=0){const{files:r}=e.dataTransfer;return async(i,a,{handleTrackDropEvent:o})=>{if(o){const r=await o(e);if(null!=r)return void i(ji(r,t,n))}i(Ci(r,t,n))}}function ji(e,t=R.e.NONE,n=0){return r=>{t===R.e.PLAY&&r(e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}),e.forEach((e,i)=>{const a=0===i?t:R.e.NONE;r(function(e,t=R.e.NONE,n=0){return r=>{const i=B.D(),{defaultName:a,metaData:o,duration:A}=e;let s;if("url"in e)s=e.url.toString();else{if(!("blob"in e))throw new Error("Expected track to have either a blob or a url");s=URL.createObjectURL(e.blob)}switch(r({type:"ADD_TRACK_FROM_URL",url:s,duration:e.duration,defaultName:a,id:i,atIndex:n}),t){case R.e.BUFFER:r({type:"BUFFER_TRACK",id:i});break;case R.e.PLAY:r({type:"PLAY_TRACK",id:i});break;case R.e.NONE:default:r(null!=A?{type:"SET_MEDIA_DURATION",duration:A,id:i}:Di(s,i))}if(null!=o){const{artist:e,title:t,album:n}=o;r({type:"SET_MEDIA_TAGS",artist:e,title:t,album:n,sampleRate:44e3,bitrate:192e3,numberOfChannels:2,id:i})}else r("blob"in e?Ri(e.blob,i):function(e){return(t,n)=>{const r=We(n())[e];Si.push(()=>t(Ri(r.url,e)),()=>Ot(n())(e)?10:20)}}(i))}}(e,a,n+i))})}}function Ri(e,t){return async(n,r,{requireMusicMetadata:i})=>{n({type:"MEDIA_TAG_REQUEST_INITIALIZED",id:t});try{const r=await function(e,t){Ee()(null!=e,"Attempted to get the tags of media file without passing a file");const n={duration:!0,skipPostHeaders:!0};return"string"==typeof e?t.fetchFromUrl(e,n):t.parseBlob(e,n)}(e,await i()),{artist:a,title:o,album:A,picture:s}=r.common,{numberOfChannels:l,bitrate:u,sampleRate:c}=r.format;let d=null;if(s&&s.length>=1){const e=new Uint8Array(s[0].data),t=new Blob([e],{type:s[0].format});d=URL.createObjectURL(t)}n({type:"SET_MEDIA_TAGS",artist:a||"",title:o||"",album:A,albumArtUrl:d,numberOfChannels:l,bitrate:u,sampleRate:c,id:t})}catch(e){n({type:"MEDIA_TAG_REQUEST_FAILED",id:t})}}}function Fi(e){return t=>{t(Br(B.q(e.preamp))),R.a.forEach(n=>{t(Or(n,B.q(e["hz"+n])))})}}function Pi(){return(e,t)=>{const n=t(),r=qe(n),i=Object(_r.creator)(r),a="data:application/zip;base64,"+B.a(i);B.f(a,"entry.eqf")}}function Qi(){return(e,t)=>{const n=Ft(t());B.f(n,"Winamp Playlist.html")}}let zi=document.createElement("input");zi.type="file";const Vi=void 0!==zi.webkitdirectory||void 0!==zi.mozdirectory||void 0!==zi.directory;function Gi(e){return async t=>{t(Ii(await ye(),R.e.NONE,e))}}function Yi(e){return async t=>{if(!Vi)return void alert("Not supported in your browser");t(Ii(await ye({directory:!0}),R.e.NONE,e))}}function Ki(e=0){new ki.a(!1).getTrackListFromYandexDisk(prompt("Введите ссылку на Яндекс Диск"))}function Hi(){}function Ji(){return(e,t,{handleSaveListEvent:n})=>{n?n(tt(t())):alert("Not supported in Webamp")}}function qi(e,t){return n=>{var r;return n({type:"DROPPED_FILES",count:e.dataTransfer.files.length,firstFileName:null===(r=e.dataTransfer.files[0])||void 0===r?void 0:r.name,windowId:t})}}function Wi(e){const{name:t}=e;if("butterchurnPresetObject"in e)return{type:"RESOLVED",name:t,preset:e.butterchurnPresetObject};if("getButterchrunPresetObject"in e)return{type:"UNRESOLVED",name:t,getPreset:e.getButterchrunPresetObject};if("butterchurnPresetUrl"in e)return{type:"UNRESOLVED",name:t,getPreset:async()=>(await fetch(e.butterchurnPresetUrl)).json()};throw new Error("Invalid preset object")}function Zi(e){return(t,n)=>{const r=n(),i=r.milkdrop.presets.length;t({type:"GOT_BUTTERCHURN_PRESETS",presets:e}),0===i&&On(r)?t(ta()):t(na(i,xe.IMMEDIATE,!0))}}function Xi(e){return async(t,n,{convertPreset:r})=>{t(Zi(Array.from(e).map(e=>{const t=e.name.toLowerCase();if(t.endsWith(".milk")){if(null==r)throw new Error("Invalid type");return{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".milk".length),getPreset:()=>r(e)}}return t.endsWith(".json")?{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".json".length),getPreset:async()=>{const t=await we(e);return JSON.parse(t)}}:(console.error("Invalid type preset when loading directory"),null)}).filter(Boolean)))}}function $i(e=xe.DEFAULT){return(t,n)=>{const r=n();if(On(r))return t(ta(e));const i=yn(r);if(null==i)return;t(na(i+1,e,!0))}}function ea(e=xe.DEFAULT){return(t,n)=>{const r=n(),{presetHistory:i}=r.milkdrop;if(i.length<1)return;t(na(i[i.length-2],e,!1))}}function ta(e=xe.DEFAULT){return(t,n)=>{const r=n();t(na(Math.floor(Math.random()*r.milkdrop.presets.length),e,!0))}}function na(e,t,n){return async(r,i)=>{const a=i().milkdrop.presets[e];if(null!=a)switch(r({type:"PRESET_REQUESTED",index:e,addToHistory:n}),a.type){case"RESOLVED":return void r({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:t});case"UNRESOLVED":const n=await a.getPreset();return r({type:"RESOLVE_PRESET_AT_INDEX",index:e,json:n}),void r({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:t})}}}function ra(e){return Xi(e.dataTransfer.files)}function ia(){return{type:"TOGGLE_RANDOMIZE_PRESETS"}}function aa(){return{type:"TOGGLE_PRESET_CYCLING"}}function oa(e){return{type:"SCHEDULE_MILKDROP_MESSAGE",message:e}}function Aa(){return e=>{let t=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{t=!0}}),t||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))}}function sa(){return{type:"TOGGLE_VISUALIZER_STYLE"}}function la(){return{type:"MINIMIZE_WINAMP"}}function ua(e){return{type:"SET_FOCUS",input:e}}function ca(){return{type:"UNSET_FOCUS"}}function da(e){return{type:"SET_BAND_FOCUS",input:"eq",bandFocused:e}}function ha(){return{type:"LOAD_DEFAULT_SKIN"}}function fa(){return(e,t)=>{mn(t())?e({type:"SET_MILKDROP_DESKTOP",enabled:!1}):e({type:"SET_MILKDROP_DESKTOP",enabled:!0})}}function pa(e){return{type:"SET_MILKDROP_FULLSCREEN",enabled:e}}function ga(){return(e,t)=>{e(pa(!bn(t())))}}function ma(){return(e,t)=>{Sn(t())&&e(er(R.m.MILKDROP)),e({type:"TOGGLE_PRESET_OVERLAY"})}}function ba(){return{type:"STEP_MARQUEE"}}zi=null;var Ea=e=>t=>{const{media:{volume:n,balance:r},equalizer:{sliders:i}}=t.getState();return e.setVolume(n),e.setBalance(r),e.setPreamp(i.preamp),e.on("timeupdate",()=>{t.dispatch({type:"UPDATE_TIME_ELAPSED",elapsed:e.timeElapsed()})}),e.on("ended",()=>{t.dispatch(hr())}),e.on("playing",()=>{t.dispatch({type:"IS_PLAYING"})}),e.on("waiting",()=>{t.dispatch({type:"START_WORKING"})}),e.on("stopWaiting",()=>{t.dispatch({type:"STOP_WORKING"})}),e.on("fileLoaded",()=>{const n=ct(t.getState());null!=n&&t.dispatch({id:n,type:"SET_MEDIA",kbps:"128",khz:"44",channels:2,length:e.duration()})}),n=>r=>{const i=n(r),a=t.getState();switch(r.type){case"PLAY":e.play();break;case"PAUSE":e.pause();break;case"STOP":e.stop();break;case"SET_VOLUME":e.setVolume(en(a));break;case"SET_BALANCE":e.setBalance(tn(a));break;case"SEEK_TO_PERCENT_COMPLETE":e.seekToPercentComplete(r.percent);break;case"PLAY_TRACK":{const n=Ze(t.getState())(r.id);null!=n&&e.loadFromUrl(n,!0);break}case"BUFFER_TRACK":{const n=Ze(t.getState())(r.id);null!=n&&e.loadFromUrl(n,!1);break}case"SET_BAND_VALUE":"preamp"===r.band?e.setPreamp(r.value):e.setEqBand(r.band,r.value);break;case"SET_EQ_OFF":e.disableEq();break;case"SET_EQ_ON":e.enableEq();break;case"LOAD_SERIALIZED_STATE":An(a)?e.enableEq():e.disableEq(),e.setVolume(en(a)),e.setBalance(tn(a)),Object(B.s)(a.equalizer.sliders,(t,n)=>{"preamp"===n?e.setPreamp(t):e.setEqBand(n,t)})}return i}};const wa=Object(U.composeWithDevTools)({actionsBlacklist:["UPDATE_TIME_ELAPSED","STEP_MARQUEE"]});var ya=n(15),va=n.n(ya);var ka=function(e){const{onChange:t,enabled:n}=e,r=Object(o.useRef)(null);return Object(o.useEffect)(()=>{function e(){t&&t(va.a.fullscreenElement===r.current)}return va.a.addEventListener("fullscreenchange",e),()=>{va.a.removeEventListener("fullscreenchange",e)}},[t]),Object(o.useLayoutEffect)(()=>{const e=va.a.fullscreenElement===r.current;var t;e&&!n?va.a.fullscreenEnabled&&va.a.exitFullscreen():!e&&n&&null!=r.current&&(t=r.current,va.a.fullscreenEnabled&&va.a.requestFullscreen(t))},[n]),Object(a.jsx)("div",{ref:r,style:e.enabled?{height:"100%",width:"100%"}:void 0,children:e.children})};function Sa(e){const[t,n]=Object(o.useState)(null);return Object(o.useEffect)(()=>{let t=!1;return e.then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}const Ia={current:{pageX:0,pageY:0}};function Oa(){const e=Ia,[t,n]=Object(o.useState)(!1),[r,i]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(null==r)return void n(!1);const t=r.getBoundingClientRect(),{pageX:i,pageY:a}=e.current;n(i>=t.left&&i<=t.right&&a>=t.top&&a<=t.bottom);const o=()=>n(!0),A=()=>n(!1);return r.addEventListener("mouseenter",o),r.addEventListener("mouseleave",A),()=>{r.removeEventListener("mouseenter",o),r.removeEventListener("mouseleave",A)}},[r,e]),{ref:i,hover:t}}function Ta(e){return O(e)}function Ca(e){const t=v();return Object(o.useCallback)((...n)=>t(e(...n)),[t,e])}function xa(){return v()}window.document.addEventListener("mousemove",({pageX:e,pageY:t})=>{Ia.current={pageX:e,pageY:t}});var Ua=n(6),Ba=n.n(Ua);n(71);function Ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Na=Object(o.memo)((function(e){const{currentSize:t,setWindowSize:n,widthOnly:r}=e,A=j()(e,["currentSize","setWindowSize","widthOnly"]),[s,l]=Object(o.useState)(!1),[u,c]=Object(o.useState)(null);Object(o.useEffect)(()=>{if(!1===s||null==u)return;const[n,i]=t,a=t=>{const a=B.l(t)-u.x,o=B.m(t)-u.y,A=[Math.max(0,n+Math.round(a/R.o)),r?n:Math.max(0,i+Math.round(o/R.n))];e.setWindowSize(A)};window.addEventListener("mousemove",a),window.addEventListener("touchmove",a);const o=()=>l(!1);return window.addEventListener("mouseup",o),window.addEventListener("touchend",o),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)}},[u,s]);const d=e=>{c({x:B.l(e),y:B.m(e)}),l(!0)};return Object(a.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ma(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ma(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onMouseDown:d,onTouchStart:d},A))}));var _a=function({onKeyDown:e,windowId:t,children:n}){const r=Ta(Qt),i=Ca(er),A=Object(o.useCallback)(()=>{t!==r&&i(t)},[t,r,i]),[s,l]=Object(o.useState)(null);return Object(o.useEffect)(()=>{if(null!=s&&null!=e)return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[e,t,r,s]),Object(o.useEffect)(()=>{if(null==s||t!==r)return;const e=new MutationObserver(e=>{document.activeElement===document.body&&e.some(e=>e.removedNodes.length>0)&&s.focus()});return e.observe(s,{subtree:!0,attributes:!1,childList:!0}),()=>e.disconnect()},[t,r,s]),Object(a.jsx)("div",{ref:l,onMouseDown:A,onTouchStart:A,onFocus:A,tabIndex:-1,style:{height:"100%",width:"100%"},children:n})};const Da=({children:e})=>{const t=e.split("");return Object(a.jsx)(o.Fragment,{children:t.map((e,t)=>Object(a.jsx)("div",{className:"draggable gen-text-letter gen-text-"+(" "===e?"space":e.toLowerCase())},t))})};var La=({children:e,title:t,windowId:n,onKeyDown:r})=>{const i=Ca(tr),o=Ca($n),A=Ta(Kt),s=Ta(Qt),l=Ta(mt)(n),u=s===n,{width:c,height:d}=A(n);return Object(a.jsx)(_a,{windowId:n,onKeyDown:r,children:Object(a.jsxs)("div",{className:Ba()("gen-window","window",{selected:u}),style:{width:c,height:d},children:[Object(a.jsxs)("div",{className:"gen-top draggable",children:[Object(a.jsx)("div",{className:"gen-top-left draggable"}),Object(a.jsx)("div",{className:"gen-top-left-fill draggable"}),Object(a.jsx)("div",{className:"gen-top-left-end draggable"}),Object(a.jsx)("div",{className:"gen-top-title draggable",children:Object(a.jsx)(Da,{children:t})}),Object(a.jsx)("div",{className:"gen-top-right-end draggable"}),Object(a.jsx)("div",{className:"gen-top-right-fill draggable"}),Object(a.jsx)("div",{className:"gen-top-right draggable",children:Object(a.jsx)("div",{className:"gen-close selected",onClick:()=>o(n)})})]}),Object(a.jsxs)("div",{className:"gen-middle",children:[Object(a.jsx)("div",{className:"gen-middle-left draggable",children:Object(a.jsx)("div",{className:"gen-middle-left-bottom draggable"})}),Object(a.jsx)("div",{className:"gen-middle-center",children:e({width:c-19,height:d-34})}),Object(a.jsx)("div",{className:"gen-middle-right draggable",children:Object(a.jsx)("div",{className:"gen-middle-right-bottom draggable"})})]}),Object(a.jsxs)("div",{className:"gen-bottom draggable",children:[Object(a.jsx)("div",{className:"gen-bottom-left draggable"}),Object(a.jsx)("div",{className:"gen-bottom-right draggable",children:Object(a.jsx)(Na,{currentSize:l,setWindowSize:e=>i(n,e),id:"gen-resize-target"})})]})]})})};const ja={[xe.DEFAULT]:2.7,[xe.IMMEDIATE]:0,[xe.USER_PRESET]:5.7};var Ra=function({analyser:e,width:t,height:n}){const r=Ta($t),i=Ta(Bt),A=Ta(En),s=Ta(xt),l=Ta(vn),u=Ta(wn),c=Ta(gn),d=r===R.k.MILKDROP,h=Object(o.useRef)(null),[f,p]=Object(o.useState)(null);Object(o.useEffect)(()=>{if(null==h.current||null==A)return;if(null!=f)return;const r=A.createVisualizer(e.context,h.current,{width:t,height:n,meshWidth:32,meshHeight:24,pixelRatio:window.devicePixelRatio||1});r.connectAudio(e),p(r)},[A,e,n,t,f]),Object(o.useEffect)(()=>{null!=f&&f.setRendererSize(t,n)},[f,t,n]);const g=Object(o.useRef)(!1);Object(o.useEffect)(()=>{null!=f&&null!=l&&(g.current?f.loadPreset(l,ja[u]):(f.loadPreset(l,ja[xe.IMMEDIATE]),g.current=!0))},[f,l]),Object(o.useEffect)(()=>{null!=f&&s&&f.launchSongTitleAnim(s)},[f,s]);const m=Object(o.useRef)(null);Object(o.useEffect)(()=>{null!=f&&null!=c&&(null==m.current||c.time>m.current)&&(m.current=Date.now(),f.launchSongTitleAnim(c.text))},[f,c]);const b=i&&d;return Object(o.useEffect)(()=>{if(!b||null==f)return;let e=null;const t=()=>{f.render(),e=window.requestAnimationFrame(t)};return t(),()=>{null!=e&&window.cancelAnimationFrame(e)}},[f,b]),Object(a.jsx)("canvas",{height:n,width:t,style:{height:"100%",width:"100%",display:d?"block":"none"},ref:h})};n(74);var Fa=e=>{const{innerRef:t}=e;return Object(a.jsx)("div",{ref:t,className:"draggable",style:{backgroundColor:"#000",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%"},tabIndex:0,children:e.children})};function Pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pa(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const za={position:"absolute",top:0,left:0,color:"white",background:"rgba(0.33, 0.33, 0.33, 0.33)"},Va={position:"absolute",top:0,left:0,padding:"15px 10px 0 10px"},Ga={display:"inline-block",whiteSpace:"nowrap",overflow:"hidden",background:"rgba(0, 0, 0, 0.815)",fontSize:"12px"};function Ya(e){return e-1}var Ka=function({height:e,width:t}){const n=Ta(kn),r=Ta(yn),i=Ca(na),A=Ca(ma),s=Ca(Xi),l=function(){const e=Object(o.useRef)(!1);return Object(o.useEffect)(()=>()=>{e.current=!0},[]),e}(),[u,c]=Object(o.useState)(()=>null!=r?r+1:0),d=n.length,h=Object(o.useCallback)(()=>{const t=Math.floor((e-15)/14),i=Math.floor(.75*t),[o,A]=function(e,t,n){const r=Math.min(e,t),i=Math.floor(r/2),a=n-i,o=Object(B.d)(a,0,e-r);return[o,o+r-1]}(d+1,i,u),s=[];for(let e=o;e<=A;e++){const t=Ya(e),i=t===r;let o;o=e===u?i?"#FFCC22":"#FF5050":i?"#CCFF03":"#CCCCCC",s.push(Object(a.jsx)("li",{style:{color:o,lineHeight:"14px"},children:0===e?"Load Local Directory":n[t]},e))}return s},[r,e,d,n,u]),f=Object(o.useCallback)(async()=>{const e=await ye({directory:!0});l.current||s(e)},[s,l]),p=Object(o.useCallback)(e=>{switch(e.keyCode){case 38:c(e=>Math.max(e-1,0)),e.stopPropagation();break;case 40:c(e=>Math.min(e+1,d)),e.stopPropagation();break;case 13:0===u?f():i(Ya(u),xe.DEFAULT,!0),e.stopPropagation();break;case 27:A(),e.stopPropagation()}},[f,d,i,u,A]),g=Object(o.useCallback)(e=>{null!=e&&document.activeElement!==e&&e.focus()},[]);return null==n?Object(a.jsx)("div",{style:za,children:Object(a.jsx)("span",{children:"Loading presets"})}):Object(a.jsx)("div",{ref:g,tabIndex:-1,style:Va,onKeyDown:p,children:Object(a.jsx)("div",{style:Qa(Qa({},Ga),{},{width:t-20-20,maxHeight:e-15}),children:Object(a.jsx)("ul",{style:{listStyleType:"none",padding:0,margin:0},children:h()})})})};function Ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ja(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ha(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qa(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="link",e.dataTransfer.effectAllowed="link"}var Wa=e=>{const{handleDrop:t,windowId:n}=e,r=j()(e,["handleDrop","windowId"]),i=Ca(qi),A=Object(o.useCallback)(e=>{qa(e),i(e,n);const{currentTarget:r}=e;if(!(r instanceof Element))return;const{left:a,top:o}=r.getBoundingClientRect();t(e,{x:a,y:o})},[t,i,n]);return Object(a.jsx)("div",Ja(Ja({},r),{},{onDragStart:qa,onDragEnter:qa,onDragOver:qa,onDrop:A}))};n(76);function Za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Za(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Za(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const $a=e=>{const t=Object(o.useMemo)(()=>{const t=document.createElement("div");return t.id="webamp-context-menu",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex=String(e.zIndex+1),t},[e.zIndex]);Object(o.useEffect)(()=>(document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]);const n={top:e.top,left:e.left,position:"absolute"};return Object(s.createPortal)(Object(a.jsx)("div",{style:n,children:e.children}),t)},eo=()=>Object(a.jsx)("li",{className:"hr",children:Object(a.jsx)("hr",{})}),to=({children:e,label:t})=>Object(a.jsxs)("li",{className:"parent",children:[Object(a.jsx)("ul",{children:e}),t]}),no=e=>Object(a.jsx)("li",{children:Object(a.jsx)("a",Xa(Xa({},e),{},{children:e.label}))}),ro=e=>{const{label:t,checked:n,className:r=""}=e,i=j()(e,["label","checked","className"]);return Object(a.jsx)("li",Xa(Xa({className:Ba()(r,{checked:n})},i),{},{children:t}))};function io({children:e,offsetTop:t,offsetLeft:n,top:r,bottom:i,selected:o}){const A=Ta(Gt);return o?Object(a.jsx)($a,{top:t,left:n,zIndex:A,children:Object(a.jsx)("ul",{className:Ba()("context-menu",{top:r,bottom:i}),children:e})}):null}function ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ao(e){var t,n;let{children:r,renderContents:i}=e,A=j()(e,["children","renderContents"]);const[s,l]=Object(o.useState)(null),u=Object(o.useCallback)(()=>{l(null)},[]),c=Object(o.useCallback)(e=>{2!==e.button&&u()},[u]),d=Object(o.useCallback)(e=>{const{pageX:t,pageY:n}=e;l({x:t,y:n}),e.preventDefault(),e.stopPropagation()},[]);return Object(o.useEffect)(()=>{if(null!=s)return document.addEventListener("click",c),document.body.addEventListener("contextmenu",u),()=>{document.removeEventListener("click",c),document.body.removeEventListener("contextmenu",u)}},[s,u,c]),Object(a.jsxs)("div",oo(oo({onContextMenu:d,style:{width:"100%",height:"100%"}},A),{},{children:[Object(a.jsx)(io,{selected:null!=s,offsetTop:null!==(t=null==s?void 0:s.y)&&void 0!==t?t:0,offsetLeft:null!==(n=null==s?void 0:s.x)&&void 0!==n?n:0,children:i()}),r]}))}var so=e=>{const t=Ta(mn),n=Ca($n),r=Ca(fa),i=Ca(ga);return Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ro,{onClick:i,label:"Fullscreen",hotkey:"Alt+Enter"}),Object(a.jsx)(ro,{onClick:r,checked:t,label:"Desktop Mode",hotkey:"Alt+D"}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:()=>n(R.m.MILKDROP),label:"Quit"})]}),children:e.children})};var lo=o.memo(({children:e})=>{const[t]=o.useState(()=>document.createElement("div"));return o.useEffect(()=>(t.classList.add("webamp-desktop"),document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]),l.a.createPortal(e,t)});function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ho=function({analyser:e}){const t=Ta(mn),n=Ta(bn),r=Ta(Sn),i=Ta(In),A=Ta(yn),s=Ta(Bt),l=Ca(ga),u=Ca($i),c=Ca(ra),d=Ca(pa),h=function(){const e=Ta(xt),t=Ca($i),n=Ca(ea),r=Ca(ia),i=Ca(ma),a=Ca(oa),A=Ca(aa);return Object(o.useCallback)(o=>{switch(o.keyCode){case 32:t();break;case 8:n(xe.IMMEDIATE);break;case 72:t(xe.IMMEDIATE);break;case 82:r();break;case 76:i(),o.stopPropagation();break;case 84:null!=e&&a(e),o.stopPropagation();break;case 145:case 125:A()}},[a,t,n,A,i,r,e])}();Object(o.useEffect)(()=>{if(!i||!s)return;const e=setInterval(u,15e3);return()=>clearInterval(e)},[i,A,s,u]);const f=function(){const[e]=Object(o.useState)(B.h());return e}(),p=function(){const[e,t]=Object(o.useState)(B.k()),n=Object(o.useCallback)(B.C(()=>{t(B.k())},100),[]);return Object(o.useEffect)(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n]),e}();return t?Object(a.jsx)(lo,{children:Object(a.jsx)(so,{children:Object(a.jsx)(Ra,co(co({},p),{},{analyser:e}))})}):Object(a.jsx)(La,{title:"Milkdrop",windowId:R.m.MILKDROP,onKeyDown:h,children:t=>{const i=n?f:t;return Object(a.jsx)(so,{children:Object(a.jsx)(Fa,{children:Object(a.jsxs)(Wa,{windowId:R.m.MILKDROP,handleDrop:c,children:[r&&Object(a.jsx)(Ka,co({},i)),Object(a.jsx)(ka,{enabled:n,onChange:d,children:Object(a.jsx)("div",{onDoubleClick:l,children:Object(a.jsx)(Ra,co(co({},i),{},{analyser:e}))})})]})})})}})};var fo=()=>{const e=Ca(fr),t=Ca(lr),n=Ca(ur),r=Ca(cr),i=Ca(hr),A=Ca(gr),s=Ca(mr),l=Ca(dr);return Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(ro,{label:"Previous",hotkey:"Z",onClick:e}),Object(a.jsx)(ro,{label:"Play",hotkey:"X",onClick:t}),Object(a.jsx)(ro,{label:"Pause",hotkey:"C",onClick:n}),Object(a.jsx)(ro,{label:"Stop",hotkey:"V",onClick:r}),Object(a.jsx)(ro,{label:"Next",hotkey:"B",onClick:i}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Back 5 seconds",hotkey:"Left",onClick:()=>s(5)}),Object(a.jsx)(ro,{label:"Fwd 5 seconds",hotkey:"Right",onClick:()=>A(5)}),Object(a.jsx)(ro,{label:"10 tracks back",hotkey:"Num. 1",onClick:()=>l(-10)}),Object(a.jsx)(ro,{label:"10 tracks fwd",hotkey:"Num. 3",onClick:()=>l(10)})]})};var po=()=>{const e=Ca(ha),t=Ca(_i),n=Ca(Ui),r=Ta(jn);return Object(a.jsxs)(to,{label:"Skins",children:[Object(a.jsx)(ro,{onClick:t,label:"Load Skin..."}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:e,label:"<Base Skin>"}),r.map(e=>Object(a.jsx)(ro,{onClick:()=>n(e.url),label:e.name},e.url))]})};var go=()=>{const e=Ca(Sr),t=Ca(qn),n=Ca(vr),r=Ca(kr),i=Ta(zt),o=Ta(_n),A=Ta(rn),s=Ta(nn);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(po,{}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Time elapsed",hotkey:"(Ctrl+T toggles)",onClick:e,checked:o===R.h.ELAPSED}),Object(a.jsx)(ro,{label:"Time remaining",hotkey:"(Ctrl+T toggles)",onClick:e,checked:o===R.h.REMAINING}),Object(a.jsx)(ro,{label:"Double Size",hotkey:"Ctrl+D",onClick:t,checked:i}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Repeat",hotkey:"R",onClick:n,checked:A}),Object(a.jsx)(ro,{label:"Shuffle",hotkey:"S",onClick:r,checked:s})]})};var mo=Object(o.memo)(({filePickers:e})=>{const t=Ta(Nn),n=Ta(ht),r=Ca(Aa),i=Ca(Ni),A=Ca(ji),s=Ca(nr),l=Ca(()=>({type:"MAIN_CONTEXT_MENU_OPENED"}));return Object(o.useEffect)(()=>{l()},[l]),Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(no,{href:"https://webamp.org/about",target:"_blank",label:"Webamp..."}),Object(a.jsx)(eo,{}),Object(a.jsxs)(to,{label:"Play",children:[Object(a.jsx)(ro,{onClick:i,label:"File...",hotkey:"L"}),null!=e&&e.map((e,n)=>(t||!e.requiresNetwork)&&Object(a.jsx)(ro,{onClick:async()=>{let t;try{t=await e.filePicker()}catch(e){console.error("Error loading from file picker",e)}A(t||[],R.e.PLAY)},label:e.contextMenuName},n))]}),Object(a.jsx)(eo,{}),Object.keys(n).map(e=>Object(a.jsx)(ro,{label:n[e].title,checked:n[e].open,onClick:()=>s(e),hotkey:n[e].hotkey},e)),Object(a.jsx)(eo,{}),Object(a.jsx)(po,{}),Object(a.jsx)(eo,{}),Object(a.jsx)(to,{label:"Options",children:Object(a.jsx)(go,{})}),Object(a.jsx)(to,{label:"Playback",children:Object(a.jsx)(fo,{})}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:r,label:"Exit"})]})});function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const wo=(e,t)=>{const n=Vn(e,t);return void 0!==n.x||void 0!==n.y};function yo(e){const t=Ta(Jt),n=Ta(pt),r=Ta(sn),i=Ca(rr),[a,A]=Object(o.useState)(null);return Object(o.useEffect)(()=>{if(null==a)return;const{boundingBox:e,moving:t,stationary:n,mouseStart:o}=a,s=a=>{const A={x:B.l(a)-o.x,y:B.m(a)-o.y},s=t.map(e=>Eo(Eo({},e),Yn(e,A))),l=Eo(Eo({},e),Yn(e,A)),u=((e,t)=>{let n=0,r=0;for(const i of e)for(const e of t){const t=Gn(i,e);if(n=n||t.x,r=r||t.y,void 0!==n&&n>0&&void 0!==r&&r>0)break}return{x:n,y:r}})(s,n),c=((e,t)=>{const n=((e,t)=>{let n,r;return e.x-15<0?n=0:e.x+e.width+15>t.width&&(n=t.width-e.width),e.y-15<0?r=0:e.y+e.height+15>t.height&&(r=t.height-e.height),{x:n,y:r}})(e,t);return{x:void 0===n.x?0:n.x-e.x,y:void 0===n.y?0:n.y-e.y}})(l,r),d=((e,...t)=>{const n=t.reduce((e,t)=>({x:0===e.x||0===t.x?e.x+t.x:Math.min(e.x,t.x),y:0===e.y||0===t.y?e.y+t.y:Math.min(e.y,t.y)}));return Yn(e,n)})(A,u,c),h={};t.forEach(e=>{h[e.key]=Yn(e,d)}),i(h,!1)};function l(){A(null)}return window.addEventListener("mouseup",l),window.addEventListener("touchend",l),window.addEventListener("mousemove",s,{passive:!1}),window.addEventListener("touchmove",s,{passive:!1}),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("touchmove",s),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}},[r,a,i]),Object(o.useCallback)((r,i)=>{if(!i.target.classList.contains("draggable"))return;const a=B.l(i),o=B.m(i);if(n(r))return;const s=t.filter(t=>null!=e[t.key]&&!n(t.key)),l=s.find(e=>e.key===r);if(null==l)throw new Error("Tried to move a node that does not exist: "+r);let u=new Set([l]);if("main"===r){const e=(c=wo,(e,t)=>{const n=new Set,r=t=>{for(const i of e)!n.has(i)&&c(i,t)&&(n.add(i),r(i))};return r(t),n});u=e(s,l)}var c;const d=s.filter(e=>!u.has(e)),h=Array.from(u),f={x:a,y:o},p=(e=>{const t=e.slice(),n=t.pop();if(null==n)throw new Error("boundingBox must be called with at least one node");const r={top:Rn(n),right:Qn(n),bottom:Fn(n),left:Pn(n)};return t.forEach(e=>{r.top=Math.min(r.top,Rn(e)),r.right=Math.max(r.right,Qn(e)),r.bottom=Math.max(r.bottom,Fn(e)),r.left=Math.min(r.left,Pn(e))}),{x:r.left,y:r.top,width:r.right-r.left,height:r.bottom-r.top}})(h);A({boundingBox:p,moving:h,stationary:d,mouseStart:f})},[n,e,t])}function vo({windows:e}){const t=Ta(Jt),n=Ca(er),r=yo(e),i=t.filter(t=>e[t.key]),A=Object(o.useCallback)(e=>{const{currentTarget:t,relatedTarget:r}=e;t===r||t.contains(r)||n(null)},[n]);return Object(a.jsx)(a.Fragment,{children:i.map(t=>Object(a.jsx)("div",{onBlur:A,onMouseDown:e=>{r(t.key,e)},onTouchStart:e=>{r(t.key,e)},style:{position:"absolute",top:0,left:0,transform:`translate(${t.x}px, ${t.y}px)`,touchAction:"none"},children:e[t.key]},t.key))})}var ko=n(43),So=n.n(ko);function Io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const To=e=>"character-"+So()(e.toString()).toLowerCase().charCodeAt(0);var Co=o.memo(e=>{let{children:t,className:n}=e,r=j()(e,["children","className"]);return Object(a.jsx)("span",Oo(Oo({},r),{},{className:`${n||""} character ${To(t)}`,children:t}))});n(91);const xo=()=>Object(a.jsx)(o.Fragment,{children:[1,7,12,20,25].map((e,t)=>Object(a.jsx)(Co,{style:{left:e},className:"background-character",children:" "},t))});var Uo=()=>{const e=Ta(Ut),t=Ta(Tt),n=Ta(on),r=Ta(_n),i=Ca(Sr);let o=null;e!==R.f.STOPPED&&null!=t&&(o=r===R.h.ELAPSED?n:t-n);const A=Object(B.i)(o),s=r===R.h.REMAINING&&e!==R.f.STOPPED;return Object(a.jsxs)("div",{onClick:i,className:Ba()("mini-time","countdown",{blinking:e===R.f.PAUSED}),children:[Object(a.jsx)(xo,{}),Object(a.jsx)(Co,{style:{left:1},children:s?"-":" "}),Object(a.jsx)(Co,{style:{left:7},children:A.minutesFirstDigit}),Object(a.jsx)(Co,{style:{left:12},children:A.minutesSecondDigit}),Object(a.jsx)(Co,{style:{left:20},children:A.secondsFirstDigit}),Object(a.jsx)(Co,{style:{left:25},children:A.secondsSecondDigit})]})};function Bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var No=function(e){const[t,n]=Object(o.useState)(!1);return Object(a.jsx)("div",Mo(Mo({},e),{},{className:Ba()(e.className,{clicked:t}),onMouseDown:function(t){n(!0),e.onMouseDown&&e.onMouseDown(t)}}))};function _o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Do(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_o(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lo=function(e){const t=Object(o.useRef)(null),[n,r]=Object(o.useState)(!1);Object(o.useEffect)(()=>{if(n)return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)};function e(e){n&&e.target instanceof Element&&n&&t.current&&!t.current.contains(e.target)&&r(!1)}},[n]);const i=Object(o.useMemo)(()=>n?function(e){if(null==e)return{top:0,left:0};const t=e.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+r,left:t.left+n}}(t.current):{top:0,left:0},[n]),{renderMenu:A,children:s,top:l,bottom:u}=e,c=j()(e,["renderMenu","children","top","bottom"]);return Object(a.jsxs)("div",Do(Do({},c),{},{children:[Object(a.jsx)("div",{className:"handle",style:{width:"100%",height:"100%"},ref:t,onClick:()=>r(!n),children:s}),Object(a.jsx)(io,{selected:n,offsetTop:i.top,offsetLeft:i.left,top:l,bottom:u,children:A()})]}))};function jo(e,t,n){const r=t*n,i=r+t;let a=0;for(let t=r;t<i;t++)a+=e[t];return a/t}function Ro({renderHeight:e,height:t}){const n=Ta(Zt),r=Ta(gt)("main"),i=Object(o.useMemo)(()=>function(e,t,n){const r=document.createElement("canvas");r.width=6,r.height=e;const i=t.slice(2,18),a=r.getContext("2d");if(null==a)throw new Error("Could not construct canvas context");const o=16/n;for(let t=0;t<n;t++){const n=15-Math.floor(t*o);a.fillStyle=i[n];const r=e-2*t;a.fillRect(0,r,6,2)}return r}(t,n,e),[n,t,e]);return Object(o.useCallback)((e,a,o,A)=>{if(o=2*Math.ceil(o),A=2*Math.ceil(A),o>0||A>0){const s=t-o,l=6;if(t>0&&e.drawImage(i,0,s,l,t,a,s,l,t),!r){const r=t-A;e.fillStyle=n[23],e.fillRect(a,r,l,2)}}},[i,n,t,r])}function Fo({renderHeight:e,height:t,analyser:n}){const[r]=Object(o.useState)(()=>new Array(20).fill(0)),[i]=Object(o.useState)(()=>new Array(20).fill(0)),a=n.frequencyBinCount,A=Object(o.useMemo)(()=>function(e){const t=new Array(20).fill(0),n=Math.pow(110.25,.05);t[0]=0,t[1]=200;for(let e=2;e<19;e++)t[e]=t[e-1]*n;t[19]=22050;for(let n=0;n<20;n++){const r=Math.floor(t[n]/22050*e);t[n]=r}return t}(a),[a]),s=Object(o.useMemo)(()=>new Uint8Array(a),[a]),l=Ro({height:t,renderHeight:e});return Object(o.useCallback)(t=>{n.getByteFrequencyData(s);const a=e/256;for(let e=0;e<19;e++){const n=A[e],o=A[e+1];let u=0;for(let e=n;e<o;e++)u+=s[e];u/=o-n;let c=r[e]-.01*Math.pow(i[e],2);c<u?(c=u,i[e]=0):i[e]+=1,r[e]=c,l(t,8*e,u*a,c*a)}},[n,i,r,s,A,l,e])}var Po=function({analyser:e}){Object(o.useLayoutEffect)(()=>{e.fftSize=2048},[e.fftSize]);const t=Ta(Zt),n=Ta($t),r=Ta(Ut),i=Ta(gt),A=Ta(Bn),s=Ca(sa),l=i("main"),u=l?38:76,c=l?5:16,d=2*u,h=2*c,f=Object(o.useMemo)(()=>function(e,t,n,r,i){const a=document.createElement("canvas");a.width=e,a.height=t;const o=a.getContext("2d");if(null==o)throw new Error("Could not construct canvas context");if(o.fillStyle=n,o.fillRect(0,0,e,t),!i){o.fillStyle=r;for(let n=0;n<e;n+=4)for(let e=2;e<t;e+=4)o.fillRect(n,e,2,2)}return a}(d,h,t[0],t[1],Boolean(l)),[t,h,d,l]),p=function({analyser:e,height:t,width:n,renderWidth:r}){const i=Ta(Zt),a=e.fftSize,A=Object(o.useMemo)(()=>new Uint8Array(a),[a]);return Object(o.useCallback)(o=>{e.getByteTimeDomainData(A),o.lineWidth=2,o.strokeStyle=i[18];const s=2*Math.floor(a/n),l=t;o.beginPath();for(let e=0;e<=r;e++){const t=(1-jo(A,s,e)/255)*l,n=2*e;0===n?o.moveTo(n,t):o.lineTo(n,t)}o.stroke()},[e,a,i,A,t,r,n])}({analyser:e,height:h,width:d,renderWidth:u}),g=Fo({analyser:e,height:h,renderHeight:c}),m=Ro({height:h,renderHeight:c}),b=Object(o.useCallback)(e=>{if(r===R.f.PLAYING){if(A)return e.drawImage(f,0,0),void Object.entries(A).forEach(([t,n])=>{m(e,Number(t),n,-1)});switch(n){case R.k.OSCILLOSCOPE:e.drawImage(f,0,0),p(e);break;case R.k.BAR:e.drawImage(f,0,0),g(e);break;default:e.clearRect(0,0,d,h)}}},[f,A,h,m,g,p,r,n,d]),[E,w]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(null==E)return;const e=E.getContext("2d");if(null==e)return;e.imageSmoothingEnabled=!1;let t=null;const n=()=>{b(e),t=window.requestAnimationFrame(n)};return n(),()=>{null!=t&&window.cancelAnimationFrame(t)}},[E,b]),r===R.f.STOPPED?null:Object(a.jsx)("canvas",{id:"visualizer",ref:w,style:{width:u,height:c},width:d,height:h,onClick:s})};var Qo=Object(o.memo)(()=>{const e=Ca(fr),t=Ca(lr),n=Ca(ur),r=Ca(hr),i=Ca(cr);return Object(a.jsxs)("div",{className:"actions",children:[Object(a.jsx)("div",{id:"previous",onClick:e,title:"Previous Track"}),Object(a.jsx)("div",{id:"play",onClick:t,title:"Play"}),Object(a.jsx)("div",{id:"pause",onClick:n,title:"Pause"}),Object(a.jsx)("div",{id:"stop",onClick:i,title:"Stop"}),Object(a.jsx)("div",{id:"next",onClick:r,title:"Next Track"})]})});function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Go({style:e,className:t,id:n}){const r=Ta(tn),i=Ca(yr),o=Ca(ua),A=Ca(ca);return Object(a.jsx)("input",{id:n,className:t,type:"range",min:"-100",max:"100",step:"1",value:r,style:Vo(Vo({},e),{},{touchAction:"none"}),onChange:e=>i(Number(e.target.value)),onMouseDown:()=>o("balance"),onMouseUp:A,title:"Balance"})}const Yo=e=>{const t=Math.abs(e)/100;return 15*Math.floor(27*t)};var Ko=Object(o.memo)(()=>{const e=Ta(tn);return Object(a.jsx)(Go,{id:"balance",style:{backgroundPosition:`0 -${Yo(e)}px`}})});var Ho=Object(o.memo)(()=>{const e=Ca(Aa);return Object(a.jsx)(No,{id:"close",onClick:e,title:"Close"})});function Jo(){return ua("double")}function qo(){return e=>{e(qn()),e({type:"UNSET_FOCUS"})}}var Wo=Object(o.memo)(()=>{const e=Ca(Jo),t=Ca(qo),n=Ta(zt);return Object(a.jsxs)("div",{id:"clutter-bar",children:[Object(a.jsx)(Lo,{bottom:!0,renderMenu:()=>Object(a.jsx)(go,{}),children:Object(a.jsx)("div",{id:"button-o"})}),Object(a.jsx)("div",{id:"button-a"}),Object(a.jsx)("div",{id:"button-i"}),Object(a.jsx)("div",{title:"Toggle Doublesize Mode",id:"button-d",className:Ba()({selected:n}),onMouseUp:t,onMouseDown:e}),Object(a.jsx)("div",{id:"button-v"})]})});var Zo=Object(o.memo)(()=>{const e=Ca(Ni);return Object(a.jsx)("div",{id:"eject",onClick:e,title:"Open File(s)"})});function Xo(){return nr("equalizer")}var $o=Object(o.memo)(()=>{const e=Ca(Xo),t=Ta(ft)("equalizer");return Object(a.jsx)("div",{id:"equalizer-button",className:Ba()({selected:t}),onClick:e,title:"Toggle Graphical Equalizer"})});function eA(){return nr("playlist")}var tA=Object(o.memo)(()=>{const e=Ta(ft)("playlist"),t=Ca(eA);return Object(a.jsx)("div",{id:"playlist-button",className:Ba()({selected:e}),onClick:t,title:"Toggle Playlist Editor"})});var nA=Object(o.memo)(e=>{const t=(""+e.children||"").split("");return Object(a.jsx)(o.Fragment,{children:t.map((e,t)=>Object(a.jsx)(Co,{children:e},t+e))})});var rA=Object(o.memo)(()=>{const e=Ta(fn);return Object(a.jsx)("div",{id:"kbps",children:Object(a.jsx)(nA,{children:e||""})})});var iA=Object(o.memo)(()=>{const e=Ta(pn);return Object(a.jsx)("div",{id:"khz",children:Object(a.jsx)(nA,{children:e||""})})});const aA=e=>e.length>=31,oA=e=>aA(e)?`${e} *** ${e}`:e.padEnd(31," ");var AA=o.memo(()=>{const e=Ta(hn),t=Ta(zt),n=Ta(Mn),r=Ca(ba),{handleMouseDown:i,dragOffset:A,dragging:s}=function(){const[e,t]=o.useState(null),[n,r]=o.useState(0);return o.useEffect(()=>{if(null==e)return;const n=e,i=e=>{const t=B.l(e)-n;r(-t)};let a=!1;const o=()=>{a||(document.removeEventListener("mousemove",i),document.removeEventListener("touchmove",i),document.removeEventListener("mouseup",o),document.removeEventListener("touchend",o),t(null),a=!0)};return document.addEventListener("mousemove",i),document.addEventListener("touchmove",i),document.addEventListener("touseup",o),document.addEventListener("touchend",o),o},[e]),{handleMouseDown:o.useCallback(e=>{t(B.l(e))},[]),dragOffset:n,dragging:null!=e}}(),l=((e,t,n)=>{if(!aA(e))return 0;const r=5*t+n,i=5*(e.length+" *** ".length);return(r%(a=i)+a)%a;var a})(e,n,A),u=-l+"px";return function({step:e,dragging:t}){const[n,r]=o.useState(!0);o.useEffect(()=>{if(!1===n)return;const t=setInterval(e,220);return()=>clearInterval(t)},[e,n]),o.useEffect(()=>{if(t)return void r(!1);const e=window.setTimeout(()=>{r(!0)},1e3);return()=>{window.clearTimeout(e)}},[t])}({step:r,dragging:s}),Object(a.jsx)("div",{id:"marquee",className:"text",onMouseDown:i,onTouchStart:i,title:"Song Title",children:Object(a.jsx)("div",{style:{whiteSpace:"nowrap",willChange:"transform",transform:`translateX(${u})`},children:Object(a.jsx)(nA,{children:oA(e)})},t?"doubled":"not-doubled")})});var sA=Object(o.memo)(()=>{const e=Ta(an);return Object(a.jsxs)("div",{className:"mono-stereo",children:[Object(a.jsx)("div",{id:"stereo",className:Ba()({selected:2===e})}),Object(a.jsx)("div",{id:"mono",className:Ba()({selected:1===e})})]})});var lA=Object(o.memo)(()=>{const[e,t]=function(){const e=Ta(Tt),t=Ta(on),n=e?Math.floor(t)/e*100:0,r=Ta(dn);return[n,"position"===Ta(cn)?r:n]}(),n=xa(),r=Object(o.useCallback)(e=>{n({type:"SEEK_TO_PERCENT_COMPLETE",percent:Number(e.target.value)}),n({type:"UNSET_FOCUS"})},[n]),i=Object(o.useCallback)(e=>{n({type:"SET_FOCUS",input:"position"}),n({type:"SET_SCRUB_POSITION",position:Number(e.target.value)})},[n]);let A="";return e<=33?A="left":e>=66&&(A="right"),Object(a.jsx)("input",{id:"position",className:A,type:"range",min:"0",max:"100",step:"1",style:{touchAction:"none"},value:t,onInput:i,onChange:()=>{},onMouseUp:r,onMouseDown:i,title:"Seeking Bar"})});var uA=Object(o.memo)(()=>{const e=Ta(rn),t=Ca(vr);return Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsx)(ro,{checked:e,label:"Repeat",onClick:t,hotkey:"(R)"}),children:Object(a.jsx)("div",{id:"repeat",className:Ba()({selected:e}),onClick:t,title:"Toggle Repeat"})})});var cA=Object(o.memo)(()=>{const e=Ca(Zn);return Object(a.jsx)(No,{id:"shade",onMouseDown:e,onDoubleClick:e=>e.stopPropagation(),title:"Toggle Windowshade Mode"})});var dA=Object(o.memo)(()=>{const e=Ca(la);return Object(a.jsx)(No,{id:"minimize",title:"Minimize",onClick:e})});var hA=Object(o.memo)(()=>{const e=Ta(nn),t=Ca(kr);return Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsx)(ro,{checked:e,label:"Shuffle",onClick:t,hotkey:"(S)"}),children:Object(a.jsx)("div",{id:"shuffle",className:Ba()({selected:e}),onClick:t,title:"Toggle Shuffle"})})});var fA=Object(o.memo)(()=>{const e=Ca(Sr),t=Ta(on),n=Ta(Tt)||0,r=Ta(_n),i=r===R.h.ELAPSED?t:n-t,o=B.i(i);return Object(a.jsxs)("div",{id:"time",onClick:e,className:"countdown",children:[r===R.h.REMAINING&&Object(a.jsx)("div",{id:"minus-sign"}),Object(a.jsx)("div",{id:"minute-first-digit",className:"digit digit-"+o.minutesFirstDigit}),Object(a.jsx)("div",{id:"minute-second-digit",className:"digit digit-"+o.minutesSecondDigit}),Object(a.jsx)("div",{id:"second-first-digit",className:"digit digit-"+o.secondsFirstDigit}),Object(a.jsx)("div",{id:"second-second-digit",className:"digit digit-"+o.secondsSecondDigit})]})});function pA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pA(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mA({id:e,style:t,className:n}){const r=Ta(en),i=Ca(ua),o=Ca(ca),A=Ca(br);return Object(a.jsx)("input",{id:e,type:"range",min:"0",max:"100",step:"1",value:r,style:gA(gA({},t),{},{touchAction:"none"}),className:n,onChange:e=>A(Number(e.target.value)),onMouseDown:()=>i("volume"),onTouchStart:()=>{i("volume")},onMouseUp:o,onTouchEnd:o,title:"Volume Bar"})}var bA=Object(o.memo)(()=>{const e=Ta(en)/100,t={backgroundPosition:`0 -${15*(Math.round(28*e)-1)}px`};return Object(a.jsx)("div",{id:"volume",style:t,children:Object(a.jsx)(mA,{})})});n(93);function EA(e){return Li(e,R.e.PLAY)}var wA=o.memo(({analyser:e,filePickers:t})=>{const n=Ta(gt)("main"),r=Ta(Ut),i=Ta(Qt),o=Ta(Dn),A=Ta(zt),s=Ta(Vt),l=Ta(Ln),u=Ba()({window:!0,play:r===R.f.PLAYING,stop:r===R.f.STOPPED,pause:r===R.f.PAUSED,selected:i===R.m.MAIN,shade:n,draggable:!0,loading:o,doubled:A,llama:s}),c=Ca(Zn),d=Ca(wr),h=Ca(EA);return Object(a.jsx)(Wa,{id:"main-window",windowId:R.m.MAIN,className:u,handleDrop:h,onWheel:d,children:Object(a.jsxs)(_a,{windowId:R.m.MAIN,children:[Object(a.jsxs)("div",{id:"title-bar",className:"selected draggable",onDoubleClick:c,children:[Object(a.jsx)(Lo,{id:"option-context",bottom:!0,renderMenu:()=>Object(a.jsx)(mo,{filePickers:t}),children:Object(a.jsx)(No,{id:"option",title:"Winamp Menu"})}),n&&Object(a.jsx)(Uo,{}),Object(a.jsx)(dA,{}),Object(a.jsx)(cA,{}),Object(a.jsx)(Ho,{})]}),Object(a.jsxs)("div",{className:"webamp-status",children:[Object(a.jsx)(Wo,{}),!l&&Object(a.jsx)("div",{id:"play-pause"}),Object(a.jsx)("div",{id:"work-indicator",className:Ba()({selected:l})}),Object(a.jsx)(fA,{})]}),Object(a.jsx)(Po,{analyser:e}),Object(a.jsxs)("div",{className:"media-info",children:[Object(a.jsx)(AA,{}),Object(a.jsx)(rA,{}),Object(a.jsx)(iA,{}),Object(a.jsx)(sA,{})]}),Object(a.jsx)(bA,{}),Object(a.jsx)(Ko,{}),Object(a.jsxs)("div",{className:"windows",children:[Object(a.jsx)($o,{}),Object(a.jsx)(tA,{})]}),Object(a.jsx)(lA,{}),Object(a.jsx)(Qo,{}),Object(a.jsx)(Zo,{}),Object(a.jsxs)("div",{className:"shuffle-repeat",children:[Object(a.jsx)(hA,{}),Object(a.jsx)(uA,{})]}),Object(a.jsx)("a",{id:"about",target:"_blank",href:"https://webamp.org/about",title:"About"})]})})});var yA=function({widthOnly:e}){const t=Ta(mt),n=Ca(tr),r=t("playlist");return Object(a.jsx)(Na,{currentSize:r,id:"playlist-resize-target",setWindowSize:e=>{n("playlist",e)},widthOnly:e})};var vA=function(){const e=Ta(Qt),t=Ta(mt)("playlist"),n=Ta(Tt),r=Ta(Dt),i=Ca($n),A=Ca(Xn),s=Ca(er),l=t[0]*R.o,u=Object(o.useMemo)(()=>{if(null==r)return"[No file]";const e=(205+l)/R.b;return r.length>e?r.slice(0,e-1)+R.j:r},[l,r]),c=Object(o.useMemo)(()=>null==r?"":Object(B.j)(n),[n,r]);return Object(a.jsx)("div",{id:"playlist-window-shade",className:Ba()("window","draggable",{selected:e===R.m.PLAYLIST}),style:{width:R.p+l+"px"},onMouseDown:()=>s("playlist"),onDoubleClick:A,children:Object(a.jsx)("div",{className:"left",children:Object(a.jsxs)("div",{className:"right draggable",children:[Object(a.jsx)("div",{id:"playlist-shade-track-title",children:Object(a.jsx)(nA,{children:u})}),Object(a.jsx)("div",{id:"playlist-shade-time",children:Object(a.jsx)(nA,{children:c})}),Object(a.jsx)(yA,{widthOnly:!0}),Object(a.jsx)("div",{id:"playlist-shade-button",onClick:A}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>i("playlist")})]})})})};var kA=Object(o.memo)((function({children:e}){const{ref:t,hover:n}=Oa();return Object(a.jsx)("li",{ref:t,className:Ba()({hover:n}),children:e})}));var SA=Object(o.memo)((function(e){const[t,n]=Object(o.useState)(!1),[r,i]=Object(o.useState)(null),A=Object(o.useCallback)(()=>{setTimeout(()=>{n(!1)},0)},[]);return function(e,t){Object(o.useEffect)(()=>{if(null==e||null==t)return;const n=r=>{const i=r.target;i instanceof Element&&(e.contains(i)||(t(),window.document.removeEventListener("click",n,{capture:!0})))};return window.document.addEventListener("click",n,{capture:!0}),()=>{window.document.removeEventListener("click",n,{capture:!0})}},[e,t])}(r,t?A:null),Object(a.jsxs)("div",{id:e.id,className:Ba()("playlist-menu",{selected:t}),ref:i,onClick:()=>n(e=>!e),children:[Object(a.jsx)("div",{className:"bar"}),t&&Object(a.jsx)("ul",{children:o.Children.map(e.children,(e,t)=>Object(a.jsx)(kA,{children:e},t))})]})}));var IA=()=>{const e=Ta($e),t=Ca(Yi),n=Ca(Gi),r=Ca(Ki);return Object(a.jsxs)(SA,{id:"playlist-add-menu",children:[Object(a.jsx)("div",{className:"add-url",onClick:()=>r(e)}),Object(a.jsx)("div",{className:"add-dir",onClick:()=>t(e)}),Object(a.jsx)("div",{className:"add-file",onClick:()=>n(e)})]})};var OA=()=>{const e=Ca(li),t=Ca(ui),n=Ca(si);return Object(a.jsxs)(SA,{id:"playlist-remove-menu",children:[Object(a.jsx)("div",{className:"remove-misc",onClick:()=>alert("Not supported in Webamp")}),Object(a.jsx)("div",{className:"remove-all",onClick:t}),Object(a.jsx)("div",{className:"crop",onClick:n}),Object(a.jsx)("div",{className:"remove-selected",onClick:e})]})};function TA(){const e=Ca(wi),t=Ca(yi),n=Ca(vi);return Object(a.jsxs)(SA,{id:"playlist-selection-menu",children:[Object(a.jsx)("div",{className:"invert-selection",onClick:e}),Object(a.jsx)("div",{className:"select-zero",onClick:t}),Object(a.jsx)("div",{className:"select-all",onClick:n})]})}function CA(){const e=Ca(ci),t=Ca(di),n=Ca(hi);return Object(a.jsx)(Lo,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ro,{label:"Sort list by title",onClick:n}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Reverse list",onClick:e}),Object(a.jsx)(ro,{label:"Randomize list",onClick:t})]}),children:Object(a.jsx)("div",{})})}var xA=()=>{const e=Ca(Qi);return Object(a.jsx)(Lo,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsx)(ro,{onClick:e,label:"Generate HTML playlist"}),children:Object(a.jsx)("div",{})})};var UA=()=>Object(a.jsxs)(SA,{id:"playlist-misc-menu",children:[Object(a.jsx)("div",{className:"sort-list",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(CA,{})}),Object(a.jsx)("div",{className:"file-info",onClick:()=>alert("Not supported in Webamp")}),Object(a.jsx)("div",{className:"misc-options",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(xA,{})})]});function BA(){const e=Ca(ui),t=(Ca(Hi),Ca(Ji));return Object(a.jsxs)(SA,{id:"playlist-list-menu",children:[Object(a.jsx)("div",{className:"new-list",onClick:e}),Object(a.jsx)("div",{className:"save-list",onClick:t}),Object(a.jsx)("div",{className:"load-list"})]})}var MA=()=>{const e=Ta(st),t=Object(o.useMemo)(()=>function(e,t,n){for(;e.length<t;)e+=n;return e}(e,18," "),[e]);return Object(a.jsx)("div",{className:"playlist-running-time-display draggable",children:Object(a.jsx)("div",{children:Object(a.jsx)(nA,{children:t})})})};var NA=()=>{const e=Ca(lr),t=Ca(ur),n=Ca(cr),r=Ca(Ni),i=Ca(hr),A=Ca(fr);return Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(MA,{}),Object(a.jsxs)("div",{className:"playlist-action-buttons",children:[Object(a.jsx)("div",{className:"playlist-previous-button",onClick:A}),Object(a.jsx)("div",{className:"playlist-play-button",onClick:e}),Object(a.jsx)("div",{className:"playlist-pause-button",onClick:t}),Object(a.jsx)("div",{className:"playlist-stop-button",onClick:n}),Object(a.jsx)("div",{className:"playlist-next-button",onClick:i}),Object(a.jsx)("div",{className:"playlist-eject-button",onClick:r})]}),Object(a.jsx)(Uo,{})]})};var _A=function({children:e,handleMoveClick:t,index:n,id:r}){const i=Ta(Xt),A=Ta(rt),s=Ta(ct),l=A.has(r),u=s===r,c=xa(),d=Ca(sr),h=Object(o.useCallback)(e=>e.shiftKey?(e.preventDefault(),void c({type:"SHIFT_CLICKED_TRACK",index:n})):e.metaKey||e.ctrlKey?(e.preventDefault(),void c({type:"CTRL_CLICKED_TRACK",index:n})):(l||c({type:"CLICKED_TRACK",index:n}),void t(e)),[c,t,n,l]),f=Object(o.useCallback)(e=>{function i(){d(r)}l||c({type:"CLICKED_TRACK",index:n}),t(e),e.target.addEventListener("touchstart",i),setTimeout(()=>{e.target.removeEventListener("touchstart",i)},250)},[c,t,r,n,d,l]),p={backgroundColor:l?i.selectedbg:void 0,color:u?i.current:void 0};return Object(a.jsx)("div",{className:Ba()("track-cell",{selected:l,current:u}),style:p,onClick:e=>e.stopPropagation(),onMouseDown:h,onTouchStart:f,onContextMenu:e=>e.preventDefault(),onDoubleClick:()=>d(r),children:e})};var DA=({id:e,paddedTrackNumber:t})=>{const n=Ta(Ct)(e);return Object(a.jsxs)("span",{children:[t,". ",n]})};var LA=function(){const e=Ta(kt),t=Ta(St),n=Ta(We),r=Ta(jt),i=Ca(yi),A=Ca(Ei),s=Ca(gi),[l,u]=Object(o.useState)(null),[c,d]=Object(o.useState)(!1),[h,f]=Object(o.useState)(null),p=e=>{d(!0),f(B.m(e))};function g(n){return t.map((t,r)=>Object(a.jsx)(_A,{id:t,index:e+r,handleMoveClick:p,children:n(t,r)},t))}Object(o.useEffect)(()=>{if(null==l||null==h||!1===c)return;const{top:e,bottom:t,left:n,right:r}=l.getBoundingClientRect();let i=0;const a=a=>{const o=B.l(a),s=B.m(a);if(s<e||s>t||o<n||o>r)return;const l=Math.floor((s-h)/R.i);if(l!==i){A(l-i),i=l}},o=()=>d(!1);return window.addEventListener("mouseup",o),window.addEventListener("mousemove",a),window.addEventListener("touchend",o),window.addEventListener("touchmove",a),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)}},[c]);const m=r.toString().length,b=t=>(t+1+e).toString().padStart(m," ");return Object(o.useEffect)(()=>{if(null!=l)return l.addEventListener("wheel",s,{passive:!1}),()=>{l.removeEventListener("wheel",s)}},[l,s]),Object(a.jsxs)("div",{ref:u,className:"playlist-tracks",style:{height:"100%",userSelect:"none"},onClick:i,children:[Object(a.jsx)("div",{className:"playlist-track-titles",children:g((e,t)=>Object(a.jsx)(DA,{id:e,paddedTrackNumber:b(t)}))}),Object(a.jsx)("div",{className:"playlist-track-durations",children:g(e=>B.j(n[e].duration))})]})};function jA({value:e,height:t,width:n,handle:r,handleHeight:i,onBeforeChange:A,onChange:s,onAfterChange:l,disabled:u}){const c=Object(o.useRef)(null),d=Object(o.useRef)(null);function h({target:e,clientY:t,touch:n}){const r=c.current,i=d.current;if(null==r||null==i)return null;const a=r.getBoundingClientRect(),o=i.getBoundingClientRect(),{top:u,height:h}=a,{top:f,height:p}=o,g=u+(i.contains(e)?t-f:p/2),m=h-p;function b(e){const t=e-g;s(B.d(t/m,0,1))}if(n){const e=e=>{e.cancelable&&e.preventDefault(),b(e.touches[0].clientY)},t=()=>{null!=l&&l(),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)};document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t)}else{const e=e=>{e.preventDefault(),b(e.clientY)},t=()=>{null!=l&&l(),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)};document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)}null!=A&&A(),b(t)}const f=Math.floor((t-i)*e);return Object(a.jsx)("div",{style:{height:t,width:n},onMouseDown:u?void 0:function(e){e.preventDefault(),h({target:e.target,clientY:e.clientY,touch:!1})},onTouchStart:u?void 0:function(e){h({target:e.target,clientY:e.touches[0].clientY,touch:!0})},ref:c,children:Object(a.jsx)("div",{style:{transform:`translateY(${f}px)`},ref:d,children:r})})}const RA=()=>Object(a.jsx)("div",{className:"playlist-scrollbar-handle",style:{height:18}});function FA(){const e=Ta(Kt)(R.m.PLAYLIST).height,t=Ta(vt),n=Ta(It),r=Ca(fi);return Object(a.jsx)("div",{className:"playlist-scrollbar",style:{marginLeft:5},children:Object(a.jsx)(jA,{height:e-58,handleHeight:18,width:8,value:t/100,onChange:e=>r(100*e),handle:Object(a.jsx)(RA,{}),disabled:n})})}n(95);function PA(e){return e.playlist.trackOrder.length-1}var QA=function({analyser:e}){const t=Ta(kt),n=Ta(mt),r=Ta(Qt),i=Ta(gt),A=Ta(ft),s=Ta(PA),l=Ta(Xt),u=Ta(Kt),c=r===R.m.PLAYLIST,d=Boolean(i(R.m.PLAYLIST)),h=n(R.m.PLAYLIST),f=u(R.m.PLAYLIST),p=Ca($n),g=Ca(Xn),m=Ca(mi),b=Ca(bi),E=Ca(wr),w=Ca(Li),y=h[0]>2,v=!A(R.m.MAIN),k=Object(o.useCallback)((e,n)=>{const r=e.clientY-n.y,i=Object(B.d)(t+Math.round((r-23)/R.i),0,s+1);w(e,R.e.NONE,i)},[w,s,t]);if(d)return Object(a.jsx)(vA,{});const S={color:l.normal,backgroundColor:l.normalbg,fontFamily:l.font+", Arial, sans-serif",height:f.height+"px",width:f.width+"px"},I=Ba()("window","draggable",{selected:c}),O=h[0]%2==0;return Object(a.jsx)(_a,{windowId:R.m.PLAYLIST,children:Object(a.jsxs)(Wa,{id:"playlist-window",windowId:R.m.PLAYLIST,className:I,style:S,handleDrop:k,onWheel:E,children:[Object(a.jsxs)("div",{className:"playlist-top draggable",onDoubleClick:g,children:[Object(a.jsx)("div",{className:"playlist-top-left draggable"}),O&&Object(a.jsx)("div",{className:"playlist-top-left-spacer draggable"}),Object(a.jsx)("div",{className:"playlist-top-left-fill draggable"}),Object(a.jsx)("div",{className:"playlist-top-title draggable"}),O&&Object(a.jsx)("div",{className:"playlist-top-right-spacer draggable"}),Object(a.jsx)("div",{className:"playlist-top-right-fill draggable"}),Object(a.jsxs)("div",{className:"playlist-top-right draggable",children:[Object(a.jsx)("div",{id:"playlist-shade-button",onClick:g}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>p(R.m.PLAYLIST)})]})]}),Object(a.jsxs)("div",{className:"playlist-middle draggable",children:[Object(a.jsx)("div",{className:"playlist-middle-left draggable"}),Object(a.jsx)("div",{className:"playlist-middle-center",children:Object(a.jsx)(LA,{})}),Object(a.jsx)("div",{className:"playlist-middle-right draggable",children:Object(a.jsx)(FA,{})})]}),Object(a.jsxs)("div",{className:"playlist-bottom draggable",children:[Object(a.jsxs)("div",{className:"playlist-bottom-left draggable",children:[Object(a.jsx)(IA,{}),Object(a.jsx)(OA,{}),Object(a.jsx)(TA,{}),Object(a.jsx)(UA,{})]}),Object(a.jsx)("div",{className:"playlist-bottom-center draggable"}),Object(a.jsxs)("div",{className:"playlist-bottom-right draggable",children:[y&&Object(a.jsx)("div",{className:"playlist-visualizer",children:v&&Object(a.jsx)("div",{className:"visualizer-wrapper",children:Object(a.jsx)(Po,{analyser:e})})}),Object(a.jsx)(NA,{}),Object(a.jsx)(BA,{}),Object(a.jsx)("div",{id:"playlist-scroll-up-button",onClick:m}),Object(a.jsx)("div",{id:"playlist-scroll-down-button",onClick:b}),Object(a.jsx)(yA,{})]})]})]})})};const zA=()=>Object(a.jsx)("div",{style:{width:11,height:11,marginLeft:1},className:"slider-handle"});function VA({id:e,onChange:t,band:n}){const r=Ta(Je)[n],i=Object(o.useMemo)(()=>{const{x:e,y:t}={x:(n=(e=>{const t=e/100;return Math.round(27*t)})(r))%14,y:Math.floor(n/14)};var n;return`-${15*e}px -${65*t}px`},[r]),A=Ca(da),s=Ca(ca);return Object(a.jsx)("div",{id:e,className:"band",style:{backgroundPosition:i,height:63},children:Object(a.jsx)(jA,{height:62,width:14,handleHeight:11,value:1-r/100,onBeforeChange:()=>A(n),onChange:e=>t(100*(1-e)),onAfterChange:s,handle:Object(a.jsx)(zA,{})})})}var GA=()=>{const e=Ca(Mr),t=Ta(An);return Object(a.jsx)("div",{id:"on",className:Ba()({selected:t}),onClick:e})};var YA=Object(o.memo)(()=>{const e=Ta(e=>e.equalizer.auto),t=Ca(Nr);return Object(a.jsx)("div",{id:"auto",className:Ba()({selected:e}),onClick:t})});function KA(e,t){const n=function(e,t){const n=e.map(()=>0),r=e.length-1,i=function(e,t){const n=[];for(let r=0;r<e;r++){n.push([]);for(let e=0;e<t;e++)n[r].push(0)}return n}(r+1,r+2);for(let n=1;n<r;n++)i[n][n-1]=1/(e[n]-e[n-1]),i[n][n]=2*(1/(e[n]-e[n-1])+1/(e[n+1]-e[n])),i[n][n+1]=1/(e[n+1]-e[n]),i[n][r+1]=3*((t[n]-t[n-1])/((e[n]-e[n-1])*(e[n]-e[n-1]))+(t[n+1]-t[n])/((e[n+1]-e[n])*(e[n+1]-e[n])));return i[0][0]=2/(e[1]-e[0]),i[0][1]=1/(e[1]-e[0]),i[0][r+1]=3*(t[1]-t[0])/((e[1]-e[0])*(e[1]-e[0])),i[r][r-1]=1/(e[r]-e[r-1]),i[r][r]=2/(e[r]-e[r-1]),i[r][r+1]=3*(t[r]-t[r-1])/((e[r]-e[r-1])*(e[r]-e[r-1])),function(e,t){const n=e.length;for(let t=0;t<n;t++){let r=0,i=Number.NEGATIVE_INFINITY;for(let a=t;a<n;a++)e[a][t]>i&&(r=a,i=e[a][t]);HA(e,t,r);for(let r=t+1;r<n;r++){for(let i=t+1;i<n+1;i++)e[r][i]=e[r][i]-e[t][i]*(e[r][t]/e[t][t]);e[r][t]=0}}for(let r=n-1;r>=0;r--){const i=e[r][n]/e[r][r];t[r]=i;for(let t=r-1;t>=0;t--)e[t][n]-=e[t][r]*i,e[t][r]=0}return t}(i,n)}(e,t),r=e[e.length-1],i=[];let a=1;for(let o=0;o<=r;o++){for(;e[a]<o;)a++;const r=(o-e[a-1])/(e[a]-e[a-1]),A=n[a-1]*(e[a]-e[a-1])-(t[a]-t[a-1]),s=-n[a]*(e[a]-e[a-1])+(t[a]-t[a-1]),l=(1-r)*t[a-1]+r*t[a]+r*(1-r)*(A*(1-r)+s*r);i.push(l)}return i}function HA(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}var JA=function(){const e=Ta(Je),t=Sa(Ta(xn)),[n,r]=Object(o.useState)(null),i=Object(o.useMemo)(()=>{var e;return null!==(e=null==n?void 0:n.getContext("2d"))&&void 0!==e?e:null},[n]),A=function(e){const t=Sa(Ta(Un));return Object(o.useMemo)(()=>null==e||null==t?null:e.createPattern(t,"repeat-x"),[e,t])}(i);return Object(o.useLayoutEffect)(()=>{if(null==i||null==n||null==t||null==A)return;const r=Number(n.width),a=Number(n.height);i.clearRect(0,0,r,a),function({colorPattern:e,sliders:t,canvasCtx:n,preampLineImage:r}){const i=Object(B.x)(t.preamp/100,0,18);n.drawImage(r,0,i,r.width,r.height);const a=R.a.map(e=>t[e]);n.fillStyle=e;const o=[],A=[];a.forEach((e,t)=>{const n=(100-e)/100;o.push(12*t),A.push(Object(B.x)(n,0,18))});const s=KA(o,A),l=o[o.length-1];let u=A[0];for(let e=0;e<=l;e++){const t=Object(B.d)(Math.round(s[e]),0,18),r=Math.min(t,u),i=1+Math.abs(u-t);n.fillRect(2+e,r,1,i),u=t}}({colorPattern:A,sliders:e,canvasCtx:i,preampLineImage:t})},[i,n,A,t,e]),Object(a.jsx)("canvas",{id:"eqGraph",ref:r,width:113,height:19})},qA=n(44);var WA=()=>{const e=Ca(Mi),t=Ca(Pi),n=Ca(Fi);return Object(a.jsx)(Lo,{top:!0,id:"presets-context",renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)(to,{label:"Load",children:[qA.presets.map(e=>Object(a.jsx)(ro,{onClick:()=>n(e),label:e.name},e.name)),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:e,label:"From Eqf..."})]}),Object(a.jsx)(ro,{onClick:t,label:"Save"})]}),children:Object(a.jsx)("div",{id:"presets"})})};function ZA(){const e=Ta(Qt)===R.m.EQUALIZER,t=Ca($n),n=Ca(Wn);return Object(a.jsxs)(No,{id:"eq-buttons",children:[Object(a.jsx)("div",{id:"equalizer-shade",onClick:n}),Object(a.jsx)("div",{id:"equalizer-close",onClick:()=>t(R.m.EQUALIZER)})]},e?"selected":"unselected")}var XA=()=>{const e=Ta(en),t=Ta(tn),n=Ca(Wn),r=["left","center","right"],i=Object(B.z)(0,100,e,r),o=Object(B.z)(-100,100,t,r);return Object(a.jsxs)("div",{className:"draggable",onDoubleClick:n,style:{width:"100%",height:"100%"},children:[Object(a.jsx)(ZA,{}),Object(a.jsx)(mA,{id:"equalizer-volume",className:i}),Object(a.jsx)(Go,{id:"equalizer-balance",className:o})]})};n(97);var $A=()=>{const e=Ta(zt),t=Ta(Qt),n=Ta(gt),r=t===R.m.EQUALIZER,i=n(R.m.EQUALIZER),o=Ca(Br),A=Ca(Ur),s=Ca(xr),l=Ca(Cr),u=Ca(Or),c=Ca(Wn),d=Ba()({selected:r,doubled:e,shade:i,window:!0,draggable:!0});return Object(a.jsx)("div",{id:"equalizer-window",className:d,children:Object(a.jsx)(_a,{windowId:R.m.EQUALIZER,children:i?Object(a.jsx)(XA,{}):Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"equalizer-top title-bar draggable",onDoubleClick:c,children:Object(a.jsx)(ZA,{})}),Object(a.jsx)(GA,{}),Object(a.jsx)(YA,{}),Object(a.jsx)(JA,{}),Object(a.jsx)(WA,{}),Object(a.jsx)(VA,{id:"preamp",band:"preamp",onChange:o}),Object(a.jsx)("div",{id:"plus12db",onClick:l}),Object(a.jsx)("div",{id:"zerodb",onClick:s}),Object(a.jsx)("div",{id:"minus12db",onClick:A}),R.a.map(e=>{return Object(a.jsx)(VA,{id:(t=e,"band-"+t),band:e,onChange:t=>u(e,t)},e);var t})]})})})};const es={MAIN_BALANCE_BACKGROUND:["#balance"],MAIN_BALANCE_THUMB:["#balance::-webkit-slider-thumb","#balance::-moz-range-thumb"],MAIN_BALANCE_THUMB_ACTIVE:["#balance:active::-webkit-slider-thumb","#balance:active::-moz-range-thumb"],MAIN_PREVIOUS_BUTTON:[".actions #previous"],MAIN_PREVIOUS_BUTTON_ACTIVE:[".actions #previous:active"],MAIN_PLAY_BUTTON:[".actions #play"],MAIN_PLAY_BUTTON_ACTIVE:[".actions #play:active"],MAIN_PAUSE_BUTTON:[".actions #pause"],MAIN_PAUSE_BUTTON_ACTIVE:[".actions #pause:active"],MAIN_STOP_BUTTON:[".actions #stop"],MAIN_STOP_BUTTON_ACTIVE:[".actions #stop:active"],MAIN_NEXT_BUTTON:[".actions #next"],MAIN_NEXT_BUTTON_ACTIVE:[".actions #next:active"],MAIN_EJECT_BUTTON:["#eject"],MAIN_EJECT_BUTTON_ACTIVE:["#eject:active"],MAIN_WINDOW_BACKGROUND:["#main-window"],MAIN_STEREO:[".media-info #stereo",".stop .media-info #stereo.selected"],MAIN_STEREO_SELECTED:[".media-info #stereo.selected"],MAIN_MONO:[".media-info #mono",".stop .media-info #mono.selected"],MAIN_MONO_SELECTED:[".media-info #mono.selected"],NO_MINUS_SIGN:["#time #minus-sign"],MINUS_SIGN:["#time.countdown #minus-sign"],DIGIT_0:[".digit-0"],DIGIT_1:[".digit-1"],DIGIT_2:[".digit-2"],DIGIT_3:[".digit-3"],DIGIT_4:[".digit-4"],DIGIT_5:[".digit-5"],DIGIT_6:[".digit-6"],DIGIT_7:[".digit-7"],DIGIT_8:[".digit-8"],DIGIT_9:[".digit-9"],NO_MINUS_SIGN_EX:["#time #minus-sign"],MINUS_SIGN_EX:["#time.countdown #minus-sign"],DIGIT_0_EX:[".digit-0"],DIGIT_1_EX:[".digit-1"],DIGIT_2_EX:[".digit-2"],DIGIT_3_EX:[".digit-3"],DIGIT_4_EX:[".digit-4"],DIGIT_5_EX:[".digit-5"],DIGIT_6_EX:[".digit-6"],DIGIT_7_EX:[".digit-7"],DIGIT_8_EX:[".digit-8"],DIGIT_9_EX:[".digit-9"],MAIN_PLAYING_INDICATOR:[".play #play-pause"],MAIN_PAUSED_INDICATOR:[".pause #play-pause"],MAIN_STOPPED_INDICATOR:[".stop #play-pause"],MAIN_NOT_WORKING_INDICATOR:["#work-indicator"],MAIN_WORKING_INDICATOR:["#work-indicator.selected"],PLAYLIST_TOP_TILE:[".playlist-top-left-fill",".playlist-top-left-spacer",".playlist-top-right-fill",".playlist-top-right-spacer"],PLAYLIST_TOP_LEFT_CORNER:[".playlist-top-left"],PLAYLIST_TITLE_BAR:[".playlist-top-title"],PLAYLIST_TOP_RIGHT_CORNER:[".playlist-top-right"],PLAYLIST_TOP_TILE_SELECTED:[".selected .playlist-top-left-fill",".selected .playlist-top-left-spacer",".selected .playlist-top-right-fill",".selected .playlist-top-right-spacer"],PLAYLIST_TOP_LEFT_SELECTED:[".selected .playlist-top-left"],PLAYLIST_TITLE_BAR_SELECTED:[".selected .playlist-top-title"],PLAYLIST_TOP_RIGHT_CORNER_SELECTED:[".selected .playlist-top-right"],PLAYLIST_LEFT_TILE:[".playlist-middle-left"],PLAYLIST_RIGHT_TILE:[".playlist-middle-right"],PLAYLIST_SCROLL_HANDLE:[".playlist-scrollbar-handle"],PLAYLIST_SCROLL_HANDLE_SELECTED:[".playlist-middle-right:active .playlist-scrollbar-handle"],PLAYLIST_BOTTOM_TILE:[".playlist-bottom"],PLAYLIST_BOTTOM_LEFT_CORNER:[".playlist-bottom-left"],PLAYLIST_BOTTOM_RIGHT_CORNER:[".playlist-bottom-right"],PLAYLIST_VISUALIZER_BACKGROUND:[".playlist-visualizer"],PLAYLIST_SHADE_BACKGROUND:["#playlist-window-shade"],PLAYLIST_SHADE_BACKGROUND_LEFT:["#playlist-window-shade .left"],PLAYLIST_SHADE_BACKGROUND_RIGHT:["#playlist-window-shade .right"],PLAYLIST_SHADE_BACKGROUND_RIGHT_SELECTED:["#playlist-window-shade.selected .right"],PLAYLIST_ADD_MENU_BAR:["#playlist-add-menu.selected .bar"],PLAYLIST_ADD_URL:["#playlist-add-menu .add-url"],PLAYLIST_ADD_URL_SELECTED:["#playlist-add-menu .hover .add-url"],PLAYLIST_ADD_DIR:["#playlist-add-menu .add-dir"],PLAYLIST_ADD_DIR_SELECTED:["#playlist-add-menu .hover .add-dir"],PLAYLIST_ADD_FILE:["#playlist-add-menu .add-file"],PLAYLIST_ADD_FILE_SELECTED:["#playlist-add-menu .hover .add-file"],PLAYLIST_REMOVE_MENU_BAR:["#playlist-remove-menu.selected .bar"],PLAYLIST_REMOVE_ALL:["#playlist-remove-menu .remove-all"],PLAYLIST_REMOVE_ALL_SELECTED:["#playlist-remove-menu .hover .remove-all"],PLAYLIST_CROP:["#playlist-remove-menu .crop"],PLAYLIST_CROP_SELECTED:["#playlist-remove-menu .hover .crop"],PLAYLIST_REMOVE_SELECTED:["#playlist-remove-menu .remove-selected"],PLAYLIST_REMOVE_SELECTED_SELECTED:["#playlist-remove-menu .hover .remove-selected"],PLAYLIST_REMOVE_MISC:["#playlist-remove-menu .remove-misc"],PLAYLIST_REMOVE_MISC_SELECTED:["#playlist-remove-menu .hover .remove-misc"],PLAYLIST_SELECT_MENU_BAR:["#playlist-selection-menu.selected .bar"],PLAYLIST_INVERT_SELECTION:["#playlist-selection-menu .invert-selection"],PLAYLIST_INVERT_SELECTION_SELECTED:["#playlist-selection-menu .hover .invert-selection"],PLAYLIST_SELECT_ZERO:["#playlist-selection-menu .select-zero"],PLAYLIST_SELECT_ZERO_SELECTED:["#playlist-selection-menu .hover .select-zero"],PLAYLIST_SELECT_ALL:["#playlist-selection-menu .select-all"],PLAYLIST_SELECT_ALL_SELECTED:["#playlist-selection-menu .hover .select-all"],PLAYLIST_CLOSE_SELECTED:["#playlist-close-button:active"],PLAYLIST_COLLAPSE_SELECTED:["#playlist-window #playlist-shade-button:active"],PLAYLIST_EXPAND_SELECTED:["#playlist-window-shade #playlist-shade-button:active"],PLAYLIST_MISC_MENU_BAR:["#playlist-misc-menu.selected .bar"],PLAYLIST_MISC_OPTIONS:["#playlist-misc-menu .misc-options"],PLAYLIST_MISC_OPTIONS_SELECTED:["#playlist-misc-menu .hover .misc-options"],PLAYLIST_FILE_INFO:["#playlist-misc-menu .file-info"],PLAYLIST_FILE_INFO_SELECTED:["#playlist-misc-menu .hover .file-info"],PLAYLIST_SORT_LIST:["#playlist-misc-menu .sort-list"],PLAYLIST_SORT_LIST_SELECTED:["#playlist-misc-menu .hover .sort-list"],PLAYLIST_LIST_BAR:["#playlist-list-menu.selected .bar"],PLAYLIST_NEW_LIST:["#playlist-list-menu .new-list"],PLAYLIST_NEW_LIST_SELECTED:["#playlist-list-menu .hover .new-list"],PLAYLIST_LOAD_LIST:["#playlist-list-menu .load-list"],PLAYLIST_LOAD_LIST_SELECTED:["#playlist-list-menu .hover .load-list"],PLAYLIST_SAVE_LIST:["#playlist-list-menu .save-list"],PLAYLIST_SAVE_LIST_SELECTED:["#playlist-list-menu .hover .save-list"],EQ_WINDOW_BACKGROUND:["#equalizer-window:not(.shade)"],EQ_TITLE_BAR:[".equalizer-top"],EQ_TITLE_BAR_SELECTED:[".selected .equalizer-top"],EQ_SLIDER_BACKGROUND:[".band"],EQ_SLIDER_THUMB:[".band .slider-handle"],EQ_SLIDER_THUMB_SELECTED:[".band:active .slider-handle"],EQ_ON_BUTTON:["#on"],EQ_ON_BUTTON_DEPRESSED:["#on:active"],EQ_ON_BUTTON_SELECTED:["#on.selected"],EQ_ON_BUTTON_SELECTED_DEPRESSED:["#on.selected:active"],EQ_AUTO_BUTTON:["#auto"],EQ_AUTO_BUTTON_DEPRESSED:["#auto:active"],EQ_AUTO_BUTTON_SELECTED:["#auto.selected"],EQ_AUTO_BUTTON_SELECTED_DEPRESSED:["#auto.selected:active"],EQ_GRAPH_BACKGROUND:["#eqGraph"],EQ_PRESETS_BUTTON:["#presets"],EQ_PRESETS_BUTTON_SELECTED:["#presets:active"],EQ_PREAMP_LINE:["#preamp-line"],EQ_SHADE_BACKGROUND:["#equalizer-window.shade"],EQ_SHADE_BACKGROUND_SELECTED:["#equalizer-window.shade.selected"],EQ_SHADE_VOLUME_SLIDER_LEFT:["#equalizer-volume.left::-webkit-slider-thumb","#equalizer-volume.left::-moz-range-thumb"],EQ_SHADE_VOLUME_SLIDER_CENTER:["#equalizer-volume.center::-webkit-slider-thumb","#equalizer-volume.center::-moz-range-thumb"],EQ_SHADE_VOLUME_SLIDER_RIGHT:["#equalizer-volume.right::-webkit-slider-thumb","#equalizer-volume.right::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_LEFT:["#equalizer-balance.left::-webkit-slider-thumb","#equalizer-balance.left::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_CENTER:["#equalizer-balance.center::-webkit-slider-thumb","#equalizer-balance.center::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_RIGHT:["#equalizer-balance.right::-webkit-slider-thumb","#equalizer-balance.right::-moz-range-thumb"],EQ_MAXIMIZE_BUTTON_ACTIVE:["#equalizer-shade:active"],EQ_MINIMIZE_BUTTON_ACTIVE:["#equalizer-window.shade #equalizer-shade:active"],EQ_CLOSE_BUTTON:["#equalizer-window.selected #eq-buttons.clicked #equalizer-close"],EQ_CLOSE_BUTTON_ACTIVE:["#equalizer-window.selected #eq-buttons.clicked #equalizer-close:active"],EQ_SHADE_CLOSE_BUTTON:["#equalizer-window.shade.selected #eq-buttons.clicked #equalizer-close"],EQ_SHADE_CLOSE_BUTTON_ACTIVE:["#equalizer-window.shade.selected #eq-buttons.clicked #equalizer-close:active"],MAIN_POSITION_SLIDER_BACKGROUND:["#position"],MAIN_POSITION_SLIDER_THUMB:["#position::-webkit-slider-thumb","#position::-moz-range-thumb"],MAIN_POSITION_SLIDER_THUMB_SELECTED:["#position:active::-webkit-slider-thumb","#position:active::-moz-range-thumb"],MAIN_SHUFFLE_BUTTON:["#shuffle"],MAIN_SHUFFLE_BUTTON_DEPRESSED:["#shuffle:active"],MAIN_SHUFFLE_BUTTON_SELECTED:["#shuffle.selected"],MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED:["#shuffle.selected:active"],MAIN_REPEAT_BUTTON:["#repeat"],MAIN_REPEAT_BUTTON_DEPRESSED:["#repeat:active"],MAIN_REPEAT_BUTTON_SELECTED:["#repeat.selected"],MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED:["#repeat.selected:active"],MAIN_EQ_BUTTON:["#equalizer-button"],MAIN_EQ_BUTTON_SELECTED:["#equalizer-button.selected"],MAIN_EQ_BUTTON_DEPRESSED:["#equalizer-button:active"],MAIN_EQ_BUTTON_DEPRESSED_SELECTED:["#equalizer-button.selected:active"],MAIN_PLAYLIST_BUTTON:["#playlist-button"],MAIN_PLAYLIST_BUTTON_SELECTED:["#playlist-button.selected"],MAIN_PLAYLIST_BUTTON_DEPRESSED:["#playlist-button:active"],MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED:["#playlist-button.selected:active"],MAIN_TITLE_BAR:["#title-bar"],MAIN_TITLE_BAR_SELECTED:[".selected #title-bar"],MAIN_EASTER_EGG_TITLE_BAR:[".llama #title-bar"],MAIN_EASTER_EGG_TITLE_BAR_SELECTED:[".llama.selected #title-bar"],MAIN_OPTIONS_BUTTON:[".selected #title-bar #option.clicked"],MAIN_OPTIONS_BUTTON_DEPRESSED:[".selected #title-bar #option:active",".selected #title-bar #option.selected"],MAIN_MINIMIZE_BUTTON:[".selected #title-bar #minimize.clicked"],MAIN_MINIMIZE_BUTTON_DEPRESSED:[".selected #title-bar #minimize:active"],MAIN_SHADE_BUTTON:[".selected #title-bar #shade.clicked"],MAIN_SHADE_BUTTON_DEPRESSED:[".selected #title-bar #shade:active"],MAIN_CLOSE_BUTTON:[".selected #title-bar #close.clicked"],MAIN_CLOSE_BUTTON_DEPRESSED:[".selected #title-bar #close:active"],MAIN_CLUTTER_BAR_BACKGROUND:["#clutter-bar"],MAIN_CLUTTER_BAR_BACKGROUND_DISABLED:["#clutter-bar.disabled"],MAIN_CLUTTER_BAR_BUTTON_O_SELECTED:["#button-o:active","#button-0.selected"],MAIN_CLUTTER_BAR_BUTTON_A_SELECTED:["#button-a:active","#button-a.selected"],MAIN_CLUTTER_BAR_BUTTON_I_SELECTED:["#button-i:active","#button-i.selected"],MAIN_CLUTTER_BAR_BUTTON_D_SELECTED:["#button-d:active","#button-d.selected"],MAIN_CLUTTER_BAR_BUTTON_V_SELECTED:["#button-v:active","#button-v.selected"],MAIN_SHADE_BACKGROUND:[".shade #title-bar"],MAIN_SHADE_BACKGROUND_SELECTED:[".shade.selected #title-bar"],MAIN_SHADE_BUTTON_SELECTED:[".shade.selected #title-bar #shade"],MAIN_SHADE_BUTTON_SELECTED_DEPRESSED:[".shade #title-bar #shade:active"],MAIN_SHADE_POSITION_BACKGROUND:[".shade #position"],MAIN_SHADE_POSITION_THUMB:[".shade #position::-moz-range-thumb",".shade #position::-webkit-slider-thumb"],MAIN_SHADE_POSITION_THUMB_LEFT:[".shade #position.left::-moz-range-thumb",".shade #position.left::-webkit-slider-thumb"],MAIN_SHADE_POSITION_THUMB_RIGHT:[".shade #position.right::-moz-range-thumb",".shade #position.right::-webkit-slider-thumb"],MAIN_VOLUME_BACKGROUND:["#volume"],MAIN_VOLUME_THUMB:["#volume input::-webkit-slider-thumb","#volume input::-moz-range-thumb"],MAIN_VOLUME_THUMB_SELECTED:["#volume input:active::-webkit-slider-thumb","#volume input:active::-moz-range-thumb"],GEN_TOP_CENTER_FILL:[".gen-window .gen-top"],GEN_TOP_LEFT:[".gen-window .gen-top-left"],GEN_TOP_LEFT_END:[".gen-window .gen-top-left-end"],GEN_TOP_RIGHT:[".gen-window .gen-top-right"],GEN_TOP_RIGHT_END:[".gen-window .gen-top-right-end"],GEN_TOP_LEFT_RIGHT_FILL:[".gen-window .gen-top-left-fill",".gen-window .gen-top-right-fill"],GEN_TOP_CENTER_FILL_SELECTED:[".gen-window.selected .gen-top"],GEN_TOP_LEFT_SELECTED:[".gen-window.selected .gen-top-left"],GEN_TOP_LEFT_END_SELECTED:[".gen-window.selected .gen-top-left-end"],GEN_TOP_RIGHT_SELECTED:[".gen-window.selected .gen-top-right"],GEN_TOP_RIGHT_END_SELECTED:[".gen-window.selected .gen-top-right-end"],GEN_TOP_LEFT_RIGHT_FILL_SELECTED:[".gen-window.selected .gen-top-left-fill",".gen-window.selected .gen-top-right-fill"],GEN_BOTTOM_LEFT:[".gen-window .gen-bottom-left"],GEN_BOTTOM_RIGHT:[".gen-window .gen-bottom-right"],GEN_BOTTOM_FILL:[".gen-window .gen-bottom"],GEN_MIDDLE_LEFT:[".gen-window .gen-middle-left"],GEN_MIDDLE_LEFT_BOTTOM:[".gen-window .gen-middle-left-bottom"],GEN_MIDDLE_RIGHT:[".gen-window .gen-middle-right"],GEN_MIDDLE_RIGHT_BOTTOM:[".gen-window .gen-middle-right-bottom"],GEN_CLOSE_SELECTED:[".gen-window .gen-close:active"]};Object.keys(Dr).forEach(e=>{const t=Lr(e),n=e.charCodeAt(0);es[t]=[".character-"+n]}),R.d.forEach(e=>{es["GEN_TEXT_"+e]=[".gen-text-"+e.toLowerCase()],es["GEN_TEXT_SELECTED_"+e]=[".gen-window.selected .gen-text-"+e.toLowerCase()]});const ts={CLOSE:["#title-bar #close"],EQSLID:["#equalizer-window .band"],EQNORMAL:["#equalizer-window"],EQCLOSE:["#equalizer-window #equalizer-close"],EQTITLE:["#equalizer-window .title-bar","#equalizer-window.shade","#equalizer-window.shade input"],MAINMENU:["#main-window #option","#webamp-context-menu .context-menu"],MIN:["#main-window #minimize"],NORMAL:[".window",".window input","#main-window","#main-window.shade #title-bar"],MMENU:["#main-window.shade #option"],PNORMAL:["#playlist-window"],PTBAR:["#playlist-window .playlist-top"],PCLOSE:["#playlist-window #playlist-close-button","#playlist-window-shade #playlist-close-button"],PWINBUT:["#playlist-window #playlist-shade-button","#playlist-window-shade #playlist-shade-button"],POSBAR:["#main-window #position"],PSIZE:["#playlist-window #playlist-resize-target"],PWSSIZE:["#playlist-window-shade #playlist-resize-target"],PWSNORM:["#playlist-window-shade"],PVSCROLL:["#playlist-window .playlist-scrollbar"],SONGNAME:["#main-window #marquee"],TITLEBAR:["#main-window #title-bar"],VOLBAL:["#volume","#volume input","#balance"],WINBUT:["#main-window #shade"],WSNORMAL:["#main-window.shade #title-bar"],WSPOSBAR:["#main-window.shade #position"]};function ns({children:e,id:t}){const n=Object(o.useMemo)(()=>{const e=document.createElement("style");return e.type="text/css",e.id=t,e},[t]);return Object(o.useLayoutEffect)(()=>(document.head.appendChild(n),()=>n.remove()),[n]),Object(s.createPortal)(e,n)}function rs({children:e}){const t=Object(o.useMemo)(()=>document.createElement("div"),[]);return Object(o.useLayoutEffect)(()=>(document.body.appendChild(t),()=>t.remove()),[t]),Object(s.createPortal)(Object(a.jsx)("svg",{height:0,width:0,children:Object(a.jsx)("defs",{children:Object.keys(e).map(t=>Object(a.jsx)("clipPath",{id:t,children:e[t].map((e,t)=>Object(a.jsx)("polygon",{points:e},t))},t))})}),t)}var is=n(45);const as={normal:"mainWindowClipPath",windowshade:"shadeMainWindowClipPath",equalizer:"equalizerWindowClipPath",equalizerws:"shadeEqualizerWindowClipPath"},os={normal:"#main-window:not(.shade)",windowshade:"#main-window.shade",equalizer:"#equalizer-window:not(.shade)",equalizerws:"#equalizer-window.shade"},As={MAIN_BALANCE_BACKGROUND:"MAIN_VOLUME_BACKGROUND",MAIN_BALANCE_THUMB:"MAIN_VOLUME_THUMB",MAIN_BALANCE_THUMB_ACTIVE:"MAIN_VOLUME_THUMB_SELECTED",EQ_MAXIMIZE_BUTTON_ACTIVE:"EQ_MAXIMIZE_BUTTON_ACTIVE_FALLBACK"};function ss(e){return`${e.startsWith("#webamp-context-menu")?"":"#webamp"} ${e}`}const ls=Object(q.createSelector)((function(e){return e.display.skinImages}),(function(e){return e.display.skinCursors}),(function(e){return e.display.skinGenLetterWidths}),Cn,(e,t,n,r)=>{if(!e||!t)return null;const i=[];Object.keys(es).forEach(t=>{const n=e[t]||e[As[t]];n&&es[t].forEach(e=>{i.push(`#webamp ${e} {background-image: url(${n})}`)})}),null!=n&&R.d.forEach(e=>{const t=n["GEN_TEXT_"+e],r=n["GEN_TEXT_SELECTED_"+e];i.push(`#webamp .gen-text-${e.toLowerCase()} {width: ${t}px;}`),i.push(`#webamp .selected .gen-text-${e.toLowerCase()} {width: ${r}px;}`)}),Object.entries(ts).forEach(([e,n])=>{const r=t[e];if(null==r)return;const a=n.map(ss).map(e=>{switch(r.type){case"cur":return`${e} {cursor: url(${r.url}), auto}`;case"ani":try{return Object(is.convertAniBinaryToCSS)(e,r.aniData)}catch(e){return console.error(e),null}}}).filter(Boolean);i.push(...a)}),(e=>Boolean(e.DIGIT_0_EX))(e)&&i.push("#webamp .webamp-status #time #minus-sign { top: 0px; left: -1px; width: 9px; height: 13px; }");for(const[e,t]of Object.entries(r))if(t){const t=os[e],n=as[e];i.push(`#webamp ${t} { clip-path: url(#${n}); }`)}return i.join("\n")}),us=Object(q.createSelector)(Cn,e=>{const t={};for(const[n,r]of Object.entries(e))if(r){t[as[n]]=r}return t});function cs(){const e=Ta(ls),t=Ta(us);return null==e?null:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ns,{id:"webamp-skin",children:e}),Object(a.jsx)(rs,{children:t})]})}n(101);function ds({media:e,filePickers:t}){const n=Ta(Tn),r=Ta(ht),i=Ta(Gt),A=Ca(ar),s=Ca(er),[u]=Object(o.useState)(()=>{const e=document.createElement("div");return e.id="webamp",e.role="application",e});Object(o.useLayoutEffect)(()=>{u.style.zIndex=String(i)},[u,i]),Object(o.useLayoutEffect)(()=>(document.body.appendChild(u),()=>{document.body.removeChild(u)}),[u]),Object(o.useEffect)(()=>{const e=()=>{null!=u&&(u.style.right="0",u.style.bottom="0",u.style.overflow="hidden",A(B.k()),u.style.right="auto",u.style.bottom="auto",u.style.overflow="visible")};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[A,u]);const c=Object(o.useCallback)(()=>B.t(r,(n,r)=>{if(!n.open)return null;switch(r){case R.m.MAIN:return Object(a.jsx)(wA,{analyser:e.getAnalyser(),filePickers:t});case R.m.EQUALIZER:return Object(a.jsx)($A,{});case R.m.PLAYLIST:return Object(a.jsx)(QA,{analyser:e.getAnalyser()});case R.m.MILKDROP:return Object(a.jsx)(ho,{analyser:e.getAnalyser()});default:throw new Error("Tried to render an unknown window: "+r)}}),[e,t,r]);return n?null:l.a.createPortal(Object(a.jsx)(o.StrictMode,{children:Object(a.jsxs)("div",{onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(null)},children:[Object(a.jsx)(cs,{}),Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsx)(mo,{filePickers:t}),children:Object(a.jsx)(vo,{windows:c()})})]})}),u)}const hs=new Set(["input","textarea","select"]);class fs{constructor(){i()(this,"_listeners",void 0),this._listeners={}}on(e,t){const n=this._listeners[e]||[];n.push(t),this._listeners[e]=n;return()=>{this._listeners[e]=n.filter(e=>e!==t)}}trigger(e,...t){const n=this._listeners[e];n&&n.forEach(e=>e(...t))}dispose(){this._listeners={}}}function ps(e,t={balance:0}){let n=0;const r=e.createGain();r.channelCount=2,r.channelCountMode="explicit",r.channelInterpretation="speakers";const i=e.createChannelSplitter(2),a=e.createGain(),o=e.createGain(),A=e.createChannelMerger(2);function s(e){const t=Number(e);a.gain.value=t>0?1-t:1,o.gain.value=t>0?1:1+t,n=t}r.connect(i),i.connect(a,0),i.connect(o,1),a.connect(A,0,0),o.connect(A,0,1);const l={};return Object.defineProperties(l,{value:{get:function(){return n},set:s,enumerable:!0,configurable:!0}}),Object.defineProperties(r,{balance:{value:l,enumerable:!0,writable:!1,configurable:!0},connect:{value:AudioNode.prototype.connect.bind(A),enumerable:!1,writable:!1,configurable:!0},disconnect:{value:AudioNode.prototype.disconnect.bind(A),enumerable:!1,writable:!1,configurable:!0}}),n!==t.balance&&s(t.balance),r}class gs{on(e,t){return this._emitter.on(e,t)}constructor(e,t){i()(this,"_emitter",void 0),i()(this,"_context",void 0),i()(this,"_source",void 0),i()(this,"_destination",void 0),i()(this,"_audio",void 0),i()(this,"_stalled",void 0),i()(this,"_status",void 0),this._emitter=new fs,this._context=e,this._destination=t,this._audio=document.createElement("audio"),this._audio.crossOrigin="anonymous",this._stalled=!1,this._status=R.f.STOPPED,this._audio.addEventListener("suspend",()=>{this._setStalled(!0)}),this._audio.addEventListener("durationchange",()=>{this._emitter.trigger("loaded"),this._setStalled(!1)}),this._audio.addEventListener("ended",()=>{this._emitter.trigger("ended"),this._setStatus(R.f.STOPPED)}),this._audio.addEventListener("timeupdate",()=>{this._emitter.trigger("positionChange")}),this._audio.addEventListener("error",e=>{switch(this._audio.error.code){case 1:console.error("MEDIA_ERR_ABORTED",e);break;case 2:console.error("MEDIA_ERR_NETWORK",e);break;case 3:console.error("PIPELINE_ERROR_DECODE",e);break;case 4:console.error("MEDIA_ERR_SRC_NOT_SUPPORTED",e)}this._emitter.trigger("ended"),this._setStatus(R.f.STOPPED)}),this._source=this._context.createMediaElementSource(this._audio),this._source.connect(t)}_setStalled(e){this._stalled=e,this._emitter.trigger("stallChanged")}disconnect(){this._source.disconnect()}async loadUrl(e){this._audio.src=e}async play(){this._status!==R.f.PAUSED&&this.seekToTime(0);try{await this._audio.play()}catch(e){}this._setStatus(R.f.PLAYING)}pause(){this._audio.pause(),this._setStatus(R.f.PAUSED)}stop(){this._audio.pause(),this._audio.currentTime=0,this._setStatus(R.f.STOPPED)}seekToTime(e){this._audio.currentTime=Object(B.d)(e,0,this.getDuration()),this._emitter.trigger("positionChange")}getStalled(){return this._stalled}getStatus(){return this._status}getDuration(){const{duration:e}=this._audio;return isNaN(e)||e===1/0?0:e}getTimeElapsed(){return this._audio.currentTime}_setStatus(e){this._status=e,this._emitter.trigger("statusChange")}dispose(){this.stop(),this._emitter.dispose()}}class ms{constructor(){if(i()(this,"_emitter",void 0),i()(this,"_context",void 0),i()(this,"_balance",void 0),i()(this,"_staticSource",void 0),i()(this,"_preamp",void 0),i()(this,"_analyser",void 0),i()(this,"_gainNode",void 0),i()(this,"_source",void 0),i()(this,"_bands",void 0),this._emitter=new fs,this._context=new(window.AudioContext||window.webkitAudioContext),"suspended"===this._context.state){const e=async()=>{await this._context.resume(),"running"===this._context.state&&(document.body.removeEventListener("touchend",e,!1),document.body.removeEventListener("click",e,!1),document.body.removeEventListener("keydown",e,!1))};document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1),document.body.addEventListener("keydown",e,!1)}this._staticSource=this._context.createGain(),this._balance=new ps(this._context),this._preamp=this._context.createGain(),this._analyser=this._context.createAnalyser(),this._analyser.fftSize=2048,this._analyser.smoothingTimeConstant=0,this._gainNode=this._context.createGain(),this._source=new gs(this._context,this._staticSource),this._source.on("positionChange",()=>{this._emitter.trigger("timeupdate")}),this._source.on("ended",()=>{this._emitter.trigger("ended")}),this._source.on("statusChange",()=>{switch(this._source.getStatus()){case R.f.PLAYING:this._emitter.trigger("playing")}this._emitter.trigger("timeupdate")}),this._source.on("loaded",()=>{this._emitter.trigger("fileLoaded")}),this._staticSource.connect(this._preamp);let e=this._preamp;this._bands={},R.a.forEach((t,n)=>{const r=this._context.createBiquadFilter();this._bands[t]=r,0===n?r.type="lowshelf":n===R.a.length-1?r.type="highshelf":r.type="peaking",r.frequency.value=t,r.gain.value=0,e.connect(r),e=r}),e.connect(this._balance),this._balance.connect(this._gainNode),this._balance.connect(this._analyser),this._gainNode.connect(this._context.destination)}getAnalyser(){return this._analyser}duration(){return this._source.getDuration()}timeElapsed(){return this._source.getTimeElapsed()}timeRemaining(){return this.duration()-this.timeElapsed()}percentComplete(){return this.timeElapsed()/this.duration()*100}async play(){await this._source.play()}pause(){this._source.pause()}stop(){this._source.stop()}seekToPercentComplete(e){const t=this.duration()*(e/100);this.seekToTime(t)}setVolume(e){this._gainNode.gain.value=e/100}setPreamp(e){const t=e/100*24-12;this._preamp.gain.value=Math.pow(10,t/20)}setBalance(e){this._balance.balance.value=e/100}setEqBand(e,t){const n=t/100*24-12;this._bands[e].gain.value=n}disableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._balance)}enableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._preamp)}on(e,t){this._emitter.on(e,t)}seekToTime(e){this._source.seekToTime(e)}async loadFromUrl(e,t){this._emitter.trigger("waiting"),await this._source.loadUrl(e),this._emitter.trigger("stopWaiting"),t&&this.play()}dispose(){this._source.dispose(),this._emitter.dispose()}}n(103);class bs{constructor(){i()(this,"_teardowns",[]),i()(this,"disposed",void 0),this.disposed=!1}add(...e){if(this.disposed)throw new Error("Attempted to add a new teardown to a disposed disposable.");this._teardowns.push(...e)}dispose(){if(this.disposed)throw new Error("Attempted to dispose disposable which is already disposed.");this._teardowns.forEach(e=>{"function"==typeof e?e():"function"==typeof e.dispose&&e.dispose()}),this._teardowns=[],this.disposed=!0}}class Es{static browserIsSupported(){const e=!(!window.AudioContext&&!window.webkitAudioContext),t=!!window.document.createElement("canvas").getContext;return e&&t&&"undefined"!=typeof Promise}constructor(e){i()(this,"_actionEmitter",void 0),i()(this,"_node",void 0),i()(this,"_disposable",void 0),i()(this,"options",void 0),i()(this,"media",void 0),i()(this,"store",void 0),this._node=null,this._disposable=new bs,this._actionEmitter=new fs,this.options=e;const{initialTracks:t,initialSkin:n,avaliableSkins:r,availableSkins:a,enableHotkeys:o=!1,zIndex:A,requireJSZip:s,requireMusicMetadata:l,handleTrackDropEvent:u,handleAddUrlEvent:c,handleLoadListEvent:d,handleSaveListEvent:h,__butterchurnOptions:f,__customMediaClass:p}=this.options;let g=null;if(null!=f){const{importConvertPreset:e,presetConverterEndpoint:t}=f;null!=e&&null!=t&&(g=async n=>{const{convertPreset:r}=await e();return r(await we(n),t)})}var b;this.media=new(p||ms),this.store=function(e,t,n=[],r,i){let a;r&&(a=Object(B.o)(_e(void 0,{type:"@@init"}),r));const o=wa(Object(m.applyMiddleware)(...[x.withExtraArgument(i),Ea(e),()=>e=>n=>(t.trigger(n.type,n),e(n)),...n].filter(Boolean)));return a?Object(m.createStore)(_e,a,o):Object(m.createStore)(_e,o)}(this.media,this._actionEmitter,this.options.__customMiddlewares,this.options.__initialState,{requireJSZip:s,requireMusicMetadata:l,convertPreset:g,handleTrackDropEvent:u,handleAddUrlEvent:c,handleLoadListEvent:d,handleSaveListEvent:h}),navigator.onLine?this.store.dispatch({type:"NETWORK_CONNECTED"}):this.store.dispatch({type:"NETWORK_DISCONNECTED"}),null!=A&&this.store.dispatch({type:"SET_Z_INDEX",zIndex:A}),e.__butterchurnOptions&&(this.store.dispatch({type:"ENABLE_MILKDROP",open:e.__butterchurnOptions.butterchurnOpen}),this.store.dispatch((b=e.__butterchurnOptions,async e=>{const{getPresets:t,importButterchurn:n}=b;n().then(t=>{e({type:"GOT_BUTTERCHURN",butterchurn:t.default})});const r=(await t()).map(Wi);e(Zi(r))})));const E=()=>this.store.dispatch({type:"NETWORK_CONNECTED"}),w=()=>this.store.dispatch({type:"NETWORK_DISCONNECTED"});window.addEventListener("online",E),window.addEventListener("offline",w),this._disposable.add(()=>{window.removeEventListener("online",E),window.removeEventListener("offline",w)}),n?this.store.dispatch(Ui(n.url)):this.store.dispatch({type:"LOADED"}),t&&this._bufferTracks(t),null!=r?(console.warn("The misspelled option `avaliableSkins` is deprecated. Please use `availableSkins` instead."),this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:r})):null!=a&&this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:a});const y=e.__initialWindowLayout;null==y?this.store.dispatch(or()):(B.s(y,(e,t)=>{null!=e.size&&this.store.dispatch(tr(t,e.size))}),this.store.dispatch(rr(B.t(y,e=>e.position),!1))),o&&this._disposable.add(function(e){let t=0;const n=[78,85,76,76,83,79,70,84],r=r=>{if(!(r.target instanceof Element&&hs.has(r.target.tagName.toLowerCase()))){if(r.ctrlKey)switch(r.keyCode){case 68:e(qn()),r.preventDefault();break;case 76:break;case 82:e({type:"REVERSE_LIST"});break;case 84:e({type:"TOGGLE_TIME_MODE"})}else if(r.altKey)switch(r.keyCode){case 87:e(nr("main"));break;case 69:e(nr("playlist"));break;case 71:e(nr("equalizer"))}else switch(r.keyCode){case 37:e(mr(5));break;case 38:e(Er(1));break;case 39:e(gr(5));break;case 40:e(Er(-1));break;case 66:e(hr());break;case 67:e(ur());break;case 76:e(Ni());break;case 82:e({type:"TOGGLE_REPEAT"});break;case 83:e({type:"TOGGLE_SHUFFLE"});break;case 86:e({type:"STOP"});break;case 88:e(lr());break;case 90:e(fr());break;case 96:e(Ni());break;case 97:e(dr(-10));break;case 98:e(Er(-1));break;case 99:e(dr(10));break;case 100:e(fr());break;case 101:e(lr());break;case 102:e(hr());break;case 103:e(mr(5));break;case 104:e(Er(1));break;case 105:e(gr(5))}27!==r.keyCode&&(t=r.keyCode===n[t]?t+1:0,t===n.length&&e({type:"TOGGLE_LLAMA_MODE"}))}};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}}(this.store.dispatch))}play(){this.store.dispatch(lr())}pause(){this.store.dispatch(ur())}stop(){this.store.dispatch({type:"STOP"})}seekBackward(e){this.store.dispatch(mr(e))}seekForward(e){this.store.dispatch(gr(e))}seekToTime(e){this.store.dispatch(pr(e))}nextTrack(){this.store.dispatch(hr())}previousTrack(){this.store.dispatch(fr())}_bufferTracks(e){const t=$e(this.store.getState());this.store.dispatch(ji(e,R.e.BUFFER,t))}appendTracks(e){const t=$e(this.store.getState());this.store.dispatch(ji(e,R.e.NONE,t))}setTracksToPlay(e){this.store.dispatch(ji(e,R.e.PLAY))}getMediaStatus(){return Ut(this.store.getState())}onWillClose(e){return this._actionEmitter.on("CLOSE_REQUESTED",t=>{e(t.cancel)})}onClose(e){return this._actionEmitter.on("CLOSE_WINAMP",e)}close(){this.store.dispatch(e=>{let t=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{t=!0}}),t||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))})}reopen(){this.store.dispatch({type:"OPEN_WINAMP"})}onTrackDidChange(e){let t=null;return this.store.subscribe(()=>{const n=this.store.getState(),r=Nt(n);r!==t&&(t=r,e(null==r?null:_t(n)))})}onMinimize(e){return this._actionEmitter.on("MINIMIZE_WINAMP",e)}setSkinFromUrl(e){this.store.dispatch(Ui(e))}async skinIsLoaded(){var e,t;await(e=this.store,t=e=>!e.display.loading,new Promise(n=>{if(t(e.getState()))return void n();const r=e.subscribe(()=>{t(e.getState())&&(n(),r())})})),await Promise.all([xn(this.store.getState()),Un(this.store.getState())])}__loadSerializedState(e){this.store.dispatch(function(e){return t=>{t({type:"LOAD_SERIALIZED_STATE",serializedState:e}),t(Ar())}}(e))}__getSerializedState(){return{version:1,media:H((e=this.store.getState()).media),equalizer:e.equalizer,display:te(e.display),windows:z(e.windows)};var e}__onStateChange(e){return this.store.subscribe(e)}async renderWhenReady(e){var t;if(this.store.dispatch((t=e,(e,n)=>{if(!n().windows.positionsAreRelative)return;const{left:r,top:i}=t.getBoundingClientRect(),{scrollWidth:a,scrollHeight:o}=t;e(ir({left:r,top:i,width:a,height:o}))})),await this.skinIsLoaded(),null!=this._node)throw new Error("Cannot render a Webamp instance twice");this._node=e,this._disposable.add(()=>{null!=this._node&&(l.a.unmountComponentAtNode(this._node),this._node=null)}),l.a.render(Object(a.jsx)(p,{store:this.store,children:Object(a.jsx)(ds,{media:this.media,filePickers:this.options.filePickers||[]})}),e)}dispose(){this.media.dispose(),this._actionEmitter.dispose(),this._disposable.dispose()}}i()(Es,"VERSION","1.5.0");t.default=Es},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(10),a=n(16),o=n(8),A=n(22),s=i("music-metadata:parser:ID3v1");t.Genres=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"];const l={len:128,get:(e,t)=>{const n=new u(3).get(e,t);return"TAG"===n?{header:n,title:new u(30).get(e,t+3),artist:new u(30).get(e,t+33),album:new u(30).get(e,t+63),year:new u(4).get(e,t+93),comment:new u(28).get(e,t+97),zeroByte:o.UINT8.get(e,t+127),track:o.UINT8.get(e,t+126),genre:o.UINT8.get(e,t+127)}:null}};class u extends o.StringType{constructor(e){super(e,"binary")}get(e,t){let n=super.get(e,t);return n=a.default.trimRightNull(n),n=n.trim(),n.length>0?n:void 0}}class c extends A.BasicParser{static getGenre(e){if(e<t.Genres.length)return t.Genres[e]}parse(){return r(this,void 0,void 0,(function*(){if(!this.tokenizer.fileSize)return void s("Skip checking for ID3v1 because the file-size is unknown");const e=this.tokenizer.fileSize-l.len;if(this.tokenizer.position>e)return void s("Already consumed the last 128 bytes");const t=yield this.tokenizer.readToken(l,e);if(t){s("ID3v1 header found at: pos=%s",this.tokenizer.fileSize-l.len);for(const e of["title","artist","album","comment","track","year"])t[e]&&""!==t[e]&&this.addTag(e,t[e]);const e=c.getGenre(t.genre);e&&this.addTag("genre",e)}else s("ID3v1 header not found at: pos=%s",this.tokenizer.fileSize-l.len)}))}addTag(e,t){this.metadata.addTag("ID3v1",e,t)}}t.ID3v1Parser=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(109);class i extends r.Readable{constructor(e){super(),this.buf=e}_read(){this.push(this.buf),this.push(null)}}t.ID3Stream=i},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function A(){A.init.call(this)}e.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?A.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,a,o,A;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,A=s,console&&console.warn&&console.warn(A)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),A.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},A.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},A.prototype.getMaxListeners=function(){return u(this)},A.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var A=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw A.context=o,A}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var l=s.length,u=g(s,l);for(n=0;n<l;++n)a(u[n],this,t)}return!0},A.prototype.addListener=function(e,t){return c(this,e,t,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(e,t){return c(this,e,t,!0)},A.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},A.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},A.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},A.prototype.listeners=function(e){return f(this,e,!0)},A.prototype.rawListeners=function(e){return f(this,e,!1)},A.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},A.prototype.listenerCount=p,A.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(110)).Stream=t,t.Readable=t,t.Writable=n(56),t.Duplex=n(26),t.Transform=n(114),t.PassThrough=n(156)},function(e,t,n){"use strict";(function(t,r,i){var a=n(47);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var A,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;b.WritableState=m;var l=Object.create(n(37));l.inherits=n(33);var u={deprecate:n(155)},c=n(111),d=n(48).Buffer,h=i.Uint8Array||function(){};var f,p=n(112);function g(){}function m(e,t){A=A||n(26),e=e||{};var r=t instanceof A;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,i);else{var o=v(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),r?s(w,e,n,o,i):w(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(A=A||n(26),!(f.call(b,this)||this instanceof A))return new b(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function E(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var A=0,s=!0;n;)i[A]=n,n.isBuf||(s=!1),n=n.next,A+=1;i.allBuffers=s,E(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,c=n.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,u,c),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=v(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(b,c),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===b&&(e&&e._writableState instanceof m)}})):f=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,A=!i.objectMode&&(r=e,d.isBuffer(r)||r instanceof h);return A&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),A?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(A||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var A=t.objectMode?1:r.length;t.length+=A;var s=t.length<t.highWaterMark;s||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,A,r,i,a);return s}(this,i,A,e,t,n)),o},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=p.destroy,b.prototype._undestroy=p.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(32),n(107).setImmediate,n(19))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),i=n(10),a=n(116),o=i("music-metadata:parser:ogg:vorbis1");t.VorbisParser=class{constructor(e,t){this.metadata=e,this.options=t,this.codecName="Vorbis I",this.pageSegments=[]}parsePage(t,n){if(t.headerType.firstPage)this.parseFirstPage(t,n);else{if(t.headerType.continued){if(0===this.pageSegments.length)throw new Error("Cannot continue on previous page");this.pageSegments.push(n)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){const t=e.concat(this.pageSegments);this.parseFullPage(t)}this.pageSegments=t.headerType.lastPage?[]:[n]}}t.headerType.lastPage&&this.calculateDuration(t)}flush(){this.parseFullPage(e.concat(this.pageSegments))}parseFirstPage(e,t){o("Parse first page");const n=a.CommonHeader.get(t,0);if("vorbis"!==n.vorbis)throw new Error("Metadata does not look like Vorbis");if(1!==n.packetType)throw new Error("First Ogg page should be type 1: the identification header");{const e=a.IdentificationHeader.get(t,a.CommonHeader.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),o("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}}parseFullPage(e){const t=a.CommonHeader.get(e,0);switch(o("Parse full page: type=%s, byteLength=%s",t.packetType,e.byteLength),t.packetType){case 3:return this.parseUserCommentList(e,a.CommonHeader.len)}}calculateDuration(e){this.metadata.format.sampleRate&&e.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",e.absoluteGranulePosition),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate))}parseUserCommentList(e,t){const n=r.UINT32_LE.get(e,t);t+=4;new r.StringType(n,"utf-8").get(e,t);t+=n;let i=r.UINT32_LE.get(e,t);for(t+=4;i-- >0;)t+=this.parseUserComment(e,t)}parseUserComment(e,t){const n=r.UINT32_LE.get(e,t),i=new r.StringType(n,"utf-8").get(e,t+4),A=i.indexOf("="),s=i.slice(0,A).toUpperCase();let l=i.slice(A+1);return"METADATA_BLOCK_PICTURE"===s&&(l=this.options.skipCovers?null:a.VorbisPictureToken.fromBase64(l)),null!==l&&(o("Push tag: id=%s, value=%s",s,l),this.metadata.addTag("vorbis",s,l)),r.UINT32_LE.len+n}}}).call(this,n(11).Buffer)},function(e,t,n){"use strict";
24
+ */var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,A,s=o(e),l=1;l<arguments.length;l++){for(var u in n=Object(arguments[l]))i.call(n,u)&&(s[u]=n[u]);if(r){A=r(n);for(var c=0;c<A.length;c++)a.call(n,A[c])&&(s[A[c]]=n[A[c]])}}return s}},function(e,t,n){"use strict";var r=n(47),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=c;var a=Object.create(n(37));a.inherits=n(33);var o=n(110),A=n(56);a.inherits(c,o);for(var s=i(A.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=A.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),A.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),c.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){var r=n(82).Symbol;e.exports=r},function(e,t,n){"use strict";e.exports=n(66)},function(e,t,n){"use strict";var r=n(28),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},A={};function s(e){return r.isMemo(e)?o:A[e.$$typeof]||i}A[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},A[r.Memo]=o;var l=Object.defineProperty,u=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(f){var i=h(n);i&&i!==f&&e(t,i,r)}var o=u(n);c&&(o=o.concat(c(n)));for(var A=s(t),p=s(n),g=0;g<o.length;++g){var m=o[g];if(!(a[m]||r&&r[m]||p&&p[m]||A&&A[m])){var b=d(n,m);try{l(t,m,b)}catch(e){}}}}return t}},function(e,t,n){"use strict";(function(e,r){var i,a=n(39);i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var o=Object(a.a)(i);t.a=o}).call(this,n(19),n(67)(e))},function(e,t,n){var r=n(69),i=n(70);e.exports={parser:r,creator:i}},function(e,t){var n,r,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function A(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,l=[],u=!1,c=-1;function d(){u&&s&&(u=!1,s.length?l=s.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=A(d);u=!0;for(var t=l.length;t;){for(s=l,l=[];++c<t;)s&&s[c].run();c=-1,t=l.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||u||A(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),i=n.n(r),a=n(3);class o{constructor(e,t){var n,r;i()(this,"webamp",void 0),i()(this,"maxFileSize",20971520),i()(this,"applicationStorage",null===(n=window)||void 0===n||null===(r=n.Telegram)||void 0===r?void 0:r.WebApp.DeviceStorage),i()(this,"telegram",void 0),i()(this,"loadCustomTracks",e=>{var t;(null!==(t=this.webamp)&&void 0!==t?t:window.__webamp).setTracksToPlay(e)}),i()(this,"updateAppState",()=>{this.applicationStorage.setItem("app-state",JSON.stringify(this.webamp.__getSerializedState())),localStorage.setItem("app-state",JSON.stringify(this.webamp.__getSerializedState()))}),i()(this,"getTrackListFromYandexDisk",async e=>{fetch("https://cloud-api.yandex.net/v1/disk/public/resources?public_key="+encodeURIComponent(e),{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(async e=>200===e.status?e.text():null).then(async t=>{if(null!==t){var n;const r=null===(n=JSON.parse(t))||void 0===n?void 0:n._embedded.items;let i=0;this.saveLastPlaylist(e);for(const e of r)0===i?this.webamp.setTracksToPlay([{defaultName:e.name,url:`${e.file}&public_key=${e.public_key}`}]):this.webamp.appendTracks([{defaultName:e.name,url:`${e.file}&public_key=${e.public_key}`}]),i++}})}),i()(this,"loadTrackFromYandexDisk",async e=>{let t=new URL(e.url).searchParams.get("public_key");await fetch(e.url,{method:"GET"}).then(e=>e).then(e=>fetch(e.url)).then(async e=>302===e.status?await fetch(`${e.headers.get("Location")}&public_key=${t}`):e).then(e=>{var t;console.log(e);const n=null===(t=e.body)||void 0===t?void 0:t.getReader();return new ReadableStream({start:e=>function t(){return null==n?void 0:n.read().then(({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()})}()})}).then(e=>new Response(e)).then(e=>e.blob()).then(e=>URL.createObjectURL(e)).then(t=>{let n=this.getAllTracks();this.replaceTrack(e,n)}).catch(e=>e)}),i()(this,"getCurrentTrack",()=>{let e=this.webamp.store.getState().playlist.currentTrack;return this.webamp.store.getState().tracks[e]}),i()(this,"getAllTracks",()=>this.webamp.store.getState().tracks),i()(this,"replaceTrack",(e,t)=>{let n=[];Object.entries(t).forEach(([t,r])=>{r.id===e.id?n.push(e):n.push(r)}),this.webamp.setTracksToPlay(n)}),i()(this,"saveLastPlaylist",e=>{this.applicationStorage.setItem("lastlist",e),document.cookie=`lastlist=${e}; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT; SameSite=None; secure`}),i()(this,"getCookie",e=>{const t=new RegExp(`(^| )${e}=([^;]+)`),n=document.cookie.match(t);if(n)return n[2]}),i()(this,"loadOptions",e=>{this.webamp.__loadSerializedState(e)}),i()(this,"loadOptions2",e=>{let t=0,n=e.media.volume,r=e.media.balance,i=[e.equalizer.sliders.preamp,e.equalizer.sliders[60],e.equalizer.sliders[170],e.equalizer.sliders[310],e.equalizer.sliders[600],e.equalizer.sliders[1e3],e.equalizer.sliders[3e3],e.equalizer.sliders[6e3],e.equalizer.sliders[12e3],e.equalizer.sliders[14e3],e.equalizer.sliders[16e3]],o=[60,170,310,600,1e3,3e3,6e3,12e3,14e3,16e3];this.webamp.store.dispatch({type:"SET_VOLUME",volume:Object(a.d)(n,0,100)}),this.webamp.store.dispatch({type:"SET_BALANCE",balance:r}),this.webamp.store.dispatch({type:"SET_BAND_VALUE",band:"preamp",value:e.equalizer.sliders.preamp});for(const e of o)this.webamp.store.dispatch({type:"SET_BAND_VALUE",band:e,value:i[t]}),t++;window.__webamp.store.getState().media.shuffle!==e.media.shuffle&&this.webamp.store.dispatch({type:"TOGGLE_SHUFFLE"}),window.__webamp.store.getState().media.repeat!==e.media.repeat&&this.webamp.store.dispatch({type:"TOGGLE_REPEAT"})}),setTimeout(()=>{if(!window.__webamp)throw new Error("Webamp __webamp is undefined!!");if(this.webamp=window.__webamp,void 0!==localStorage.getItem("app-state"))this.applicationStorage.getItem("app-state",(e,t)=>{this.loadOptions(JSON.parse(t))});else try{this.applicationStorage.getItem("app-state",(e,t)=>{this.loadOptions(JSON.parse(t))})}catch(e){console.log(e)}if(!1!==e){var t,n;let e;var r,i;if(console.error(this.applicationStorage.getItem),this.applicationStorage.getItem("lastlist",(t,n)=>{e=n,console.error(n),console.error(t)}),console.error(e),void 0!==e&&this.getTrackListFromYandexDisk(e),null!==(t=window)&&void 0!==t&&null!==(n=t.Telegram)&&void 0!==n&&n.WebApp)this.telegram=null===(r=window)||void 0===r||null===(i=r.Telegram)||void 0===i?void 0:i.WebApp,this.initializeTelegramWebAppEvents();else console.error("Telegram is undefined!! Skipping Telegram.WebApp event handler...");this.webamp.__onStateChange(()=>{this.updateAppState()}),this.initializeApplicationHandlers()}},1e3)}initializeTelegramWebAppEvents(){this.telegram.offEvent("deactivated",()=>{this.updateAppState()})}initializeApplicationHandlers(){["unload","beforeunload","pagehide"].forEach(e=>{window.addEventListener(e,()=>{this.updateAppState()})}),this.webamp.onTrackDidChange(()=>{console.log(this.webamp.store.getState()),this.updateAppState()}),this.webamp.onWillClose(()=>{this.updateAppState()}),this.webamp.onClose(()=>{this.updateAppState()}),this.webamp.onMinimize(()=>{this.updateAppState()}),this.webamp.store.dispatch({type:"ENABLE_MILKDROP",open:!1});["ended","playing","timeupdate","fileLoaded","waiting","stopWaiting"].forEach(e=>this.webamp.media.on(e,()=>{this.updateAppState()}))}}new o(!0)},function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),a=n(16),o=n(149),A=n(36);class s{static removeUnsyncBytes(e){let t=0,n=0;for(;t<e.length-1;)t!==n&&(e[n]=e[t]),t+=255===e[t]&&0===e[t+1]?2:1,n++;return t<e.length&&(e[n++]=e[t++]),e.slice(0,n)}static readFrameHeader(e,t){let n;switch(t){case 2:n={id:e.toString("ascii",0,3),length:i.UINT24_BE.get(e,3)};break;case 3:n={id:e.toString("ascii",0,4),length:i.UINT32_BE.get(e,4),flags:s.readFrameFlags(e.slice(8,10))};break;case 4:n={id:e.toString("ascii",0,4),length:A.ID3v2Token.UINT32SYNCSAFE.get(e,4),flags:s.readFrameFlags(e.slice(8,10))};break;default:throw new Error("Unexpected majorVer: "+t)}return n}static getFrameHeaderLength(e){switch(e){case 2:return 6;case 3:case 4:return 10;default:throw new Error("header versionIndex is incorrect")}}static readFrameFlags(e){return{status:{tag_alter_preservation:a.default.strtokBITSET.get(e,0,6),file_alter_preservation:a.default.strtokBITSET.get(e,0,5),read_only:a.default.strtokBITSET.get(e,0,4)},format:{grouping_identity:a.default.strtokBITSET.get(e,1,7),compression:a.default.strtokBITSET.get(e,1,3),encryption:a.default.strtokBITSET.get(e,1,2),unsynchronisation:a.default.strtokBITSET.get(e,1,1),data_length_indicator:a.default.strtokBITSET.get(e,1,0)}}}static readFrameData(e,t,n,r){switch(n){case 2:return o.default.readData(e,t.id,n,r);case 3:case 4:return t.flags.format.unsynchronisation&&(e=s.removeUnsyncBytes(e)),t.flags.format.data_length_indicator&&(e=e.slice(4,e.length)),o.default.readData(e,t.id,n,r);default:throw new Error("Unexpected majorVer: "+n)}}static makeDescriptionTagName(e,t){return e+(t?":"+t:"")}parse(e,t,n){return r(this,void 0,void 0,(function*(){this.tokenizer=t,this.metadata=e,this.options=n;const r=yield this.tokenizer.readToken(A.ID3v2Token.Header);if("ID3"!==r.fileIdentifier)throw new Error("expected ID3-header file-identifier 'ID3' was not found");return this.id3Header=r,this.headerType="ID3v2."+r.version.major,r.flags.isExtendedHeader?this.parseExtendedHeader():this.parseId3Data(r.size)}))}parseExtendedHeader(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(A.ID3v2Token.ExtendedHeader),t=e.size-A.ID3v2Token.ExtendedHeader.len;return t>0?this.parseExtendedHeaderData(t,e.size):this.parseId3Data(this.id3Header.size-e.size)}))}parseExtendedHeaderData(t,n){return r(this,void 0,void 0,(function*(){const r=e.alloc(t);return yield this.tokenizer.readBuffer(r,0,t),this.parseId3Data(this.id3Header.size-n)}))}parseId3Data(t){return r(this,void 0,void 0,(function*(){const n=e.alloc(t);yield this.tokenizer.readBuffer(n,0,t);for(const e of this.parseMetadata(n))if("TXXX"===e.id)for(const t of e.value.text)this.addTag(s.makeDescriptionTagName(e.id,e.value.description),t);else if("COM"===e.id)for(const t of e.value)this.addTag(s.makeDescriptionTagName(e.id,t.description),t.text);else if(Array.isArray(e.value))for(const t of e.value)this.addTag(e.id,t);else this.addTag(e.id,e.value)}))}addTag(e,t){this.metadata.addTag(this.headerType,e,t)}parseMetadata(e){let t=0;const n=[];for(;t!==e.length;){const r=s.getFrameHeaderLength(this.id3Header.version.major);if(t+r>e.length)break;const i=e.slice(t,t+=r),a=s.readFrameHeader(i,this.id3Header.version.major);if(""===a.id||"\0\0\0\0"===a.id||-1==="ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(a.id[0]))break;const o=e.slice(t,t+=a.length),A=s.readFrameData(o,a,this.id3Header.version.major,!this.options.skipCovers);n.push({id:a.id,value:A})}return n}}t.ID3v2Parser=s}).call(this,n(11).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),i=n(16);!function(e){e[e.Other=0]="Other",e[e["32x32 pixels 'file icon' (PNG only)"]=1]="32x32 pixels 'file icon' (PNG only)",e[e["Other file icon"]=2]="Other file icon",e[e["Cover (front)"]=3]="Cover (front)",e[e["Cover (back)"]=4]="Cover (back)",e[e["Leaflet page"]=5]="Leaflet page",e[e["Media (e.g. label side of CD)"]=6]="Media (e.g. label side of CD)",e[e["Lead artist/lead performer/soloist"]=7]="Lead artist/lead performer/soloist",e[e["Artist/performer"]=8]="Artist/performer",e[e.Conductor=9]="Conductor",e[e["Band/Orchestra"]=10]="Band/Orchestra",e[e.Composer=11]="Composer",e[e["Lyricist/text writer"]=12]="Lyricist/text writer",e[e["Recording Location"]=13]="Recording Location",e[e["During recording"]=14]="During recording",e[e["During performance"]=15]="During performance",e[e["Movie/video screen capture"]=16]="Movie/video screen capture",e[e["A bright coloured fish"]=17]="A bright coloured fish",e[e.Illustration=18]="Illustration",e[e["Band/artist logotype"]=19]="Band/artist logotype",e[e["Publisher/Studio logotype"]=20]="Publisher/Studio logotype"}(t.AttachedPictureType||(t.AttachedPictureType={}));class a{}a.UINT32SYNCSAFE={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},a.Header={len:10,get:(e,t)=>({fileIdentifier:new r.StringType(3,"ascii").get(e,t),version:{major:r.INT8.get(e,t+3),revision:r.INT8.get(e,t+4)},flags:{raw:r.INT8.get(e,t+4),unsynchronisation:i.default.strtokBITSET.get(e,t+5,7),isExtendedHeader:i.default.strtokBITSET.get(e,t+5,6),expIndicator:i.default.strtokBITSET.get(e,t+5,5),footer:i.default.strtokBITSET.get(e,t+5,4)},size:a.UINT32SYNCSAFE.get(e,t+6)})},a.ExtendedHeader={len:10,get:(e,t)=>({size:r.UINT32_BE.get(e,t),extendedFlags:r.UINT16_BE.get(e,t+4),sizeOfPadding:r.UINT32_BE.get(e,t+6),crcDataPresent:i.default.strtokBITSET.get(e,t+4,31)})},t.ID3v2Token=a},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(11).Buffer)},function(e,t){e.exports={PRESET_VALUES:["hz60","hz170","hz310","hz600","hz1000","hz3000","hz6000","hz12000","hz14000","hz16000","preamp"],HEADER:"Winamp EQ library file v1.1"}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(14).compose;t.__esModule=!0,t.composeWithDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}},function(e){e.exports=JSON.parse('{"images":{"EQ_PREAMP_LINE":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHEAAAABCAYAAADpXEERAAAAE0lEQVQoU2Pcdfruf4ZRMKRDAAD1lwNjTqcaUQAAAABJRU5ErkJggg==","EQ_GRAPH_LINE_COLORS":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAATCAYAAABRC2cZAAAAR0lEQVQYV2O4rCT9n+F9kOJ/hvfViv8ZHkzSQCE2afxneH/HEJm49Nr0PwOYWPLIAkp0PjL4z1B41uQ/Q9QGnf8MWrPEIAQANWYwvnlToNIAAAAASUVORK5CYII="},"colors":["rgb(0,0,0)","rgb(24,33,41)","rgb(239,49,16)","rgb(206,41,16)","rgb(214,90,0)","rgb(214,102,0)","rgb(214,115,0)","rgb(198,123,8)","rgb(222,165,24)","rgb(214,181,33)","rgb(189,222,41)","rgb(148,222,33)","rgb(41,206,16)","rgb(50,190,16)","rgb(57,181,16)","rgb(49,156,8)","rgb(41,148,0)","rgb(24,132,8)","rgb(255,255,255)","rgb(214,214,222)","rgb(181,189,189)","rgb(160,170,175)","rgb(148,156,165)","rgb(150,150,150)"],"playlistStyle":{"normal":"#00FF00","current":"#FFFFFF","normalbg":"#000000","selectedbg":"#0000FF","font":"Arial"}}')},function(e,t,n){"use strict";function r(e,t){if(!(this instanceof r))return new r(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function i(e,t){return e<t?-1:e>t?1:0}e.exports=r,e.exports.default=r,r.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,n=this.compare,r=t[e];e>0;){var i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r},_down:function(e){for(var t=this.data,n=this.compare,r=this.length>>1,i=t[e];e<r;){var a=1+(e<<1),o=a+1,A=t[a];if(o<this.length&&n(t[o],A)<0&&(a=o,A=t[o]),n(A,i)>=0)break;t[e]=A,e=a}t[e]=i}}},function(e,t,n){var r=n(78),i=n(80),a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");e.exports=function(e){return(e=i(e))&&e.replace(a,r).replace(o,"")}},function(e){e.exports=JSON.parse('{"type":"Winamp EQ library file v1.1","presets":[{"name":"Classical","hz60":33,"hz170":33,"hz310":33,"hz600":33,"hz1000":33,"hz3000":33,"hz6000":20,"hz12000":20,"hz14000":20,"hz16000":16,"preamp":33},{"name":"Club","hz60":33,"hz170":33,"hz310":38,"hz600":42,"hz1000":42,"hz3000":42,"hz6000":38,"hz12000":33,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Dance","hz60":48,"hz170":44,"hz310":36,"hz600":32,"hz1000":32,"hz3000":22,"hz6000":20,"hz12000":20,"hz14000":32,"hz16000":32,"preamp":33},{"name":"Laptop speakers/headphones","hz60":40,"hz170":50,"hz310":41,"hz600":26,"hz1000":28,"hz3000":35,"hz6000":40,"hz12000":48,"hz14000":53,"hz16000":56,"preamp":33},{"name":"Large hall","hz60":49,"hz170":49,"hz310":42,"hz600":42,"hz1000":33,"hz3000":24,"hz6000":24,"hz12000":24,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Party","hz60":44,"hz170":44,"hz310":33,"hz600":33,"hz1000":33,"hz3000":33,"hz6000":33,"hz12000":33,"hz14000":44,"hz16000":44,"preamp":33},{"name":"Pop","hz60":29,"hz170":40,"hz310":44,"hz600":45,"hz1000":41,"hz3000":30,"hz6000":28,"hz12000":28,"hz14000":29,"hz16000":29,"preamp":33},{"name":"Reggae","hz60":33,"hz170":33,"hz310":31,"hz600":22,"hz1000":33,"hz3000":43,"hz6000":43,"hz12000":33,"hz14000":33,"hz16000":33,"preamp":33},{"name":"Rock","hz60":45,"hz170":40,"hz310":23,"hz600":19,"hz1000":26,"hz3000":39,"hz6000":47,"hz12000":50,"hz14000":50,"hz16000":50,"preamp":33},{"name":"Soft","hz60":40,"hz170":35,"hz310":30,"hz600":28,"hz1000":30,"hz3000":39,"hz6000":46,"hz12000":48,"hz14000":50,"hz16000":52,"preamp":33},{"name":"Ska","hz60":28,"hz170":24,"hz310":25,"hz600":31,"hz1000":39,"hz3000":42,"hz6000":47,"hz12000":48,"hz14000":50,"hz16000":48,"preamp":33},{"name":"Full Bass","hz60":48,"hz170":48,"hz310":48,"hz600":42,"hz1000":35,"hz3000":25,"hz6000":18,"hz12000":15,"hz14000":14,"hz16000":14,"preamp":33},{"name":"Soft Rock","hz60":39,"hz170":39,"hz310":36,"hz600":31,"hz1000":25,"hz3000":23,"hz6000":26,"hz12000":31,"hz14000":37,"hz16000":47,"preamp":33},{"name":"Full Treble","hz60":16,"hz170":16,"hz310":16,"hz600":25,"hz1000":37,"hz3000":50,"hz6000":58,"hz12000":58,"hz14000":58,"hz16000":60,"preamp":33},{"name":"Full Bass & Treble","hz60":44,"hz170":42,"hz310":33,"hz600":20,"hz1000":24,"hz3000":35,"hz6000":46,"hz12000":50,"hz14000":52,"hz16000":52,"preamp":33},{"name":"Live","hz60":24,"hz170":33,"hz310":39,"hz600":41,"hz1000":42,"hz3000":42,"hz6000":39,"hz12000":37,"hz14000":37,"hz16000":36,"preamp":33},{"name":"Techno","hz60":45,"hz170":42,"hz310":33,"hz600":23,"hz1000":24,"hz3000":33,"hz6000":45,"hz12000":48,"hz14000":48,"hz16000":47,"preamp":33}]}')},function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0}),t.convertAniBinaryToCSS=void 0;var a=n(99);t.convertAniBinaryToCSS=function(e,t){var n=function(e){var t,n=a.parseAni(e),r=null!==(t=n.rate)&&void 0!==t?t:n.images.map((function(){return n.metadata.iDispRate})),o=(l=r,l.reduce((function(e,t){return e+t}),0)),A=n.images.map((function(e){return{url:(n=e,t=n,r=window.btoa(String.fromCharCode.apply(String,i(t))),"data:image/x-win-bitmap;base64,"+r),percents:[]};var t,n,r})),s=0;var l;return r.forEach((function(e,t){var r=n.seq?n.seq[t]:t;A[r].percents.push(s/o*100),s+=e})),{duration:o*(1e3/60),frames:A}}(t),r="ani-cursor-"+A();return"\n @keyframes "+r+" {\n "+n.frames.map((function(e){var t=e.url;return e.percents.map((function(e){return e+"%"})).join(", ")+" { cursor: url("+t+"), auto; }"})).join("\n")+"\n }\n "+e+":hover {\n animation: "+r+" "+n.duration+"ms step-end infinite;\n }\n "};var o=0,A=function(){return o++}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(126),i=n(132);t.fromStream=function(e,t){return new r.ReadStreamTokenizer(e,t)},t.fromBuffer=function(e){return new i.BufferTokenizer(e)}},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,A=arguments.length;switch(A){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(a=new Array(A-1),o=0;o<a.length;)a[o++]=arguments[o];return t.nextTick((function(){e.apply(null,a)}))}}}:e.exports=t}).call(this,n(32))},function(e,t,n){var r=n(11),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(a(r,t),t.Buffer=o),a(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";(function(e){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(10),a=n(108),o=n(8),A=n(20),s=n(16),l=n(22),u=n(161),c=i("music-metadata:parser:APEv2");class d extends l.BasicParser{constructor(){super(...arguments),this.ape={}}static calculateDuration(e){let t=e.totalFrames>1?e.blocksPerFrame*(e.totalFrames-1):0;return t+=e.finalFrameBlocks,t/e.sampleRate}static parseTagHeader(t,n,i){return r(this,void 0,void 0,(function*(){if(n.fileSize&&n.fileSize-n.position<u.TagFooter.len)return void c("No APEv2 header found, end-of-file reached");const r=yield n.peekToken(u.TagFooter);if("APETAGEX"===r.ID){yield n.ignore(u.TagFooter.len);const e=yield n.readToken(u.TagField(r));d.parseTags(t,r,e,0,!i.skipCovers)}else if(c("APEv2 header not found at offset="+n.position),n.fileSize){const r=n.fileSize-n.position,a=e.alloc(r);return yield n.readBuffer(a),d.parseTagFooter(t,a,!i.skipCovers)}}))}static parseTagFooter(e,t,n){const r=u.TagFooter.get(t,t.length-u.TagFooter.len);A.equal(r.ID,"APETAGEX","APEv2 Footer preamble"),this.parseTags(e,r,t,t.length-r.size,n)}static parseTags(t,n,r,i,o){for(let A=0;A<n.fields;A++){const n=u.TagItemHeader.get(r,i);i+=u.TagItemHeader.len;let A=s.default.findZero(r,i,r.length);const l=r.toString("ascii",i,A);switch(i=A+1,n.flags.dataType){case u.DataType.text_utf8:{const e=r.toString("utf8",i,i+=n.size).split(/\x00/g);for(const n of e)t.addTag("APEv2",l,n);break}case u.DataType.binary:if(o){const o=r.slice(i,i+n.size);let u=0;A=s.default.findZero(o,u,o.length);const d=o.toString("utf8",u,A);u=A+1;const h=e.from(o.slice(u)),f=a(h);if(f)if(0===f.mime.indexOf("image/")){const e={description:d,data:h,format:f.mime};i+=n.size,t.addTag("APEv2",l,e)}else c("Unexpected binary tag of type': "+f.mime);else c("Failed to determine file type for binary tag: "+l)}break;case u.DataType.external_info:c("Ignore external info "+l);break;default:throw new Error("Unexpected data-type: "+n.flags.dataType)}}}parse(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(u.DescriptorParser);A.equal(e.ID,"MAC ","descriptor.ID"),this.ape.descriptor=e;const t=e.descriptorBytes-u.DescriptorParser.len,n=yield t>0?this.parseDescriptorExpansion(t):this.parseHeader();return yield this.tokenizer.readToken(new o.IgnoreType(n.forwardBytes)),d.parseTagHeader(this.metadata,this.tokenizer,this.options)}))}parseDescriptorExpansion(e){return r(this,void 0,void 0,(function*(){return yield this.tokenizer.readToken(new o.IgnoreType(e)),this.parseHeader()}))}parseHeader(){return r(this,void 0,void 0,(function*(){const e=yield this.tokenizer.readToken(u.Header);return this.metadata.setFormat("lossless",!0),this.metadata.setFormat("dataformat","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",e.bitsPerSample),this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("numberOfChannels",e.channel),this.metadata.setFormat("duration",d.calculateDuration(e)),{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}))}}t.APEv2Parser=d}).call(this,n(11).Buffer)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(24),a=n(36),o=n(35),A=n(52),s=n(10),l=n(22),u=s("music-metadata:parser:ID3");class c extends l.BasicParser{constructor(){super(...arguments),this.id3parser=new o.ID3v2Parser}static startsWithID3v2Header(e){return r(this,void 0,void 0,(function*(){return"ID3"===(yield e.peekToken(a.ID3v2Token.Header)).fileIdentifier}))}parse(){return this.parseID3v2().catch(e=>{if(e.message!==i.endOfFile)throw e})}finalize(){}parseID3v2(){return r(this,void 0,void 0,(function*(){if(yield this.tryReadId3v2Headers(),u("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),yield this._parse(),this.options.skipPostHeaders&&this.metadata.hasAny())this.finalize();else{const e=new A.ID3v1Parser;yield e.init(this.metadata,this.tokenizer,this.options).parse(),this.finalize()}}))}tryReadId3v2Headers(){return r(this,void 0,void 0,(function*(){if("ID3"===(yield this.tokenizer.peekToken(a.ID3v2Token.Header)).fileIdentifier)return u("Found ID3v2 header, pos=%s",this.tokenizer.position),yield this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}))}}t.AbstractID3Parser=c},function(e,t,n){"use strict";n.r(t);var r=n(4),i=n.n(r),a=n(0),o=n(1),A=n.n(o),s=n(7),l=n.n(s),u=(n(63),A.a.createContext(null));var c=function(e){e()},d={notify:function(){}};function h(){var e=c,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){r&&null!==t&&(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var f=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=d,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=h())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=d)},e}();var p=function(e){var t=e.store,n=e.context,r=e.children,i=Object(o.useMemo)((function(){var e=new f(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),a=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=i.subscription;return e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[i,a]);var s=n||u;return A.a.createElement(s.Provider,{value:i},r)};n(29),n(28);var g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;var m=n(14);function b(){return Object(o.useContext)(u)}function E(e){void 0===e&&(e=u);var t=e===u?b:function(){return Object(o.useContext)(e)};return function(){return t().store}}var w=E();function y(e){void 0===e&&(e=u);var t=e===u?w:E(e);return function(){return t().dispatch}}var v=y(),k=function(e,t){return e===t};function S(e){void 0===e&&(e=u);var t=e===u?b:function(){return Object(o.useContext)(e)};return function(e,n){void 0===n&&(n=k);var r=t(),i=function(e,t,n,r){var i,a=Object(o.useReducer)((function(e){return e+1}),0)[1],A=Object(o.useMemo)((function(){return new f(n,r)}),[n,r]),s=Object(o.useRef)(),l=Object(o.useRef)(),u=Object(o.useRef)(),c=Object(o.useRef)(),d=n.getState();try{i=e!==l.current||d!==u.current||s.current?e(d):c.current}catch(e){throw s.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+s.current.stack+"\n\n"),e}return g((function(){l.current=e,u.current=d,c.current=i,s.current=void 0})),g((function(){function e(){try{var e=l.current(n.getState());if(t(e,c.current))return;c.current=e}catch(e){s.current=e}a()}return A.onStateChange=e,A.trySubscribe(),e(),function(){return A.tryUnsubscribe()}}),[n,A]),i}(e,n,r.store,r.subscription);return Object(o.useDebugValue)(i),i}}var I,O=S();function T(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(i){return"function"==typeof i?i(n,r,e):t(i)}}}}I=s.unstable_batchedUpdates,c=I;var C=T();C.withExtraArgument=T;var x=C,U=n(40);var B=n(3);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const _={trackOrder:[],currentTrack:null,lastSelectedIndex:null,selectedTracks:new Set};var D=(e=_,t)=>{switch(t.type){case"CLICKED_TRACK":return N(N({},e),{},{selectedTracks:new Set([e.trackOrder[t.index]]),lastSelectedIndex:t.index});case"CTRL_CLICKED_TRACK":{const i=e.trackOrder[t.index],a=new Set(e.selectedTracks);return r=i,(n=a).has(r)?n.delete(r):n.add(r),N(N({},e),{},{selectedTracks:a,lastSelectedIndex:t.index})}case"SHIFT_CLICKED_TRACK":if(null==e.lastSelectedIndex)return e;const i=t.index,a=Math.min(i,e.lastSelectedIndex),o=Math.max(i,e.lastSelectedIndex),A=new Set(e.trackOrder.slice(a,o+1));return N(N({},e),{},{selectedTracks:A});case"SELECT_ALL":return N(N({},e),{},{selectedTracks:new Set(e.trackOrder)});case"SELECT_ZERO":return N(N({},e),{},{selectedTracks:new Set});case"INVERT_SELECTION":return N(N({},e),{},{selectedTracks:new Set(e.trackOrder.filter(t=>!e.selectedTracks.has(t)))});case"REMOVE_ALL_TRACKS":return N(N({},e),{},{trackOrder:[],currentTrack:null,selectedTracks:new Set,lastSelectedIndex:null});case"REMOVE_TRACKS":const s=new Set(t.ids.map(Number)),{currentTrack:l}=e;return N(N({},e),{},{trackOrder:e.trackOrder.filter(e=>!s.has(e)),currentTrack:s.has(Number(l))?null:l,selectedTracks:new Set(Array.from(e.selectedTracks).filter(e=>s.has(e))),lastSelectedIndex:null});case"REVERSE_LIST":return N(N({},e),{},{trackOrder:[...e.trackOrder].reverse(),lastSelectedIndex:null});case"RANDOMIZE_LIST":return N(N({},e),{},{trackOrder:Object(B.A)(e.trackOrder)});case"SET_TRACK_ORDER":const{trackOrder:u}=t;return N(N({},e),{},{trackOrder:u});case"ADD_TRACK_FROM_URL":const c=null==t.atIndex?e.trackOrder.length:t.atIndex;return N(N({},e),{},{trackOrder:[...e.trackOrder.slice(0,c),Number(t.id),...e.trackOrder.slice(c)],lastSelectedIndex:null});case"PLAY_TRACK":case"BUFFER_TRACK":return N(N({},e),{},{currentTrack:t.id});case"DRAG_SELECTED":return N(N({},e),{},{trackOrder:Object(B.p)(e.trackOrder,t=>e.selectedTracks.has(e.trackOrder[t]),t.offset),lastSelectedIndex:null});default:return e}var n,r},L=n(9),j=n.n(L),R=n(2);function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Q={focused:R.m.MAIN,positionsAreRelative:!0,genWindows:{[R.m.MAIN]:{title:"Main Window",size:[0,0],open:!0,shade:!1,canResize:!1,canShade:!0,canDouble:!0,hotkey:"Alt+W",position:{x:0,y:0}},[R.m.EQUALIZER]:{title:"Equalizer",size:[0,0],open:!0,shade:!1,canResize:!1,canShade:!0,canDouble:!0,hotkey:"Alt+G",position:{x:0,y:0}},[R.m.PLAYLIST]:{title:"Playlist Editor",size:[0,0],open:!0,shade:!1,canResize:!0,canShade:!0,canDouble:!1,hotkey:"Alt+E",position:{x:0,y:0}}},browserWindowSize:{width:0,height:0},windowOrder:[R.m.PLAYLIST,R.m.EQUALIZER,R.m.MILKDROP,R.m.MAIN]};function z(e){return{positionsAreRelative:e.positionsAreRelative,genWindows:B.t(e.genWindows,e=>({size:e.size,open:e.open,hidden:!1,shade:e.shade||!1,position:e.position})),focused:e.focused}}var V=(e=Q,t)=>{switch(t.type){case"ENABLE_MILKDROP":return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[R.m.MILKDROP]:{title:"Milkdrop",size:[0,0],open:t.open,shade:!1,canResize:!0,canShade:!1,canDouble:!1,position:{x:0,y:0}}})});case"SET_FOCUSED_WINDOW":let n=e.windowOrder;return null!=t.window&&(n=[...e.windowOrder.filter(e=>e!==t.window),t.window]),P(P({},e),{},{focused:t.window,windowOrder:n});case"TOGGLE_WINDOW_SHADE_MODE":const{canShade:r}=e.genWindows[t.windowId];if(!r)throw new Error("Tried to shade/unshade a window that cannot be shaded: "+t.windowId);return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},e.genWindows[t.windowId]),{},{shade:!e.genWindows[t.windowId].shade})})});case"TOGGLE_WINDOW":const i=e.genWindows[t.windowId];return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},i),{},{open:!i.open})})});case"CLOSE_WINDOW":return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},e.genWindows[t.windowId]),{},{open:!1})})});case"WINDOW_SIZE_CHANGED":const{canResize:a}=e.genWindows[t.windowId];if(!a)throw new Error("Tried to resize a window that cannot be resized: "+t.windowId);return P(P({},e),{},{genWindows:P(P({},e.genWindows),{},{[t.windowId]:P(P({},e.genWindows[t.windowId]),{},{size:t.size})})});case"UPDATE_WINDOW_POSITIONS":return P(P({},e),{},{positionsAreRelative:!0!==t.absolute&&e.positionsAreRelative,genWindows:B.t(e.genWindows,(e,n)=>{const r=t.positions[n];return null==r?e:P(P({},e),{},{position:r})})});case"RESET_WINDOW_SIZES":return P(P({},e),{},{genWindows:B.t(e.genWindows,e=>P(P({},e),{},{size:[0,0]}))});case"LOAD_SERIALIZED_STATE":{const{genWindows:n,focused:r,positionsAreRelative:i}=t.serializedState.windows;return P(P({},e),{},{positionsAreRelative:i,genWindows:B.t(e.genWindows,(e,t)=>{const r=n[t];if(null==r)return e;const{hidden:i}=r,a=j()(r,["hidden"]);return P(P({},e),a)}),focused:r})}case"BROWSER_WINDOW_SIZE_CHANGED":return P(P({},e),{},{browserWindowSize:{height:t.height,width:t.width}});default:return e}};function G(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const K={timeMode:R.h.ELAPSED,timeElapsed:0,volume:Math.round(200/255*100),balance:0,shuffle:!1,repeat:!1,status:R.f.STOPPED};function H(e){const{volume:t,balance:n,shuffle:r,repeat:i}=e;return{volume:t,balance:n,shuffle:r,repeat:i}}var J=(e=K,t)=>{switch(t.type){case"PLAY":case"IS_PLAYING":return Y(Y({},e),{},{status:R.f.PLAYING});case"PAUSE":return Y(Y({},e),{},{status:R.f.PAUSED});case"STOP":case"IS_STOPPED":return Y(Y({},e),{},{status:R.f.STOPPED});case"TOGGLE_TIME_MODE":const n=e.timeMode===R.h.REMAINING?R.h.ELAPSED:R.h.REMAINING;return Y(Y({},e),{},{timeMode:n});case"UPDATE_TIME_ELAPSED":return Y(Y({},e),{},{timeElapsed:t.elapsed});case"SET_MEDIA":return Y({},e);case"SET_VOLUME":return Y(Y({},e),{},{volume:t.volume});case"SET_BALANCE":return Y(Y({},e),{},{balance:t.balance});case"TOGGLE_REPEAT":return Y(Y({},e),{},{repeat:!e.repeat});case"TOGGLE_SHUFFLE":return Y(Y({},e),{},{shuffle:!e.shuffle});case"LOAD_SERIALIZED_STATE":return Y(Y({},e),t.serializedState.media);default:return e}},q=n(5);function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const X={itemBackground:"rgb(0,0,0)",itemForeground:"rgb(0,255,0)",windowBackground:"rgb(56,55,87)",buttonText:"rgb(57,57,66)",windowText:"rgb(255,255,255)",divider:"rgb(117,116,139)",playlistSelection:"rgb(0,0,198)",listHeaderBackground:"rgb(72,72,120)",listHeaderText:"rgb(255,255,255)",listHeaderFrameTopAndLeft:"rgb(108,108,180)",listHeaderFrameBottomAndRight:"rgb(36,36,60)",listHeaderFramePressed:"rgb(18,18,30)",listHeaderDeadArea:"rgb(36,36,60)",scrollbarOne:"rgb(36,36,60)",scrollbarTwo:"rgb(36,36,60)",pressedScrollbarOne:"rgb(121,130,150)",pressedScrollbarTwo:"rgb(78,88,110)",scrollbarDeadArea:"rgb(36,36,60)",listTextHighlighted:"rgb(0,198,255)",listTextHighlightedBackground:"rgb(0,198,255)",listTextSelected:"rgb(0,198,255)",listTextSelectedBackground:"rgb(0,198,255)"},$={doubled:!1,marqueeStep:0,disableMarquee:!1,loading:!0,llama:!1,closed:!1,working:!1,skinImages:R.c.images,skinColors:R.c.colors,skinCursors:null,skinPlaylistStyle:null,skinRegion:{},visualizerStyle:0,dummyVizData:null,playlistScrollPosition:0,skinGenLetterWidths:null,skinGenExColors:X,additionalVisualizers:[],zIndex:0};var ee=(e=$,t)=>{switch(t.type){case"LOAD_DEFAULT_SKIN":{const{skinImages:t,skinColors:n,skinCursors:r,skinPlaylistStyle:i,skinRegion:a,skinGenLetterWidths:o,skinGenExColors:A}=$;return Z(Z({},e),{},{skinImages:t,skinColors:n,skinCursors:r,skinPlaylistStyle:i,skinRegion:a,skinGenLetterWidths:o,skinGenExColors:A})}case"TOGGLE_DOUBLESIZE_MODE":return Z(Z({},e),{},{doubled:!e.doubled});case"TOGGLE_LLAMA_MODE":return Z(Z({},e),{},{llama:!e.llama});case"STEP_MARQUEE":return e.disableMarquee?e:Z(Z({},e),{},{marqueeStep:e.marqueeStep+1});case"DISABLE_MARQUEE":return Z(Z({},e),{},{disableMarquee:!0});case"STOP_WORKING":return Z(Z({},e),{},{working:!1});case"START_WORKING":return Z(Z({},e),{},{working:!0});case"CLOSE_WINAMP":return Z(Z({},e),{},{closed:!0});case"OPEN_WINAMP":return Z(Z({},e),{},{closed:!1});case"LOADING":return Z(Z({},e),{},{loading:!0});case"LOADED":return Z(Z({},e),{},{loading:!1});case"SET_SKIN_DATA":const{data:n}=t;return Z(Z({},e),{},{loading:!1,skinImages:n.skinImages,skinColors:n.skinColors,skinPlaylistStyle:n.skinPlaylistStyle,skinCursors:n.skinCursors,skinRegion:n.skinRegion,skinGenLetterWidths:n.skinGenLetterWidths,skinGenExColors:n.skinGenExColors||X});case"TOGGLE_VISUALIZER_STYLE":return Z(Z({},e),{},{visualizerStyle:(e.visualizerStyle+1)%R.l.length});case"SET_PLAYLIST_SCROLL_POSITION":return Z(Z({},e),{},{playlistScrollPosition:t.position});case"SET_Z_INDEX":return Z(Z({},e),{},{zIndex:t.zIndex});case"SET_DUMMY_VIZ_DATA":return Z(Z({},e),{},{dummyVizData:t.data});case"LOAD_SERIALIZED_STATE":{const n=t.serializedState.display,{skinCursors:r}=n,i=j()(n,["skinCursors"]),a=e=>({type:"cur",url:e}),o=null==r?null:B.t(r,a);return Z(Z({},e),{},{skinCursors:o},i)}default:return e}};const te=e=>{const{visualizerStyle:t,doubled:n,llama:r,marqueeStep:i,skinImages:a,skinCursors:o,skinRegion:A,skinGenLetterWidths:s,skinColors:l,skinPlaylistStyle:u}=e;let c=null;return null!=o&&(c=B.t(o,e=>"cur"===e.type?e.url:void 0)),{visualizerStyle:t,doubled:n,llama:r,marqueeStep:i,skinImages:a,skinCursors:c,skinRegion:A,skinGenLetterWidths:s,skinColors:l,skinPlaylistStyle:u}},ne=Object(q.createSelector)(e=>e.visualizerStyle,e=>R.l[e]);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ae={focus:null,bandFocused:null,scrubPosition:0,userMessage:null};var oe=(e=ae,t)=>{switch(t.type){case"SET_FOCUS":return ie(ie({},e),{},{focus:t.input,bandFocused:null});case"SET_BAND_FOCUS":return ie(ie({},e),{},{focus:t.input,bandFocused:t.bandFocused});case"UNSET_FOCUS":return ie(ie({},e),{},{focus:null,bandFocused:null});case"SET_SCRUB_POSITION":return ie(ie({},e),{},{scrubPosition:t.position});case"SET_USER_MESSAGE":return ie(ie({},e),{},{userMessage:t.message});case"UNSET_USER_MESSAGE":return ie(ie({},e),{},{userMessage:null});default:return e}};function Ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ae(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const le={on:!0,auto:!1,sliders:{preamp:50,60:50,170:50,310:50,600:50,1e3:50,3e3:50,6e3:50,12e3:50,14e3:50,16e3:50}};var ue=(e=le,t)=>{switch(t.type){case"SET_BAND_VALUE":const n=se(se({},e.sliders),{},{[t.band]:t.value});return se(se({},e),{},{sliders:n});case"SET_EQ_ON":return se(se({},e),{},{on:!0});case"SET_EQ_OFF":return se(se({},e),{},{on:!1});case"SET_EQ_AUTO":return se(se({},e),{},{auto:t.value});case"LOAD_SERIALIZED_STATE":return t.serializedState.equalizer||e;default:return e}};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var he=(e={connected:!0},t)=>{switch(t.type){case"NETWORK_CONNECTED":return de(de({},e),{},{connected:!0});case"NETWORK_DISCONNECTED":return de(de({},e),{},{connected:!1});default:return e}};function fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const ge={availableSkins:[]};var me=(e=ge,t)=>{switch(t.type){case"SET_AVAILABLE_SKINS":return pe(pe({},e),{},{availableSkins:t.skins});default:return e}},be=n(21),Ee=n.n(be);async function we(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=n,r.readAsText(e)})}async function ye({accept:e,directory:t=!1}={accept:null,directory:!1}){return new Promise(n=>{const r=document.createElement("input");e&&r.setAttribute("accept",e),r.type="file",r.multiple=!0,r.webkitdirectory=t,r.directory=t,r.mozdirectory=t,r.value=null,r.addEventListener("change",e=>{const t=e.target.files;n(t)}),r.click()})}function ve(e){return"data:image/x-win-bitmap;base64,"+B.b(e)}function ke(e){if(function(e){return/^blob:/.test(e)}(e))return null;const t=e.split("/").pop();return null==t?null:t.split("#")[0].split("?")[0]}const Se=B.E(e=>{const{artist:t,title:n,defaultName:r,url:i}=e;if(t&&n)return`${t} - ${n}`;if(n)return n;if(r)return r;if(i){const e=ke(i);if(e)return e}return"???"});B.E(e=>{if(e.url){const t=ke(e.url);if(null!=t)return t}return e.defaultName?e.defaultName:"???"});function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Te={};var Ce=(e=Te,t)=>{var n;switch(t.type){case"ADD_TRACK_FROM_URL":return Oe(Oe({},e),{},{[t.id]:{id:t.id,defaultName:t.defaultName||null,duration:null!==(n=t.duration)&&void 0!==n?n:null,url:t.url,mediaTagsRequestStatus:R.g.INITIALIZED}});case"SET_MEDIA":{const n=Oe(Oe({},e[t.id]),{},{duration:t.length});return Oe(Oe({},e),{},{[t.id]:n})}case"MEDIA_TAG_REQUEST_INITIALIZED":return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},e[t.id]),{},{mediaTagsRequestStatus:R.g.INITIALIZED})});case"MEDIA_TAG_REQUEST_FAILED":return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},e[t.id]),{},{mediaTagsRequestStatus:R.g.FAILED})});case"SET_MEDIA_DURATION":return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},e[t.id]),{},{duration:t.duration})});case"SET_MEDIA_TAGS":const r=e[t.id],{sampleRate:i,bitrate:a,numberOfChannels:o,title:A,artist:s,album:l,albumArtUrl:u}=t,{kbps:c,khz:d,channels:h}=r;return Oe(Oe({},e),{},{[t.id]:Oe(Oe({},r),{},{mediaTagsRequestStatus:R.g.COMPLETE,title:A,artist:s,album:l,albumArtUrl:u,kbps:null!=a?String(Math.round(a/1e3)):c,khz:null!=i?String(Math.round(i/1e3)):d,channels:null!=o?o:h})});default:return e}};let xe;function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFAULT=1]="DEFAULT",e[e.USER_PRESET=2]="USER_PRESET"}(xe||(xe={}));const Me={display:"WINDOW",overlay:!1,presetHistory:[],presets:[],currentPresetIndex:null,butterchurn:null,transitionType:xe.DEFAULT,randomize:!0,cycling:!0,message:null};var Ne=(e=Me,t)=>{switch(t.type){case"SET_MILKDROP_DESKTOP":return Be(Be({},e),{},{display:t.enabled?"DESKTOP":"WINDOW"});case"SET_MILKDROP_FULLSCREEN":return Be(Be({},e),{},{display:t.enabled?"FULLSCREEN":"WINDOW"});case"GOT_BUTTERCHURN":return Be(Be({},e),{},{butterchurn:t.butterchurn});case"GOT_BUTTERCHURN_PRESETS":return Be(Be({},e),{},{presets:e.presets.concat(t.presets)});case"PRESET_REQUESTED":return t.addToHistory?Be(Be({},e),{},{presetHistory:[...e.presetHistory,t.index]}):Be(Be({},e),{},{presetHistory:e.presetHistory.slice(0,-1)});case"RESOLVE_PRESET_AT_INDEX":const n=e.presets[t.index];return Be(Be({},e),{},{presets:B.y(e.presets,t.index,{type:"RESOLVED",name:n.name,preset:t.json})});case"SELECT_PRESET_AT_INDEX":return Be(Be({},e),{},{currentPresetIndex:t.index,transitionType:t.transitionType});case"TOGGLE_PRESET_OVERLAY":return Be(Be({},e),{},{overlay:!e.overlay});case"TOGGLE_RANDOMIZE_PRESETS":return Be(Be({},e),{},{randomize:!e.randomize});case"TOGGLE_PRESET_CYCLING":return Be(Be({},e),{},{cycling:!e.cycling});case"SCHEDULE_MILKDROP_MESSAGE":return Be(Be({},e),{},{message:{text:t.message,time:Date.now()}});default:return e}};var _e=Object(m.combineReducers)({userInput:oe,windows:V,display:ee,settings:me,equalizer:ue,playlist:D,media:J,network:he,tracks:Ce,milkdrop:Ne});function De(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?De(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const je={height:"2px",borderWidth:0,color:"gray",backgroundColor:"gray"},Re=e=>Object(a.jsx)("body",Le({},e)),Fe=e=>Object(a.jsx)("font",Le({},e)),Pe=e=>Object(a.jsx)("hr",Le({},e)),Qe=e=>Object(a.jsx)("div",Le({},e)),ze=e=>Object(a.jsx)("table",Le({},e)),Ve=e=>Object(a.jsxs)("html",{children:[Object(a.jsxs)("head",{children:[Object(a.jsx)("link",{rel:"stylesheet",href:"null"}),Object(a.jsx)("style",{type:"text/css",children:'\n body { background: #000040; }\n .para1 { margin-top: -42px; margin-left: 145px; margin-right: 10px; font-family: "font2, Arial"; font-size: 30px; line-height: 35px; text-align: left; color: #E1E1E1; }\n .para2 { margin-top: 15px; margin-left: 15px; margin-right: 50px; font-family: "font1, Arial Black"; font-size: 50px; line-height: 40px; text-align: left; color: #004080; }\n '}),Object(a.jsx)("title",{children:"Winamp Generated PlayList"})]}),Object(a.jsxs)(Re,{bgcolor:"#000080",topmargin:"0",leftmargin:"0",text:"#FFFFFF",children:[Object(a.jsxs)(Qe,{align:"center",children:[Object(a.jsx)(Qe,{className:"para2",align:"center",children:Object(a.jsx)("p",{children:"WINAMP"})}),Object(a.jsx)(Qe,{className:"para1",align:"center",children:Object(a.jsx)("p",{children:"playlist"})})]}),Object(a.jsx)(Pe,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:je}),Object(a.jsx)(Qe,{align:"right",children:Object(a.jsx)(ze,{border:"0",cellSpacing:"0",cellPadding:"0",width:"98%",children:Object(a.jsx)("tbody",{children:Object(a.jsx)("tr",{children:Object(a.jsxs)("td",{children:[Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.numberOfTracks}),Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:" track in playlist, average track length: "}),Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.averageTrackLength})]})}),Object(a.jsx)("br",{}),Object(a.jsx)("small",{children:Object(a.jsxs)("small",{children:[Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:"Playlist length: "}),Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.playlistLengthMinutes}),Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:" minutes "}),Object(a.jsx)(Fe,{face:"Arial",color:"#FFBF00",children:e.playlistLengthSeconds}),Object(a.jsx)(Fe,{color:"#409FFF",face:"Arial",children:" second "}),Object(a.jsx)("br",{}),Object(a.jsxs)(Fe,{color:"#409FFF",face:"Arial",children:["Right-click ",Object(a.jsx)("a",{href:"./",children:"here"})," to save this HTML file."]})]})})]})})})})}),Object(a.jsxs)("blockquote",{children:[Object(a.jsx)("p",{children:Object(a.jsx)(Fe,{color:"#FFBF00",face:"Arial",children:Object(a.jsx)("big",{children:"Playlist files:"})})}),Object(a.jsx)("ul",{children:Object(a.jsx)(Fe,{face:"Arial",color:"#FFFFFF",children:Object(a.jsx)("small",{children:e.tracks.map(e=>Object(a.jsxs)("span",{children:[e,Object(a.jsx)("br",{})]},e))})})})]}),Object(a.jsx)(Pe,{align:"left",width:"90%",size:"1",color:"#FFBF00",style:je})]})]}),Ge=e=>{return t=(e=>{const t=document.createElement("div");return Object(s.render)(Object(a.jsx)(Ve,Le({},e)),t),t.innerHTML})(e),"data:text/html;base64,"+window.btoa(t);var t},Ye=(e,t)=>{const n=(r=(t-50)/50*12,(Math.round(10*r)/10).toFixed(1));var r;var i;return`EQ: ${"preamp"===e?"Preamp":(i=e)<1e3?i+"HZ":i/1e3+"KHZ"} ${(e=>e>0?"+"+e:e.toString())(n)} DB`};function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Je=e=>e.equalizer.sliders,qe=Object(q.createSelector)(Je,e=>{const t={name:"Entry1",preamp:B.e(e.preamp)};R.a.forEach(n=>{t["hz"+n]=B.e(e[n])});return{presets:[t],type:"Winamp EQ library file v1.1"}}),We=e=>e.tracks,Ze=e=>t=>{var n;return null===(n=e.tracks[t])||void 0===n?void 0:n.url},Xe=e=>e.playlist.trackOrder,$e=Object(q.createSelector)(Xe,e=>e.length),et=Object(q.createSelector)(We,Xe,(e,t)=>t.filter(t=>e[t])),tt=Object(q.createSelector)(We,Xe,(e,t)=>t.map(t=>{const n=e[t];return{url:n.url,metaData:{artist:n.artist||"",title:n.title||"",album:n.album,albumArtUrl:n.albumArtUrl||""}}})),nt=Object(q.createSelector)(We,et,(e,t)=>t.map(t=>e[t])),rt=e=>e.playlist.selectedTracks,it=Object(q.createSelector)(nt,rt,(e,t)=>e.filter(e=>t.has(e.id))),at=e=>e.reduce((e,t)=>e+Number(t.duration),0),ot=Object(q.createSelector)(nt,at),At=Object(q.createSelector)(it,at),st=Object(q.createSelector)(ot,At,(e,t)=>`${B.j(t)}/${B.j(e)}`),lt=e=>{const{playlist:t}=e;return null==t.currentTrack?-1:t.trackOrder.indexOf(t.currentTrack)},ut=Object(q.createSelector)(lt,e=>e+1),ct=e=>e.playlist.currentTrack,dt=(e,t=1)=>{const{playlist:{trackOrder:n},media:{repeat:r,shuffle:i}}=e;if(i)return(e=>{const{playlist:{trackOrder:t,currentTrack:n}}=e;if(0===t.length)return null;let r;do{r=t[Math.floor(t.length*Math.random())]}while(r===n&&t.length>1);return r})(e);const a=$e(e);if(0===a)return null;const o=lt(e);let A=o+t;return r?(A%=a,A<0&&(A+=a),n[A]):o===a-1&&t>0||0===o&&t<0?null:(A=B.d(A,0,a-1),n[A])},ht=e=>e.windows.genWindows,ft=Object(q.createSelector)(ht,e=>t=>e[t].open),pt=Object(q.createSelector)((function(e){return"WINDOW"===e.milkdrop.display}),e=>t=>t===R.m.MILKDROP&&!e),gt=Object(q.createSelector)(ht,e=>t=>e[t].shade),mt=Object(q.createSelector)(ht,e=>t=>e[t].size),bt=Object(q.createSelector)(ht,e=>B.t(e,e=>e.position)),Et=Object(q.createSelector)(mt,e=>{const t=e("playlist");return Math.floor((58+R.n*t[1])/R.i)}),wt=Object(q.createSelector)($e,Et,(e,t)=>Math.max(0,e-t)),yt=e=>e.display.playlistScrollPosition,vt=Object(q.createSelector)(wt,yt,(e,t)=>0===e?0:Math.round(Math.round(e*t/100)/e*100)),kt=Object(q.createSelector)(yt,$e,Et,(e,t,n)=>{const r=Math.max(0,t-n);return B.w(e/100,r+1)}),St=Object(q.createSelector)(kt,Xe,Et,(e,t,n)=>t.slice(e,e+n));function It(e){return St(e).length===e.playlist.trackOrder.length}const Ot=Object(q.createSelector)(St,e=>t=>e.includes(t)),Tt=(Object(q.createSelector)(St,We,(e,t)=>e.map(e=>t[e])),e=>{const{playlist:t,tracks:n}=e;if(null==t.currentTrack)return null;const r=n[t.currentTrack];return r&&r.duration}),Ct=Object(q.createSelector)(We,e=>Object(q.defaultMemoize)(t=>((e,t=null)=>{if(null==t)return null;const n=e[t];return null==n?null:Se(n)})(e,t))),xt=Object(q.createSelector)(ct,Ct,(e,t)=>t(e)),Ut=e=>e.media.status,Bt=e=>e.media.status===R.f.PLAYING,Mt=Object(q.createSelector)(ct,We,(e,t)=>null==e?null:t[e]),Nt=Object(q.createSelector)(Bt,Mt,(e,t)=>e&&t&&t.mediaTagsRequestStatus!==R.g.INITIALIZED?t.id:null),_t=Object(q.createSelector)(Mt,e=>null==e?null:{url:e.url,metaData:{title:e.title||null,artist:e.artist||null,album:e.album||null,albumArtUrl:e.albumArtUrl||null}}),Dt=Object(q.createSelector)(ut,xt,(e,t)=>null==t?null:`${e}. ${t}`),Lt=Object(q.createSelector)(Dt,Tt,(e,t)=>null==e?null:`${e} (${B.j(t)})`),jt=e=>Xe(e).length,Rt=Object(q.createSelector)(We,e=>Object.values(e).reduce((e,t)=>e+(t.duration||0),0)),Ft=Object(q.createSelector)(jt,Rt,Xe,We,Ct,(e,t,n,r,i)=>Ge({numberOfTracks:e,averageTrackLength:B.j(t/e),playlistLengthMinutes:Math.floor(t/60),playlistLengthSeconds:Math.floor(t%60),tracks:n.map((e,t)=>`${t+1}. ${i(e)} (${B.j(r[e].duration)})`)}));function Pt(e,t){const[n,r]=e.size,i=t&&e.canDouble?2:1,a=116+r*R.n,o=R.p+n*R.o;return{height:(e.shade?14:a)*i,width:o*i}}function Qt(e){return e.windows.focused}function zt(e){return e.display.doubled}function Vt(e){return e.display.llama}function Gt(e){return e.display.zIndex}const Yt=Object(q.createSelector)(ht,zt,(e,t)=>B.t(e,e=>Pt(e,t))),Kt=Object(q.createSelector)(Yt,e=>t=>e[t]),Ht=Object(q.createSelector)(e=>e.windows.windowOrder,ht,(e,t)=>[R.m.MAIN,...e.filter(e=>e!==R.m.MAIN&&null!=t[e])]),Jt=Object(q.createSelector)(Yt,bt,Ht,(e,t,n)=>n.map(n=>He(He({key:n},e[n]),t[n]))),qt=Object(q.createSelector)(Jt,(function(e){const t={},n={};for(const r of e){const e=r.y+r.height;t[e]?t[e].push(r):t[e]=[r];const i=r.x+r.width;n[i]?n[i].push(r):n[i]=[r]}const r={};for(const i of e){const e={},a=i.y,o=i.x,A=t[a],s=n[o];if(A)for(const t of A){const n=t.x+t.width<i.x,r=t.x>i.x+i.width;if(!(n||r)){e.below=t.key;break}}if(s)for(const t of s){const n=t.y+t.height<i.y,r=t.y>i.y+i.height;if(!(n||r)){e.right=t.key;break}}r[i.key]=e}return r})),Wt={normal:"#00FF00",current:"#FFFFFF",normalbg:"#000000",selectedbg:"#0000C6",font:"Arial"};function Zt(e){return e.display.skinColors}const Xt=e=>e.display.skinPlaylistStyle||Wt,$t=e=>{const t=e.windows.genWindows[R.m.MILKDROP];return null!=t&&t.open?R.k.MILKDROP:ne(e.display)},en=e=>e.media.volume,tn=e=>e.media.balance,nn=e=>e.media.shuffle,rn=e=>e.media.repeat,an=Object(q.createSelector)(Mt,e=>null!=e&&e.channels||null),on=e=>e.media.timeElapsed;function An(e){return e.equalizer.on}function sn(e){return e.windows.browserWindowSize}const ln=Object(q.createSelector)(ht,e=>B.r(e,e=>e.open)),un=Object(q.createSelector)(ln,zt,(e,t)=>{let n=0;return B.t(e,e=>{const r={x:0,y:n};return n+=Pt(e,t).height,r})}),cn=e=>e.userInput.focus,dn=e=>e.userInput.scrubPosition,hn=e=>{if(null!=e.userInput.userMessage)return e.userInput.userMessage;switch(cn(e)){case"balance":return(e=>{if(0===e)return"Balance: Center";const t=e>0?"Right":"Left";return`Balance: ${Math.abs(e)}% ${t}`})(e.media.balance);case"volume":return`Volume: ${e.media.volume}%`;case"position":const t=Tt(e);return null==t?"Winamp 2.91":((e,t)=>`Seek to: ${B.j(e*t/100,!1)}/${B.j(e,!1)} (${t}%)`)(t,dn(e));case"double":return(e.display.doubled?"Disable":"Enable")+" doublesize mode";case"eq":const n=e.userInput.bandFocused;return null==n?"Winamp 2.91":Ye(n,e.equalizer.sliders[n])}if(null!=e.playlist.currentTrack){const t=Lt(e);return null==t?"Winamp 2.91":t}return"Winamp 2.91"},fn=Object(q.createSelector)(Mt,e=>null!=e&&e.kbps||null),pn=Object(q.createSelector)(Mt,e=>null!=e&&e.khz||null);function gn(e){return e.milkdrop.message}function mn(e){return"DESKTOP"===e.milkdrop.display}function bn(e){return"FULLSCREEN"===e.milkdrop.display}function En(e){return e.milkdrop.butterchurn}function wn(e){return e.milkdrop.transitionType}function yn(e){return e.milkdrop.currentPresetIndex}function vn(e){const t=yn(e);if(null==t)return null;const n=e.milkdrop.presets[t];return null==n||"UNRESOLVED"===n.type?null:n.preset}function kn(e){return e.milkdrop.presets.map(e=>e.name)}function Sn(e){return e.milkdrop.overlay}function In(e){return e.milkdrop.cycling}function On(e){return e.milkdrop.randomize}function Tn(e){return e.display.closed}function Cn(e){return e.display.skinRegion}const xn=Object(q.createSelector)((function(e){return e.display.skinImages.EQ_PREAMP_LINE}),async e=>null==e?null:B.n(e)),Un=Object(q.createSelector)((function(e){return e.display.skinImages.EQ_GRAPH_LINE_COLORS}),async e=>null==e?null:B.n(e));function Bn(e){return e.display.dummyVizData}function Mn(e){return e.display.marqueeStep}function Nn(e){return e.network.connected}function _n(e){return e.media.timeMode}function Dn(e){return e.display.loading}function Ln(e){return e.display.working}function jn(e){return e.settings.availableSkins}const Rn=e=>e.y,Fn=e=>e.y+e.height,Pn=e=>e.x,Qn=e=>e.x+e.width,zn=(e,t)=>Math.abs(e-t)<15,Vn=(e,t)=>{let n,r;var i,a;return a=t,Rn(i=e)<=Fn(a)+15&&Rn(a)<=Fn(i)+15&&(zn(Pn(e),Qn(t))?n=Qn(t):zn(Qn(e),Pn(t))?n=Pn(t)-e.width:zn(Pn(e),Pn(t))?n=Pn(t):zn(Qn(e),Qn(t))&&(n=Qn(t)-e.width)),((e,t)=>Pn(e)<=Qn(t)+15&&Pn(t)<=Qn(e)+15)(e,t)&&(zn(Rn(e),Fn(t))?r=Fn(t):zn(Fn(e),Rn(t))?r=Rn(t)-e.height:zn(Rn(e),Rn(t))?r=Rn(t):zn(Fn(e),Fn(t))&&(r=Fn(t)-e.height)),{x:n,y:r}},Gn=(e,t)=>{const n=Vn(e,t);return{x:void 0===n.x?0:n.x-e.x,y:void 0===n.y?0:n.y-e.y}};const Yn=(e,t)=>({x:e.x+t.x,y:e.y+t.y});function Kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kn(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jn(e){return(t,n)=>{const r=n(),i=qt(r),a=Yt(r);t(e);const o=Yt(n()),A={};for(const e of Object.keys(o)){const t=a[e],n=o[e];A[e]={height:n.height-t.height,width:n.width-t.width}}const s=function(e,t){const n={},r={};for(const t of Object.keys(e))n[t]={above:[],left:[]},r[t]={x:0,y:0};for(const[t,r]of Object.entries(e)){const{below:e,right:i}=r;null!=i&&n[i].left.push(t),null!=e&&n[e].above.push(t)}function i(e){const a=n[e],o=t[e];a.left.forEach(t=>{r[t].x+=o.width+r[e].x,i(t)})}function a(e){const i=n[e],o=t[e];i.above.forEach(t=>{r[t].y+=o.height+r[e].y,a(t)})}for(const[t,n]of Object.entries(e))null==n.below&&a(t),null==n.right&&i(t);return r}(i,A),l=bt(r);t(rr(B.t(l,(e,t)=>Yn(e,s[t]))))}}function qn(){return Jn({type:"TOGGLE_DOUBLESIZE_MODE"})}function Wn(){return Jn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"equalizer"})}function Zn(){return Jn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"main"})}function Xn(){return Jn({type:"TOGGLE_WINDOW_SHADE_MODE",windowId:"playlist"})}function $n(e){return{type:"CLOSE_WINDOW",windowId:e}}function er(e){return{type:"SET_FOCUSED_WINDOW",window:e}}function tr(e,t){return{type:"WINDOW_SIZE_CHANGED",windowId:e,size:t}}function nr(e){return{type:"TOGGLE_WINDOW",windowId:e}}function rr(e,t){return{type:"UPDATE_WINDOW_POSITIONS",positions:e,absolute:t}}function ir(e){return(t,n)=>{const r=n(),i=Jt(r),a=ft(r),{top:o,left:A,width:s,height:l}=e,u=A+window.scrollX,c=o+window.scrollY,d=B.c(i.filter(e=>a(e.key)));if(null==d)return;const h=d.bottom-d.top,f=d.right-d.left,p=Math.ceil(u-d.left+(s-f)/2),g=Math.ceil(c-d.top+(l-h)/2);t(rr(i.reduce((e,t)=>Hn(Hn({},e),{},{[t.key]:{x:p+t.x,y:g+t.y}}),{}),!0))}}function ar(e){return t=>{t(Hn({type:"BROWSER_WINDOW_SIZE_CHANGED"},e)),t(Ar())}}function or(){return(e,t)=>{e(rr(un(t())))}}function Ar(){return(e,t)=>{const n=t(),r=Jt(n),i=ft(n),{height:a,width:o}=B.k(),A=B.c(r.filter(e=>i(e.key)));if(null==A)return;const s=bt(n);if(A.left>=0&&A.top>=0&&A.right<=o&&A.bottom<=a)return;const l=A.bottom-A.top;if(A.right-A.left<=o&&l<=a){let t=0,n=0;A.top<=0?t=A.top:A.bottom>a&&(t=A.bottom-a),A.left<=0?n=A.left:A.right>o&&(n=A.right-o);e(rr(B.t(s,e=>({x:e.x-n,y:e.y-t}))))}else e({type:"RESET_WINDOW_SIZES"}),e(or()),e(ir({left:window.scrollX,top:window.scrollY,width:window.innerWidth,height:window.innerHeight}))}}function sr(e){return{type:"PLAY_TRACK",id:e}}function lr(){return(e,t)=>{const n=t();n.media.status===R.f.STOPPED&&null==n.playlist.currentTrack&&0===n.playlist.trackOrder.length?e(Ni()):e({type:"PLAY"})}}function ur(){return(e,t)=>{const{status:n}=t().media;n===R.f.PLAYING?e({type:"PAUSE"}):e({type:"PLAY"})}}function cr(){return{type:"STOP"}}function dr(e){return(t,n)=>{const r=dt(n(),e);var i;null!=r?t((i=r,(e,t)=>{const n=t();e(Ut(n)===R.f.STOPPED?{type:"BUFFER_TRACK",id:i}:{type:"PLAY_TRACK",id:i})})):t({type:"IS_STOPPED"})}}function hr(){return dr(1)}function fr(){return dr(-1)}function pr(e){return function(t,n){const r=n(),i=Tt(r);null!=i&&t({type:"SEEK_TO_PERCENT_COMPLETE",percent:e/i*100})}}function gr(e){return function(t,n){t(pr(on(n())+e))}}function mr(e){return gr(-e)}function br(e){return{type:"SET_VOLUME",volume:Object(B.d)(e,0,100)}}function Er(e){return(t,n)=>t(br(n().media.volume+e))}function wr(e){return e.preventDefault(),(t,n)=>t(br(n().media.volume+e.deltaY))}function yr(e){return e=Object(B.d)(e,-100,100),Math.abs(e)<25&&(e=0),{type:"SET_BALANCE",balance:e}}function vr(){return{type:"TOGGLE_REPEAT"}}function kr(){return{type:"TOGGLE_SHUFFLE"}}function Sr(){return{type:"TOGGLE_TIME_MODE"}}function Ir(e){return e<55&&e>45?50:e}function Or(e,t){return{type:"SET_BAND_VALUE",band:e,value:Ir(t)}}function Tr(e){return t=>{Object.values(R.a).forEach(n=>{t({type:"SET_BAND_VALUE",value:e,band:n})})}}function Cr(){return Tr(100)}function xr(){return Tr(50)}function Ur(){return Tr(0)}function Br(e){return{type:"SET_BAND_VALUE",band:"preamp",value:Ir(e)}}function Mr(){return(e,t)=>{t().equalizer.on?e({type:"SET_EQ_OFF"}):e({type:"SET_EQ_ON"})}}function Nr(){return e=>{e({type:"SET_EQ_AUTO",value:!1})}}var _r=n(31);const Dr={a:[0,0],b:[0,1],c:[0,2],d:[0,3],e:[0,4],f:[0,5],g:[0,6],h:[0,7],i:[0,8],j:[0,9],k:[0,10],l:[0,11],m:[0,12],n:[0,13],o:[0,14],p:[0,15],q:[0,16],r:[0,17],s:[0,18],t:[0,19],u:[0,20],v:[0,21],w:[0,22],x:[0,23],y:[0,24],z:[0,25],'"':[0,26],"@":[0,27]," ":[0,30],0:[1,0],1:[1,1],2:[1,2],3:[1,3],4:[1,4],5:[1,5],6:[1,6],7:[1,7],8:[1,8],9:[1,9],[R.j]:[1,10],".":[1,11],":":[1,12],"(":[1,13],")":[1,14],"-":[1,15],"'":[1,16],"!":[1,17],_:[1,18],"+":[1,19],"\\":[1,20],"/":[1,21],"[":[1,22],"]":[1,23],"^":[1,24],"&":[1,25],"%":[1,26],",":[1,27],"=":[1,28],$:[1,29],"#":[1,30],"Å":[2,0],"Ö":[2,1],"Ä":[2,2],"?":[2,3],"*":[2,4],"<":[1,22],">":[1,23],"{":[1,22],"}":[1,23]},Lr=e=>"CHARACTER_"+e.charCodeAt(0),jr=[];for(const e in Dr)if(Dr.hasOwnProperty(e)){const t=Dr[e];jr.push({name:Lr(e),y:6*t[0],x:5*t[1],width:5,height:6})}var Rr={BALANCE:[{name:"MAIN_BALANCE_BACKGROUND",x:9,y:0,width:38,height:420},{name:"MAIN_BALANCE_THUMB",x:15,y:422,width:14,height:11},{name:"MAIN_BALANCE_THUMB_ACTIVE",x:0,y:422,width:14,height:11}],CBUTTONS:[{name:"MAIN_PREVIOUS_BUTTON",x:0,y:0,width:23,height:18},{name:"MAIN_PREVIOUS_BUTTON_ACTIVE",x:0,y:18,width:23,height:18},{name:"MAIN_PLAY_BUTTON",x:23,y:0,width:23,height:18},{name:"MAIN_PLAY_BUTTON_ACTIVE",x:23,y:18,width:23,height:18},{name:"MAIN_PAUSE_BUTTON",x:46,y:0,width:23,height:18},{name:"MAIN_PAUSE_BUTTON_ACTIVE",x:46,y:18,width:23,height:18},{name:"MAIN_STOP_BUTTON",x:69,y:0,width:23,height:18},{name:"MAIN_STOP_BUTTON_ACTIVE",x:69,y:18,width:23,height:18},{name:"MAIN_NEXT_BUTTON",x:92,y:0,width:23,height:18},{name:"MAIN_NEXT_BUTTON_ACTIVE",x:92,y:18,width:22,height:18},{name:"MAIN_EJECT_BUTTON",x:114,y:0,width:22,height:16},{name:"MAIN_EJECT_BUTTON_ACTIVE",x:114,y:16,width:22,height:16}],MAIN:[{name:"MAIN_WINDOW_BACKGROUND",x:0,y:0,width:275,height:116}],MONOSTER:[{name:"MAIN_STEREO",x:0,y:12,width:29,height:12},{name:"MAIN_STEREO_SELECTED",x:0,y:0,width:29,height:12},{name:"MAIN_MONO",x:29,y:12,width:27,height:12},{name:"MAIN_MONO_SELECTED",x:29,y:0,width:27,height:12}],NUMBERS:[{name:"NO_MINUS_SIGN",x:9,y:6,width:5,height:1},{name:"MINUS_SIGN",x:20,y:6,width:5,height:1},{name:"DIGIT_0",x:0,y:0,width:9,height:13},{name:"DIGIT_1",x:9,y:0,width:9,height:13},{name:"DIGIT_2",x:18,y:0,width:9,height:13},{name:"DIGIT_3",x:27,y:0,width:9,height:13},{name:"DIGIT_4",x:36,y:0,width:9,height:13},{name:"DIGIT_5",x:45,y:0,width:9,height:13},{name:"DIGIT_6",x:54,y:0,width:9,height:13},{name:"DIGIT_7",x:63,y:0,width:9,height:13},{name:"DIGIT_8",x:72,y:0,width:9,height:13},{name:"DIGIT_9",x:81,y:0,width:9,height:13}],NUMS_EX:[{name:"NO_MINUS_SIGN_EX",x:90,y:0,width:9,height:13},{name:"MINUS_SIGN_EX",x:99,y:0,width:9,height:13},{name:"DIGIT_0_EX",x:0,y:0,width:9,height:13},{name:"DIGIT_1_EX",x:9,y:0,width:9,height:13},{name:"DIGIT_2_EX",x:18,y:0,width:9,height:13},{name:"DIGIT_3_EX",x:27,y:0,width:9,height:13},{name:"DIGIT_4_EX",x:36,y:0,width:9,height:13},{name:"DIGIT_5_EX",x:45,y:0,width:9,height:13},{name:"DIGIT_6_EX",x:54,y:0,width:9,height:13},{name:"DIGIT_7_EX",x:63,y:0,width:9,height:13},{name:"DIGIT_8_EX",x:72,y:0,width:9,height:13},{name:"DIGIT_9_EX",x:81,y:0,width:9,height:13}],PLAYPAUS:[{name:"MAIN_PLAYING_INDICATOR",x:0,y:0,width:9,height:9},{name:"MAIN_PAUSED_INDICATOR",x:9,y:0,width:9,height:9},{name:"MAIN_STOPPED_INDICATOR",x:18,y:0,width:9,height:9},{name:"MAIN_NOT_WORKING_INDICATOR",x:36,y:0,width:9,height:9},{name:"MAIN_WORKING_INDICATOR",x:39,y:0,width:9,height:9}],PLEDIT:[{name:"PLAYLIST_TOP_TILE",x:127,y:21,width:25,height:20},{name:"PLAYLIST_TOP_LEFT_CORNER",x:0,y:21,width:25,height:20},{name:"PLAYLIST_TITLE_BAR",x:26,y:21,width:100,height:20},{name:"PLAYLIST_TOP_RIGHT_CORNER",x:153,y:21,width:25,height:20},{name:"PLAYLIST_TOP_TILE_SELECTED",x:127,y:0,width:25,height:20},{name:"PLAYLIST_TOP_LEFT_SELECTED",x:0,y:0,width:25,height:20},{name:"PLAYLIST_TITLE_BAR_SELECTED",x:26,y:0,width:100,height:20},{name:"PLAYLIST_TOP_RIGHT_CORNER_SELECTED",x:153,y:0,width:25,height:20},{name:"PLAYLIST_LEFT_TILE",x:0,y:42,width:12,height:29},{name:"PLAYLIST_RIGHT_TILE",x:31,y:42,width:20,height:29},{name:"PLAYLIST_BOTTOM_TILE",x:179,y:0,width:25,height:38},{name:"PLAYLIST_BOTTOM_LEFT_CORNER",x:0,y:72,width:125,height:38},{name:"PLAYLIST_BOTTOM_RIGHT_CORNER",x:126,y:72,width:150,height:38},{name:"PLAYLIST_VISUALIZER_BACKGROUND",x:205,y:0,width:75,height:38},{name:"PLAYLIST_SHADE_BACKGROUND",x:72,y:57,width:25,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_LEFT",x:72,y:42,width:25,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_RIGHT",x:99,y:57,width:50,height:14},{name:"PLAYLIST_SHADE_BACKGROUND_RIGHT_SELECTED",x:99,y:42,width:50,height:14},{name:"PLAYLIST_SCROLL_HANDLE_SELECTED",x:61,y:53,width:8,height:18},{name:"PLAYLIST_SCROLL_HANDLE",x:52,y:53,width:8,height:18},{name:"PLAYLIST_ADD_URL",x:0,y:111,width:22,height:18},{name:"PLAYLIST_ADD_URL_SELECTED",x:23,y:111,width:22,height:18},{name:"PLAYLIST_ADD_DIR",x:0,y:130,width:22,height:18},{name:"PLAYLIST_ADD_DIR_SELECTED",x:23,y:130,width:22,height:18},{name:"PLAYLIST_ADD_FILE",x:0,y:149,width:22,height:18},{name:"PLAYLIST_ADD_FILE_SELECTED",x:23,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_ALL",x:54,y:111,width:22,height:18},{name:"PLAYLIST_REMOVE_ALL_SELECTED",x:77,y:111,width:22,height:18},{name:"PLAYLIST_CROP",x:54,y:130,width:22,height:18},{name:"PLAYLIST_CROP_SELECTED",x:77,y:130,width:22,height:18},{name:"PLAYLIST_REMOVE_SELECTED",x:54,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_SELECTED_SELECTED",x:77,y:149,width:22,height:18},{name:"PLAYLIST_REMOVE_MISC",x:54,y:168,width:22,height:18},{name:"PLAYLIST_REMOVE_MISC_SELECTED",x:77,y:168,width:22,height:18},{name:"PLAYLIST_INVERT_SELECTION",x:104,y:111,width:22,height:18},{name:"PLAYLIST_INVERT_SELECTION_SELECTED",x:127,y:111,width:22,height:18},{name:"PLAYLIST_SELECT_ZERO",x:104,y:130,width:22,height:18},{name:"PLAYLIST_SELECT_ZERO_SELECTED",x:127,y:130,width:22,height:18},{name:"PLAYLIST_SELECT_ALL",x:104,y:149,width:22,height:18},{name:"PLAYLIST_SELECT_ALL_SELECTED",x:127,y:149,width:22,height:18},{name:"PLAYLIST_SORT_LIST",x:154,y:111,width:22,height:18},{name:"PLAYLIST_SORT_LIST_SELECTED",x:177,y:111,width:22,height:18},{name:"PLAYLIST_FILE_INFO",x:154,y:130,width:22,height:18},{name:"PLAYLIST_FILE_INFO_SELECTED",x:177,y:130,width:22,height:18},{name:"PLAYLIST_MISC_OPTIONS",x:154,y:149,width:22,height:18},{name:"PLAYLIST_MISC_OPTIONS_SELECTED",x:177,y:149,width:22,height:18},{name:"PLAYLIST_NEW_LIST",x:204,y:111,width:22,height:18},{name:"PLAYLIST_NEW_LIST_SELECTED",x:227,y:111,width:22,height:18},{name:"PLAYLIST_SAVE_LIST",x:204,y:130,width:22,height:18},{name:"PLAYLIST_SAVE_LIST_SELECTED",x:227,y:130,width:22,height:18},{name:"PLAYLIST_LOAD_LIST",x:204,y:149,width:22,height:18},{name:"PLAYLIST_LOAD_LIST_SELECTED",x:227,y:149,width:22,height:18},{name:"PLAYLIST_ADD_MENU_BAR",x:48,y:111,width:3,height:54},{name:"PLAYLIST_REMOVE_MENU_BAR",x:100,y:111,width:3,height:72},{name:"PLAYLIST_SELECT_MENU_BAR",x:150,y:111,width:3,height:54},{name:"PLAYLIST_MISC_MENU_BAR",x:200,y:111,width:3,height:54},{name:"PLAYLIST_LIST_BAR",x:250,y:111,width:3,height:54},{name:"PLAYLIST_CLOSE_SELECTED",x:52,y:42,width:9,height:9},{name:"PLAYLIST_COLLAPSE_SELECTED",x:62,y:42,width:9,height:9},{name:"PLAYLIST_EXPAND_SELECTED",x:150,y:42,width:9,height:9}],EQ_EX:[{name:"EQ_SHADE_BACKGROUND_SELECTED",x:0,y:0,width:275,height:14},{name:"EQ_SHADE_BACKGROUND",x:0,y:15,width:275,height:14},{name:"EQ_SHADE_VOLUME_SLIDER_LEFT",x:1,y:30,width:3,height:7},{name:"EQ_SHADE_VOLUME_SLIDER_CENTER",x:4,y:30,width:3,height:7},{name:"EQ_SHADE_VOLUME_SLIDER_RIGHT",x:7,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_LEFT",x:11,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_CENTER",x:14,y:30,width:3,height:7},{name:"EQ_SHADE_BALANCE_SLIDER_RIGHT",x:17,y:30,width:3,height:7},{name:"EQ_MAXIMIZE_BUTTON_ACTIVE",x:1,y:38,width:9,height:9},{name:"EQ_MINIMIZE_BUTTON_ACTIVE",x:1,y:47,width:9,height:9},{name:"EQ_SHADE_CLOSE_BUTTON",x:11,y:38,width:9,height:9},{name:"EQ_SHADE_CLOSE_BUTTON_ACTIVE",x:11,y:47,width:9,height:9}],EQMAIN:[{name:"EQ_WINDOW_BACKGROUND",x:0,y:0,width:275,height:116},{name:"EQ_TITLE_BAR",x:0,y:149,width:275,height:14},{name:"EQ_TITLE_BAR_SELECTED",x:0,y:134,width:275,height:14},{name:"EQ_SLIDER_BACKGROUND",x:13,y:164,width:209,height:129},{name:"EQ_SLIDER_THUMB",x:0,y:164,width:11,height:11},{name:"EQ_SLIDER_THUMB_SELECTED",x:0,y:176,width:11,height:11},{name:"EQ_CLOSE_BUTTON",x:0,y:116,width:9,height:9},{name:"EQ_CLOSE_BUTTON_ACTIVE",x:0,y:125,width:9,height:9},{name:"EQ_MAXIMIZE_BUTTON_ACTIVE_FALLBACK",x:254,y:152,width:9,height:9},{name:"EQ_ON_BUTTON",x:10,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_DEPRESSED",x:128,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_SELECTED",x:69,y:119,width:26,height:12},{name:"EQ_ON_BUTTON_SELECTED_DEPRESSED",x:187,y:119,width:26,height:12},{name:"EQ_AUTO_BUTTON",x:36,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_DEPRESSED",x:154,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_SELECTED",x:95,y:119,width:32,height:12},{name:"EQ_AUTO_BUTTON_SELECTED_DEPRESSED",x:213,y:119,width:32,height:12},{name:"EQ_GRAPH_BACKGROUND",x:0,y:294,width:113,height:19},{name:"EQ_GRAPH_LINE_COLORS",x:115,y:294,width:1,height:19},{name:"EQ_PRESETS_BUTTON",x:224,y:164,width:44,height:12},{name:"EQ_PRESETS_BUTTON_SELECTED",x:224,y:176,width:44,height:12},{name:"EQ_PREAMP_LINE",x:0,y:314,width:113,height:1}],POSBAR:[{name:"MAIN_POSITION_SLIDER_BACKGROUND",x:0,y:0,width:248,height:10},{name:"MAIN_POSITION_SLIDER_THUMB",x:248,y:0,width:29,height:10},{name:"MAIN_POSITION_SLIDER_THUMB_SELECTED",x:278,y:0,width:29,height:10}],SHUFREP:[{name:"MAIN_SHUFFLE_BUTTON",x:28,y:0,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_DEPRESSED",x:28,y:15,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_SELECTED",x:28,y:30,width:47,height:15},{name:"MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED",x:28,y:45,width:47,height:15},{name:"MAIN_REPEAT_BUTTON",x:0,y:0,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_DEPRESSED",x:0,y:15,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_SELECTED",x:0,y:30,width:28,height:15},{name:"MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED",x:0,y:45,width:28,height:15},{name:"MAIN_EQ_BUTTON",x:0,y:61,width:23,height:12},{name:"MAIN_EQ_BUTTON_SELECTED",x:0,y:73,width:23,height:12},{name:"MAIN_EQ_BUTTON_DEPRESSED",x:46,y:61,width:23,height:12},{name:"MAIN_EQ_BUTTON_DEPRESSED_SELECTED",x:46,y:73,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON",x:23,y:61,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_SELECTED",x:23,y:73,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_DEPRESSED",x:69,y:61,width:23,height:12},{name:"MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED",x:69,y:73,width:23,height:12}],TEXT:jr,TITLEBAR:[{name:"MAIN_TITLE_BAR",x:27,y:15,width:275,height:14},{name:"MAIN_TITLE_BAR_SELECTED",x:27,y:0,width:275,height:14},{name:"MAIN_EASTER_EGG_TITLE_BAR",x:27,y:72,width:275,height:14},{name:"MAIN_EASTER_EGG_TITLE_BAR_SELECTED",x:27,y:57,width:275,height:14},{name:"MAIN_OPTIONS_BUTTON",x:0,y:0,width:9,height:9},{name:"MAIN_OPTIONS_BUTTON_DEPRESSED",x:0,y:9,width:9,height:9},{name:"MAIN_MINIMIZE_BUTTON",x:9,y:0,width:9,height:9},{name:"MAIN_MINIMIZE_BUTTON_DEPRESSED",x:9,y:9,width:9,height:9},{name:"MAIN_SHADE_BUTTON",x:0,y:18,width:9,height:9},{name:"MAIN_SHADE_BUTTON_DEPRESSED",x:9,y:18,width:9,height:9},{name:"MAIN_CLOSE_BUTTON",x:18,y:0,width:9,height:9},{name:"MAIN_CLOSE_BUTTON_DEPRESSED",x:18,y:9,width:9,height:9},{name:"MAIN_CLUTTER_BAR_BACKGROUND",x:304,y:0,width:8,height:43},{name:"MAIN_CLUTTER_BAR_BACKGROUND_DISABLED",x:312,y:0,width:8,height:43},{name:"MAIN_CLUTTER_BAR_BUTTON_O_SELECTED",x:304,y:47,width:8,height:8},{name:"MAIN_CLUTTER_BAR_BUTTON_A_SELECTED",x:312,y:55,width:8,height:7},{name:"MAIN_CLUTTER_BAR_BUTTON_I_SELECTED",x:320,y:62,width:8,height:7},{name:"MAIN_CLUTTER_BAR_BUTTON_D_SELECTED",x:328,y:69,width:8,height:8},{name:"MAIN_CLUTTER_BAR_BUTTON_V_SELECTED",x:336,y:77,width:8,height:7},{name:"MAIN_SHADE_BACKGROUND",x:27,y:42,width:275,height:14},{name:"MAIN_SHADE_BACKGROUND_SELECTED",x:27,y:29,width:275,height:14},{name:"MAIN_SHADE_BUTTON_SELECTED",x:0,y:27,width:9,height:9},{name:"MAIN_SHADE_BUTTON_SELECTED_DEPRESSED",x:9,y:27,width:9,height:9},{name:"MAIN_SHADE_POSITION_BACKGROUND",x:0,y:36,width:17,height:7},{name:"MAIN_SHADE_POSITION_THUMB",x:20,y:36,width:3,height:7},{name:"MAIN_SHADE_POSITION_THUMB_LEFT",x:17,y:36,width:3,height:7},{name:"MAIN_SHADE_POSITION_THUMB_RIGHT",x:23,y:36,width:3,height:7}],VOLUME:[{name:"MAIN_VOLUME_BACKGROUND",x:0,y:0,width:68,height:420},{name:"MAIN_VOLUME_THUMB",x:15,y:422,width:14,height:11},{name:"MAIN_VOLUME_THUMB_SELECTED",x:0,y:422,width:14,height:11}],GEN:[{name:"GEN_TOP_LEFT_SELECTED",x:0,y:0,width:25,height:20},{name:"GEN_TOP_LEFT_END_SELECTED",x:26,y:0,width:25,height:20},{name:"GEN_TOP_CENTER_FILL_SELECTED",x:52,y:0,width:25,height:20},{name:"GEN_TOP_RIGHT_END_SELECTED",x:78,y:0,width:25,height:20},{name:"GEN_TOP_LEFT_RIGHT_FILL_SELECTED",x:104,y:0,width:25,height:20},{name:"GEN_TOP_RIGHT_SELECTED",x:130,y:0,width:25,height:20},{name:"GEN_TOP_LEFT",x:0,y:21,width:25,height:20},{name:"GEN_TOP_LEFT_END",x:26,y:21,width:25,height:20},{name:"GEN_TOP_CENTER_FILL",x:52,y:21,width:25,height:20},{name:"GEN_TOP_RIGHT_END",x:78,y:21,width:25,height:20},{name:"GEN_TOP_LEFT_RIGHT_FILL",x:104,y:21,width:25,height:20},{name:"GEN_TOP_RIGHT",x:130,y:21,width:25,height:20},{name:"GEN_BOTTOM_LEFT",x:0,y:42,width:125,height:14},{name:"GEN_BOTTOM_RIGHT",x:0,y:57,width:125,height:14},{name:"GEN_BOTTOM_FILL",x:127,y:72,width:25,height:14},{name:"GEN_MIDDLE_LEFT",x:127,y:42,width:11,height:29},{name:"GEN_MIDDLE_LEFT_BOTTOM",x:158,y:42,width:11,height:24},{name:"GEN_MIDDLE_RIGHT",x:139,y:42,width:8,height:29},{name:"GEN_MIDDLE_RIGHT_BOTTOM",x:170,y:42,width:8,height:24},{name:"GEN_CLOSE_SELECTED",x:148,y:42,width:9,height:9}]};function Fr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fr(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qr(e,t){return new RegExp(`^(.*[/\\\\])?${e}.(${t})$`,"i")}async function zr(e,t,n,r){const i=e.file(Qr(t,n));if(!i.length)return null;const a=i[i.length-1];try{return{contents:await a.async(r),name:a.name}}catch(e){return console.warn(`Failed to extract "${t}.${n}" from the skin archive.`),null}}async function Vr(e){try{return await window.createImageBitmap(e)}catch(t){try{return await function(e){return B.n(URL.createObjectURL(e))}(e)}catch(e){return null}}}function Gr(e,t){const n=document.createElement("canvas"),r=n.getContext("2d");if(null==r)throw new Error("Failed to get canvas context");const i={};return t.forEach(t=>{n.height=t.height,n.width=t.width,r.drawImage(e,-t.x,-t.y);const a=n.toDataURL();i[t.name]=a}),i}async function Yr(e,t){const n=await zr(e,t,"(png|bmp)","blob");if(!n)return null;const r="image/"+((e=>{const t=/\.([a-z]{3,4})$/i.exec(e);return t?t[1].toLowerCase():null})(n.name)||"*");return Vr(new Blob([n.contents],{type:r}))}const Kr="RIFF".split("").map(e=>e.charCodeAt(0));async function Hr(e,t){const n=await zr(e,t,"CUR","uint8array");if(null==n)return null;const r=n.contents;return i=r,Kr.every((e,t)=>i[t]===e)?{type:"ani",aniData:r}:{type:"cur",url:ve(r)};var i}async function Jr(e){const t=e.file(Qr("PLEDIT","txt"))[0];if(null==t)return R.c.playlistStyle;const n=await t.async("text");if(null==n)return R.c.playlistStyle;const r=n&&B.u(n).text;return r?(["normal","current","normalbg","selectedbg","mbFG","mbBG"].forEach(e=>{let t=r[e];t&&("#"!==t[0]&&(t="#"+t),r[e]=t.slice(0,7))}),Pr(Pr({},R.c.playlistStyle),r)):R.c.playlistStyle}async function qr(e){const t=await Yr(e,"GENEX");if(null==t)return null;const n=document.createElement("canvas"),r=n.getContext("2d");if(null==r)return null;n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const i=e=>`rgb(${r.getImageData(e,0,1,1).data.slice(0,3).join(",")})`;return{itemBackground:i(48),itemForeground:i(50),windowBackground:i(52),buttonText:i(54),windowText:i(56),divider:i(58),playlistSelection:i(60),listHeaderBackground:i(62),listHeaderText:i(64),listHeaderFrameTopAndLeft:i(66),listHeaderFrameBottomAndRight:i(68),listHeaderFramePressed:i(70),listHeaderDeadArea:i(72),scrollbarOne:i(74),scrollbarTwo:i(76),pressedScrollbarOne:i(78),pressedScrollbarTwo:i(80),scrollbarDeadArea:i(82),listTextHighlighted:i(84),listTextHighlightedBackground:i(86),listTextSelected:i(88),listTextSelectedBackground:i(90)}}function Wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wr(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Xr=e=>e.reduce((e,t)=>Object.assign(e,t),{}),$r=["CLOSE","EQCLOSE","EQNORMAL","EQSLID","EQTITLE","MAINMENU","MMENU","MIN","NORMAL","PCLOSE","PNORMAL","POSBAR","PSIZE","PTBAR","PVSCROLL","PWINBUT","PWSNORM","PWSSIZE","SONGNAME","TITLEBAR","VOLBAL","WINBUT","WSNORMAL","WSPOSBAR"];async function ei(e){const t=await zr(e,"VISCOLOR","txt","text");return t?Object(B.v)(t.contents):R.c.colors}async function ti(e){const t=await Promise.all(Object.keys(Rr).map(t=>async function(e,t){const n=await Yr(e,t);return null==n?{}:Gr(n,Rr[t])}(e,t)));return Xr(t)}async function ni(e){const t=await Promise.all($r.map(async t=>({[t]:await Hr(e,t)})));return Xr(t)}async function ri(e){const t=await zr(e,"REGION","txt","text");return t?function(e){const t=Object(B.u)(e),n={};return Object.keys(t).forEach(e=>{const{numpoints:r,pointlist:i}=t[e];if(!r||!i)return;const a=r.split(/\s*,\s*/).filter(e=>""!==e),o=function(e){const t=[];for(let n=0;n<e.length;n+=2)t.push(`${e[n]},${e[n+1]}`);return t}(i.split(/\s*[, ]\s*/).filter(e=>""!==e));let A=0;const s=a.map(e=>{const t=Number(e);if(t<3)return A+=t,null;const n=o.slice(A,A+t).join(" ");return n.length?(A+=t,n):null}).filter(e=>null!=e);s.length&&(n[e]=s)}),n}(t.contents):{}}async function ii(e){const t=await Yr(e,"GEN");if(null==t)return null;const n=document.createElement("canvas"),r=n.getContext("2d");n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const i=(e,t)=>{const i=t=>r.getImageData(t,e,1,1).data.join(",");let a=1;const o=i(0);return R.d.map(r=>{let A=a;for(;i(A)!==o&&A<n.width;)A++;const s={x:a,y:e,height:7,width:A-a,name:`${t}_${r}`};return a=A+1,s})},a={},o=[...i(88,"GEN_TEXT_SELECTED"),...i(96,"GEN_TEXT")];return o.forEach(e=>{a[e.name]=e.width}),[a,Gr(t,o)]}var ai=async function(e,t){const n=await t.loadAsync(e),[r,i,a,o,A,s,l]=await Promise.all([ei(n),Jr(n),ti(n),ni(n),ri(n),ii(n),qr(n)]),[u,c]=s||[null,{}];return{colors:r,playlistStyle:i,images:Zr(Zr({},a),c),genLetterWidths:u,cursors:o,region:A,genExColors:l}},oi=n(42),Ai=n.n(oi);function si(){return(e,t)=>{const n=t();if(0===it(n).length)return;const r=rt(n),{playlist:{trackOrder:i}}=n;e({type:"REMOVE_TRACKS",ids:i.filter(e=>!r.has(e))})}}function li(){return(e,t)=>{e({type:"REMOVE_TRACKS",ids:Array.from(rt(t()))})}}function ui(){return e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}}function ci(){return{type:"REVERSE_LIST"}}function di(){return{type:"RANDOMIZE_LIST"}}function hi(){return(e,t)=>{const n=t(),r=We(n);return e({type:"SET_TRACK_ORDER",trackOrder:Object(B.B)(Xe(n),e=>(""+r[e].title).toLowerCase())})}}function fi(e){return{type:"SET_PLAYLIST_SCROLL_POSITION",position:e}}function pi(e){return(t,n)=>{const r=n(),i=wt(r),a=kt(r);return t({type:"SET_PLAYLIST_SCROLL_POSITION",position:100*(i?Object(B.d)((a+e)/i,0,1):0)})}}function gi(e){return e.preventDefault(),(t,n)=>{const r=n();wt(r)&&e.stopPropagation();const i=r.playlist.trackOrder.length*R.i,a=e.deltaY/i*100;t({type:"SET_PLAYLIST_SCROLL_POSITION",position:Object(B.d)(r.display.playlistScrollPosition+a,0,100)})}}function mi(){return pi(-4)}function bi(){return pi(4)}function Ei(e){return(t,n)=>{const r=n(),i=We(r),a=Xe(r),o=rt(r),A=a.findIndex(e=>i[e]&&o.has(e));if(-1===A)return;const s=Object(B.g)(a,e=>i[e]&&o.has(e));if(-1===s)throw new Error("We found a first selected, but not a last selected.");const l=-A,u=a.length-1-s,c=Object(B.d)(e,l,u);0!==c&&t({type:"DRAG_SELECTED",offset:c})}}function wi(){return{type:"INVERT_SELECTION"}}function yi(){return{type:"SELECT_ZERO"}}function vi(){return{type:"SELECT_ALL"}}var ki=n(34);const Si=new class{constructor({threads:e}){this._queue=new Ai.a([],(e,t)=>e.priority()-t.priority()),this._availableThreads=e}push(e,t){const n={task:e,priority:t};return this._queue.push(n),setTimeout(()=>{this._run()},0),()=>{this._queue=this._queue.filter(e=>e!==n)}}_run(){for(;this._availableThreads>0;){if(0===this._queue.length)return;this._availableThreads--;const e=this._queue.pop().task();Ee()("function"==typeof e.then,"LoadQueue only supports loading Promises. Got "+e),e.then(()=>{this._availableThreads++,this._run()})}}}({threads:4});function Ii(e,t,n){return ji(Array.from(e).map(e=>({blob:e,defaultName:e.name})),t,n)}const Oi=new RegExp("(wsz|zip)$","i"),Ti=new RegExp("eqf$","i");function Ci(e,t=R.e.PLAY,n){return r=>{if(!(e.length<1)){if(1===e.length){const t=e[0];if(Oi.test(t.name))return void r(xi(t));if(Ti.test(t.name))return void r(function(e){return async t=>{const n=await async function(e){return Ee()(null!=e,"Attempt to get an ArrayBuffer without assigning a fileReference"),new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})}(e);t(Fi(Object(_r.parser)(n).presets[0]))}}(t))}r(Ii(e,t,n))}}}function xi(e){return async(t,n,{requireJSZip:r})=>{if(!r)return void alert("Webamp has not been configured to support custom skins.");let i;t({type:"LOADING"});try{i=await r()}catch(e){return console.error(e),t({type:"LOADED"}),void alert("Failed to load the skin parser.")}try{const n=await ai(e,i);t({type:"SET_SKIN_DATA",data:{skinImages:n.images,skinColors:n.colors,skinPlaylistStyle:n.playlistStyle,skinCursors:n.cursors,skinRegion:n.region,skinGenLetterWidths:n.genLetterWidths,skinGenExColors:n.genExColors}})}catch(e){console.error(e),t({type:"LOADED"}),alert("Failed to parse skin")}}}function Ui(e){return async t=>{t({type:"LOADING"});try{const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);t(xi(n.blob()))}catch(n){console.error(n),t({type:"LOADED"}),alert("Failed to download skin from "+e)}}}function Bi(e,t){return async n=>{var r;const i=await ye({accept:e});n({type:"OPENED_FILES",expectedType:t,count:i.length,firstFileName:null===(r=i[0])||void 0===r?void 0:r.name}),n(Ci(i))}}function Mi(){return Bi(".eqf","EQ")}function Ni(){return Bi(null,"MEDIA")}function _i(){return Bi(".zip, .wsz","SKIN")}function Di(e,t){return(n,r)=>{Si.push(async()=>{try{const r=await function(e){return Ee()("string"==typeof e,"Attempted to get the duration of media file without passing a url"),new Promise((t,n)=>{const r=document.createElement("audio");r.crossOrigin="anonymous";const i=()=>{t(r.duration),r.removeEventListener("durationchange",i),r.src=""};r.addEventListener("durationchange",i),r.addEventListener("error",e=>{n(e)}),r.src=e})}(e);n({type:"SET_MEDIA_DURATION",duration:r,id:t})}catch(e){}},()=>Ot(r())(t)?5:15)}}function Li(e,t=R.e.NONE,n=0){const{files:r}=e.dataTransfer;return async(i,a,{handleTrackDropEvent:o})=>{if(o){const r=await o(e);if(null!=r)return void i(ji(r,t,n))}i(Ci(r,t,n))}}function ji(e,t=R.e.NONE,n=0){return r=>{t===R.e.PLAY&&r(e=>{e({type:"STOP"}),e({type:"REMOVE_ALL_TRACKS"})}),e.forEach((e,i)=>{const a=0===i?t:R.e.NONE;r(function(e,t=R.e.NONE,n=0){return r=>{const i=B.D(),{defaultName:a,metaData:o,duration:A}=e;let s;if("url"in e)s=e.url.toString();else{if(!("blob"in e))throw new Error("Expected track to have either a blob or a url");s=URL.createObjectURL(e.blob)}switch(r({type:"ADD_TRACK_FROM_URL",url:s,duration:e.duration,defaultName:a,id:i,atIndex:n}),t){case R.e.BUFFER:r({type:"BUFFER_TRACK",id:i});break;case R.e.PLAY:r({type:"PLAY_TRACK",id:i});break;case R.e.NONE:default:r(null!=A?{type:"SET_MEDIA_DURATION",duration:A,id:i}:Di(s,i))}if(null!=o){const{artist:e,title:t,album:n}=o;r({type:"SET_MEDIA_TAGS",artist:e,title:t,album:n,sampleRate:44e3,bitrate:192e3,numberOfChannels:2,id:i})}else r("blob"in e?Ri(e.blob,i):function(e){return(t,n)=>{const r=We(n())[e];Si.push(()=>t(Ri(r.url,e)),()=>Ot(n())(e)?10:20)}}(i))}}(e,a,n+i))})}}function Ri(e,t){return async(n,r,{requireMusicMetadata:i})=>{n({type:"MEDIA_TAG_REQUEST_INITIALIZED",id:t});try{const r=await function(e,t){Ee()(null!=e,"Attempted to get the tags of media file without passing a file");const n={duration:!0,skipPostHeaders:!0};return"string"==typeof e?t.fetchFromUrl(e,n):t.parseBlob(e,n)}(e,await i()),{artist:a,title:o,album:A,picture:s}=r.common,{numberOfChannels:l,bitrate:u,sampleRate:c}=r.format;let d=null;if(s&&s.length>=1){const e=new Uint8Array(s[0].data),t=new Blob([e],{type:s[0].format});d=URL.createObjectURL(t)}n({type:"SET_MEDIA_TAGS",artist:a||"",title:o||"",album:A,albumArtUrl:d,numberOfChannels:l,bitrate:u,sampleRate:c,id:t})}catch(e){n({type:"MEDIA_TAG_REQUEST_FAILED",id:t})}}}function Fi(e){return t=>{t(Br(B.q(e.preamp))),R.a.forEach(n=>{t(Or(n,B.q(e["hz"+n])))})}}function Pi(){return(e,t)=>{const n=t(),r=qe(n),i=Object(_r.creator)(r),a="data:application/zip;base64,"+B.a(i);B.f(a,"entry.eqf")}}function Qi(){return(e,t)=>{const n=Ft(t());B.f(n,"Winamp Playlist.html")}}let zi=document.createElement("input");zi.type="file";const Vi=void 0!==zi.webkitdirectory||void 0!==zi.mozdirectory||void 0!==zi.directory;function Gi(e){return async t=>{t(Ii(await ye(),R.e.NONE,e))}}function Yi(e){return async t=>{if(!Vi)return void alert("Not supported in your browser");t(Ii(await ye({directory:!0}),R.e.NONE,e))}}function Ki(e=0){new ki.a(!1).getTrackListFromYandexDisk(prompt("Введите ссылку на Яндекс Диск"))}function Hi(){}function Ji(){return(e,t,{handleSaveListEvent:n})=>{n?n(tt(t())):alert("Not supported in Webamp")}}function qi(e,t){return n=>{var r;return n({type:"DROPPED_FILES",count:e.dataTransfer.files.length,firstFileName:null===(r=e.dataTransfer.files[0])||void 0===r?void 0:r.name,windowId:t})}}function Wi(e){const{name:t}=e;if("butterchurnPresetObject"in e)return{type:"RESOLVED",name:t,preset:e.butterchurnPresetObject};if("getButterchrunPresetObject"in e)return{type:"UNRESOLVED",name:t,getPreset:e.getButterchrunPresetObject};if("butterchurnPresetUrl"in e)return{type:"UNRESOLVED",name:t,getPreset:async()=>(await fetch(e.butterchurnPresetUrl)).json()};throw new Error("Invalid preset object")}function Zi(e){return(t,n)=>{const r=n(),i=r.milkdrop.presets.length;t({type:"GOT_BUTTERCHURN_PRESETS",presets:e}),0===i&&On(r)?t(ta()):t(na(i,xe.IMMEDIATE,!0))}}function Xi(e){return async(t,n,{convertPreset:r})=>{t(Zi(Array.from(e).map(e=>{const t=e.name.toLowerCase();if(t.endsWith(".milk")){if(null==r)throw new Error("Invalid type");return{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".milk".length),getPreset:()=>r(e)}}return t.endsWith(".json")?{type:"UNRESOLVED",name:e.name.slice(0,e.name.length-".json".length),getPreset:async()=>{const t=await we(e);return JSON.parse(t)}}:(console.error("Invalid type preset when loading directory"),null)}).filter(Boolean)))}}function $i(e=xe.DEFAULT){return(t,n)=>{const r=n();if(On(r))return t(ta(e));const i=yn(r);if(null==i)return;t(na(i+1,e,!0))}}function ea(e=xe.DEFAULT){return(t,n)=>{const r=n(),{presetHistory:i}=r.milkdrop;if(i.length<1)return;t(na(i[i.length-2],e,!1))}}function ta(e=xe.DEFAULT){return(t,n)=>{const r=n();t(na(Math.floor(Math.random()*r.milkdrop.presets.length),e,!0))}}function na(e,t,n){return async(r,i)=>{const a=i().milkdrop.presets[e];if(null!=a)switch(r({type:"PRESET_REQUESTED",index:e,addToHistory:n}),a.type){case"RESOLVED":return void r({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:t});case"UNRESOLVED":const n=await a.getPreset();return r({type:"RESOLVE_PRESET_AT_INDEX",index:e,json:n}),void r({type:"SELECT_PRESET_AT_INDEX",index:e,transitionType:t})}}}function ra(e){return Xi(e.dataTransfer.files)}function ia(){return{type:"TOGGLE_RANDOMIZE_PRESETS"}}function aa(){return{type:"TOGGLE_PRESET_CYCLING"}}function oa(e){return{type:"SCHEDULE_MILKDROP_MESSAGE",message:e}}function Aa(){return e=>{let t=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{t=!0}}),t||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))}}function sa(){return{type:"TOGGLE_VISUALIZER_STYLE"}}function la(){return{type:"MINIMIZE_WINAMP"}}function ua(e){return{type:"SET_FOCUS",input:e}}function ca(){return{type:"UNSET_FOCUS"}}function da(e){return{type:"SET_BAND_FOCUS",input:"eq",bandFocused:e}}function ha(){return{type:"LOAD_DEFAULT_SKIN"}}function fa(){return(e,t)=>{mn(t())?e({type:"SET_MILKDROP_DESKTOP",enabled:!1}):e({type:"SET_MILKDROP_DESKTOP",enabled:!0})}}function pa(e){return{type:"SET_MILKDROP_FULLSCREEN",enabled:e}}function ga(){return(e,t)=>{e(pa(!bn(t())))}}function ma(){return(e,t)=>{Sn(t())&&e(er(R.m.MILKDROP)),e({type:"TOGGLE_PRESET_OVERLAY"})}}function ba(){return{type:"STEP_MARQUEE"}}zi=null;var Ea=e=>t=>{const{media:{volume:n,balance:r},equalizer:{sliders:i}}=t.getState();return e.setVolume(n),e.setBalance(r),e.setPreamp(i.preamp),e.on("timeupdate",()=>{t.dispatch({type:"UPDATE_TIME_ELAPSED",elapsed:e.timeElapsed()})}),e.on("ended",()=>{t.dispatch(hr())}),e.on("playing",()=>{t.dispatch({type:"IS_PLAYING"})}),e.on("waiting",()=>{t.dispatch({type:"START_WORKING"})}),e.on("stopWaiting",()=>{t.dispatch({type:"STOP_WORKING"})}),e.on("fileLoaded",()=>{const n=ct(t.getState());null!=n&&t.dispatch({id:n,type:"SET_MEDIA",kbps:"128",khz:"44",channels:2,length:e.duration()})}),n=>r=>{const i=n(r),a=t.getState();switch(r.type){case"PLAY":e.play();break;case"PAUSE":e.pause();break;case"STOP":e.stop();break;case"SET_VOLUME":e.setVolume(en(a));break;case"SET_BALANCE":e.setBalance(tn(a));break;case"SEEK_TO_PERCENT_COMPLETE":e.seekToPercentComplete(r.percent);break;case"PLAY_TRACK":{const n=Ze(t.getState())(r.id);null!=n&&e.loadFromUrl(n,!0);break}case"BUFFER_TRACK":{const n=Ze(t.getState())(r.id);null!=n&&e.loadFromUrl(n,!1);break}case"SET_BAND_VALUE":"preamp"===r.band?e.setPreamp(r.value):e.setEqBand(r.band,r.value);break;case"SET_EQ_OFF":e.disableEq();break;case"SET_EQ_ON":e.enableEq();break;case"LOAD_SERIALIZED_STATE":An(a)?e.enableEq():e.disableEq(),e.setVolume(en(a)),e.setBalance(tn(a)),Object(B.s)(a.equalizer.sliders,(t,n)=>{"preamp"===n?e.setPreamp(t):e.setEqBand(n,t)})}return i}};const wa=Object(U.composeWithDevTools)({actionsBlacklist:["UPDATE_TIME_ELAPSED","STEP_MARQUEE"]});var ya=n(15),va=n.n(ya);var ka=function(e){const{onChange:t,enabled:n}=e,r=Object(o.useRef)(null);return Object(o.useEffect)(()=>{function e(){t&&t(va.a.fullscreenElement===r.current)}return va.a.addEventListener("fullscreenchange",e),()=>{va.a.removeEventListener("fullscreenchange",e)}},[t]),Object(o.useLayoutEffect)(()=>{const e=va.a.fullscreenElement===r.current;var t;e&&!n?va.a.fullscreenEnabled&&va.a.exitFullscreen():!e&&n&&null!=r.current&&(t=r.current,va.a.fullscreenEnabled&&va.a.requestFullscreen(t))},[n]),Object(a.jsx)("div",{ref:r,style:e.enabled?{height:"100%",width:"100%"}:void 0,children:e.children})};function Sa(e){const[t,n]=Object(o.useState)(null);return Object(o.useEffect)(()=>{let t=!1;return e.then(e=>{t||n(e)}),()=>{t=!0}},[e]),t}const Ia={current:{pageX:0,pageY:0}};function Oa(){const e=Ia,[t,n]=Object(o.useState)(!1),[r,i]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(null==r)return void n(!1);const t=r.getBoundingClientRect(),{pageX:i,pageY:a}=e.current;n(i>=t.left&&i<=t.right&&a>=t.top&&a<=t.bottom);const o=()=>n(!0),A=()=>n(!1);return r.addEventListener("mouseenter",o),r.addEventListener("mouseleave",A),()=>{r.removeEventListener("mouseenter",o),r.removeEventListener("mouseleave",A)}},[r,e]),{ref:i,hover:t}}function Ta(e){return O(e)}function Ca(e){const t=v();return Object(o.useCallback)((...n)=>t(e(...n)),[t,e])}function xa(){return v()}window.document.addEventListener("mousemove",({pageX:e,pageY:t})=>{Ia.current={pageX:e,pageY:t}});var Ua=n(6),Ba=n.n(Ua);n(71);function Ma(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Na=Object(o.memo)((function(e){const{currentSize:t,setWindowSize:n,widthOnly:r}=e,A=j()(e,["currentSize","setWindowSize","widthOnly"]),[s,l]=Object(o.useState)(!1),[u,c]=Object(o.useState)(null);Object(o.useEffect)(()=>{if(!1===s||null==u)return;const[n,i]=t,a=t=>{const a=B.l(t)-u.x,o=B.m(t)-u.y,A=[Math.max(0,n+Math.round(a/R.o)),r?n:Math.max(0,i+Math.round(o/R.n))];e.setWindowSize(A)};window.addEventListener("mousemove",a),window.addEventListener("touchmove",a);const o=()=>l(!1);return window.addEventListener("mouseup",o),window.addEventListener("touchend",o),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)}},[u,s]);const d=e=>{c({x:B.l(e),y:B.m(e)}),l(!0)};return Object(a.jsx)("div",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ma(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ma(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({onMouseDown:d,onTouchStart:d},A))}));var _a=function({onKeyDown:e,windowId:t,children:n}){const r=Ta(Qt),i=Ca(er),A=Object(o.useCallback)(()=>{t!==r&&i(t)},[t,r,i]),[s,l]=Object(o.useState)(null);return Object(o.useEffect)(()=>{if(null!=s&&null!=e)return s.addEventListener("keydown",e),()=>s.removeEventListener("keydown",e)},[e,t,r,s]),Object(o.useEffect)(()=>{if(null==s||t!==r)return;const e=new MutationObserver(e=>{document.activeElement===document.body&&e.some(e=>e.removedNodes.length>0)&&s.focus()});return e.observe(s,{subtree:!0,attributes:!1,childList:!0}),()=>e.disconnect()},[t,r,s]),Object(a.jsx)("div",{ref:l,onMouseDown:A,onTouchStart:A,onFocus:A,tabIndex:-1,style:{height:"100%",width:"100%"},children:n})};const Da=({children:e})=>{const t=e.split("");return Object(a.jsx)(o.Fragment,{children:t.map((e,t)=>Object(a.jsx)("div",{className:"draggable gen-text-letter gen-text-"+(" "===e?"space":e.toLowerCase())},t))})};var La=({children:e,title:t,windowId:n,onKeyDown:r})=>{const i=Ca(tr),o=Ca($n),A=Ta(Kt),s=Ta(Qt),l=Ta(mt)(n),u=s===n,{width:c,height:d}=A(n);return Object(a.jsx)(_a,{windowId:n,onKeyDown:r,children:Object(a.jsxs)("div",{className:Ba()("gen-window","window",{selected:u}),style:{width:c,height:d},children:[Object(a.jsxs)("div",{className:"gen-top draggable",children:[Object(a.jsx)("div",{className:"gen-top-left draggable"}),Object(a.jsx)("div",{className:"gen-top-left-fill draggable"}),Object(a.jsx)("div",{className:"gen-top-left-end draggable"}),Object(a.jsx)("div",{className:"gen-top-title draggable",children:Object(a.jsx)(Da,{children:t})}),Object(a.jsx)("div",{className:"gen-top-right-end draggable"}),Object(a.jsx)("div",{className:"gen-top-right-fill draggable"}),Object(a.jsx)("div",{className:"gen-top-right draggable",children:Object(a.jsx)("div",{className:"gen-close selected",onClick:()=>o(n)})})]}),Object(a.jsxs)("div",{className:"gen-middle",children:[Object(a.jsx)("div",{className:"gen-middle-left draggable",children:Object(a.jsx)("div",{className:"gen-middle-left-bottom draggable"})}),Object(a.jsx)("div",{className:"gen-middle-center",children:e({width:c-19,height:d-34})}),Object(a.jsx)("div",{className:"gen-middle-right draggable",children:Object(a.jsx)("div",{className:"gen-middle-right-bottom draggable"})})]}),Object(a.jsxs)("div",{className:"gen-bottom draggable",children:[Object(a.jsx)("div",{className:"gen-bottom-left draggable"}),Object(a.jsx)("div",{className:"gen-bottom-right draggable",children:Object(a.jsx)(Na,{currentSize:l,setWindowSize:e=>i(n,e),id:"gen-resize-target"})})]})]})})};const ja={[xe.DEFAULT]:2.7,[xe.IMMEDIATE]:0,[xe.USER_PRESET]:5.7};var Ra=function({analyser:e,width:t,height:n}){const r=Ta($t),i=Ta(Bt),A=Ta(En),s=Ta(xt),l=Ta(vn),u=Ta(wn),c=Ta(gn),d=r===R.k.MILKDROP,h=Object(o.useRef)(null),[f,p]=Object(o.useState)(null);Object(o.useEffect)(()=>{if(null==h.current||null==A)return;if(null!=f)return;const r=A.createVisualizer(e.context,h.current,{width:t,height:n,meshWidth:32,meshHeight:24,pixelRatio:window.devicePixelRatio||1});r.connectAudio(e),p(r)},[A,e,n,t,f]),Object(o.useEffect)(()=>{null!=f&&f.setRendererSize(t,n)},[f,t,n]);const g=Object(o.useRef)(!1);Object(o.useEffect)(()=>{null!=f&&null!=l&&(g.current?f.loadPreset(l,ja[u]):(f.loadPreset(l,ja[xe.IMMEDIATE]),g.current=!0))},[f,l]),Object(o.useEffect)(()=>{null!=f&&s&&f.launchSongTitleAnim(s)},[f,s]);const m=Object(o.useRef)(null);Object(o.useEffect)(()=>{null!=f&&null!=c&&(null==m.current||c.time>m.current)&&(m.current=Date.now(),f.launchSongTitleAnim(c.text))},[f,c]);const b=i&&d;return Object(o.useEffect)(()=>{if(!b||null==f)return;let e=null;const t=()=>{f.render(),e=window.requestAnimationFrame(t)};return t(),()=>{null!=e&&window.cancelAnimationFrame(e)}},[f,b]),Object(a.jsx)("canvas",{height:n,width:t,style:{height:"100%",width:"100%",display:d?"block":"none"},ref:h})};n(74);var Fa=e=>{const{innerRef:t}=e;return Object(a.jsx)("div",{ref:t,className:"draggable",style:{backgroundColor:"#000",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%"},tabIndex:0,children:e.children})};function Pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pa(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const za={position:"absolute",top:0,left:0,color:"white",background:"rgba(0.33, 0.33, 0.33, 0.33)"},Va={position:"absolute",top:0,left:0,padding:"15px 10px 0 10px"},Ga={display:"inline-block",whiteSpace:"nowrap",overflow:"hidden",background:"rgba(0, 0, 0, 0.815)",fontSize:"12px"};function Ya(e){return e-1}var Ka=function({height:e,width:t}){const n=Ta(kn),r=Ta(yn),i=Ca(na),A=Ca(ma),s=Ca(Xi),l=function(){const e=Object(o.useRef)(!1);return Object(o.useEffect)(()=>()=>{e.current=!0},[]),e}(),[u,c]=Object(o.useState)(()=>null!=r?r+1:0),d=n.length,h=Object(o.useCallback)(()=>{const t=Math.floor((e-15)/14),i=Math.floor(.75*t),[o,A]=function(e,t,n){const r=Math.min(e,t),i=Math.floor(r/2),a=n-i,o=Object(B.d)(a,0,e-r);return[o,o+r-1]}(d+1,i,u),s=[];for(let e=o;e<=A;e++){const t=Ya(e),i=t===r;let o;o=e===u?i?"#FFCC22":"#FF5050":i?"#CCFF03":"#CCCCCC",s.push(Object(a.jsx)("li",{style:{color:o,lineHeight:"14px"},children:0===e?"Load Local Directory":n[t]},e))}return s},[r,e,d,n,u]),f=Object(o.useCallback)(async()=>{const e=await ye({directory:!0});l.current||s(e)},[s,l]),p=Object(o.useCallback)(e=>{switch(e.keyCode){case 38:c(e=>Math.max(e-1,0)),e.stopPropagation();break;case 40:c(e=>Math.min(e+1,d)),e.stopPropagation();break;case 13:0===u?f():i(Ya(u),xe.DEFAULT,!0),e.stopPropagation();break;case 27:A(),e.stopPropagation()}},[f,d,i,u,A]),g=Object(o.useCallback)(e=>{null!=e&&document.activeElement!==e&&e.focus()},[]);return null==n?Object(a.jsx)("div",{style:za,children:Object(a.jsx)("span",{children:"Loading presets"})}):Object(a.jsx)("div",{ref:g,tabIndex:-1,style:Va,onKeyDown:p,children:Object(a.jsx)("div",{style:Qa(Qa({},Ga),{},{width:t-20-20,maxHeight:e-15}),children:Object(a.jsx)("ul",{style:{listStyleType:"none",padding:0,margin:0},children:h()})})})};function Ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ja(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ha(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ha(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qa(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="link",e.dataTransfer.effectAllowed="link"}var Wa=e=>{const{handleDrop:t,windowId:n}=e,r=j()(e,["handleDrop","windowId"]),i=Ca(qi),A=Object(o.useCallback)(e=>{qa(e),i(e,n);const{currentTarget:r}=e;if(!(r instanceof Element))return;const{left:a,top:o}=r.getBoundingClientRect();t(e,{x:a,y:o})},[t,i,n]);return Object(a.jsx)("div",Ja(Ja({},r),{},{onDragStart:qa,onDragEnter:qa,onDragOver:qa,onDrop:A}))};n(76);function Za(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Za(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Za(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const $a=e=>{const t=Object(o.useMemo)(()=>{const t=document.createElement("div");return t.id="webamp-context-menu",t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.zIndex=String(e.zIndex+1),t},[e.zIndex]);Object(o.useEffect)(()=>(document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]);const n={top:e.top,left:e.left,position:"absolute"};return Object(s.createPortal)(Object(a.jsx)("div",{style:n,children:e.children}),t)},eo=()=>Object(a.jsx)("li",{className:"hr",children:Object(a.jsx)("hr",{})}),to=({children:e,label:t})=>Object(a.jsxs)("li",{className:"parent",children:[Object(a.jsx)("ul",{children:e}),t]}),no=e=>Object(a.jsx)("li",{children:Object(a.jsx)("a",Xa(Xa({},e),{},{children:e.label}))}),ro=e=>{const{label:t,checked:n,className:r=""}=e,i=j()(e,["label","checked","className"]);return Object(a.jsx)("li",Xa(Xa({className:Ba()(r,{checked:n})},i),{},{children:t}))};function io({children:e,offsetTop:t,offsetLeft:n,top:r,bottom:i,selected:o}){const A=Ta(Gt);return o?Object(a.jsx)($a,{top:t,left:n,zIndex:A,children:Object(a.jsx)("ul",{className:Ba()("context-menu",{top:r,bottom:i}),children:e})}):null}function ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ao(e){var t,n;let{children:r,renderContents:i}=e,A=j()(e,["children","renderContents"]);const[s,l]=Object(o.useState)(null),u=Object(o.useCallback)(()=>{l(null)},[]),c=Object(o.useCallback)(e=>{2!==e.button&&u()},[u]),d=Object(o.useCallback)(e=>{const{pageX:t,pageY:n}=e;l({x:t,y:n}),e.preventDefault(),e.stopPropagation()},[]);return Object(o.useEffect)(()=>{if(null!=s)return document.addEventListener("click",c),document.body.addEventListener("contextmenu",u),()=>{document.removeEventListener("click",c),document.body.removeEventListener("contextmenu",u)}},[s,u,c]),Object(a.jsxs)("div",oo(oo({onContextMenu:d,style:{width:"100%",height:"100%"}},A),{},{children:[Object(a.jsx)(io,{selected:null!=s,offsetTop:null!==(t=null==s?void 0:s.y)&&void 0!==t?t:0,offsetLeft:null!==(n=null==s?void 0:s.x)&&void 0!==n?n:0,children:i()}),r]}))}var so=e=>{const t=Ta(mn),n=Ca($n),r=Ca(fa),i=Ca(ga);return Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ro,{onClick:i,label:"Fullscreen",hotkey:"Alt+Enter"}),Object(a.jsx)(ro,{onClick:r,checked:t,label:"Desktop Mode",hotkey:"Alt+D"}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:()=>n(R.m.MILKDROP),label:"Quit"})]}),children:e.children})};var lo=o.memo(({children:e})=>{const[t]=o.useState(()=>document.createElement("div"));return o.useEffect(()=>(t.classList.add("webamp-desktop"),document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]),l.a.createPortal(e,t)});function uo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ho=function({analyser:e}){const t=Ta(mn),n=Ta(bn),r=Ta(Sn),i=Ta(In),A=Ta(yn),s=Ta(Bt),l=Ca(ga),u=Ca($i),c=Ca(ra),d=Ca(pa),h=function(){const e=Ta(xt),t=Ca($i),n=Ca(ea),r=Ca(ia),i=Ca(ma),a=Ca(oa),A=Ca(aa);return Object(o.useCallback)(o=>{switch(o.keyCode){case 32:t();break;case 8:n(xe.IMMEDIATE);break;case 72:t(xe.IMMEDIATE);break;case 82:r();break;case 76:i(),o.stopPropagation();break;case 84:null!=e&&a(e),o.stopPropagation();break;case 145:case 125:A()}},[a,t,n,A,i,r,e])}();Object(o.useEffect)(()=>{if(!i||!s)return;const e=setInterval(u,15e3);return()=>clearInterval(e)},[i,A,s,u]);const f=function(){const[e]=Object(o.useState)(B.h());return e}(),p=function(){const[e,t]=Object(o.useState)(B.k()),n=Object(o.useCallback)(B.C(()=>{t(B.k())},100),[]);return Object(o.useEffect)(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}),[n]),e}();return t?Object(a.jsx)(lo,{children:Object(a.jsx)(so,{children:Object(a.jsx)(Ra,co(co({},p),{},{analyser:e}))})}):Object(a.jsx)(La,{title:"Milkdrop",windowId:R.m.MILKDROP,onKeyDown:h,children:t=>{const i=n?f:t;return Object(a.jsx)(so,{children:Object(a.jsx)(Fa,{children:Object(a.jsxs)(Wa,{windowId:R.m.MILKDROP,handleDrop:c,children:[r&&Object(a.jsx)(Ka,co({},i)),Object(a.jsx)(ka,{enabled:n,onChange:d,children:Object(a.jsx)("div",{onDoubleClick:l,children:Object(a.jsx)(Ra,co(co({},i),{},{analyser:e}))})})]})})})}})};var fo=()=>{const e=Ca(fr),t=Ca(lr),n=Ca(ur),r=Ca(cr),i=Ca(hr),A=Ca(gr),s=Ca(mr),l=Ca(dr);return Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(ro,{label:"Previous",hotkey:"Z",onClick:e}),Object(a.jsx)(ro,{label:"Play",hotkey:"X",onClick:t}),Object(a.jsx)(ro,{label:"Pause",hotkey:"C",onClick:n}),Object(a.jsx)(ro,{label:"Stop",hotkey:"V",onClick:r}),Object(a.jsx)(ro,{label:"Next",hotkey:"B",onClick:i}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Back 5 seconds",hotkey:"Left",onClick:()=>s(5)}),Object(a.jsx)(ro,{label:"Fwd 5 seconds",hotkey:"Right",onClick:()=>A(5)}),Object(a.jsx)(ro,{label:"10 tracks back",hotkey:"Num. 1",onClick:()=>l(-10)}),Object(a.jsx)(ro,{label:"10 tracks fwd",hotkey:"Num. 3",onClick:()=>l(10)})]})};var po=()=>{const e=Ca(ha),t=Ca(_i),n=Ca(Ui),r=Ta(jn);return Object(a.jsxs)(to,{label:"Skins",children:[Object(a.jsx)(ro,{onClick:t,label:"Load Skin..."}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:e,label:"<Base Skin>"}),r.map(e=>Object(a.jsx)(ro,{onClick:()=>n(e.url),label:e.name},e.url))]})};var go=()=>{const e=Ca(Sr),t=Ca(qn),n=Ca(vr),r=Ca(kr),i=Ta(zt),o=Ta(_n),A=Ta(rn),s=Ta(nn);return Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(po,{}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Time elapsed",hotkey:"(Ctrl+T toggles)",onClick:e,checked:o===R.h.ELAPSED}),Object(a.jsx)(ro,{label:"Time remaining",hotkey:"(Ctrl+T toggles)",onClick:e,checked:o===R.h.REMAINING}),Object(a.jsx)(ro,{label:"Double Size",hotkey:"Ctrl+D",onClick:t,checked:i}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Repeat",hotkey:"R",onClick:n,checked:A}),Object(a.jsx)(ro,{label:"Shuffle",hotkey:"S",onClick:r,checked:s})]})};var mo=Object(o.memo)(({filePickers:e})=>{const t=Ta(Nn),n=Ta(ht),r=Ca(Aa),i=Ca(Ni),A=Ca(ji),s=Ca(nr),l=Ca(()=>({type:"MAIN_CONTEXT_MENU_OPENED"}));return Object(o.useEffect)(()=>{l()},[l]),Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(no,{href:"https://webamp.org/about",target:"_blank",label:"Webamp..."}),Object(a.jsx)(eo,{}),Object(a.jsxs)(to,{label:"Play",children:[Object(a.jsx)(ro,{onClick:i,label:"File...",hotkey:"L"}),null!=e&&e.map((e,n)=>(t||!e.requiresNetwork)&&Object(a.jsx)(ro,{onClick:async()=>{let t;try{t=await e.filePicker()}catch(e){console.error("Error loading from file picker",e)}A(t||[],R.e.PLAY)},label:e.contextMenuName},n))]}),Object(a.jsx)(eo,{}),Object.keys(n).map(e=>Object(a.jsx)(ro,{label:n[e].title,checked:n[e].open,onClick:()=>s(e),hotkey:n[e].hotkey},e)),Object(a.jsx)(eo,{}),Object(a.jsx)(po,{}),Object(a.jsx)(eo,{}),Object(a.jsx)(to,{label:"Options",children:Object(a.jsx)(go,{})}),Object(a.jsx)(to,{label:"Playback",children:Object(a.jsx)(fo,{})}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:r,label:"Exit"})]})});function bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const wo=(e,t)=>{const n=Vn(e,t);return void 0!==n.x||void 0!==n.y};function yo(e){const t=Ta(Jt),n=Ta(pt),r=Ta(sn),i=Ca(rr),[a,A]=Object(o.useState)(null);return Object(o.useEffect)(()=>{if(null==a)return;const{boundingBox:e,moving:t,stationary:n,mouseStart:o}=a,s=a=>{const A={x:B.l(a)-o.x,y:B.m(a)-o.y},s=t.map(e=>Eo(Eo({},e),Yn(e,A))),l=Eo(Eo({},e),Yn(e,A)),u=((e,t)=>{let n=0,r=0;for(const i of e)for(const e of t){const t=Gn(i,e);if(n=n||t.x,r=r||t.y,void 0!==n&&n>0&&void 0!==r&&r>0)break}return{x:n,y:r}})(s,n),c=((e,t)=>{const n=((e,t)=>{let n,r;return e.x-15<0?n=0:e.x+e.width+15>t.width&&(n=t.width-e.width),e.y-15<0?r=0:e.y+e.height+15>t.height&&(r=t.height-e.height),{x:n,y:r}})(e,t);return{x:void 0===n.x?0:n.x-e.x,y:void 0===n.y?0:n.y-e.y}})(l,r),d=((e,...t)=>{const n=t.reduce((e,t)=>({x:0===e.x||0===t.x?e.x+t.x:Math.min(e.x,t.x),y:0===e.y||0===t.y?e.y+t.y:Math.min(e.y,t.y)}));return Yn(e,n)})(A,u,c),h={};t.forEach(e=>{h[e.key]=Yn(e,d)}),i(h,!1)};function l(){A(null)}return window.addEventListener("mouseup",l),window.addEventListener("touchend",l),window.addEventListener("mousemove",s,{passive:!1}),window.addEventListener("touchmove",s,{passive:!1}),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("touchmove",s),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l)}},[r,a,i]),Object(o.useCallback)((r,i)=>{if(!i.target.classList.contains("draggable"))return;const a=B.l(i),o=B.m(i);if(n(r))return;const s=t.filter(t=>null!=e[t.key]&&!n(t.key)),l=s.find(e=>e.key===r);if(null==l)throw new Error("Tried to move a node that does not exist: "+r);let u=new Set([l]);if("main"===r){const e=(c=wo,(e,t)=>{const n=new Set,r=t=>{for(const i of e)!n.has(i)&&c(i,t)&&(n.add(i),r(i))};return r(t),n});u=e(s,l)}var c;const d=s.filter(e=>!u.has(e)),h=Array.from(u),f={x:a,y:o},p=(e=>{const t=e.slice(),n=t.pop();if(null==n)throw new Error("boundingBox must be called with at least one node");const r={top:Rn(n),right:Qn(n),bottom:Fn(n),left:Pn(n)};return t.forEach(e=>{r.top=Math.min(r.top,Rn(e)),r.right=Math.max(r.right,Qn(e)),r.bottom=Math.max(r.bottom,Fn(e)),r.left=Math.min(r.left,Pn(e))}),{x:r.left,y:r.top,width:r.right-r.left,height:r.bottom-r.top}})(h);A({boundingBox:p,moving:h,stationary:d,mouseStart:f})},[n,e,t])}function vo({windows:e}){const t=Ta(Jt),n=Ca(er),r=yo(e),i=t.filter(t=>e[t.key]),A=Object(o.useCallback)(e=>{const{currentTarget:t,relatedTarget:r}=e;t===r||t.contains(r)||n(null)},[n]);return Object(a.jsx)(a.Fragment,{children:i.map(t=>Object(a.jsx)("div",{onBlur:A,onMouseDown:e=>{r(t.key,e)},onTouchStart:e=>{r(t.key,e)},style:{position:"absolute",top:0,left:0,transform:`translate(${t.x}px, ${t.y}px)`,touchAction:"none"},children:e[t.key]},t.key))})}var ko=n(43),So=n.n(ko);function Io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const To=e=>"character-"+So()(e.toString()).toLowerCase().charCodeAt(0);var Co=o.memo(e=>{let{children:t,className:n}=e,r=j()(e,["children","className"]);return Object(a.jsx)("span",Oo(Oo({},r),{},{className:`${n||""} character ${To(t)}`,children:t}))});n(91);const xo=()=>Object(a.jsx)(o.Fragment,{children:[1,7,12,20,25].map((e,t)=>Object(a.jsx)(Co,{style:{left:e},className:"background-character",children:" "},t))});var Uo=()=>{const e=Ta(Ut),t=Ta(Tt),n=Ta(on),r=Ta(_n),i=Ca(Sr);let o=null;e!==R.f.STOPPED&&null!=t&&(o=r===R.h.ELAPSED?n:t-n);const A=Object(B.i)(o),s=r===R.h.REMAINING&&e!==R.f.STOPPED;return Object(a.jsxs)("div",{onClick:i,className:Ba()("mini-time","countdown",{blinking:e===R.f.PAUSED}),children:[Object(a.jsx)(xo,{}),Object(a.jsx)(Co,{style:{left:1},children:s?"-":" "}),Object(a.jsx)(Co,{style:{left:7},children:A.minutesFirstDigit}),Object(a.jsx)(Co,{style:{left:12},children:A.minutesSecondDigit}),Object(a.jsx)(Co,{style:{left:20},children:A.secondsFirstDigit}),Object(a.jsx)(Co,{style:{left:25},children:A.secondsSecondDigit})]})};function Bo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var No=function(e){const[t,n]=Object(o.useState)(!1);return Object(a.jsx)("div",Mo(Mo({},e),{},{className:Ba()(e.className,{clicked:t}),onMouseDown:function(t){n(!0),e.onMouseDown&&e.onMouseDown(t)}}))};function _o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Do(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_o(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lo=function(e){const t=Object(o.useRef)(null),[n,r]=Object(o.useState)(!1);Object(o.useEffect)(()=>{if(n)return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)};function e(e){n&&e.target instanceof Element&&n&&t.current&&!t.current.contains(e.target)&&r(!1)}},[n]);const i=Object(o.useMemo)(()=>n?function(e){if(null==e)return{top:0,left:0};const t=e.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+r,left:t.left+n}}(t.current):{top:0,left:0},[n]),{renderMenu:A,children:s,top:l,bottom:u}=e,c=j()(e,["renderMenu","children","top","bottom"]);return Object(a.jsxs)("div",Do(Do({},c),{},{children:[Object(a.jsx)("div",{className:"handle",style:{width:"100%",height:"100%"},ref:t,onClick:()=>r(!n),children:s}),Object(a.jsx)(io,{selected:n,offsetTop:i.top,offsetLeft:i.left,top:l,bottom:u,children:A()})]}))};function jo(e,t,n){const r=t*n,i=r+t;let a=0;for(let t=r;t<i;t++)a+=e[t];return a/t}function Ro({renderHeight:e,height:t}){const n=Ta(Zt),r=Ta(gt)("main"),i=Object(o.useMemo)(()=>function(e,t,n){const r=document.createElement("canvas");r.width=6,r.height=e;const i=t.slice(2,18),a=r.getContext("2d");if(null==a)throw new Error("Could not construct canvas context");const o=16/n;for(let t=0;t<n;t++){const n=15-Math.floor(t*o);a.fillStyle=i[n];const r=e-2*t;a.fillRect(0,r,6,2)}return r}(t,n,e),[n,t,e]);return Object(o.useCallback)((e,a,o,A)=>{if(o=2*Math.ceil(o),A=2*Math.ceil(A),o>0||A>0){const s=t-o,l=6;if(t>0&&e.drawImage(i,0,s,l,t,a,s,l,t),!r){const r=t-A;e.fillStyle=n[23],e.fillRect(a,r,l,2)}}},[i,n,t,r])}function Fo({renderHeight:e,height:t,analyser:n}){const[r]=Object(o.useState)(()=>new Array(20).fill(0)),[i]=Object(o.useState)(()=>new Array(20).fill(0)),a=n.frequencyBinCount,A=Object(o.useMemo)(()=>function(e){const t=new Array(20).fill(0),n=Math.pow(110.25,.05);t[0]=0,t[1]=200;for(let e=2;e<19;e++)t[e]=t[e-1]*n;t[19]=22050;for(let n=0;n<20;n++){const r=Math.floor(t[n]/22050*e);t[n]=r}return t}(a),[a]),s=Object(o.useMemo)(()=>new Uint8Array(a),[a]),l=Ro({height:t,renderHeight:e});return Object(o.useCallback)(t=>{n.getByteFrequencyData(s);const a=e/256;for(let e=0;e<19;e++){const n=A[e],o=A[e+1];let u=0;for(let e=n;e<o;e++)u+=s[e];u/=o-n;let c=r[e]-.01*Math.pow(i[e],2);c<u?(c=u,i[e]=0):i[e]+=1,r[e]=c,l(t,8*e,u*a,c*a)}},[n,i,r,s,A,l,e])}var Po=function({analyser:e}){Object(o.useLayoutEffect)(()=>{e.fftSize=2048},[e.fftSize]);const t=Ta(Zt),n=Ta($t),r=Ta(Ut),i=Ta(gt),A=Ta(Bn),s=Ca(sa),l=i("main"),u=l?38:76,c=l?5:16,d=2*u,h=2*c,f=Object(o.useMemo)(()=>function(e,t,n,r,i){const a=document.createElement("canvas");a.width=e,a.height=t;const o=a.getContext("2d");if(null==o)throw new Error("Could not construct canvas context");if(o.fillStyle=n,o.fillRect(0,0,e,t),!i){o.fillStyle=r;for(let n=0;n<e;n+=4)for(let e=2;e<t;e+=4)o.fillRect(n,e,2,2)}return a}(d,h,t[0],t[1],Boolean(l)),[t,h,d,l]),p=function({analyser:e,height:t,width:n,renderWidth:r}){const i=Ta(Zt),a=e.fftSize,A=Object(o.useMemo)(()=>new Uint8Array(a),[a]);return Object(o.useCallback)(o=>{e.getByteTimeDomainData(A),o.lineWidth=2,o.strokeStyle=i[18];const s=2*Math.floor(a/n),l=t;o.beginPath();for(let e=0;e<=r;e++){const t=(1-jo(A,s,e)/255)*l,n=2*e;0===n?o.moveTo(n,t):o.lineTo(n,t)}o.stroke()},[e,a,i,A,t,r,n])}({analyser:e,height:h,width:d,renderWidth:u}),g=Fo({analyser:e,height:h,renderHeight:c}),m=Ro({height:h,renderHeight:c}),b=Object(o.useCallback)(e=>{if(r===R.f.PLAYING){if(A)return e.drawImage(f,0,0),void Object.entries(A).forEach(([t,n])=>{m(e,Number(t),n,-1)});switch(n){case R.k.OSCILLOSCOPE:e.drawImage(f,0,0),p(e);break;case R.k.BAR:e.drawImage(f,0,0),g(e);break;default:e.clearRect(0,0,d,h)}}},[f,A,h,m,g,p,r,n,d]),[E,w]=Object(o.useState)(null);return Object(o.useLayoutEffect)(()=>{if(null==E)return;const e=E.getContext("2d");if(null==e)return;e.imageSmoothingEnabled=!1;let t=null;const n=()=>{b(e),t=window.requestAnimationFrame(n)};return n(),()=>{null!=t&&window.cancelAnimationFrame(t)}},[E,b]),r===R.f.STOPPED?null:Object(a.jsx)("canvas",{id:"visualizer",ref:w,style:{width:u,height:c},width:d,height:h,onClick:s})};var Qo=Object(o.memo)(()=>{const e=Ca(fr),t=Ca(lr),n=Ca(ur),r=Ca(hr),i=Ca(cr);return Object(a.jsxs)("div",{className:"actions",children:[Object(a.jsx)("div",{id:"previous",onClick:e,title:"Previous Track"}),Object(a.jsx)("div",{id:"play",onClick:t,title:"Play"}),Object(a.jsx)("div",{id:"pause",onClick:n,title:"Pause"}),Object(a.jsx)("div",{id:"stop",onClick:i,title:"Stop"}),Object(a.jsx)("div",{id:"next",onClick:r,title:"Next Track"})]})});function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Go({style:e,className:t,id:n}){const r=Ta(tn),i=Ca(yr),o=Ca(ua),A=Ca(ca);return Object(a.jsx)("input",{id:n,className:t,type:"range",min:"-100",max:"100",step:"1",value:r,style:Vo(Vo({},e),{},{touchAction:"none"}),onChange:e=>i(Number(e.target.value)),onMouseDown:()=>o("balance"),onMouseUp:A,title:"Balance"})}const Yo=e=>{const t=Math.abs(e)/100;return 15*Math.floor(27*t)};var Ko=Object(o.memo)(()=>{const e=Ta(tn);return Object(a.jsx)(Go,{id:"balance",style:{backgroundPosition:`0 -${Yo(e)}px`}})});var Ho=Object(o.memo)(()=>{const e=Ca(Aa);return Object(a.jsx)(No,{id:"close",onClick:e,title:"Close"})});function Jo(){return ua("double")}function qo(){return e=>{e(qn()),e({type:"UNSET_FOCUS"})}}var Wo=Object(o.memo)(()=>{const e=Ca(Jo),t=Ca(qo),n=Ta(zt);return Object(a.jsxs)("div",{id:"clutter-bar",children:[Object(a.jsx)(Lo,{bottom:!0,renderMenu:()=>Object(a.jsx)(go,{}),children:Object(a.jsx)("div",{id:"button-o"})}),Object(a.jsx)("div",{id:"button-a"}),Object(a.jsx)("div",{id:"button-i"}),Object(a.jsx)("div",{title:"Toggle Doublesize Mode",id:"button-d",className:Ba()({selected:n}),onMouseUp:t,onMouseDown:e}),Object(a.jsx)("div",{id:"button-v"})]})});var Zo=Object(o.memo)(()=>{const e=Ca(Ni);return Object(a.jsx)("div",{id:"eject",onClick:e,title:"Open File(s)"})});function Xo(){return nr("equalizer")}var $o=Object(o.memo)(()=>{const e=Ca(Xo),t=Ta(ft)("equalizer");return Object(a.jsx)("div",{id:"equalizer-button",className:Ba()({selected:t}),onClick:e,title:"Toggle Graphical Equalizer"})});function eA(){return nr("playlist")}var tA=Object(o.memo)(()=>{const e=Ta(ft)("playlist"),t=Ca(eA);return Object(a.jsx)("div",{id:"playlist-button",className:Ba()({selected:e}),onClick:t,title:"Toggle Playlist Editor"})});var nA=Object(o.memo)(e=>{const t=(""+e.children||"").split("");return Object(a.jsx)(o.Fragment,{children:t.map((e,t)=>Object(a.jsx)(Co,{children:e},t+e))})});var rA=Object(o.memo)(()=>{const e=Ta(fn);return Object(a.jsx)("div",{id:"kbps",children:Object(a.jsx)(nA,{children:e||""})})});var iA=Object(o.memo)(()=>{const e=Ta(pn);return Object(a.jsx)("div",{id:"khz",children:Object(a.jsx)(nA,{children:e||""})})});const aA=e=>e.length>=31,oA=e=>aA(e)?`${e} *** ${e}`:e.padEnd(31," ");var AA=o.memo(()=>{const e=Ta(hn),t=Ta(zt),n=Ta(Mn),r=Ca(ba),{handleMouseDown:i,dragOffset:A,dragging:s}=function(){const[e,t]=o.useState(null),[n,r]=o.useState(0);return o.useEffect(()=>{if(null==e)return;const n=e,i=e=>{const t=B.l(e)-n;r(-t)};let a=!1;const o=()=>{a||(document.removeEventListener("mousemove",i),document.removeEventListener("touchmove",i),document.removeEventListener("mouseup",o),document.removeEventListener("touchend",o),t(null),a=!0)};return document.addEventListener("mousemove",i),document.addEventListener("touchmove",i),document.addEventListener("touseup",o),document.addEventListener("touchend",o),o},[e]),{handleMouseDown:o.useCallback(e=>{t(B.l(e))},[]),dragOffset:n,dragging:null!=e}}(),l=((e,t,n)=>{if(!aA(e))return 0;const r=5*t+n,i=5*(e.length+" *** ".length);return(r%(a=i)+a)%a;var a})(e,n,A),u=-l+"px";return function({step:e,dragging:t}){const[n,r]=o.useState(!0);o.useEffect(()=>{if(!1===n)return;const t=setInterval(e,220);return()=>clearInterval(t)},[e,n]),o.useEffect(()=>{if(t)return void r(!1);const e=window.setTimeout(()=>{r(!0)},1e3);return()=>{window.clearTimeout(e)}},[t])}({step:r,dragging:s}),Object(a.jsx)("div",{id:"marquee",className:"text",onMouseDown:i,onTouchStart:i,title:"Song Title",children:Object(a.jsx)("div",{style:{whiteSpace:"nowrap",willChange:"transform",transform:`translateX(${u})`},children:Object(a.jsx)(nA,{children:oA(e)})},t?"doubled":"not-doubled")})});var sA=Object(o.memo)(()=>{const e=Ta(an);return Object(a.jsxs)("div",{className:"mono-stereo",children:[Object(a.jsx)("div",{id:"stereo",className:Ba()({selected:2===e})}),Object(a.jsx)("div",{id:"mono",className:Ba()({selected:1===e})})]})});var lA=Object(o.memo)(()=>{const[e,t]=function(){const e=Ta(Tt),t=Ta(on),n=e?Math.floor(t)/e*100:0,r=Ta(dn);return[n,"position"===Ta(cn)?r:n]}(),n=xa(),r=Object(o.useCallback)(e=>{n({type:"SEEK_TO_PERCENT_COMPLETE",percent:Number(e.target.value)}),n({type:"UNSET_FOCUS"})},[n]),i=Object(o.useCallback)(e=>{n({type:"SET_FOCUS",input:"position"}),n({type:"SET_SCRUB_POSITION",position:Number(e.target.value)})},[n]);let A="";return e<=33?A="left":e>=66&&(A="right"),Object(a.jsx)("input",{id:"position",className:A,type:"range",min:"0",max:"100",step:"1",style:{touchAction:"none"},value:t,onInput:i,onChange:()=>{},onMouseUp:r,onMouseDown:i,title:"Seeking Bar"})});var uA=Object(o.memo)(()=>{const e=Ta(rn),t=Ca(vr);return Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsx)(ro,{checked:e,label:"Repeat",onClick:t,hotkey:"(R)"}),children:Object(a.jsx)("div",{id:"repeat",className:Ba()({selected:e}),onClick:t,title:"Toggle Repeat"})})});var cA=Object(o.memo)(()=>{const e=Ca(Zn);return Object(a.jsx)(No,{id:"shade",onMouseDown:e,onDoubleClick:e=>e.stopPropagation(),title:"Toggle Windowshade Mode"})});var dA=Object(o.memo)(()=>{const e=Ca(la);return Object(a.jsx)(No,{id:"minimize",title:"Minimize",onClick:e})});var hA=Object(o.memo)(()=>{const e=Ta(nn),t=Ca(kr);return Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsx)(ro,{checked:e,label:"Shuffle",onClick:t,hotkey:"(S)"}),children:Object(a.jsx)("div",{id:"shuffle",className:Ba()({selected:e}),onClick:t,title:"Toggle Shuffle"})})});var fA=Object(o.memo)(()=>{const e=Ca(Sr),t=Ta(on),n=Ta(Tt)||0,r=Ta(_n),i=r===R.h.ELAPSED?t:n-t,o=B.i(i);return Object(a.jsxs)("div",{id:"time",onClick:e,className:"countdown",children:[r===R.h.REMAINING&&Object(a.jsx)("div",{id:"minus-sign"}),Object(a.jsx)("div",{id:"minute-first-digit",className:"digit digit-"+o.minutesFirstDigit}),Object(a.jsx)("div",{id:"minute-second-digit",className:"digit digit-"+o.minutesSecondDigit}),Object(a.jsx)("div",{id:"second-first-digit",className:"digit digit-"+o.secondsFirstDigit}),Object(a.jsx)("div",{id:"second-second-digit",className:"digit digit-"+o.secondsSecondDigit})]})});function pA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pA(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pA(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mA({id:e,style:t,className:n}){const r=Ta(en),i=Ca(ua),o=Ca(ca),A=Ca(br);return Object(a.jsx)("input",{id:e,type:"range",min:"0",max:"100",step:"1",value:r,style:gA(gA({},t),{},{touchAction:"none"}),className:n,onChange:e=>A(Number(e.target.value)),onMouseDown:()=>i("volume"),onTouchStart:()=>{i("volume")},onMouseUp:o,onTouchEnd:o,title:"Volume Bar"})}var bA=Object(o.memo)(()=>{const e=Ta(en)/100,t={backgroundPosition:`0 -${15*(Math.round(28*e)-1)}px`};return Object(a.jsx)("div",{id:"volume",style:t,children:Object(a.jsx)(mA,{})})});n(93);function EA(e){return Li(e,R.e.PLAY)}var wA=o.memo(({analyser:e,filePickers:t})=>{const n=Ta(gt)("main"),r=Ta(Ut),i=Ta(Qt),o=Ta(Dn),A=Ta(zt),s=Ta(Vt),l=Ta(Ln),u=Ba()({window:!0,play:r===R.f.PLAYING,stop:r===R.f.STOPPED,pause:r===R.f.PAUSED,selected:i===R.m.MAIN,shade:n,draggable:!0,loading:o,doubled:A,llama:s}),c=Ca(Zn),d=Ca(wr),h=Ca(EA);return Object(a.jsx)(Wa,{id:"main-window",windowId:R.m.MAIN,className:u,handleDrop:h,onWheel:d,children:Object(a.jsxs)(_a,{windowId:R.m.MAIN,children:[Object(a.jsxs)("div",{id:"title-bar",className:"selected draggable",onDoubleClick:c,children:[Object(a.jsx)(Lo,{id:"option-context",bottom:!0,renderMenu:()=>Object(a.jsx)(mo,{filePickers:t}),children:Object(a.jsx)(No,{id:"option",title:"Winamp Menu"})}),n&&Object(a.jsx)(Uo,{}),Object(a.jsx)(dA,{}),Object(a.jsx)(cA,{}),Object(a.jsx)(Ho,{})]}),Object(a.jsxs)("div",{className:"webamp-status",children:[Object(a.jsx)(Wo,{}),!l&&Object(a.jsx)("div",{id:"play-pause"}),Object(a.jsx)("div",{id:"work-indicator",className:Ba()({selected:l})}),Object(a.jsx)(fA,{})]}),Object(a.jsx)(Po,{analyser:e}),Object(a.jsxs)("div",{className:"media-info",children:[Object(a.jsx)(AA,{}),Object(a.jsx)(rA,{}),Object(a.jsx)(iA,{}),Object(a.jsx)(sA,{})]}),Object(a.jsx)(bA,{}),Object(a.jsx)(Ko,{}),Object(a.jsxs)("div",{className:"windows",children:[Object(a.jsx)($o,{}),Object(a.jsx)(tA,{})]}),Object(a.jsx)(lA,{}),Object(a.jsx)(Qo,{}),Object(a.jsx)(Zo,{}),Object(a.jsxs)("div",{className:"shuffle-repeat",children:[Object(a.jsx)(hA,{}),Object(a.jsx)(uA,{})]}),Object(a.jsx)("a",{id:"about",target:"_blank",href:"https://webamp.org/about",title:"About"})]})})});var yA=function({widthOnly:e}){const t=Ta(mt),n=Ca(tr),r=t("playlist");return Object(a.jsx)(Na,{currentSize:r,id:"playlist-resize-target",setWindowSize:e=>{n("playlist",e)},widthOnly:e})};var vA=function(){const e=Ta(Qt),t=Ta(mt)("playlist"),n=Ta(Tt),r=Ta(Dt),i=Ca($n),A=Ca(Xn),s=Ca(er),l=t[0]*R.o,u=Object(o.useMemo)(()=>{if(null==r)return"[No file]";const e=(205+l)/R.b;return r.length>e?r.slice(0,e-1)+R.j:r},[l,r]),c=Object(o.useMemo)(()=>null==r?"":Object(B.j)(n),[n,r]);return Object(a.jsx)("div",{id:"playlist-window-shade",className:Ba()("window","draggable",{selected:e===R.m.PLAYLIST}),style:{width:R.p+l+"px"},onMouseDown:()=>s("playlist"),onDoubleClick:A,children:Object(a.jsx)("div",{className:"left",children:Object(a.jsxs)("div",{className:"right draggable",children:[Object(a.jsx)("div",{id:"playlist-shade-track-title",children:Object(a.jsx)(nA,{children:u})}),Object(a.jsx)("div",{id:"playlist-shade-time",children:Object(a.jsx)(nA,{children:c})}),Object(a.jsx)(yA,{widthOnly:!0}),Object(a.jsx)("div",{id:"playlist-shade-button",onClick:A}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>i("playlist")})]})})})};var kA=Object(o.memo)((function({children:e}){const{ref:t,hover:n}=Oa();return Object(a.jsx)("li",{ref:t,className:Ba()({hover:n}),children:e})}));var SA=Object(o.memo)((function(e){const[t,n]=Object(o.useState)(!1),[r,i]=Object(o.useState)(null),A=Object(o.useCallback)(()=>{setTimeout(()=>{n(!1)},0)},[]);return function(e,t){Object(o.useEffect)(()=>{if(null==e||null==t)return;const n=r=>{const i=r.target;i instanceof Element&&(e.contains(i)||(t(),window.document.removeEventListener("click",n,{capture:!0})))};return window.document.addEventListener("click",n,{capture:!0}),()=>{window.document.removeEventListener("click",n,{capture:!0})}},[e,t])}(r,t?A:null),Object(a.jsxs)("div",{id:e.id,className:Ba()("playlist-menu",{selected:t}),ref:i,onClick:()=>n(e=>!e),children:[Object(a.jsx)("div",{className:"bar"}),t&&Object(a.jsx)("ul",{children:o.Children.map(e.children,(e,t)=>Object(a.jsx)(kA,{children:e},t))})]})}));var IA=()=>{const e=Ta($e),t=Ca(Yi),n=Ca(Gi),r=Ca(Ki);return Object(a.jsxs)(SA,{id:"playlist-add-menu",children:[Object(a.jsx)("div",{className:"add-url",onClick:()=>r(e)}),Object(a.jsx)("div",{className:"add-dir",onClick:()=>t(e)}),Object(a.jsx)("div",{className:"add-file",onClick:()=>n(e)})]})};var OA=()=>{const e=Ca(li),t=Ca(ui),n=Ca(si);return Object(a.jsxs)(SA,{id:"playlist-remove-menu",children:[Object(a.jsx)("div",{className:"remove-misc",onClick:()=>alert("Not supported in Webamp")}),Object(a.jsx)("div",{className:"remove-all",onClick:t}),Object(a.jsx)("div",{className:"crop",onClick:n}),Object(a.jsx)("div",{className:"remove-selected",onClick:e})]})};function TA(){const e=Ca(wi),t=Ca(yi),n=Ca(vi);return Object(a.jsxs)(SA,{id:"playlist-selection-menu",children:[Object(a.jsx)("div",{className:"invert-selection",onClick:e}),Object(a.jsx)("div",{className:"select-zero",onClick:t}),Object(a.jsx)("div",{className:"select-all",onClick:n})]})}function CA(){const e=Ca(ci),t=Ca(di),n=Ca(hi);return Object(a.jsx)(Lo,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ro,{label:"Sort list by title",onClick:n}),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{label:"Reverse list",onClick:e}),Object(a.jsx)(ro,{label:"Randomize list",onClick:t})]}),children:Object(a.jsx)("div",{})})}var xA=()=>{const e=Ca(Qi);return Object(a.jsx)(Lo,{style:{width:"100%",height:"100%"},top:!0,renderMenu:()=>Object(a.jsx)(ro,{onClick:e,label:"Generate HTML playlist"}),children:Object(a.jsx)("div",{})})};var UA=()=>Object(a.jsxs)(SA,{id:"playlist-misc-menu",children:[Object(a.jsx)("div",{className:"sort-list",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(CA,{})}),Object(a.jsx)("div",{className:"file-info",onClick:()=>alert("Not supported in Webamp")}),Object(a.jsx)("div",{className:"misc-options",onClick:e=>e.stopPropagation(),children:Object(a.jsx)(xA,{})})]});function BA(){const e=Ca(ui),t=(Ca(Hi),Ca(Ji));return Object(a.jsxs)(SA,{id:"playlist-list-menu",children:[Object(a.jsx)("div",{className:"new-list",onClick:e}),Object(a.jsx)("div",{className:"save-list",onClick:t}),Object(a.jsx)("div",{className:"load-list"})]})}var MA=()=>{const e=Ta(st),t=Object(o.useMemo)(()=>function(e,t,n){for(;e.length<t;)e+=n;return e}(e,18," "),[e]);return Object(a.jsx)("div",{className:"playlist-running-time-display draggable",children:Object(a.jsx)("div",{children:Object(a.jsx)(nA,{children:t})})})};var NA=()=>{const e=Ca(lr),t=Ca(ur),n=Ca(cr),r=Ca(Ni),i=Ca(hr),A=Ca(fr);return Object(a.jsxs)(o.Fragment,{children:[Object(a.jsx)(MA,{}),Object(a.jsxs)("div",{className:"playlist-action-buttons",children:[Object(a.jsx)("div",{className:"playlist-previous-button",onClick:A}),Object(a.jsx)("div",{className:"playlist-play-button",onClick:e}),Object(a.jsx)("div",{className:"playlist-pause-button",onClick:t}),Object(a.jsx)("div",{className:"playlist-stop-button",onClick:n}),Object(a.jsx)("div",{className:"playlist-next-button",onClick:i}),Object(a.jsx)("div",{className:"playlist-eject-button",onClick:r})]}),Object(a.jsx)(Uo,{})]})};var _A=function({children:e,handleMoveClick:t,index:n,id:r}){const i=Ta(Xt),A=Ta(rt),s=Ta(ct),l=A.has(r),u=s===r,c=xa(),d=Ca(sr),h=Object(o.useCallback)(e=>e.shiftKey?(e.preventDefault(),void c({type:"SHIFT_CLICKED_TRACK",index:n})):e.metaKey||e.ctrlKey?(e.preventDefault(),void c({type:"CTRL_CLICKED_TRACK",index:n})):(l||c({type:"CLICKED_TRACK",index:n}),void t(e)),[c,t,n,l]),f=Object(o.useCallback)(e=>{function i(){d(r)}l||c({type:"CLICKED_TRACK",index:n}),t(e),e.target.addEventListener("touchstart",i),setTimeout(()=>{e.target.removeEventListener("touchstart",i)},250)},[c,t,r,n,d,l]),p={backgroundColor:l?i.selectedbg:void 0,color:u?i.current:void 0};return Object(a.jsx)("div",{className:Ba()("track-cell",{selected:l,current:u}),style:p,onClick:e=>e.stopPropagation(),onMouseDown:h,onTouchStart:f,onContextMenu:e=>e.preventDefault(),onDoubleClick:()=>d(r),children:e})};var DA=({id:e,paddedTrackNumber:t})=>{const n=Ta(Ct)(e);return Object(a.jsxs)("span",{children:[t,". ",n]})};var LA=function(){const e=Ta(kt),t=Ta(St),n=Ta(We),r=Ta(jt),i=Ca(yi),A=Ca(Ei),s=Ca(gi),[l,u]=Object(o.useState)(null),[c,d]=Object(o.useState)(!1),[h,f]=Object(o.useState)(null),p=e=>{d(!0),f(B.m(e))};function g(n){return t.map((t,r)=>Object(a.jsx)(_A,{id:t,index:e+r,handleMoveClick:p,children:n(t,r)},t))}Object(o.useEffect)(()=>{if(null==l||null==h||!1===c)return;const{top:e,bottom:t,left:n,right:r}=l.getBoundingClientRect();let i=0;const a=a=>{const o=B.l(a),s=B.m(a);if(s<e||s>t||o<n||o>r)return;const l=Math.floor((s-h)/R.i);if(l!==i){A(l-i),i=l}},o=()=>d(!1);return window.addEventListener("mouseup",o),window.addEventListener("mousemove",a),window.addEventListener("touchend",o),window.addEventListener("touchmove",a),()=>{window.removeEventListener("mousemove",a),window.removeEventListener("touchmove",a),window.removeEventListener("mouseup",o),window.removeEventListener("touchend",o)}},[c]);const m=r.toString().length,b=t=>(t+1+e).toString().padStart(m," ");return Object(o.useEffect)(()=>{if(null!=l)return l.addEventListener("wheel",s,{passive:!1}),()=>{l.removeEventListener("wheel",s)}},[l,s]),Object(a.jsxs)("div",{ref:u,className:"playlist-tracks",style:{height:"100%",userSelect:"none"},onClick:i,children:[Object(a.jsx)("div",{className:"playlist-track-titles",children:g((e,t)=>Object(a.jsx)(DA,{id:e,paddedTrackNumber:b(t)}))}),Object(a.jsx)("div",{className:"playlist-track-durations",children:g(e=>B.j(n[e].duration))})]})};function jA({value:e,height:t,width:n,handle:r,handleHeight:i,onBeforeChange:A,onChange:s,onAfterChange:l,disabled:u}){const c=Object(o.useRef)(null),d=Object(o.useRef)(null);function h({target:e,clientY:t,touch:n}){const r=c.current,i=d.current;if(null==r||null==i)return null;const a=r.getBoundingClientRect(),o=i.getBoundingClientRect(),{top:u,height:h}=a,{top:f,height:p}=o,g=u+(i.contains(e)?t-f:p/2),m=h-p;function b(e){const t=e-g;s(B.d(t/m,0,1))}if(n){const e=e=>{e.cancelable&&e.preventDefault(),b(e.touches[0].clientY)},t=()=>{null!=l&&l(),document.removeEventListener("touchmove",e),document.removeEventListener("touchend",t)};document.addEventListener("touchmove",e,{passive:!1}),document.addEventListener("touchend",t)}else{const e=e=>{e.preventDefault(),b(e.clientY)},t=()=>{null!=l&&l(),document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)};document.addEventListener("mousemove",e),document.addEventListener("mouseup",t)}null!=A&&A(),b(t)}const f=Math.floor((t-i)*e);return Object(a.jsx)("div",{style:{height:t,width:n},onMouseDown:u?void 0:function(e){e.preventDefault(),h({target:e.target,clientY:e.clientY,touch:!1})},onTouchStart:u?void 0:function(e){h({target:e.target,clientY:e.touches[0].clientY,touch:!0})},ref:c,children:Object(a.jsx)("div",{style:{transform:`translateY(${f}px)`},ref:d,children:r})})}const RA=()=>Object(a.jsx)("div",{className:"playlist-scrollbar-handle",style:{height:18}});function FA(){const e=Ta(Kt)(R.m.PLAYLIST).height,t=Ta(vt),n=Ta(It),r=Ca(fi);return Object(a.jsx)("div",{className:"playlist-scrollbar",style:{marginLeft:5},children:Object(a.jsx)(jA,{height:e-58,handleHeight:18,width:8,value:t/100,onChange:e=>r(100*e),handle:Object(a.jsx)(RA,{}),disabled:n})})}n(95);function PA(e){return e.playlist.trackOrder.length-1}var QA=function({analyser:e}){const t=Ta(kt),n=Ta(mt),r=Ta(Qt),i=Ta(gt),A=Ta(ft),s=Ta(PA),l=Ta(Xt),u=Ta(Kt),c=r===R.m.PLAYLIST,d=Boolean(i(R.m.PLAYLIST)),h=n(R.m.PLAYLIST),f=u(R.m.PLAYLIST),p=Ca($n),g=Ca(Xn),m=Ca(mi),b=Ca(bi),E=Ca(wr),w=Ca(Li),y=h[0]>2,v=!A(R.m.MAIN),k=Object(o.useCallback)((e,n)=>{const r=e.clientY-n.y,i=Object(B.d)(t+Math.round((r-23)/R.i),0,s+1);w(e,R.e.NONE,i)},[w,s,t]);if(d)return Object(a.jsx)(vA,{});const S={color:l.normal,backgroundColor:l.normalbg,fontFamily:l.font+", Arial, sans-serif",height:f.height+"px",width:f.width+"px"},I=Ba()("window","draggable",{selected:c}),O=h[0]%2==0;return Object(a.jsx)(_a,{windowId:R.m.PLAYLIST,children:Object(a.jsxs)(Wa,{id:"playlist-window",windowId:R.m.PLAYLIST,className:I,style:S,handleDrop:k,onWheel:E,children:[Object(a.jsxs)("div",{className:"playlist-top draggable",onDoubleClick:g,children:[Object(a.jsx)("div",{className:"playlist-top-left draggable"}),O&&Object(a.jsx)("div",{className:"playlist-top-left-spacer draggable"}),Object(a.jsx)("div",{className:"playlist-top-left-fill draggable"}),Object(a.jsx)("div",{className:"playlist-top-title draggable"}),O&&Object(a.jsx)("div",{className:"playlist-top-right-spacer draggable"}),Object(a.jsx)("div",{className:"playlist-top-right-fill draggable"}),Object(a.jsxs)("div",{className:"playlist-top-right draggable",children:[Object(a.jsx)("div",{id:"playlist-shade-button",onClick:g}),Object(a.jsx)("div",{id:"playlist-close-button",onClick:()=>p(R.m.PLAYLIST)})]})]}),Object(a.jsxs)("div",{className:"playlist-middle draggable",children:[Object(a.jsx)("div",{className:"playlist-middle-left draggable"}),Object(a.jsx)("div",{className:"playlist-middle-center",children:Object(a.jsx)(LA,{})}),Object(a.jsx)("div",{className:"playlist-middle-right draggable",children:Object(a.jsx)(FA,{})})]}),Object(a.jsxs)("div",{className:"playlist-bottom draggable",children:[Object(a.jsxs)("div",{className:"playlist-bottom-left draggable",children:[Object(a.jsx)(IA,{}),Object(a.jsx)(OA,{}),Object(a.jsx)(TA,{}),Object(a.jsx)(UA,{})]}),Object(a.jsx)("div",{className:"playlist-bottom-center draggable"}),Object(a.jsxs)("div",{className:"playlist-bottom-right draggable",children:[y&&Object(a.jsx)("div",{className:"playlist-visualizer",children:v&&Object(a.jsx)("div",{className:"visualizer-wrapper",children:Object(a.jsx)(Po,{analyser:e})})}),Object(a.jsx)(NA,{}),Object(a.jsx)(BA,{}),Object(a.jsx)("div",{id:"playlist-scroll-up-button",onClick:m}),Object(a.jsx)("div",{id:"playlist-scroll-down-button",onClick:b}),Object(a.jsx)(yA,{})]})]})]})})};const zA=()=>Object(a.jsx)("div",{style:{width:11,height:11,marginLeft:1},className:"slider-handle"});function VA({id:e,onChange:t,band:n}){const r=Ta(Je)[n],i=Object(o.useMemo)(()=>{const{x:e,y:t}={x:(n=(e=>{const t=e/100;return Math.round(27*t)})(r))%14,y:Math.floor(n/14)};var n;return`-${15*e}px -${65*t}px`},[r]),A=Ca(da),s=Ca(ca);return Object(a.jsx)("div",{id:e,className:"band",style:{backgroundPosition:i,height:63},children:Object(a.jsx)(jA,{height:62,width:14,handleHeight:11,value:1-r/100,onBeforeChange:()=>A(n),onChange:e=>t(100*(1-e)),onAfterChange:s,handle:Object(a.jsx)(zA,{})})})}var GA=()=>{const e=Ca(Mr),t=Ta(An);return Object(a.jsx)("div",{id:"on",className:Ba()({selected:t}),onClick:e})};var YA=Object(o.memo)(()=>{const e=Ta(e=>e.equalizer.auto),t=Ca(Nr);return Object(a.jsx)("div",{id:"auto",className:Ba()({selected:e}),onClick:t})});function KA(e,t){const n=function(e,t){const n=e.map(()=>0),r=e.length-1,i=function(e,t){const n=[];for(let r=0;r<e;r++){n.push([]);for(let e=0;e<t;e++)n[r].push(0)}return n}(r+1,r+2);for(let n=1;n<r;n++)i[n][n-1]=1/(e[n]-e[n-1]),i[n][n]=2*(1/(e[n]-e[n-1])+1/(e[n+1]-e[n])),i[n][n+1]=1/(e[n+1]-e[n]),i[n][r+1]=3*((t[n]-t[n-1])/((e[n]-e[n-1])*(e[n]-e[n-1]))+(t[n+1]-t[n])/((e[n+1]-e[n])*(e[n+1]-e[n])));return i[0][0]=2/(e[1]-e[0]),i[0][1]=1/(e[1]-e[0]),i[0][r+1]=3*(t[1]-t[0])/((e[1]-e[0])*(e[1]-e[0])),i[r][r-1]=1/(e[r]-e[r-1]),i[r][r]=2/(e[r]-e[r-1]),i[r][r+1]=3*(t[r]-t[r-1])/((e[r]-e[r-1])*(e[r]-e[r-1])),function(e,t){const n=e.length;for(let t=0;t<n;t++){let r=0,i=Number.NEGATIVE_INFINITY;for(let a=t;a<n;a++)e[a][t]>i&&(r=a,i=e[a][t]);HA(e,t,r);for(let r=t+1;r<n;r++){for(let i=t+1;i<n+1;i++)e[r][i]=e[r][i]-e[t][i]*(e[r][t]/e[t][t]);e[r][t]=0}}for(let r=n-1;r>=0;r--){const i=e[r][n]/e[r][r];t[r]=i;for(let t=r-1;t>=0;t--)e[t][n]-=e[t][r]*i,e[t][r]=0}return t}(i,n)}(e,t),r=e[e.length-1],i=[];let a=1;for(let o=0;o<=r;o++){for(;e[a]<o;)a++;const r=(o-e[a-1])/(e[a]-e[a-1]),A=n[a-1]*(e[a]-e[a-1])-(t[a]-t[a-1]),s=-n[a]*(e[a]-e[a-1])+(t[a]-t[a-1]),l=(1-r)*t[a-1]+r*t[a]+r*(1-r)*(A*(1-r)+s*r);i.push(l)}return i}function HA(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}var JA=function(){const e=Ta(Je),t=Sa(Ta(xn)),[n,r]=Object(o.useState)(null),i=Object(o.useMemo)(()=>{var e;return null!==(e=null==n?void 0:n.getContext("2d"))&&void 0!==e?e:null},[n]),A=function(e){const t=Sa(Ta(Un));return Object(o.useMemo)(()=>null==e||null==t?null:e.createPattern(t,"repeat-x"),[e,t])}(i);return Object(o.useLayoutEffect)(()=>{if(null==i||null==n||null==t||null==A)return;const r=Number(n.width),a=Number(n.height);i.clearRect(0,0,r,a),function({colorPattern:e,sliders:t,canvasCtx:n,preampLineImage:r}){const i=Object(B.x)(t.preamp/100,0,18);n.drawImage(r,0,i,r.width,r.height);const a=R.a.map(e=>t[e]);n.fillStyle=e;const o=[],A=[];a.forEach((e,t)=>{const n=(100-e)/100;o.push(12*t),A.push(Object(B.x)(n,0,18))});const s=KA(o,A),l=o[o.length-1];let u=A[0];for(let e=0;e<=l;e++){const t=Object(B.d)(Math.round(s[e]),0,18),r=Math.min(t,u),i=1+Math.abs(u-t);n.fillRect(2+e,r,1,i),u=t}}({colorPattern:A,sliders:e,canvasCtx:i,preampLineImage:t})},[i,n,A,t,e]),Object(a.jsx)("canvas",{id:"eqGraph",ref:r,width:113,height:19})},qA=n(44);var WA=()=>{const e=Ca(Mi),t=Ca(Pi),n=Ca(Fi);return Object(a.jsx)(Lo,{top:!0,id:"presets-context",renderMenu:()=>Object(a.jsxs)(a.Fragment,{children:[Object(a.jsxs)(to,{label:"Load",children:[qA.presets.map(e=>Object(a.jsx)(ro,{onClick:()=>n(e),label:e.name},e.name)),Object(a.jsx)(eo,{}),Object(a.jsx)(ro,{onClick:e,label:"From Eqf..."})]}),Object(a.jsx)(ro,{onClick:t,label:"Save"})]}),children:Object(a.jsx)("div",{id:"presets"})})};function ZA(){const e=Ta(Qt)===R.m.EQUALIZER,t=Ca($n),n=Ca(Wn);return Object(a.jsxs)(No,{id:"eq-buttons",children:[Object(a.jsx)("div",{id:"equalizer-shade",onClick:n}),Object(a.jsx)("div",{id:"equalizer-close",onClick:()=>t(R.m.EQUALIZER)})]},e?"selected":"unselected")}var XA=()=>{const e=Ta(en),t=Ta(tn),n=Ca(Wn),r=["left","center","right"],i=Object(B.z)(0,100,e,r),o=Object(B.z)(-100,100,t,r);return Object(a.jsxs)("div",{className:"draggable",onDoubleClick:n,style:{width:"100%",height:"100%"},children:[Object(a.jsx)(ZA,{}),Object(a.jsx)(mA,{id:"equalizer-volume",className:i}),Object(a.jsx)(Go,{id:"equalizer-balance",className:o})]})};n(97);var $A=()=>{const e=Ta(zt),t=Ta(Qt),n=Ta(gt),r=t===R.m.EQUALIZER,i=n(R.m.EQUALIZER),o=Ca(Br),A=Ca(Ur),s=Ca(xr),l=Ca(Cr),u=Ca(Or),c=Ca(Wn),d=Ba()({selected:r,doubled:e,shade:i,window:!0,draggable:!0});return Object(a.jsx)("div",{id:"equalizer-window",className:d,children:Object(a.jsx)(_a,{windowId:R.m.EQUALIZER,children:i?Object(a.jsx)(XA,{}):Object(a.jsxs)("div",{children:[Object(a.jsx)("div",{className:"equalizer-top title-bar draggable",onDoubleClick:c,children:Object(a.jsx)(ZA,{})}),Object(a.jsx)(GA,{}),Object(a.jsx)(YA,{}),Object(a.jsx)(JA,{}),Object(a.jsx)(WA,{}),Object(a.jsx)(VA,{id:"preamp",band:"preamp",onChange:o}),Object(a.jsx)("div",{id:"plus12db",onClick:l}),Object(a.jsx)("div",{id:"zerodb",onClick:s}),Object(a.jsx)("div",{id:"minus12db",onClick:A}),R.a.map(e=>{return Object(a.jsx)(VA,{id:(t=e,"band-"+t),band:e,onChange:t=>u(e,t)},e);var t})]})})})};const es={MAIN_BALANCE_BACKGROUND:["#balance"],MAIN_BALANCE_THUMB:["#balance::-webkit-slider-thumb","#balance::-moz-range-thumb"],MAIN_BALANCE_THUMB_ACTIVE:["#balance:active::-webkit-slider-thumb","#balance:active::-moz-range-thumb"],MAIN_PREVIOUS_BUTTON:[".actions #previous"],MAIN_PREVIOUS_BUTTON_ACTIVE:[".actions #previous:active"],MAIN_PLAY_BUTTON:[".actions #play"],MAIN_PLAY_BUTTON_ACTIVE:[".actions #play:active"],MAIN_PAUSE_BUTTON:[".actions #pause"],MAIN_PAUSE_BUTTON_ACTIVE:[".actions #pause:active"],MAIN_STOP_BUTTON:[".actions #stop"],MAIN_STOP_BUTTON_ACTIVE:[".actions #stop:active"],MAIN_NEXT_BUTTON:[".actions #next"],MAIN_NEXT_BUTTON_ACTIVE:[".actions #next:active"],MAIN_EJECT_BUTTON:["#eject"],MAIN_EJECT_BUTTON_ACTIVE:["#eject:active"],MAIN_WINDOW_BACKGROUND:["#main-window"],MAIN_STEREO:[".media-info #stereo",".stop .media-info #stereo.selected"],MAIN_STEREO_SELECTED:[".media-info #stereo.selected"],MAIN_MONO:[".media-info #mono",".stop .media-info #mono.selected"],MAIN_MONO_SELECTED:[".media-info #mono.selected"],NO_MINUS_SIGN:["#time #minus-sign"],MINUS_SIGN:["#time.countdown #minus-sign"],DIGIT_0:[".digit-0"],DIGIT_1:[".digit-1"],DIGIT_2:[".digit-2"],DIGIT_3:[".digit-3"],DIGIT_4:[".digit-4"],DIGIT_5:[".digit-5"],DIGIT_6:[".digit-6"],DIGIT_7:[".digit-7"],DIGIT_8:[".digit-8"],DIGIT_9:[".digit-9"],NO_MINUS_SIGN_EX:["#time #minus-sign"],MINUS_SIGN_EX:["#time.countdown #minus-sign"],DIGIT_0_EX:[".digit-0"],DIGIT_1_EX:[".digit-1"],DIGIT_2_EX:[".digit-2"],DIGIT_3_EX:[".digit-3"],DIGIT_4_EX:[".digit-4"],DIGIT_5_EX:[".digit-5"],DIGIT_6_EX:[".digit-6"],DIGIT_7_EX:[".digit-7"],DIGIT_8_EX:[".digit-8"],DIGIT_9_EX:[".digit-9"],MAIN_PLAYING_INDICATOR:[".play #play-pause"],MAIN_PAUSED_INDICATOR:[".pause #play-pause"],MAIN_STOPPED_INDICATOR:[".stop #play-pause"],MAIN_NOT_WORKING_INDICATOR:["#work-indicator"],MAIN_WORKING_INDICATOR:["#work-indicator.selected"],PLAYLIST_TOP_TILE:[".playlist-top-left-fill",".playlist-top-left-spacer",".playlist-top-right-fill",".playlist-top-right-spacer"],PLAYLIST_TOP_LEFT_CORNER:[".playlist-top-left"],PLAYLIST_TITLE_BAR:[".playlist-top-title"],PLAYLIST_TOP_RIGHT_CORNER:[".playlist-top-right"],PLAYLIST_TOP_TILE_SELECTED:[".selected .playlist-top-left-fill",".selected .playlist-top-left-spacer",".selected .playlist-top-right-fill",".selected .playlist-top-right-spacer"],PLAYLIST_TOP_LEFT_SELECTED:[".selected .playlist-top-left"],PLAYLIST_TITLE_BAR_SELECTED:[".selected .playlist-top-title"],PLAYLIST_TOP_RIGHT_CORNER_SELECTED:[".selected .playlist-top-right"],PLAYLIST_LEFT_TILE:[".playlist-middle-left"],PLAYLIST_RIGHT_TILE:[".playlist-middle-right"],PLAYLIST_SCROLL_HANDLE:[".playlist-scrollbar-handle"],PLAYLIST_SCROLL_HANDLE_SELECTED:[".playlist-middle-right:active .playlist-scrollbar-handle"],PLAYLIST_BOTTOM_TILE:[".playlist-bottom"],PLAYLIST_BOTTOM_LEFT_CORNER:[".playlist-bottom-left"],PLAYLIST_BOTTOM_RIGHT_CORNER:[".playlist-bottom-right"],PLAYLIST_VISUALIZER_BACKGROUND:[".playlist-visualizer"],PLAYLIST_SHADE_BACKGROUND:["#playlist-window-shade"],PLAYLIST_SHADE_BACKGROUND_LEFT:["#playlist-window-shade .left"],PLAYLIST_SHADE_BACKGROUND_RIGHT:["#playlist-window-shade .right"],PLAYLIST_SHADE_BACKGROUND_RIGHT_SELECTED:["#playlist-window-shade.selected .right"],PLAYLIST_ADD_MENU_BAR:["#playlist-add-menu.selected .bar"],PLAYLIST_ADD_URL:["#playlist-add-menu .add-url"],PLAYLIST_ADD_URL_SELECTED:["#playlist-add-menu .hover .add-url"],PLAYLIST_ADD_DIR:["#playlist-add-menu .add-dir"],PLAYLIST_ADD_DIR_SELECTED:["#playlist-add-menu .hover .add-dir"],PLAYLIST_ADD_FILE:["#playlist-add-menu .add-file"],PLAYLIST_ADD_FILE_SELECTED:["#playlist-add-menu .hover .add-file"],PLAYLIST_REMOVE_MENU_BAR:["#playlist-remove-menu.selected .bar"],PLAYLIST_REMOVE_ALL:["#playlist-remove-menu .remove-all"],PLAYLIST_REMOVE_ALL_SELECTED:["#playlist-remove-menu .hover .remove-all"],PLAYLIST_CROP:["#playlist-remove-menu .crop"],PLAYLIST_CROP_SELECTED:["#playlist-remove-menu .hover .crop"],PLAYLIST_REMOVE_SELECTED:["#playlist-remove-menu .remove-selected"],PLAYLIST_REMOVE_SELECTED_SELECTED:["#playlist-remove-menu .hover .remove-selected"],PLAYLIST_REMOVE_MISC:["#playlist-remove-menu .remove-misc"],PLAYLIST_REMOVE_MISC_SELECTED:["#playlist-remove-menu .hover .remove-misc"],PLAYLIST_SELECT_MENU_BAR:["#playlist-selection-menu.selected .bar"],PLAYLIST_INVERT_SELECTION:["#playlist-selection-menu .invert-selection"],PLAYLIST_INVERT_SELECTION_SELECTED:["#playlist-selection-menu .hover .invert-selection"],PLAYLIST_SELECT_ZERO:["#playlist-selection-menu .select-zero"],PLAYLIST_SELECT_ZERO_SELECTED:["#playlist-selection-menu .hover .select-zero"],PLAYLIST_SELECT_ALL:["#playlist-selection-menu .select-all"],PLAYLIST_SELECT_ALL_SELECTED:["#playlist-selection-menu .hover .select-all"],PLAYLIST_CLOSE_SELECTED:["#playlist-close-button:active"],PLAYLIST_COLLAPSE_SELECTED:["#playlist-window #playlist-shade-button:active"],PLAYLIST_EXPAND_SELECTED:["#playlist-window-shade #playlist-shade-button:active"],PLAYLIST_MISC_MENU_BAR:["#playlist-misc-menu.selected .bar"],PLAYLIST_MISC_OPTIONS:["#playlist-misc-menu .misc-options"],PLAYLIST_MISC_OPTIONS_SELECTED:["#playlist-misc-menu .hover .misc-options"],PLAYLIST_FILE_INFO:["#playlist-misc-menu .file-info"],PLAYLIST_FILE_INFO_SELECTED:["#playlist-misc-menu .hover .file-info"],PLAYLIST_SORT_LIST:["#playlist-misc-menu .sort-list"],PLAYLIST_SORT_LIST_SELECTED:["#playlist-misc-menu .hover .sort-list"],PLAYLIST_LIST_BAR:["#playlist-list-menu.selected .bar"],PLAYLIST_NEW_LIST:["#playlist-list-menu .new-list"],PLAYLIST_NEW_LIST_SELECTED:["#playlist-list-menu .hover .new-list"],PLAYLIST_LOAD_LIST:["#playlist-list-menu .load-list"],PLAYLIST_LOAD_LIST_SELECTED:["#playlist-list-menu .hover .load-list"],PLAYLIST_SAVE_LIST:["#playlist-list-menu .save-list"],PLAYLIST_SAVE_LIST_SELECTED:["#playlist-list-menu .hover .save-list"],EQ_WINDOW_BACKGROUND:["#equalizer-window:not(.shade)"],EQ_TITLE_BAR:[".equalizer-top"],EQ_TITLE_BAR_SELECTED:[".selected .equalizer-top"],EQ_SLIDER_BACKGROUND:[".band"],EQ_SLIDER_THUMB:[".band .slider-handle"],EQ_SLIDER_THUMB_SELECTED:[".band:active .slider-handle"],EQ_ON_BUTTON:["#on"],EQ_ON_BUTTON_DEPRESSED:["#on:active"],EQ_ON_BUTTON_SELECTED:["#on.selected"],EQ_ON_BUTTON_SELECTED_DEPRESSED:["#on.selected:active"],EQ_AUTO_BUTTON:["#auto"],EQ_AUTO_BUTTON_DEPRESSED:["#auto:active"],EQ_AUTO_BUTTON_SELECTED:["#auto.selected"],EQ_AUTO_BUTTON_SELECTED_DEPRESSED:["#auto.selected:active"],EQ_GRAPH_BACKGROUND:["#eqGraph"],EQ_PRESETS_BUTTON:["#presets"],EQ_PRESETS_BUTTON_SELECTED:["#presets:active"],EQ_PREAMP_LINE:["#preamp-line"],EQ_SHADE_BACKGROUND:["#equalizer-window.shade"],EQ_SHADE_BACKGROUND_SELECTED:["#equalizer-window.shade.selected"],EQ_SHADE_VOLUME_SLIDER_LEFT:["#equalizer-volume.left::-webkit-slider-thumb","#equalizer-volume.left::-moz-range-thumb"],EQ_SHADE_VOLUME_SLIDER_CENTER:["#equalizer-volume.center::-webkit-slider-thumb","#equalizer-volume.center::-moz-range-thumb"],EQ_SHADE_VOLUME_SLIDER_RIGHT:["#equalizer-volume.right::-webkit-slider-thumb","#equalizer-volume.right::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_LEFT:["#equalizer-balance.left::-webkit-slider-thumb","#equalizer-balance.left::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_CENTER:["#equalizer-balance.center::-webkit-slider-thumb","#equalizer-balance.center::-moz-range-thumb"],EQ_SHADE_BALANCE_SLIDER_RIGHT:["#equalizer-balance.right::-webkit-slider-thumb","#equalizer-balance.right::-moz-range-thumb"],EQ_MAXIMIZE_BUTTON_ACTIVE:["#equalizer-shade:active"],EQ_MINIMIZE_BUTTON_ACTIVE:["#equalizer-window.shade #equalizer-shade:active"],EQ_CLOSE_BUTTON:["#equalizer-window.selected #eq-buttons.clicked #equalizer-close"],EQ_CLOSE_BUTTON_ACTIVE:["#equalizer-window.selected #eq-buttons.clicked #equalizer-close:active"],EQ_SHADE_CLOSE_BUTTON:["#equalizer-window.shade.selected #eq-buttons.clicked #equalizer-close"],EQ_SHADE_CLOSE_BUTTON_ACTIVE:["#equalizer-window.shade.selected #eq-buttons.clicked #equalizer-close:active"],MAIN_POSITION_SLIDER_BACKGROUND:["#position"],MAIN_POSITION_SLIDER_THUMB:["#position::-webkit-slider-thumb","#position::-moz-range-thumb"],MAIN_POSITION_SLIDER_THUMB_SELECTED:["#position:active::-webkit-slider-thumb","#position:active::-moz-range-thumb"],MAIN_SHUFFLE_BUTTON:["#shuffle"],MAIN_SHUFFLE_BUTTON_DEPRESSED:["#shuffle:active"],MAIN_SHUFFLE_BUTTON_SELECTED:["#shuffle.selected"],MAIN_SHUFFLE_BUTTON_SELECTED_DEPRESSED:["#shuffle.selected:active"],MAIN_REPEAT_BUTTON:["#repeat"],MAIN_REPEAT_BUTTON_DEPRESSED:["#repeat:active"],MAIN_REPEAT_BUTTON_SELECTED:["#repeat.selected"],MAIN_REPEAT_BUTTON_SELECTED_DEPRESSED:["#repeat.selected:active"],MAIN_EQ_BUTTON:["#equalizer-button"],MAIN_EQ_BUTTON_SELECTED:["#equalizer-button.selected"],MAIN_EQ_BUTTON_DEPRESSED:["#equalizer-button:active"],MAIN_EQ_BUTTON_DEPRESSED_SELECTED:["#equalizer-button.selected:active"],MAIN_PLAYLIST_BUTTON:["#playlist-button"],MAIN_PLAYLIST_BUTTON_SELECTED:["#playlist-button.selected"],MAIN_PLAYLIST_BUTTON_DEPRESSED:["#playlist-button:active"],MAIN_PLAYLIST_BUTTON_DEPRESSED_SELECTED:["#playlist-button.selected:active"],MAIN_TITLE_BAR:["#title-bar"],MAIN_TITLE_BAR_SELECTED:[".selected #title-bar"],MAIN_EASTER_EGG_TITLE_BAR:[".llama #title-bar"],MAIN_EASTER_EGG_TITLE_BAR_SELECTED:[".llama.selected #title-bar"],MAIN_OPTIONS_BUTTON:[".selected #title-bar #option.clicked"],MAIN_OPTIONS_BUTTON_DEPRESSED:[".selected #title-bar #option:active",".selected #title-bar #option.selected"],MAIN_MINIMIZE_BUTTON:[".selected #title-bar #minimize.clicked"],MAIN_MINIMIZE_BUTTON_DEPRESSED:[".selected #title-bar #minimize:active"],MAIN_SHADE_BUTTON:[".selected #title-bar #shade.clicked"],MAIN_SHADE_BUTTON_DEPRESSED:[".selected #title-bar #shade:active"],MAIN_CLOSE_BUTTON:[".selected #title-bar #close.clicked"],MAIN_CLOSE_BUTTON_DEPRESSED:[".selected #title-bar #close:active"],MAIN_CLUTTER_BAR_BACKGROUND:["#clutter-bar"],MAIN_CLUTTER_BAR_BACKGROUND_DISABLED:["#clutter-bar.disabled"],MAIN_CLUTTER_BAR_BUTTON_O_SELECTED:["#button-o:active","#button-0.selected"],MAIN_CLUTTER_BAR_BUTTON_A_SELECTED:["#button-a:active","#button-a.selected"],MAIN_CLUTTER_BAR_BUTTON_I_SELECTED:["#button-i:active","#button-i.selected"],MAIN_CLUTTER_BAR_BUTTON_D_SELECTED:["#button-d:active","#button-d.selected"],MAIN_CLUTTER_BAR_BUTTON_V_SELECTED:["#button-v:active","#button-v.selected"],MAIN_SHADE_BACKGROUND:[".shade #title-bar"],MAIN_SHADE_BACKGROUND_SELECTED:[".shade.selected #title-bar"],MAIN_SHADE_BUTTON_SELECTED:[".shade.selected #title-bar #shade"],MAIN_SHADE_BUTTON_SELECTED_DEPRESSED:[".shade #title-bar #shade:active"],MAIN_SHADE_POSITION_BACKGROUND:[".shade #position"],MAIN_SHADE_POSITION_THUMB:[".shade #position::-moz-range-thumb",".shade #position::-webkit-slider-thumb"],MAIN_SHADE_POSITION_THUMB_LEFT:[".shade #position.left::-moz-range-thumb",".shade #position.left::-webkit-slider-thumb"],MAIN_SHADE_POSITION_THUMB_RIGHT:[".shade #position.right::-moz-range-thumb",".shade #position.right::-webkit-slider-thumb"],MAIN_VOLUME_BACKGROUND:["#volume"],MAIN_VOLUME_THUMB:["#volume input::-webkit-slider-thumb","#volume input::-moz-range-thumb"],MAIN_VOLUME_THUMB_SELECTED:["#volume input:active::-webkit-slider-thumb","#volume input:active::-moz-range-thumb"],GEN_TOP_CENTER_FILL:[".gen-window .gen-top"],GEN_TOP_LEFT:[".gen-window .gen-top-left"],GEN_TOP_LEFT_END:[".gen-window .gen-top-left-end"],GEN_TOP_RIGHT:[".gen-window .gen-top-right"],GEN_TOP_RIGHT_END:[".gen-window .gen-top-right-end"],GEN_TOP_LEFT_RIGHT_FILL:[".gen-window .gen-top-left-fill",".gen-window .gen-top-right-fill"],GEN_TOP_CENTER_FILL_SELECTED:[".gen-window.selected .gen-top"],GEN_TOP_LEFT_SELECTED:[".gen-window.selected .gen-top-left"],GEN_TOP_LEFT_END_SELECTED:[".gen-window.selected .gen-top-left-end"],GEN_TOP_RIGHT_SELECTED:[".gen-window.selected .gen-top-right"],GEN_TOP_RIGHT_END_SELECTED:[".gen-window.selected .gen-top-right-end"],GEN_TOP_LEFT_RIGHT_FILL_SELECTED:[".gen-window.selected .gen-top-left-fill",".gen-window.selected .gen-top-right-fill"],GEN_BOTTOM_LEFT:[".gen-window .gen-bottom-left"],GEN_BOTTOM_RIGHT:[".gen-window .gen-bottom-right"],GEN_BOTTOM_FILL:[".gen-window .gen-bottom"],GEN_MIDDLE_LEFT:[".gen-window .gen-middle-left"],GEN_MIDDLE_LEFT_BOTTOM:[".gen-window .gen-middle-left-bottom"],GEN_MIDDLE_RIGHT:[".gen-window .gen-middle-right"],GEN_MIDDLE_RIGHT_BOTTOM:[".gen-window .gen-middle-right-bottom"],GEN_CLOSE_SELECTED:[".gen-window .gen-close:active"]};Object.keys(Dr).forEach(e=>{const t=Lr(e),n=e.charCodeAt(0);es[t]=[".character-"+n]}),R.d.forEach(e=>{es["GEN_TEXT_"+e]=[".gen-text-"+e.toLowerCase()],es["GEN_TEXT_SELECTED_"+e]=[".gen-window.selected .gen-text-"+e.toLowerCase()]});const ts={CLOSE:["#title-bar #close"],EQSLID:["#equalizer-window .band"],EQNORMAL:["#equalizer-window"],EQCLOSE:["#equalizer-window #equalizer-close"],EQTITLE:["#equalizer-window .title-bar","#equalizer-window.shade","#equalizer-window.shade input"],MAINMENU:["#main-window #option","#webamp-context-menu .context-menu"],MIN:["#main-window #minimize"],NORMAL:[".window",".window input","#main-window","#main-window.shade #title-bar"],MMENU:["#main-window.shade #option"],PNORMAL:["#playlist-window"],PTBAR:["#playlist-window .playlist-top"],PCLOSE:["#playlist-window #playlist-close-button","#playlist-window-shade #playlist-close-button"],PWINBUT:["#playlist-window #playlist-shade-button","#playlist-window-shade #playlist-shade-button"],POSBAR:["#main-window #position"],PSIZE:["#playlist-window #playlist-resize-target"],PWSSIZE:["#playlist-window-shade #playlist-resize-target"],PWSNORM:["#playlist-window-shade"],PVSCROLL:["#playlist-window .playlist-scrollbar"],SONGNAME:["#main-window #marquee"],TITLEBAR:["#main-window #title-bar"],VOLBAL:["#volume","#volume input","#balance"],WINBUT:["#main-window #shade"],WSNORMAL:["#main-window.shade #title-bar"],WSPOSBAR:["#main-window.shade #position"]};function ns({children:e,id:t}){const n=Object(o.useMemo)(()=>{const e=document.createElement("style");return e.type="text/css",e.id=t,e},[t]);return Object(o.useLayoutEffect)(()=>(document.head.appendChild(n),()=>n.remove()),[n]),Object(s.createPortal)(e,n)}function rs({children:e}){const t=Object(o.useMemo)(()=>document.createElement("div"),[]);return Object(o.useLayoutEffect)(()=>(document.body.appendChild(t),()=>t.remove()),[t]),Object(s.createPortal)(Object(a.jsx)("svg",{height:0,width:0,children:Object(a.jsx)("defs",{children:Object.keys(e).map(t=>Object(a.jsx)("clipPath",{id:t,children:e[t].map((e,t)=>Object(a.jsx)("polygon",{points:e},t))},t))})}),t)}var is=n(45);const as={normal:"mainWindowClipPath",windowshade:"shadeMainWindowClipPath",equalizer:"equalizerWindowClipPath",equalizerws:"shadeEqualizerWindowClipPath"},os={normal:"#main-window:not(.shade)",windowshade:"#main-window.shade",equalizer:"#equalizer-window:not(.shade)",equalizerws:"#equalizer-window.shade"},As={MAIN_BALANCE_BACKGROUND:"MAIN_VOLUME_BACKGROUND",MAIN_BALANCE_THUMB:"MAIN_VOLUME_THUMB",MAIN_BALANCE_THUMB_ACTIVE:"MAIN_VOLUME_THUMB_SELECTED",EQ_MAXIMIZE_BUTTON_ACTIVE:"EQ_MAXIMIZE_BUTTON_ACTIVE_FALLBACK"};function ss(e){return`${e.startsWith("#webamp-context-menu")?"":"#webamp"} ${e}`}const ls=Object(q.createSelector)((function(e){return e.display.skinImages}),(function(e){return e.display.skinCursors}),(function(e){return e.display.skinGenLetterWidths}),Cn,(e,t,n,r)=>{if(!e||!t)return null;const i=[];Object.keys(es).forEach(t=>{const n=e[t]||e[As[t]];n&&es[t].forEach(e=>{i.push(`#webamp ${e} {background-image: url(${n})}`)})}),null!=n&&R.d.forEach(e=>{const t=n["GEN_TEXT_"+e],r=n["GEN_TEXT_SELECTED_"+e];i.push(`#webamp .gen-text-${e.toLowerCase()} {width: ${t}px;}`),i.push(`#webamp .selected .gen-text-${e.toLowerCase()} {width: ${r}px;}`)}),Object.entries(ts).forEach(([e,n])=>{const r=t[e];if(null==r)return;const a=n.map(ss).map(e=>{switch(r.type){case"cur":return`${e} {cursor: url(${r.url}), auto}`;case"ani":try{return Object(is.convertAniBinaryToCSS)(e,r.aniData)}catch(e){return console.error(e),null}}}).filter(Boolean);i.push(...a)}),(e=>Boolean(e.DIGIT_0_EX))(e)&&i.push("#webamp .webamp-status #time #minus-sign { top: 0px; left: -1px; width: 9px; height: 13px; }");for(const[e,t]of Object.entries(r))if(t){const t=os[e],n=as[e];i.push(`#webamp ${t} { clip-path: url(#${n}); }`)}return i.join("\n")}),us=Object(q.createSelector)(Cn,e=>{const t={};for(const[n,r]of Object.entries(e))if(r){t[as[n]]=r}return t});function cs(){const e=Ta(ls),t=Ta(us);return null==e?null:Object(a.jsxs)(a.Fragment,{children:[Object(a.jsx)(ns,{id:"webamp-skin",children:e}),Object(a.jsx)(rs,{children:t})]})}n(101);function ds({media:e,filePickers:t}){const n=Ta(Tn),r=Ta(ht),i=Ta(Gt),A=Ca(ar),s=Ca(er),[u]=Object(o.useState)(()=>{const e=document.createElement("div");return e.id="webamp",e.role="application",e});Object(o.useLayoutEffect)(()=>{u.style.zIndex=String(i)},[u,i]),Object(o.useLayoutEffect)(()=>(document.body.appendChild(u),()=>{document.body.removeChild(u)}),[u]),Object(o.useEffect)(()=>{const e=()=>{null!=u&&(u.style.right="0",u.style.bottom="0",u.style.overflow="hidden",A(B.k()),u.style.right="auto",u.style.bottom="auto",u.style.overflow="visible")};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[A,u]);const c=Object(o.useCallback)(()=>B.t(r,(n,r)=>{if(!n.open)return null;switch(r){case R.m.MAIN:return Object(a.jsx)(wA,{analyser:e.getAnalyser(),filePickers:t});case R.m.EQUALIZER:return Object(a.jsx)($A,{});case R.m.PLAYLIST:return Object(a.jsx)(QA,{analyser:e.getAnalyser()});case R.m.MILKDROP:return Object(a.jsx)(ho,{analyser:e.getAnalyser()});default:throw new Error("Tried to render an unknown window: "+r)}}),[e,t,r]);return n?null:l.a.createPortal(Object(a.jsx)(o.StrictMode,{children:Object(a.jsxs)("div",{onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(null)},children:[Object(a.jsx)(cs,{}),Object(a.jsx)(Ao,{renderContents:()=>Object(a.jsx)(mo,{filePickers:t}),children:Object(a.jsx)(vo,{windows:c()})})]})}),u)}const hs=new Set(["input","textarea","select"]);class fs{constructor(){i()(this,"_listeners",void 0),this._listeners={}}on(e,t){const n=this._listeners[e]||[];n.push(t),this._listeners[e]=n;return()=>{this._listeners[e]=n.filter(e=>e!==t)}}trigger(e,...t){const n=this._listeners[e];n&&n.forEach(e=>e(...t))}dispose(){this._listeners={}}}function ps(e,t={balance:0}){let n=0;const r=e.createGain();r.channelCount=2,r.channelCountMode="explicit",r.channelInterpretation="speakers";const i=e.createChannelSplitter(2),a=e.createGain(),o=e.createGain(),A=e.createChannelMerger(2);function s(e){const t=Number(e);a.gain.value=t>0?1-t:1,o.gain.value=t>0?1:1+t,n=t}r.connect(i),i.connect(a,0),i.connect(o,1),a.connect(A,0,0),o.connect(A,0,1);const l={};return Object.defineProperties(l,{value:{get:function(){return n},set:s,enumerable:!0,configurable:!0}}),Object.defineProperties(r,{balance:{value:l,enumerable:!0,writable:!1,configurable:!0},connect:{value:AudioNode.prototype.connect.bind(A),enumerable:!1,writable:!1,configurable:!0},disconnect:{value:AudioNode.prototype.disconnect.bind(A),enumerable:!1,writable:!1,configurable:!0}}),n!==t.balance&&s(t.balance),r}class gs{on(e,t){return this._emitter.on(e,t)}constructor(e,t){i()(this,"_emitter",void 0),i()(this,"_context",void 0),i()(this,"_source",void 0),i()(this,"_destination",void 0),i()(this,"_audio",void 0),i()(this,"_stalled",void 0),i()(this,"_status",void 0),this._emitter=new fs,this._context=e,this._destination=t,this._audio=document.createElement("audio"),this._audio.crossOrigin="anonymous",this._stalled=!1,this._status=R.f.STOPPED,this._audio.addEventListener("suspend",()=>{this._setStalled(!0)}),this._audio.addEventListener("durationchange",()=>{this._emitter.trigger("loaded"),this._setStalled(!1)}),this._audio.addEventListener("ended",()=>{this._emitter.trigger("ended"),this._setStatus(R.f.STOPPED)}),this._audio.addEventListener("timeupdate",()=>{this._emitter.trigger("positionChange")}),this._audio.addEventListener("error",e=>{switch(this._audio.error.code){case 1:console.error("MEDIA_ERR_ABORTED",e);break;case 2:console.error("MEDIA_ERR_NETWORK",e);break;case 3:console.error("PIPELINE_ERROR_DECODE",e);break;case 4:console.error("MEDIA_ERR_SRC_NOT_SUPPORTED",e)}this._emitter.trigger("ended"),this._setStatus(R.f.STOPPED)}),this._source=this._context.createMediaElementSource(this._audio),this._source.connect(t)}_setStalled(e){this._stalled=e,this._emitter.trigger("stallChanged")}disconnect(){this._source.disconnect()}async loadUrl(e){this._audio.src=e}async play(){this._status!==R.f.PAUSED&&this.seekToTime(0);try{await this._audio.play()}catch(e){}this._setStatus(R.f.PLAYING)}pause(){this._audio.pause(),this._setStatus(R.f.PAUSED)}stop(){this._audio.pause(),this._audio.currentTime=0,this._setStatus(R.f.STOPPED)}seekToTime(e){this._audio.currentTime=Object(B.d)(e,0,this.getDuration()),this._emitter.trigger("positionChange")}getStalled(){return this._stalled}getStatus(){return this._status}getDuration(){const{duration:e}=this._audio;return isNaN(e)||e===1/0?0:e}getTimeElapsed(){return this._audio.currentTime}_setStatus(e){this._status=e,this._emitter.trigger("statusChange")}dispose(){this.stop(),this._emitter.dispose()}}class ms{constructor(){if(i()(this,"_emitter",void 0),i()(this,"_context",void 0),i()(this,"_balance",void 0),i()(this,"_staticSource",void 0),i()(this,"_preamp",void 0),i()(this,"_analyser",void 0),i()(this,"_gainNode",void 0),i()(this,"_source",void 0),i()(this,"_bands",void 0),this._emitter=new fs,this._context=new(window.AudioContext||window.webkitAudioContext),"suspended"===this._context.state){const e=async()=>{await this._context.resume(),"running"===this._context.state&&(document.body.removeEventListener("touchend",e,!1),document.body.removeEventListener("click",e,!1),document.body.removeEventListener("keydown",e,!1))};document.body.addEventListener("touchend",e,!1),document.body.addEventListener("click",e,!1),document.body.addEventListener("keydown",e,!1)}this._staticSource=this._context.createGain(),this._balance=new ps(this._context),this._preamp=this._context.createGain(),this._analyser=this._context.createAnalyser(),this._analyser.fftSize=2048,this._analyser.smoothingTimeConstant=0,this._gainNode=this._context.createGain(),this._source=new gs(this._context,this._staticSource),this._source.on("positionChange",()=>{this._emitter.trigger("timeupdate")}),this._source.on("ended",()=>{this._emitter.trigger("ended")}),this._source.on("statusChange",()=>{switch(this._source.getStatus()){case R.f.PLAYING:this._emitter.trigger("playing")}this._emitter.trigger("timeupdate")}),this._source.on("loaded",()=>{this._emitter.trigger("fileLoaded")}),this._staticSource.connect(this._preamp);let e=this._preamp;this._bands={},R.a.forEach((t,n)=>{const r=this._context.createBiquadFilter();this._bands[t]=r,0===n?r.type="lowshelf":n===R.a.length-1?r.type="highshelf":r.type="peaking",r.frequency.value=t,r.gain.value=0,e.connect(r),e=r}),e.connect(this._balance),this._balance.connect(this._gainNode),this._balance.connect(this._analyser),this._gainNode.connect(this._context.destination)}getAnalyser(){return this._analyser}duration(){return this._source.getDuration()}timeElapsed(){return this._source.getTimeElapsed()}timeRemaining(){return this.duration()-this.timeElapsed()}percentComplete(){return this.timeElapsed()/this.duration()*100}async play(){await this._source.play()}pause(){this._source.pause()}stop(){this._source.stop()}seekToPercentComplete(e){const t=this.duration()*(e/100);this.seekToTime(t)}setVolume(e){this._gainNode.gain.value=e/100}setPreamp(e){const t=e/100*24-12;this._preamp.gain.value=Math.pow(10,t/20)}setBalance(e){this._balance.balance.value=e/100}setEqBand(e,t){const n=t/100*24-12;this._bands[e].gain.value=n}disableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._balance)}enableEq(){this._staticSource.disconnect(),this._staticSource.connect(this._preamp)}on(e,t){this._emitter.on(e,t)}seekToTime(e){this._source.seekToTime(e)}async loadFromUrl(e,t){this._emitter.trigger("waiting"),await this._source.loadUrl(e),this._emitter.trigger("stopWaiting"),t&&this.play()}dispose(){this._source.dispose(),this._emitter.dispose()}}n(103);class bs{constructor(){i()(this,"_teardowns",[]),i()(this,"disposed",void 0),this.disposed=!1}add(...e){if(this.disposed)throw new Error("Attempted to add a new teardown to a disposed disposable.");this._teardowns.push(...e)}dispose(){if(this.disposed)throw new Error("Attempted to dispose disposable which is already disposed.");this._teardowns.forEach(e=>{"function"==typeof e?e():"function"==typeof e.dispose&&e.dispose()}),this._teardowns=[],this.disposed=!0}}class Es{static browserIsSupported(){const e=!(!window.AudioContext&&!window.webkitAudioContext),t=!!window.document.createElement("canvas").getContext;return e&&t&&"undefined"!=typeof Promise}constructor(e){i()(this,"_actionEmitter",void 0),i()(this,"_node",void 0),i()(this,"_disposable",void 0),i()(this,"options",void 0),i()(this,"media",void 0),i()(this,"store",void 0),this._node=null,this._disposable=new bs,this._actionEmitter=new fs,this.options=e;const{initialTracks:t,initialSkin:n,avaliableSkins:r,availableSkins:a,enableHotkeys:o=!1,zIndex:A,requireJSZip:s,requireMusicMetadata:l,handleTrackDropEvent:u,handleAddUrlEvent:c,handleLoadListEvent:d,handleSaveListEvent:h,__butterchurnOptions:f,__customMediaClass:p}=this.options;let g=null;if(null!=f){const{importConvertPreset:e,presetConverterEndpoint:t}=f;null!=e&&null!=t&&(g=async n=>{const{convertPreset:r}=await e();return r(await we(n),t)})}var b;this.media=new(p||ms),this.store=function(e,t,n=[],r,i){let a;r&&(a=Object(B.o)(_e(void 0,{type:"@@init"}),r));const o=wa(Object(m.applyMiddleware)(...[x.withExtraArgument(i),Ea(e),()=>e=>n=>(t.trigger(n.type,n),e(n)),...n].filter(Boolean)));return a?Object(m.createStore)(_e,a,o):Object(m.createStore)(_e,o)}(this.media,this._actionEmitter,this.options.__customMiddlewares,this.options.__initialState,{requireJSZip:s,requireMusicMetadata:l,convertPreset:g,handleTrackDropEvent:u,handleAddUrlEvent:c,handleLoadListEvent:d,handleSaveListEvent:h}),navigator.onLine?this.store.dispatch({type:"NETWORK_CONNECTED"}):this.store.dispatch({type:"NETWORK_DISCONNECTED"}),null!=A&&this.store.dispatch({type:"SET_Z_INDEX",zIndex:A}),e.__butterchurnOptions&&(this.store.dispatch({type:"ENABLE_MILKDROP",open:e.__butterchurnOptions.butterchurnOpen}),this.store.dispatch((b=e.__butterchurnOptions,async e=>{const{getPresets:t,importButterchurn:n}=b;n().then(t=>{e({type:"GOT_BUTTERCHURN",butterchurn:t.default})});const r=(await t()).map(Wi);e(Zi(r))})));const E=()=>this.store.dispatch({type:"NETWORK_CONNECTED"}),w=()=>this.store.dispatch({type:"NETWORK_DISCONNECTED"});window.addEventListener("online",E),window.addEventListener("offline",w),this._disposable.add(()=>{window.removeEventListener("online",E),window.removeEventListener("offline",w)}),n?this.store.dispatch(Ui(n.url)):this.store.dispatch({type:"LOADED"}),t&&this._bufferTracks(t),null!=r?(console.warn("The misspelled option `avaliableSkins` is deprecated. Please use `availableSkins` instead."),this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:r})):null!=a&&this.store.dispatch({type:"SET_AVAILABLE_SKINS",skins:a});const y=e.__initialWindowLayout;null==y?this.store.dispatch(or()):(B.s(y,(e,t)=>{null!=e.size&&this.store.dispatch(tr(t,e.size))}),this.store.dispatch(rr(B.t(y,e=>e.position),!1))),o&&this._disposable.add(function(e){let t=0;const n=[78,85,76,76,83,79,70,84],r=r=>{if(!(r.target instanceof Element&&hs.has(r.target.tagName.toLowerCase()))){if(r.ctrlKey)switch(r.keyCode){case 68:e(qn()),r.preventDefault();break;case 76:break;case 82:e({type:"REVERSE_LIST"});break;case 84:e({type:"TOGGLE_TIME_MODE"})}else if(r.altKey)switch(r.keyCode){case 87:e(nr("main"));break;case 69:e(nr("playlist"));break;case 71:e(nr("equalizer"))}else switch(r.keyCode){case 37:e(mr(5));break;case 38:e(Er(1));break;case 39:e(gr(5));break;case 40:e(Er(-1));break;case 66:e(hr());break;case 67:e(ur());break;case 76:e(Ni());break;case 82:e({type:"TOGGLE_REPEAT"});break;case 83:e({type:"TOGGLE_SHUFFLE"});break;case 86:e({type:"STOP"});break;case 88:e(lr());break;case 90:e(fr());break;case 96:e(Ni());break;case 97:e(dr(-10));break;case 98:e(Er(-1));break;case 99:e(dr(10));break;case 100:e(fr());break;case 101:e(lr());break;case 102:e(hr());break;case 103:e(mr(5));break;case 104:e(Er(1));break;case 105:e(gr(5))}27!==r.keyCode&&(t=r.keyCode===n[t]?t+1:0,t===n.length&&e({type:"TOGGLE_LLAMA_MODE"}))}};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}}(this.store.dispatch))}play(){this.store.dispatch(lr())}pause(){this.store.dispatch(ur())}stop(){this.store.dispatch({type:"STOP"})}seekBackward(e){this.store.dispatch(mr(e))}seekForward(e){this.store.dispatch(gr(e))}seekToTime(e){this.store.dispatch(pr(e))}nextTrack(){this.store.dispatch(hr())}previousTrack(){this.store.dispatch(fr())}_bufferTracks(e){const t=$e(this.store.getState());this.store.dispatch(ji(e,R.e.BUFFER,t))}appendTracks(e){const t=$e(this.store.getState());this.store.dispatch(ji(e,R.e.NONE,t))}setTracksToPlay(e){this.store.dispatch(ji(e,R.e.PLAY))}getMediaStatus(){return Ut(this.store.getState())}onWillClose(e){return this._actionEmitter.on("CLOSE_REQUESTED",t=>{e(t.cancel)})}onClose(e){return this._actionEmitter.on("CLOSE_WINAMP",e)}close(){this.store.dispatch(e=>{let t=!1;e({type:"CLOSE_REQUESTED",cancel:()=>{t=!0}}),t||(e({type:"STOP"}),e({type:"CLOSE_WINAMP"}))})}reopen(){this.store.dispatch({type:"OPEN_WINAMP"})}onTrackDidChange(e){let t=null;return this.store.subscribe(()=>{const n=this.store.getState(),r=Nt(n);r!==t&&(t=r,e(null==r?null:_t(n)))})}onMinimize(e){return this._actionEmitter.on("MINIMIZE_WINAMP",e)}setSkinFromUrl(e){this.store.dispatch(Ui(e))}async skinIsLoaded(){var e,t;await(e=this.store,t=e=>!e.display.loading,new Promise(n=>{if(t(e.getState()))return void n();const r=e.subscribe(()=>{t(e.getState())&&(n(),r())})})),await Promise.all([xn(this.store.getState()),Un(this.store.getState())])}__loadSerializedState(e){this.store.dispatch(function(e){return t=>{t({type:"LOAD_SERIALIZED_STATE",serializedState:e}),t(Ar())}}(e))}__getSerializedState(){return{version:1,media:H((e=this.store.getState()).media),equalizer:e.equalizer,display:te(e.display),windows:z(e.windows)};var e}__onStateChange(e){return this.store.subscribe(e)}async renderWhenReady(e){var t;if(this.store.dispatch((t=e,(e,n)=>{if(!n().windows.positionsAreRelative)return;const{left:r,top:i}=t.getBoundingClientRect(),{scrollWidth:a,scrollHeight:o}=t;e(ir({left:r,top:i,width:a,height:o}))})),await this.skinIsLoaded(),null!=this._node)throw new Error("Cannot render a Webamp instance twice");this._node=e,this._disposable.add(()=>{null!=this._node&&(l.a.unmountComponentAtNode(this._node),this._node=null)}),l.a.render(Object(a.jsx)(p,{store:this.store,children:Object(a.jsx)(ds,{media:this.media,filePickers:this.options.filePickers||[]})}),e)}dispose(){this.media.dispose(),this._actionEmitter.dispose(),this._disposable.dispose()}}i()(Es,"VERSION","1.5.0");t.default=Es},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function A(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,A)}s((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(10),a=n(16),o=n(8),A=n(22),s=i("music-metadata:parser:ID3v1");t.Genres=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"];const l={len:128,get:(e,t)=>{const n=new u(3).get(e,t);return"TAG"===n?{header:n,title:new u(30).get(e,t+3),artist:new u(30).get(e,t+33),album:new u(30).get(e,t+63),year:new u(4).get(e,t+93),comment:new u(28).get(e,t+97),zeroByte:o.UINT8.get(e,t+127),track:o.UINT8.get(e,t+126),genre:o.UINT8.get(e,t+127)}:null}};class u extends o.StringType{constructor(e){super(e,"binary")}get(e,t){let n=super.get(e,t);return n=a.default.trimRightNull(n),n=n.trim(),n.length>0?n:void 0}}class c extends A.BasicParser{static getGenre(e){if(e<t.Genres.length)return t.Genres[e]}parse(){return r(this,void 0,void 0,(function*(){if(!this.tokenizer.fileSize)return void s("Skip checking for ID3v1 because the file-size is unknown");const e=this.tokenizer.fileSize-l.len;if(this.tokenizer.position>e)return void s("Already consumed the last 128 bytes");const t=yield this.tokenizer.readToken(l,e);if(t){s("ID3v1 header found at: pos=%s",this.tokenizer.fileSize-l.len);for(const e of["title","artist","album","comment","track","year"])t[e]&&""!==t[e]&&this.addTag(e,t[e]);const e=c.getGenre(t.genre);e&&this.addTag("genre",e)}else s("ID3v1 header not found at: pos=%s",this.tokenizer.fileSize-l.len)}))}addTag(e,t){this.metadata.addTag("ID3v1",e,t)}}t.ID3v1Parser=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(109);class i extends r.Readable{constructor(e){super(),this.buf=e}_read(){this.push(this.buf),this.push(null)}}t.ID3Stream=i},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function A(){A.init.call(this)}e.exports=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?A.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,a,o,A;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,A=s,console&&console.warn&&console.warn(A)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function f(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),A.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},A.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},A.prototype.getMaxListeners=function(){return u(this)},A.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var A=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw A.context=o,A}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var l=s.length,u=g(s,l);for(n=0;n<l;++n)a(u[n],this,t)}return!0},A.prototype.addListener=function(e,t){return c(this,e,t,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(e,t){return c(this,e,t,!0)},A.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},A.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},A.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,a=Object.keys(n);for(r=0;r<a.length;++r)"removeListener"!==(i=a[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},A.prototype.listeners=function(e){return f(this,e,!0)},A.prototype.rawListeners=function(e){return f(this,e,!1)},A.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},A.prototype.listenerCount=p,A.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(110)).Stream=t,t.Readable=t,t.Writable=n(56),t.Duplex=n(26),t.Transform=n(114),t.PassThrough=n(156)},function(e,t,n){"use strict";(function(t,r,i){var a=n(47);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var A,s=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;b.WritableState=m;var l=Object.create(n(37));l.inherits=n(33);var u={deprecate:n(155)},c=n(111),d=n(48).Buffer,h=i.Uint8Array||function(){};var f,p=n(112);function g(){}function m(e,t){A=A||n(26),e=e||{};var r=t instanceof A;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),S(e,t))}(e,n,r,t,i);else{var o=v(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),r?s(w,e,n,o,i):w(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function b(e){if(A=A||n(26),!(f.call(b,this)||this instanceof A))return new b(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),c.call(this)}function E(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var A=0,s=!0;n;)i[A]=n,n.isBuf||(s=!1),n=n.next,A+=1;i.allBuffers=s,E(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,u=n.encoding,c=n.callback;if(E(e,t,!1,t.objectMode?1:l.length,l,u,c),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function v(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=v(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(b,c),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:u.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===b&&(e&&e._writableState instanceof m)}})):f=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,A=!i.objectMode&&(r=e,d.isBuffer(r)||r instanceof h);return A&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),A?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(A||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var A=t.objectMode?1:r.length;t.length+=A;var s=t.length<t.highWaterMark;s||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else E(e,t,!1,A,r,i,a);return s}(this,i,A,e,t,n)),o},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=p.destroy,b.prototype._undestroy=p.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(32),n(107).setImmediate,n(19))},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),i=n(10),a=n(116),o=i("music-metadata:parser:ogg:vorbis1");t.VorbisParser=class{constructor(e,t){this.metadata=e,this.options=t,this.codecName="Vorbis I",this.pageSegments=[]}parsePage(t,n){if(t.headerType.firstPage)this.parseFirstPage(t,n);else{if(t.headerType.continued){if(0===this.pageSegments.length)throw new Error("Cannot continue on previous page");this.pageSegments.push(n)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){const t=e.concat(this.pageSegments);this.parseFullPage(t)}this.pageSegments=t.headerType.lastPage?[]:[n]}}t.headerType.lastPage&&this.calculateDuration(t)}flush(){this.parseFullPage(e.concat(this.pageSegments))}parseFirstPage(e,t){o("Parse first page");const n=a.CommonHeader.get(t,0);if("vorbis"!==n.vorbis)throw new Error("Metadata does not look like Vorbis");if(1!==n.packetType)throw new Error("First Ogg page should be type 1: the identification header");{const e=a.IdentificationHeader.get(t,a.CommonHeader.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),o("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}}parseFullPage(e){const t=a.CommonHeader.get(e,0);switch(o("Parse full page: type=%s, byteLength=%s",t.packetType,e.byteLength),t.packetType){case 3:return this.parseUserCommentList(e,a.CommonHeader.len)}}calculateDuration(e){this.metadata.format.sampleRate&&e.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",e.absoluteGranulePosition),this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate))}parseUserCommentList(e,t){const n=r.UINT32_LE.get(e,t);t+=4;new r.StringType(n,"utf-8").get(e,t);t+=n;let i=r.UINT32_LE.get(e,t);for(t+=4;i-- >0;)t+=this.parseUserComment(e,t)}parseUserComment(e,t){const n=r.UINT32_LE.get(e,t),i=new r.StringType(n,"utf-8").get(e,t+4),A=i.indexOf("="),s=i.slice(0,A).toUpperCase();let l=i.slice(A+1);return"METADATA_BLOCK_PICTURE"===s&&(l=this.options.skipCovers?null:a.VorbisPictureToken.fromBase64(l)),null!==l&&(o("Push tag: id=%s, value=%s",s,l),this.metadata.addTag("vorbis",s,l)),r.UINT32_LE.len+n}}}).call(this,n(11).Buffer)},function(e,t,n){"use strict";
25
25
  /** @license React v17.0.1
26
26
  * react-jsx-runtime.production.min.js
27
27
  *