@exezt-/webamp 1.5.0-0x717 → 1.5.0-0x719
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.
- package/built/webamp.bundle.js +428 -427
- package/built/webamp.bundle.min.js +5 -5
- package/built/webamp.lazy-bundle.js +189 -188
- package/built/webamp.lazy-bundle.min.js +3 -3
- package/package.json +1 -1
package/built/webamp.bundle.js
CHANGED
|
@@ -1759,7 +1759,7 @@ formatters.j = function (v) {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
};
|
|
1761
1761
|
|
|
1762
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(
|
|
1762
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32)))
|
|
1763
1763
|
|
|
1764
1764
|
/***/ }),
|
|
1765
1765
|
/* 11 */
|
|
@@ -4056,7 +4056,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4056
4056
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return combineReducers; });
|
|
4057
4057
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
|
|
4058
4058
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return createStore; });
|
|
4059
|
-
/* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
4059
|
+
/* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(30);
|
|
4060
4060
|
|
|
4061
4061
|
|
|
4062
4062
|
/**
|
|
@@ -6787,428 +6787,143 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
6787
6787
|
|
|
6788
6788
|
/***/ }),
|
|
6789
6789
|
/* 26 */
|
|
6790
|
-
/***/ (function(module,
|
|
6790
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
6791
6791
|
|
|
6792
6792
|
"use strict";
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6793
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
6794
|
+
//
|
|
6795
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
6796
|
+
// copy of this software and associated documentation files (the
|
|
6797
|
+
// "Software"), to deal in the Software without restriction, including
|
|
6798
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
6799
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
6800
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
6801
|
+
// following conditions:
|
|
6802
|
+
//
|
|
6803
|
+
// The above copyright notice and this permission notice shall be included
|
|
6804
|
+
// in all copies or substantial portions of the Software.
|
|
6805
|
+
//
|
|
6806
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
6807
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
6808
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
6809
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
6810
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
6811
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
6812
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
6797
6813
|
|
|
6814
|
+
// a duplex stream is just a stream that is both readable and writable.
|
|
6815
|
+
// Since JS doesn't have multiple prototypal inheritance, this class
|
|
6816
|
+
// prototypally inherits from Readable, and then parasitically from
|
|
6817
|
+
// Writable.
|
|
6798
6818
|
|
|
6799
|
-
class WinampTelegramCustomHandler {
|
|
6800
|
-
constructor(emit, options) {
|
|
6801
|
-
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "webamp", void 0);
|
|
6802
6819
|
|
|
6803
|
-
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "maxFileSize", 0x1400000);
|
|
6804
6820
|
|
|
6805
|
-
|
|
6821
|
+
/*<replacement>*/
|
|
6806
6822
|
|
|
6807
|
-
|
|
6823
|
+
var pna = __webpack_require__(47);
|
|
6824
|
+
/*</replacement>*/
|
|
6808
6825
|
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6826
|
+
/*<replacement>*/
|
|
6827
|
+
var objectKeys = Object.keys || function (obj) {
|
|
6828
|
+
var keys = [];
|
|
6829
|
+
for (var key in obj) {
|
|
6830
|
+
keys.push(key);
|
|
6831
|
+
}return keys;
|
|
6832
|
+
};
|
|
6833
|
+
/*</replacement>*/
|
|
6812
6834
|
|
|
6813
|
-
|
|
6814
|
-
localStorage.setItem("appState", JSON.stringify(this.webamp.__getSerializedState()));
|
|
6815
|
-
});
|
|
6835
|
+
module.exports = Duplex;
|
|
6816
6836
|
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
Accept: "application/json",
|
|
6822
|
-
"Content-Type": "application/json"
|
|
6823
|
-
}
|
|
6824
|
-
}).then(async response => {
|
|
6825
|
-
if (response.status === 200) {
|
|
6826
|
-
return response.text();
|
|
6827
|
-
} else {
|
|
6828
|
-
return null;
|
|
6829
|
-
}
|
|
6830
|
-
}).then(async response => {
|
|
6831
|
-
if (response !== null) {
|
|
6832
|
-
var _JSON$parse;
|
|
6837
|
+
/*<replacement>*/
|
|
6838
|
+
var util = Object.create(__webpack_require__(37));
|
|
6839
|
+
util.inherits = __webpack_require__(33);
|
|
6840
|
+
/*</replacement>*/
|
|
6833
6841
|
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
this.saveLastPlaylist(playlistLink);
|
|
6842
|
+
var Readable = __webpack_require__(110);
|
|
6843
|
+
var Writable = __webpack_require__(56);
|
|
6837
6844
|
|
|
6838
|
-
|
|
6839
|
-
if (i === 0) {
|
|
6840
|
-
this.webamp.setTracksToPlay([{
|
|
6841
|
-
defaultName: item.name,
|
|
6842
|
-
url: `${item.file}&public_key=${item.public_key}`
|
|
6843
|
-
}]);
|
|
6844
|
-
} else {
|
|
6845
|
-
this.webamp.appendTracks([{
|
|
6846
|
-
defaultName: item.name,
|
|
6847
|
-
url: `${item.file}&public_key=${item.public_key}`
|
|
6848
|
-
}]);
|
|
6849
|
-
}
|
|
6845
|
+
util.inherits(Duplex, Readable);
|
|
6850
6846
|
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6847
|
+
{
|
|
6848
|
+
// avoid scope creep, the keys array can then be collected
|
|
6849
|
+
var keys = objectKeys(Writable.prototype);
|
|
6850
|
+
for (var v = 0; v < keys.length; v++) {
|
|
6851
|
+
var method = keys[v];
|
|
6852
|
+
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
|
|
6853
|
+
}
|
|
6854
|
+
}
|
|
6856
6855
|
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
await fetch(track.url, {
|
|
6860
|
-
method: "GET"
|
|
6861
|
-
}).then(response => response).then(resp => fetch(resp.url)).then(async response => {
|
|
6862
|
-
if (response.status === 302) {
|
|
6863
|
-
return await fetch(`${response.headers.get("Location")}&public_key=${public_key}`);
|
|
6864
|
-
} else {
|
|
6865
|
-
return response;
|
|
6866
|
-
}
|
|
6867
|
-
}).then(res => {
|
|
6868
|
-
var _res$body;
|
|
6856
|
+
function Duplex(options) {
|
|
6857
|
+
if (!(this instanceof Duplex)) return new Duplex(options);
|
|
6869
6858
|
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
return new ReadableStream({
|
|
6873
|
-
start(controller) {
|
|
6874
|
-
// @ts-ignore
|
|
6875
|
-
function pump() {
|
|
6876
|
-
// @ts-ignore
|
|
6877
|
-
return read === null || read === void 0 ? void 0 : read.read().then(({
|
|
6878
|
-
done,
|
|
6879
|
-
value
|
|
6880
|
-
}) => {
|
|
6881
|
-
if (done) {
|
|
6882
|
-
controller.close();
|
|
6883
|
-
return;
|
|
6884
|
-
}
|
|
6859
|
+
Readable.call(this, options);
|
|
6860
|
+
Writable.call(this, options);
|
|
6885
6861
|
|
|
6886
|
-
|
|
6887
|
-
return pump();
|
|
6888
|
-
});
|
|
6889
|
-
}
|
|
6862
|
+
if (options && options.readable === false) this.readable = false;
|
|
6890
6863
|
|
|
6891
|
-
|
|
6892
|
-
}
|
|
6864
|
+
if (options && options.writable === false) this.writable = false;
|
|
6893
6865
|
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
let tracks = this.getAllTracks();
|
|
6897
|
-
this.replaceTrack(track, tracks);
|
|
6898
|
-
}).catch(err => err);
|
|
6899
|
-
});
|
|
6866
|
+
this.allowHalfOpen = true;
|
|
6867
|
+
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
|
|
6900
6868
|
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
return this.webamp.store.getState().tracks[trackId];
|
|
6904
|
-
});
|
|
6869
|
+
this.once('end', onend);
|
|
6870
|
+
}
|
|
6905
6871
|
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6872
|
+
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
|
|
6873
|
+
// making it explicit this property is not enumerable
|
|
6874
|
+
// because otherwise some prototype manipulation in
|
|
6875
|
+
// userland will fail
|
|
6876
|
+
enumerable: false,
|
|
6877
|
+
get: function () {
|
|
6878
|
+
return this._writableState.highWaterMark;
|
|
6879
|
+
}
|
|
6880
|
+
});
|
|
6909
6881
|
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
} else {
|
|
6916
|
-
a.push(value);
|
|
6917
|
-
}
|
|
6918
|
-
});
|
|
6919
|
-
this.webamp.setTracksToPlay(a);
|
|
6920
|
-
});
|
|
6882
|
+
// the no-half-open enforcer
|
|
6883
|
+
function onend() {
|
|
6884
|
+
// if we allow half-open state, or if the writable side ended,
|
|
6885
|
+
// then we're ok.
|
|
6886
|
+
if (this.allowHalfOpen || this._writableState.ended) return;
|
|
6921
6887
|
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6888
|
+
// no more data can be written.
|
|
6889
|
+
// But allow more writes to happen in this tick.
|
|
6890
|
+
pna.nextTick(onEndNT, this);
|
|
6891
|
+
}
|
|
6925
6892
|
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6893
|
+
function onEndNT(self) {
|
|
6894
|
+
self.end();
|
|
6895
|
+
}
|
|
6929
6896
|
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6897
|
+
Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
6898
|
+
get: function () {
|
|
6899
|
+
if (this._readableState === undefined || this._writableState === undefined) {
|
|
6900
|
+
return false;
|
|
6901
|
+
}
|
|
6902
|
+
return this._readableState.destroyed && this._writableState.destroyed;
|
|
6903
|
+
},
|
|
6904
|
+
set: function (value) {
|
|
6905
|
+
// we ignore the value if the stream
|
|
6906
|
+
// has not been initialized yet
|
|
6907
|
+
if (this._readableState === undefined || this._writableState === undefined) {
|
|
6908
|
+
return;
|
|
6909
|
+
}
|
|
6934
6910
|
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6911
|
+
// backward compatibility, the user is explicitly
|
|
6912
|
+
// managing destroyed
|
|
6913
|
+
this._readableState.destroyed = value;
|
|
6914
|
+
this._writableState.destroyed = value;
|
|
6915
|
+
}
|
|
6916
|
+
});
|
|
6938
6917
|
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
let balance = opts.media.balance;
|
|
6943
|
-
let eq1 = opts.equalizer.sliders.preamp;
|
|
6944
|
-
let eq2 = opts.equalizer.sliders["60"];
|
|
6945
|
-
let eq3 = opts.equalizer.sliders["170"];
|
|
6946
|
-
let eq4 = opts.equalizer.sliders["310"];
|
|
6947
|
-
let eq5 = opts.equalizer.sliders["600"];
|
|
6948
|
-
let eq6 = opts.equalizer.sliders["1000"];
|
|
6949
|
-
let eq7 = opts.equalizer.sliders["3000"];
|
|
6950
|
-
let eq8 = opts.equalizer.sliders["6000"];
|
|
6951
|
-
let eq9 = opts.equalizer.sliders["12000"];
|
|
6952
|
-
let eq10 = opts.equalizer.sliders["14000"];
|
|
6953
|
-
let eq11 = opts.equalizer.sliders["16000"];
|
|
6954
|
-
let equal = [eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11];
|
|
6955
|
-
let bands = [60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000];
|
|
6956
|
-
this.webamp.store.dispatch({
|
|
6957
|
-
type: "SET_VOLUME",
|
|
6958
|
-
volume: Object(_utils__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "d"])(vol, 0, 100)
|
|
6959
|
-
});
|
|
6960
|
-
this.webamp.store.dispatch({
|
|
6961
|
-
type: "SET_BALANCE",
|
|
6962
|
-
balance: balance
|
|
6963
|
-
});
|
|
6964
|
-
this.webamp.store.dispatch({
|
|
6965
|
-
type: "SET_BAND_VALUE",
|
|
6966
|
-
band: "preamp",
|
|
6967
|
-
value: opts.equalizer.sliders.preamp
|
|
6968
|
-
});
|
|
6969
|
-
|
|
6970
|
-
for (const band of bands) {
|
|
6971
|
-
this.webamp.store.dispatch({
|
|
6972
|
-
type: "SET_BAND_VALUE",
|
|
6973
|
-
band: band,
|
|
6974
|
-
value: equal[i]
|
|
6975
|
-
});
|
|
6976
|
-
i++;
|
|
6977
|
-
}
|
|
6978
|
-
|
|
6979
|
-
if (window.__webamp.store.getState().media.shuffle !== opts.media.shuffle) {
|
|
6980
|
-
this.webamp.store.dispatch({
|
|
6981
|
-
type: "TOGGLE_SHUFFLE"
|
|
6982
|
-
});
|
|
6983
|
-
}
|
|
6984
|
-
|
|
6985
|
-
if (window.__webamp.store.getState().media.repeat !== opts.media.repeat) {
|
|
6986
|
-
this.webamp.store.dispatch({
|
|
6987
|
-
type: "TOGGLE_REPEAT"
|
|
6988
|
-
});
|
|
6989
|
-
}
|
|
6990
|
-
});
|
|
6991
|
-
|
|
6992
|
-
this.options = options;
|
|
6993
|
-
setTimeout(() => {
|
|
6994
|
-
if (!window.__webamp) {
|
|
6995
|
-
throw new Error("Webamp __webamp is undefined!!");
|
|
6996
|
-
} else {
|
|
6997
|
-
this.webamp = window.__webamp;
|
|
6998
|
-
}
|
|
6999
|
-
|
|
7000
|
-
if (typeof localStorage.getItem('app-state') !== "undefined") {
|
|
7001
|
-
this.loadOptions(JSON.parse(localStorage.getItem('app-state')));
|
|
7002
|
-
} // emit
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
if (emit !== false) {
|
|
7006
|
-
var _window, _window$Telegram;
|
|
7007
|
-
|
|
7008
|
-
const lastList = this.getCookie('lastlist');
|
|
7009
|
-
|
|
7010
|
-
if (typeof lastList !== "undefined") {
|
|
7011
|
-
this.getTrackListFromYandexDisk(lastList);
|
|
7012
|
-
} // @ts-ignore | because no global var telegram avail in project types
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
if (!((_window = window) !== null && _window !== void 0 && (_window$Telegram = _window.Telegram) !== null && _window$Telegram !== void 0 && _window$Telegram.WebApp)) {
|
|
7016
|
-
console.error("Telegram is undefined!! Skipping Telegram.WebApp event handler...");
|
|
7017
|
-
} else {
|
|
7018
|
-
var _window2, _window2$Telegram;
|
|
7019
|
-
|
|
7020
|
-
// @ts-ignore | because no global var telegram avail in project types
|
|
7021
|
-
this.telegram = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Telegram = _window2.Telegram) === null || _window2$Telegram === void 0 ? void 0 : _window2$Telegram.WebApp;
|
|
7022
|
-
this.initializeTelegramWebAppEvents();
|
|
7023
|
-
}
|
|
7024
|
-
|
|
7025
|
-
this.initializeApplicationHandlers();
|
|
7026
|
-
}
|
|
7027
|
-
}, 1000);
|
|
7028
|
-
}
|
|
7029
|
-
|
|
7030
|
-
initializeTelegramWebAppEvents() {
|
|
7031
|
-
this.telegram.offEvent("deactivated", () => {
|
|
7032
|
-
this.updateAppState();
|
|
7033
|
-
});
|
|
7034
|
-
}
|
|
7035
|
-
|
|
7036
|
-
initializeApplicationHandlers() {
|
|
7037
|
-
const window_handlers = ['unload', 'beforeunload', 'pagehide'];
|
|
7038
|
-
window_handlers.forEach(handler => {
|
|
7039
|
-
window.addEventListener(handler, () => {
|
|
7040
|
-
this.updateAppState();
|
|
7041
|
-
});
|
|
7042
|
-
});
|
|
7043
|
-
this.webamp.onTrackDidChange(() => {
|
|
7044
|
-
console.log(this.webamp.store.getState());
|
|
7045
|
-
this.updateAppState();
|
|
7046
|
-
});
|
|
7047
|
-
this.webamp.onWillClose(() => {
|
|
7048
|
-
this.updateAppState();
|
|
7049
|
-
});
|
|
7050
|
-
this.webamp.onClose(() => {
|
|
7051
|
-
this.updateAppState();
|
|
7052
|
-
});
|
|
7053
|
-
this.webamp.onMinimize(() => {
|
|
7054
|
-
this.updateAppState();
|
|
7055
|
-
});
|
|
7056
|
-
this.webamp.store.dispatch({
|
|
7057
|
-
type: "ENABLE_MILKDROP",
|
|
7058
|
-
open: false
|
|
7059
|
-
});
|
|
7060
|
-
const ev = ['ended', 'playing', 'timeupdate', 'fileLoaded', 'waiting', 'stopWaiting'];
|
|
7061
|
-
|
|
7062
|
-
this.webamp.__onStateChange(() => {
|
|
7063
|
-
this.updateAppState();
|
|
7064
|
-
});
|
|
7065
|
-
|
|
7066
|
-
ev.forEach(ev => this.webamp.media.on(ev, () => {
|
|
7067
|
-
this.updateAppState();
|
|
7068
|
-
}));
|
|
7069
|
-
}
|
|
7070
|
-
|
|
7071
|
-
}
|
|
7072
|
-
|
|
7073
|
-
/***/ }),
|
|
7074
|
-
/* 27 */
|
|
7075
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
7076
|
-
|
|
7077
|
-
"use strict";
|
|
7078
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
7079
|
-
//
|
|
7080
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
7081
|
-
// copy of this software and associated documentation files (the
|
|
7082
|
-
// "Software"), to deal in the Software without restriction, including
|
|
7083
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
7084
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
7085
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
7086
|
-
// following conditions:
|
|
7087
|
-
//
|
|
7088
|
-
// The above copyright notice and this permission notice shall be included
|
|
7089
|
-
// in all copies or substantial portions of the Software.
|
|
7090
|
-
//
|
|
7091
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
7092
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
7093
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
7094
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
7095
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
7096
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
7097
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
7098
|
-
|
|
7099
|
-
// a duplex stream is just a stream that is both readable and writable.
|
|
7100
|
-
// Since JS doesn't have multiple prototypal inheritance, this class
|
|
7101
|
-
// prototypally inherits from Readable, and then parasitically from
|
|
7102
|
-
// Writable.
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
/*<replacement>*/
|
|
7107
|
-
|
|
7108
|
-
var pna = __webpack_require__(47);
|
|
7109
|
-
/*</replacement>*/
|
|
7110
|
-
|
|
7111
|
-
/*<replacement>*/
|
|
7112
|
-
var objectKeys = Object.keys || function (obj) {
|
|
7113
|
-
var keys = [];
|
|
7114
|
-
for (var key in obj) {
|
|
7115
|
-
keys.push(key);
|
|
7116
|
-
}return keys;
|
|
7117
|
-
};
|
|
7118
|
-
/*</replacement>*/
|
|
7119
|
-
|
|
7120
|
-
module.exports = Duplex;
|
|
7121
|
-
|
|
7122
|
-
/*<replacement>*/
|
|
7123
|
-
var util = Object.create(__webpack_require__(37));
|
|
7124
|
-
util.inherits = __webpack_require__(34);
|
|
7125
|
-
/*</replacement>*/
|
|
7126
|
-
|
|
7127
|
-
var Readable = __webpack_require__(110);
|
|
7128
|
-
var Writable = __webpack_require__(56);
|
|
7129
|
-
|
|
7130
|
-
util.inherits(Duplex, Readable);
|
|
7131
|
-
|
|
7132
|
-
{
|
|
7133
|
-
// avoid scope creep, the keys array can then be collected
|
|
7134
|
-
var keys = objectKeys(Writable.prototype);
|
|
7135
|
-
for (var v = 0; v < keys.length; v++) {
|
|
7136
|
-
var method = keys[v];
|
|
7137
|
-
if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
|
|
7138
|
-
}
|
|
7139
|
-
}
|
|
7140
|
-
|
|
7141
|
-
function Duplex(options) {
|
|
7142
|
-
if (!(this instanceof Duplex)) return new Duplex(options);
|
|
7143
|
-
|
|
7144
|
-
Readable.call(this, options);
|
|
7145
|
-
Writable.call(this, options);
|
|
7146
|
-
|
|
7147
|
-
if (options && options.readable === false) this.readable = false;
|
|
7148
|
-
|
|
7149
|
-
if (options && options.writable === false) this.writable = false;
|
|
7150
|
-
|
|
7151
|
-
this.allowHalfOpen = true;
|
|
7152
|
-
if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
|
|
7153
|
-
|
|
7154
|
-
this.once('end', onend);
|
|
7155
|
-
}
|
|
7156
|
-
|
|
7157
|
-
Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
|
|
7158
|
-
// making it explicit this property is not enumerable
|
|
7159
|
-
// because otherwise some prototype manipulation in
|
|
7160
|
-
// userland will fail
|
|
7161
|
-
enumerable: false,
|
|
7162
|
-
get: function () {
|
|
7163
|
-
return this._writableState.highWaterMark;
|
|
7164
|
-
}
|
|
7165
|
-
});
|
|
7166
|
-
|
|
7167
|
-
// the no-half-open enforcer
|
|
7168
|
-
function onend() {
|
|
7169
|
-
// if we allow half-open state, or if the writable side ended,
|
|
7170
|
-
// then we're ok.
|
|
7171
|
-
if (this.allowHalfOpen || this._writableState.ended) return;
|
|
7172
|
-
|
|
7173
|
-
// no more data can be written.
|
|
7174
|
-
// But allow more writes to happen in this tick.
|
|
7175
|
-
pna.nextTick(onEndNT, this);
|
|
7176
|
-
}
|
|
7177
|
-
|
|
7178
|
-
function onEndNT(self) {
|
|
7179
|
-
self.end();
|
|
7180
|
-
}
|
|
7181
|
-
|
|
7182
|
-
Object.defineProperty(Duplex.prototype, 'destroyed', {
|
|
7183
|
-
get: function () {
|
|
7184
|
-
if (this._readableState === undefined || this._writableState === undefined) {
|
|
7185
|
-
return false;
|
|
7186
|
-
}
|
|
7187
|
-
return this._readableState.destroyed && this._writableState.destroyed;
|
|
7188
|
-
},
|
|
7189
|
-
set: function (value) {
|
|
7190
|
-
// we ignore the value if the stream
|
|
7191
|
-
// has not been initialized yet
|
|
7192
|
-
if (this._readableState === undefined || this._writableState === undefined) {
|
|
7193
|
-
return;
|
|
7194
|
-
}
|
|
7195
|
-
|
|
7196
|
-
// backward compatibility, the user is explicitly
|
|
7197
|
-
// managing destroyed
|
|
7198
|
-
this._readableState.destroyed = value;
|
|
7199
|
-
this._writableState.destroyed = value;
|
|
7200
|
-
}
|
|
7201
|
-
});
|
|
7202
|
-
|
|
7203
|
-
Duplex.prototype._destroy = function (err, cb) {
|
|
7204
|
-
this.push(null);
|
|
7205
|
-
this.end();
|
|
6918
|
+
Duplex.prototype._destroy = function (err, cb) {
|
|
6919
|
+
this.push(null);
|
|
6920
|
+
this.end();
|
|
7206
6921
|
|
|
7207
6922
|
pna.nextTick(cb, err);
|
|
7208
6923
|
};
|
|
7209
6924
|
|
|
7210
6925
|
/***/ }),
|
|
7211
|
-
/*
|
|
6926
|
+
/* 27 */
|
|
7212
6927
|
/***/ (function(module, exports, __webpack_require__) {
|
|
7213
6928
|
|
|
7214
6929
|
var root = __webpack_require__(82);
|
|
@@ -7220,7 +6935,7 @@ module.exports = Symbol;
|
|
|
7220
6935
|
|
|
7221
6936
|
|
|
7222
6937
|
/***/ }),
|
|
7223
|
-
/*
|
|
6938
|
+
/* 28 */
|
|
7224
6939
|
/***/ (function(module, exports, __webpack_require__) {
|
|
7225
6940
|
|
|
7226
6941
|
"use strict";
|
|
@@ -7232,13 +6947,13 @@ if (true) {
|
|
|
7232
6947
|
|
|
7233
6948
|
|
|
7234
6949
|
/***/ }),
|
|
7235
|
-
/*
|
|
6950
|
+
/* 29 */
|
|
7236
6951
|
/***/ (function(module, exports, __webpack_require__) {
|
|
7237
6952
|
|
|
7238
6953
|
"use strict";
|
|
7239
6954
|
|
|
7240
6955
|
|
|
7241
|
-
var reactIs = __webpack_require__(
|
|
6956
|
+
var reactIs = __webpack_require__(28);
|
|
7242
6957
|
|
|
7243
6958
|
/**
|
|
7244
6959
|
* Copyright 2015, Yahoo! Inc.
|
|
@@ -7342,7 +7057,7 @@ module.exports = hoistNonReactStatics;
|
|
|
7342
7057
|
|
|
7343
7058
|
|
|
7344
7059
|
/***/ }),
|
|
7345
|
-
/*
|
|
7060
|
+
/* 30 */
|
|
7346
7061
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7347
7062
|
|
|
7348
7063
|
"use strict";
|
|
@@ -7368,7 +7083,7 @@ var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]
|
|
|
7368
7083
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19), __webpack_require__(67)(module)))
|
|
7369
7084
|
|
|
7370
7085
|
/***/ }),
|
|
7371
|
-
/*
|
|
7086
|
+
/* 31 */
|
|
7372
7087
|
/***/ (function(module, exports, __webpack_require__) {
|
|
7373
7088
|
|
|
7374
7089
|
var parser = __webpack_require__(69);
|
|
@@ -7381,7 +7096,7 @@ module.exports = {
|
|
|
7381
7096
|
};
|
|
7382
7097
|
|
|
7383
7098
|
/***/ }),
|
|
7384
|
-
/*
|
|
7099
|
+
/* 32 */
|
|
7385
7100
|
/***/ (function(module, exports) {
|
|
7386
7101
|
|
|
7387
7102
|
// shim for using process in browser
|
|
@@ -7571,7 +7286,7 @@ process.umask = function() { return 0; };
|
|
|
7571
7286
|
|
|
7572
7287
|
|
|
7573
7288
|
/***/ }),
|
|
7574
|
-
/*
|
|
7289
|
+
/* 33 */
|
|
7575
7290
|
/***/ (function(module, exports) {
|
|
7576
7291
|
|
|
7577
7292
|
if (typeof Object.create === 'function') {
|
|
@@ -7603,6 +7318,293 @@ if (typeof Object.create === 'function') {
|
|
|
7603
7318
|
}
|
|
7604
7319
|
|
|
7605
7320
|
|
|
7321
|
+
/***/ }),
|
|
7322
|
+
/* 34 */
|
|
7323
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7324
|
+
|
|
7325
|
+
"use strict";
|
|
7326
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return WinampTelegramCustomHandler; });
|
|
7327
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
|
|
7328
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
|
7329
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
|
7330
|
+
|
|
7331
|
+
|
|
7332
|
+
class WinampTelegramCustomHandler {
|
|
7333
|
+
constructor(emit, options) {
|
|
7334
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "webamp", void 0);
|
|
7335
|
+
|
|
7336
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "maxFileSize", 0x1400000);
|
|
7337
|
+
|
|
7338
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "telegram", void 0);
|
|
7339
|
+
|
|
7340
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "options", void 0);
|
|
7341
|
+
|
|
7342
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "loadCustomTracks", tracks => {
|
|
7343
|
+
var _this$webamp;
|
|
7344
|
+
|
|
7345
|
+
((_this$webamp = this.webamp) !== null && _this$webamp !== void 0 ? _this$webamp : window.__webamp).setTracksToPlay(tracks);
|
|
7346
|
+
});
|
|
7347
|
+
|
|
7348
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "updateAppState", () => {
|
|
7349
|
+
localStorage.setItem("appState", JSON.stringify(this.webamp.__getSerializedState()));
|
|
7350
|
+
});
|
|
7351
|
+
|
|
7352
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "getTrackListFromYandexDisk", async playlistLink => {
|
|
7353
|
+
fetch(`https://cloud-api.yandex.net/v1/disk/public/resources?public_key=${encodeURIComponent(playlistLink)}`, {
|
|
7354
|
+
method: "GET",
|
|
7355
|
+
headers: {
|
|
7356
|
+
Accept: "application/json",
|
|
7357
|
+
"Content-Type": "application/json"
|
|
7358
|
+
}
|
|
7359
|
+
}).then(async response => {
|
|
7360
|
+
if (response.status === 200) {
|
|
7361
|
+
return response.text();
|
|
7362
|
+
} else {
|
|
7363
|
+
return null;
|
|
7364
|
+
}
|
|
7365
|
+
}).then(async response => {
|
|
7366
|
+
if (response !== null) {
|
|
7367
|
+
var _JSON$parse;
|
|
7368
|
+
|
|
7369
|
+
const data = (_JSON$parse = JSON.parse(response)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse._embedded.items;
|
|
7370
|
+
let i = 0;
|
|
7371
|
+
this.saveLastPlaylist(playlistLink);
|
|
7372
|
+
|
|
7373
|
+
for (const item of data) {
|
|
7374
|
+
if (i === 0) {
|
|
7375
|
+
this.webamp.setTracksToPlay([{
|
|
7376
|
+
defaultName: item.name,
|
|
7377
|
+
url: `${item.file}&public_key=${item.public_key}`
|
|
7378
|
+
}]);
|
|
7379
|
+
} else {
|
|
7380
|
+
this.webamp.appendTracks([{
|
|
7381
|
+
defaultName: item.name,
|
|
7382
|
+
url: `${item.file}&public_key=${item.public_key}`
|
|
7383
|
+
}]);
|
|
7384
|
+
}
|
|
7385
|
+
|
|
7386
|
+
i++;
|
|
7387
|
+
}
|
|
7388
|
+
}
|
|
7389
|
+
});
|
|
7390
|
+
});
|
|
7391
|
+
|
|
7392
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "loadTrackFromYandexDisk", async track => {
|
|
7393
|
+
let public_key = new URL(track.url).searchParams.get("public_key");
|
|
7394
|
+
await fetch(track.url, {
|
|
7395
|
+
method: "GET"
|
|
7396
|
+
}).then(response => response).then(resp => fetch(resp.url)).then(async response => {
|
|
7397
|
+
if (response.status === 302) {
|
|
7398
|
+
return await fetch(`${response.headers.get("Location")}&public_key=${public_key}`);
|
|
7399
|
+
} else {
|
|
7400
|
+
return response;
|
|
7401
|
+
}
|
|
7402
|
+
}).then(res => {
|
|
7403
|
+
var _res$body;
|
|
7404
|
+
|
|
7405
|
+
console.log(res);
|
|
7406
|
+
const read = (_res$body = res.body) === null || _res$body === void 0 ? void 0 : _res$body.getReader();
|
|
7407
|
+
return new ReadableStream({
|
|
7408
|
+
start(controller) {
|
|
7409
|
+
// @ts-ignore
|
|
7410
|
+
function pump() {
|
|
7411
|
+
// @ts-ignore
|
|
7412
|
+
return read === null || read === void 0 ? void 0 : read.read().then(({
|
|
7413
|
+
done,
|
|
7414
|
+
value
|
|
7415
|
+
}) => {
|
|
7416
|
+
if (done) {
|
|
7417
|
+
controller.close();
|
|
7418
|
+
return;
|
|
7419
|
+
}
|
|
7420
|
+
|
|
7421
|
+
controller.enqueue(value);
|
|
7422
|
+
return pump();
|
|
7423
|
+
});
|
|
7424
|
+
}
|
|
7425
|
+
|
|
7426
|
+
return pump();
|
|
7427
|
+
}
|
|
7428
|
+
|
|
7429
|
+
});
|
|
7430
|
+
}).then(stream => new Response(stream)).then(response => response.blob()).then(blob => URL.createObjectURL(blob)).then(uri => {
|
|
7431
|
+
let tracks = this.getAllTracks();
|
|
7432
|
+
this.replaceTrack(track, tracks);
|
|
7433
|
+
}).catch(err => err);
|
|
7434
|
+
});
|
|
7435
|
+
|
|
7436
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "getCurrentTrack", () => {
|
|
7437
|
+
let trackId = this.webamp.store.getState().playlist.currentTrack;
|
|
7438
|
+
return this.webamp.store.getState().tracks[trackId];
|
|
7439
|
+
});
|
|
7440
|
+
|
|
7441
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "getAllTracks", () => {
|
|
7442
|
+
return this.webamp.store.getState().tracks;
|
|
7443
|
+
});
|
|
7444
|
+
|
|
7445
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "replaceTrack", (track, tracks) => {
|
|
7446
|
+
let a = [];
|
|
7447
|
+
Object.entries(tracks).forEach(([_key, value]) => {
|
|
7448
|
+
if (value.id === track.id) {
|
|
7449
|
+
a.push(track);
|
|
7450
|
+
} else {
|
|
7451
|
+
a.push(value);
|
|
7452
|
+
}
|
|
7453
|
+
});
|
|
7454
|
+
this.webamp.setTracksToPlay(a);
|
|
7455
|
+
});
|
|
7456
|
+
|
|
7457
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "saveLastPlaylist", playlistLink => {
|
|
7458
|
+
document.cookie = `lastlist=${playlistLink}; path=/;`;
|
|
7459
|
+
});
|
|
7460
|
+
|
|
7461
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "getCookie", name => {
|
|
7462
|
+
const regex = new RegExp(`(^| )${name}=([^;]+)`);
|
|
7463
|
+
const match = document.cookie.match(regex);
|
|
7464
|
+
|
|
7465
|
+
if (match) {
|
|
7466
|
+
return match[2];
|
|
7467
|
+
}
|
|
7468
|
+
});
|
|
7469
|
+
|
|
7470
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "loadOptions", opts => {
|
|
7471
|
+
this.webamp.__loadSerializedState(opts);
|
|
7472
|
+
});
|
|
7473
|
+
|
|
7474
|
+
_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, "loadOptions2", opts => {
|
|
7475
|
+
let i = 0;
|
|
7476
|
+
let vol = opts.media.volume;
|
|
7477
|
+
let balance = opts.media.balance;
|
|
7478
|
+
let eq1 = opts.equalizer.sliders.preamp;
|
|
7479
|
+
let eq2 = opts.equalizer.sliders["60"];
|
|
7480
|
+
let eq3 = opts.equalizer.sliders["170"];
|
|
7481
|
+
let eq4 = opts.equalizer.sliders["310"];
|
|
7482
|
+
let eq5 = opts.equalizer.sliders["600"];
|
|
7483
|
+
let eq6 = opts.equalizer.sliders["1000"];
|
|
7484
|
+
let eq7 = opts.equalizer.sliders["3000"];
|
|
7485
|
+
let eq8 = opts.equalizer.sliders["6000"];
|
|
7486
|
+
let eq9 = opts.equalizer.sliders["12000"];
|
|
7487
|
+
let eq10 = opts.equalizer.sliders["14000"];
|
|
7488
|
+
let eq11 = opts.equalizer.sliders["16000"];
|
|
7489
|
+
let equal = [eq1, eq2, eq3, eq4, eq5, eq6, eq7, eq8, eq9, eq10, eq11];
|
|
7490
|
+
let bands = [60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000];
|
|
7491
|
+
this.webamp.store.dispatch({
|
|
7492
|
+
type: "SET_VOLUME",
|
|
7493
|
+
volume: Object(_utils__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "d"])(vol, 0, 100)
|
|
7494
|
+
});
|
|
7495
|
+
this.webamp.store.dispatch({
|
|
7496
|
+
type: "SET_BALANCE",
|
|
7497
|
+
balance: balance
|
|
7498
|
+
});
|
|
7499
|
+
this.webamp.store.dispatch({
|
|
7500
|
+
type: "SET_BAND_VALUE",
|
|
7501
|
+
band: "preamp",
|
|
7502
|
+
value: opts.equalizer.sliders.preamp
|
|
7503
|
+
});
|
|
7504
|
+
|
|
7505
|
+
for (const band of bands) {
|
|
7506
|
+
this.webamp.store.dispatch({
|
|
7507
|
+
type: "SET_BAND_VALUE",
|
|
7508
|
+
band: band,
|
|
7509
|
+
value: equal[i]
|
|
7510
|
+
});
|
|
7511
|
+
i++;
|
|
7512
|
+
}
|
|
7513
|
+
|
|
7514
|
+
if (window.__webamp.store.getState().media.shuffle !== opts.media.shuffle) {
|
|
7515
|
+
this.webamp.store.dispatch({
|
|
7516
|
+
type: "TOGGLE_SHUFFLE"
|
|
7517
|
+
});
|
|
7518
|
+
}
|
|
7519
|
+
|
|
7520
|
+
if (window.__webamp.store.getState().media.repeat !== opts.media.repeat) {
|
|
7521
|
+
this.webamp.store.dispatch({
|
|
7522
|
+
type: "TOGGLE_REPEAT"
|
|
7523
|
+
});
|
|
7524
|
+
}
|
|
7525
|
+
});
|
|
7526
|
+
|
|
7527
|
+
this.options = options;
|
|
7528
|
+
setTimeout(() => {
|
|
7529
|
+
if (!window.__webamp) {
|
|
7530
|
+
throw new Error("Webamp __webamp is undefined!!");
|
|
7531
|
+
} else {
|
|
7532
|
+
this.webamp = window.__webamp;
|
|
7533
|
+
}
|
|
7534
|
+
|
|
7535
|
+
if (typeof localStorage.getItem('app-state') !== "undefined") {
|
|
7536
|
+
this.loadOptions(JSON.parse(localStorage.getItem('app-state')));
|
|
7537
|
+
} // emit
|
|
7538
|
+
|
|
7539
|
+
|
|
7540
|
+
if (emit !== false) {
|
|
7541
|
+
var _window, _window$Telegram;
|
|
7542
|
+
|
|
7543
|
+
const lastList = this.getCookie('lastlist');
|
|
7544
|
+
|
|
7545
|
+
if (typeof lastList !== "undefined") {
|
|
7546
|
+
this.getTrackListFromYandexDisk(lastList);
|
|
7547
|
+
} // @ts-ignore | because no global var telegram avail in project types
|
|
7548
|
+
|
|
7549
|
+
|
|
7550
|
+
if (!((_window = window) !== null && _window !== void 0 && (_window$Telegram = _window.Telegram) !== null && _window$Telegram !== void 0 && _window$Telegram.WebApp)) {
|
|
7551
|
+
console.error("Telegram is undefined!! Skipping Telegram.WebApp event handler...");
|
|
7552
|
+
} else {
|
|
7553
|
+
var _window2, _window2$Telegram;
|
|
7554
|
+
|
|
7555
|
+
// @ts-ignore | because no global var telegram avail in project types
|
|
7556
|
+
this.telegram = (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$Telegram = _window2.Telegram) === null || _window2$Telegram === void 0 ? void 0 : _window2$Telegram.WebApp;
|
|
7557
|
+
this.initializeTelegramWebAppEvents();
|
|
7558
|
+
}
|
|
7559
|
+
|
|
7560
|
+
this.initializeApplicationHandlers();
|
|
7561
|
+
}
|
|
7562
|
+
}, 1000);
|
|
7563
|
+
}
|
|
7564
|
+
|
|
7565
|
+
initializeTelegramWebAppEvents() {
|
|
7566
|
+
this.telegram.offEvent("deactivated", () => {
|
|
7567
|
+
this.updateAppState();
|
|
7568
|
+
});
|
|
7569
|
+
}
|
|
7570
|
+
|
|
7571
|
+
initializeApplicationHandlers() {
|
|
7572
|
+
const window_handlers = ['unload', 'beforeunload', 'pagehide'];
|
|
7573
|
+
window_handlers.forEach(handler => {
|
|
7574
|
+
window.addEventListener(handler, () => {
|
|
7575
|
+
this.updateAppState();
|
|
7576
|
+
});
|
|
7577
|
+
});
|
|
7578
|
+
this.webamp.onTrackDidChange(() => {
|
|
7579
|
+
console.log(this.webamp.store.getState());
|
|
7580
|
+
this.updateAppState();
|
|
7581
|
+
});
|
|
7582
|
+
this.webamp.onWillClose(() => {
|
|
7583
|
+
this.updateAppState();
|
|
7584
|
+
});
|
|
7585
|
+
this.webamp.onClose(() => {
|
|
7586
|
+
this.updateAppState();
|
|
7587
|
+
});
|
|
7588
|
+
this.webamp.onMinimize(() => {
|
|
7589
|
+
this.updateAppState();
|
|
7590
|
+
});
|
|
7591
|
+
this.webamp.store.dispatch({
|
|
7592
|
+
type: "ENABLE_MILKDROP",
|
|
7593
|
+
open: false
|
|
7594
|
+
});
|
|
7595
|
+
const ev = ['ended', 'playing', 'timeupdate', 'fileLoaded', 'waiting', 'stopWaiting'];
|
|
7596
|
+
|
|
7597
|
+
this.webamp.__onStateChange(() => {
|
|
7598
|
+
this.updateAppState();
|
|
7599
|
+
});
|
|
7600
|
+
|
|
7601
|
+
ev.forEach(ev => this.webamp.media.on(ev, () => {
|
|
7602
|
+
this.updateAppState();
|
|
7603
|
+
}));
|
|
7604
|
+
}
|
|
7605
|
+
|
|
7606
|
+
}
|
|
7607
|
+
|
|
7606
7608
|
/***/ }),
|
|
7607
7609
|
/* 35 */
|
|
7608
7610
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -8425,7 +8427,7 @@ function nextTick(fn, arg1, arg2, arg3) {
|
|
|
8425
8427
|
}
|
|
8426
8428
|
|
|
8427
8429
|
|
|
8428
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(
|
|
8430
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32)))
|
|
8429
8431
|
|
|
8430
8432
|
/***/ }),
|
|
8431
8433
|
/* 48 */
|
|
@@ -8986,11 +8988,11 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
8986
8988
|
return target;
|
|
8987
8989
|
}
|
|
8988
8990
|
// EXTERNAL MODULE: /home/exezt-/Projects/webamp/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
|
8989
|
-
var hoist_non_react_statics_cjs = __webpack_require__(
|
|
8991
|
+
var hoist_non_react_statics_cjs = __webpack_require__(29);
|
|
8990
8992
|
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
|
|
8991
8993
|
|
|
8992
8994
|
// EXTERNAL MODULE: /home/exezt-/Projects/webamp/node_modules/react-is/index.js
|
|
8993
|
-
var react_is = __webpack_require__(
|
|
8995
|
+
var react_is = __webpack_require__(28);
|
|
8994
8996
|
|
|
8995
8997
|
// CONCATENATED MODULE: /home/exezt-/Projects/webamp/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js
|
|
8996
8998
|
// React currently throws a warning when using useLayoutEffect on the server.
|
|
@@ -13007,7 +13009,7 @@ function toggleEqAuto() {
|
|
|
13007
13009
|
};
|
|
13008
13010
|
}
|
|
13009
13011
|
// EXTERNAL MODULE: ../winamp-eqf/index.js
|
|
13010
|
-
var winamp_eqf = __webpack_require__(
|
|
13012
|
+
var winamp_eqf = __webpack_require__(31);
|
|
13011
13013
|
|
|
13012
13014
|
// CONCATENATED MODULE: ./js/skinSprites.ts
|
|
13013
13015
|
|
|
@@ -15141,7 +15143,7 @@ function selectAll() {
|
|
|
15141
15143
|
};
|
|
15142
15144
|
}
|
|
15143
15145
|
// EXTERNAL MODULE: ./js/lib/webamp-telegram-handler.ts
|
|
15144
|
-
var webamp_telegram_handler = __webpack_require__(
|
|
15146
|
+
var webamp_telegram_handler = __webpack_require__(34);
|
|
15145
15147
|
|
|
15146
15148
|
// CONCATENATED MODULE: ./js/actionCreators/files.ts
|
|
15147
15149
|
|
|
@@ -15567,8 +15569,7 @@ function files_addFilesFromUrl(atIndex = 0) {
|
|
|
15567
15569
|
// }
|
|
15568
15570
|
// };
|
|
15569
15571
|
}
|
|
15570
|
-
function files_addFilesFromList() {
|
|
15571
|
-
new webamp_telegram_handler["a" /* default */](false).loadCustomTracks(); // return async (dispatch, getState, { handleLoadListEvent }) => {
|
|
15572
|
+
function files_addFilesFromList() {// return async (dispatch, getState, { handleLoadListEvent }) => {
|
|
15572
15573
|
// if (handleLoadListEvent) {
|
|
15573
15574
|
// const tracks = await handleLoadListEvent();
|
|
15574
15575
|
//
|
|
@@ -23088,7 +23089,7 @@ exports = module.exports = __webpack_require__(110);
|
|
|
23088
23089
|
exports.Stream = exports;
|
|
23089
23090
|
exports.Readable = exports;
|
|
23090
23091
|
exports.Writable = __webpack_require__(56);
|
|
23091
|
-
exports.Duplex = __webpack_require__(
|
|
23092
|
+
exports.Duplex = __webpack_require__(26);
|
|
23092
23093
|
exports.Transform = __webpack_require__(114);
|
|
23093
23094
|
exports.PassThrough = __webpack_require__(156);
|
|
23094
23095
|
|
|
@@ -23165,7 +23166,7 @@ Writable.WritableState = WritableState;
|
|
|
23165
23166
|
|
|
23166
23167
|
/*<replacement>*/
|
|
23167
23168
|
var util = Object.create(__webpack_require__(37));
|
|
23168
|
-
util.inherits = __webpack_require__(
|
|
23169
|
+
util.inherits = __webpack_require__(33);
|
|
23169
23170
|
/*</replacement>*/
|
|
23170
23171
|
|
|
23171
23172
|
/*<replacement>*/
|
|
@@ -23198,7 +23199,7 @@ util.inherits(Writable, Stream);
|
|
|
23198
23199
|
function nop() {}
|
|
23199
23200
|
|
|
23200
23201
|
function WritableState(options, stream) {
|
|
23201
|
-
Duplex = Duplex || __webpack_require__(
|
|
23202
|
+
Duplex = Duplex || __webpack_require__(26);
|
|
23202
23203
|
|
|
23203
23204
|
options = options || {};
|
|
23204
23205
|
|
|
@@ -23348,7 +23349,7 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot
|
|
|
23348
23349
|
}
|
|
23349
23350
|
|
|
23350
23351
|
function Writable(options) {
|
|
23351
|
-
Duplex = Duplex || __webpack_require__(
|
|
23352
|
+
Duplex = Duplex || __webpack_require__(26);
|
|
23352
23353
|
|
|
23353
23354
|
// Writable ctor is applied to Duplexes, too.
|
|
23354
23355
|
// `realHasInstance` is necessary because using plain `instanceof`
|
|
@@ -23785,7 +23786,7 @@ Writable.prototype._destroy = function (err, cb) {
|
|
|
23785
23786
|
this.end();
|
|
23786
23787
|
cb(err);
|
|
23787
23788
|
};
|
|
23788
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(
|
|
23789
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32), __webpack_require__(107).setImmediate, __webpack_require__(19)))
|
|
23789
23790
|
|
|
23790
23791
|
/***/ }),
|
|
23791
23792
|
/* 57 */
|
|
@@ -24932,7 +24933,7 @@ module.exports = toString;
|
|
|
24932
24933
|
/* 81 */
|
|
24933
24934
|
/***/ (function(module, exports, __webpack_require__) {
|
|
24934
24935
|
|
|
24935
|
-
var Symbol = __webpack_require__(
|
|
24936
|
+
var Symbol = __webpack_require__(27),
|
|
24936
24937
|
arrayMap = __webpack_require__(84),
|
|
24937
24938
|
isArray = __webpack_require__(85),
|
|
24938
24939
|
isSymbol = __webpack_require__(86);
|
|
@@ -25095,7 +25096,7 @@ module.exports = isSymbol;
|
|
|
25095
25096
|
/* 87 */
|
|
25096
25097
|
/***/ (function(module, exports, __webpack_require__) {
|
|
25097
25098
|
|
|
25098
|
-
var Symbol = __webpack_require__(
|
|
25099
|
+
var Symbol = __webpack_require__(27),
|
|
25099
25100
|
getRawTag = __webpack_require__(88),
|
|
25100
25101
|
objectToString = __webpack_require__(89);
|
|
25101
25102
|
|
|
@@ -25129,7 +25130,7 @@ module.exports = baseGetTag;
|
|
|
25129
25130
|
/* 88 */
|
|
25130
25131
|
/***/ (function(module, exports, __webpack_require__) {
|
|
25131
25132
|
|
|
25132
|
-
var Symbol = __webpack_require__(
|
|
25133
|
+
var Symbol = __webpack_require__(27);
|
|
25133
25134
|
|
|
25134
25135
|
/** Used for built-in method references. */
|
|
25135
25136
|
var objectProto = Object.prototype;
|
|
@@ -27002,7 +27003,7 @@ fileType.stream = readableStream => new Promise((resolve, reject) => {
|
|
|
27002
27003
|
module.exports = Stream;
|
|
27003
27004
|
|
|
27004
27005
|
var EE = __webpack_require__(54).EventEmitter;
|
|
27005
|
-
var inherits = __webpack_require__(
|
|
27006
|
+
var inherits = __webpack_require__(33);
|
|
27006
27007
|
|
|
27007
27008
|
inherits(Stream, EE);
|
|
27008
27009
|
Stream.Readable = __webpack_require__(55);
|
|
@@ -27179,7 +27180,7 @@ function _isUint8Array(obj) {
|
|
|
27179
27180
|
|
|
27180
27181
|
/*<replacement>*/
|
|
27181
27182
|
var util = Object.create(__webpack_require__(37));
|
|
27182
|
-
util.inherits = __webpack_require__(
|
|
27183
|
+
util.inherits = __webpack_require__(33);
|
|
27183
27184
|
/*</replacement>*/
|
|
27184
27185
|
|
|
27185
27186
|
/*<replacement>*/
|
|
@@ -27213,7 +27214,7 @@ function prependListener(emitter, event, fn) {
|
|
|
27213
27214
|
}
|
|
27214
27215
|
|
|
27215
27216
|
function ReadableState(options, stream) {
|
|
27216
|
-
Duplex = Duplex || __webpack_require__(
|
|
27217
|
+
Duplex = Duplex || __webpack_require__(26);
|
|
27217
27218
|
|
|
27218
27219
|
options = options || {};
|
|
27219
27220
|
|
|
@@ -27290,7 +27291,7 @@ function ReadableState(options, stream) {
|
|
|
27290
27291
|
}
|
|
27291
27292
|
|
|
27292
27293
|
function Readable(options) {
|
|
27293
|
-
Duplex = Duplex || __webpack_require__(
|
|
27294
|
+
Duplex = Duplex || __webpack_require__(26);
|
|
27294
27295
|
|
|
27295
27296
|
if (!(this instanceof Readable)) return new Readable(options);
|
|
27296
27297
|
|
|
@@ -28131,7 +28132,7 @@ function indexOf(xs, x) {
|
|
|
28131
28132
|
}
|
|
28132
28133
|
return -1;
|
|
28133
28134
|
}
|
|
28134
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19), __webpack_require__(
|
|
28135
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19), __webpack_require__(32)))
|
|
28135
28136
|
|
|
28136
28137
|
/***/ }),
|
|
28137
28138
|
/* 111 */
|
|
@@ -28594,11 +28595,11 @@ function simpleEnd(buf) {
|
|
|
28594
28595
|
|
|
28595
28596
|
module.exports = Transform;
|
|
28596
28597
|
|
|
28597
|
-
var Duplex = __webpack_require__(
|
|
28598
|
+
var Duplex = __webpack_require__(26);
|
|
28598
28599
|
|
|
28599
28600
|
/*<replacement>*/
|
|
28600
28601
|
var util = Object.create(__webpack_require__(37));
|
|
28601
|
-
util.inherits = __webpack_require__(
|
|
28602
|
+
util.inherits = __webpack_require__(33);
|
|
28602
28603
|
/*</replacement>*/
|
|
28603
28604
|
|
|
28604
28605
|
util.inherits(Transform, Duplex);
|
|
@@ -29373,7 +29374,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
29373
29374
|
/* harmony import */ var music_metadata_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(119);
|
|
29374
29375
|
/* harmony import */ var music_metadata_browser__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(music_metadata_browser__WEBPACK_IMPORTED_MODULE_2__);
|
|
29375
29376
|
/* harmony import */ var _webampLazy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(51);
|
|
29376
|
-
/* harmony import */ var _lib_webamp_telegram_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
29377
|
+
/* harmony import */ var _lib_webamp_telegram_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34);
|
|
29377
29378
|
|
|
29378
29379
|
|
|
29379
29380
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -29744,7 +29745,7 @@ function fromByteArray (uint8) {
|
|
|
29744
29745
|
attachTo.clearImmediate = clearImmediate;
|
|
29745
29746
|
}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
|
|
29746
29747
|
|
|
29747
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19), __webpack_require__(
|
|
29748
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(19), __webpack_require__(32)))
|
|
29748
29749
|
|
|
29749
29750
|
/***/ }),
|
|
29750
29751
|
/* 123 */
|
|
@@ -31304,7 +31305,7 @@ function callbackify(original) {
|
|
|
31304
31305
|
}
|
|
31305
31306
|
exports.callbackify = callbackify;
|
|
31306
31307
|
|
|
31307
|
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(
|
|
31308
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(32)))
|
|
31308
31309
|
|
|
31309
31310
|
/***/ }),
|
|
31310
31311
|
/* 130 */
|
|
@@ -33866,7 +33867,7 @@ var Transform = __webpack_require__(114);
|
|
|
33866
33867
|
|
|
33867
33868
|
/*<replacement>*/
|
|
33868
33869
|
var util = Object.create(__webpack_require__(37));
|
|
33869
|
-
util.inherits = __webpack_require__(
|
|
33870
|
+
util.inherits = __webpack_require__(33);
|
|
33870
33871
|
/*</replacement>*/
|
|
33871
33872
|
|
|
33872
33873
|
util.inherits(PassThrough, Transform);
|
|
@@ -33892,7 +33893,7 @@ module.exports = __webpack_require__(56);
|
|
|
33892
33893
|
/* 158 */
|
|
33893
33894
|
/***/ (function(module, exports, __webpack_require__) {
|
|
33894
33895
|
|
|
33895
|
-
module.exports = __webpack_require__(
|
|
33896
|
+
module.exports = __webpack_require__(26);
|
|
33896
33897
|
|
|
33897
33898
|
|
|
33898
33899
|
/***/ }),
|