NightcoreCreatorAppPatreonB.../user.js

8308 lines
265 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ==UserScript==
// @name Nightcore Creator App - Free Downloads
// @namespace https://git.fuwafuwa.moe/Inaisoft
// @version 1.0
// @description Allows downloading of songs on nightcore.app without Patreon.
// @author Inaisoft
// @match https://nightcore.app/
// @icon https://git.fuwafuwa.moe/Inaisoft/NightcoreCreatorAppPatreonBypass/raw/branch/master/favicon.ico
// @grant none
// @downloadURL https://git.fuwafuwa.moe/Inaisoft/NightcoreCreatorAppPatreonBypass/raw/branch/master/user.js
// ==/UserScript==
(function() {
'use strict';
/*
NOTE:
You can use \\* to match actual asterisks instead of using it as a wildcard!
The examples below show a wildcard in use and a regular asterisk replacement.
*/
var words = {
///////////////////////////////////////////////////////
// Syntax: 'Search word' : 'Replace word',
'Enable downloads by supporting us on Patreon.' : 'キタワァ*・゜゚・*:.。..。.:*・゜(n)η゚・*:.。. .。.:*・゜゚・* !!!!!',
///////////////////////////////////////////////////////
'':''};
//////////////////////////////////////////////////////////////////////////////
// This is where the real code is
// Don't edit below this
//////////////////////////////////////////////////////////////////////////////
var regexs = [], replacements = [],
tagsWhitelist = ['PRE', 'BLOCKQUOTE', 'CODE', 'INPUT', 'BUTTON', 'TEXTAREA'],
rIsRegexp = /^\/(.+)\/([gim]+)?$/,
word, text, texts, i, userRegexp;
// prepareRegex by JoeSimmons
// used to take a string and ready it for use in new RegExp()
function prepareRegex(string) {
return string.replace(/([\[\]\^\&\$\.\(\)\?\/\\\+\{\}\|])/g, '\\$1');
}
// function to decide whether a parent tag will have its text replaced or not
function isTagOk(tag) {
return tagsWhitelist.indexOf(tag) === -1;
}
delete words['']; // so the user can add each entry ending with a comma,
// I put an extra empty key/value pair in the object.
// so we need to remove it before continuing
// convert the 'words' JSON object to an Array
for (word in words) {
if ( typeof word === 'string' && words.hasOwnProperty(word) ) {
userRegexp = word.match(rIsRegexp);
// add the search/needle/query
if (userRegexp) {
regexs.push(
new RegExp(userRegexp[1], 'g')
);
} else {
regexs.push(
new RegExp(prepareRegex(word).replace(/\\?\*/g, function (fullMatch) {
return fullMatch === '\\*' ? '*' : '[^ ]*';
}), 'g')
);
}
// add the replacement
replacements.push( words[word] );
}
}
// do the replacement
texts = document.evaluate('//body//text()[ normalize-space(.) != "" ]', document, null, 6, null);
for (i = 0; text = texts.snapshotItem(i); i += 1) {
if ( isTagOk(text.parentNode.tagName) ) {
regexs.forEach(function (value, index) {
text.data = text.data.replace( value, replacements[index] );
});
}
}
var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function createCommonjsModule(e, t) {
return e(t = {
exports: {}
}, t.exports),
t.exports
}
var check = function(e) {
return e && e.Math == Math && e
}
, t = check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) || check("object" == typeof self && self) || check("object" == typeof e && e) || Function("return this")()
, fails = function(e) {
try {
return !!e()
} catch (e) {
return !0
}
}
, n = !fails((function() {
return 7 != Object.defineProperty({}, 1, {
get: function() {
return 7
}
})[1]
}
))
, r = {}.propertyIsEnumerable
, o = Object.getOwnPropertyDescriptor
, a = {
f: o && !r.call({
1: 2
}, 1) ? function propertyIsEnumerable(e) {
var t = o(this, e);
return !!t && t.enumerable
}
: r
}
, createPropertyDescriptor = function(e, t) {
return {
enumerable: !(1 & e),
configurable: !(2 & e),
writable: !(4 & e),
value: t
}
}
, i = {}.toString
, classofRaw = function(e) {
return i.call(e).slice(8, -1)
}
, u = "".split
, c = fails((function() {
return !Object("z").propertyIsEnumerable(0)
}
)) ? function(e) {
return "String" == classofRaw(e) ? u.call(e, "") : Object(e)
}
: Object
, requireObjectCoercible = function(e) {
if (null == e)
throw TypeError("Can't call method on " + e);
return e
}
, toIndexedObject = function(e) {
return c(requireObjectCoercible(e))
}
, isObject = function(e) {
return "object" == typeof e ? null !== e : "function" == typeof e
}
, toPrimitive = function(e, t) {
if (!isObject(e))
return e;
var n, r;
if (t && "function" == typeof (n = e.toString) && !isObject(r = n.call(e)))
return r;
if ("function" == typeof (n = e.valueOf) && !isObject(r = n.call(e)))
return r;
if (!t && "function" == typeof (n = e.toString) && !isObject(r = n.call(e)))
return r;
throw TypeError("Can't convert object to primitive value")
}
, s = {}.hasOwnProperty
, has = function(e, t) {
return s.call(e, t)
}
, l = t.document
, f = isObject(l) && isObject(l.createElement)
, documentCreateElement = function(e) {
return f ? l.createElement(e) : {}
}
, h = !n && !fails((function() {
return 7 != Object.defineProperty(documentCreateElement("div"), "a", {
get: function() {
return 7
}
}).a
}
))
, p = Object.getOwnPropertyDescriptor
, d = {
f: n ? p : function getOwnPropertyDescriptor(e, t) {
if (e = toIndexedObject(e),
t = toPrimitive(t, !0),
h)
try {
return p(e, t)
} catch (e) {}
if (has(e, t))
return createPropertyDescriptor(!a.f.call(e, t), e[t])
}
}
, anObject = function(e) {
if (!isObject(e))
throw TypeError(String(e) + " is not an object");
return e
}
, y = Object.defineProperty
, v = {
f: n ? y : function defineProperty(e, t, n) {
if (anObject(e),
t = toPrimitive(t, !0),
anObject(n),
h)
try {
return y(e, t, n)
} catch (e) {}
if ("get"in n || "set"in n)
throw TypeError("Accessors not supported");
return "value"in n && (e[t] = n.value),
e
}
}
, g = n ? function(e, t, n) {
return v.f(e, t, createPropertyDescriptor(1, n))
}
: function(e, t, n) {
return e[t] = n,
e
}
, setGlobal = function(e, n) {
try {
g(t, e, n)
} catch (r) {
t[e] = n
}
return n
}
, m = t["__core-js_shared__"] || setGlobal("__core-js_shared__", {})
, b = Function.toString;
"function" != typeof m.inspectSource && (m.inspectSource = function(e) {
return b.call(e)
}
);
var w, S, _, k = m.inspectSource, x = t.WeakMap, A = "function" == typeof x && /native code/.test(k(x)), E = createCommonjsModule((function(e) {
(e.exports = function(e, t) {
return m[e] || (m[e] = void 0 !== t ? t : {})
}
)("versions", []).push({
version: "3.6.5",
mode: "global",
copyright: "© 2020 Denis Pushkarev (zloirock.ru)"
})
}
)), R = 0, C = Math.random(), uid = function(e) {
return "Symbol(" + String(void 0 === e ? "" : e) + ")_" + (++R + C).toString(36)
}, O = E("keys"), sharedKey = function(e) {
return O[e] || (O[e] = uid(e))
}, T = {}, P = t.WeakMap;
if (A) {
var L = new P
, j = L.get
, I = L.has
, M = L.set;
w = function(e, t) {
return M.call(L, e, t),
t
}
,
S = function(e) {
return j.call(L, e) || {}
}
,
_ = function(e) {
return I.call(L, e)
}
} else {
var D = sharedKey("state");
T[D] = !0,
w = function(e, t) {
return g(e, D, t),
t
}
,
S = function(e) {
return has(e, D) ? e[D] : {}
}
,
_ = function(e) {
return has(e, D)
}
}
var U, B, q = {
set: w,
get: S,
has: _,
enforce: function(e) {
return _(e) ? S(e) : w(e, {})
},
getterFor: function(e) {
return function(t) {
var n;
if (!isObject(t) || (n = S(t)).type !== e)
throw TypeError("Incompatible receiver, " + e + " required");
return n
}
}
}, N = createCommonjsModule((function(e) {
var n = q.get
, r = q.enforce
, o = String(String).split("String");
(e.exports = function(e, n, a, i) {
var u = !!i && !!i.unsafe
, c = !!i && !!i.enumerable
, s = !!i && !!i.noTargetGet;
"function" == typeof a && ("string" != typeof n || has(a, "name") || g(a, "name", n),
r(a).source = o.join("string" == typeof n ? n : "")),
e !== t ? (u ? !s && e[n] && (c = !0) : delete e[n],
c ? e[n] = a : g(e, n, a)) : c ? e[n] = a : setGlobal(n, a)
}
)(Function.prototype, "toString", (function toString() {
return "function" == typeof this && n(this).source || k(this)
}
))
}
)), G = t, aFunction = function(e) {
return "function" == typeof e ? e : void 0
}, getBuiltIn = function(e, n) {
return arguments.length < 2 ? aFunction(G[e]) || aFunction(t[e]) : G[e] && G[e][n] || t[e] && t[e][n]
}, W = Math.ceil, z = Math.floor, toInteger = function(e) {
return isNaN(e = +e) ? 0 : (e > 0 ? z : W)(e)
}, V = Math.min, toLength = function(e) {
return e > 0 ? V(toInteger(e), 9007199254740991) : 0
}, H = Math.max, Y = Math.min, toAbsoluteIndex = function(e, t) {
var n = toInteger(e);
return n < 0 ? H(n + t, 0) : Y(n, t)
}, createMethod = function(e) {
return function(t, n, r) {
var o, a = toIndexedObject(t), i = toLength(a.length), u = toAbsoluteIndex(r, i);
if (e && n != n) {
for (; i > u; )
if ((o = a[u++]) != o)
return !0
} else
for (; i > u; u++)
if ((e || u in a) && a[u] === n)
return e || u || 0;
return !e && -1
}
}, Q = {
includes: createMethod(!0),
indexOf: createMethod(!1)
}, K = Q.indexOf, objectKeysInternal = function(e, t) {
var n, r = toIndexedObject(e), o = 0, a = [];
for (n in r)
!has(T, n) && has(r, n) && a.push(n);
for (; t.length > o; )
has(r, n = t[o++]) && (~K(a, n) || a.push(n));
return a
}, J = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"], X = J.concat("length", "prototype"), Z = {
f: Object.getOwnPropertyNames || function getOwnPropertyNames(e) {
return objectKeysInternal(e, X)
}
}, ee = {
f: Object.getOwnPropertySymbols
}, te = getBuiltIn("Reflect", "ownKeys") || function ownKeys(e) {
var t = Z.f(anObject(e))
, n = ee.f;
return n ? t.concat(n(e)) : t
}
, copyConstructorProperties = function(e, t) {
for (var n = te(t), r = v.f, o = d.f, a = 0; a < n.length; a++) {
var i = n[a];
has(e, i) || r(e, i, o(t, i))
}
}, ne = /#|\.prototype\./, isForced = function(e, t) {
var n = oe[re(e)];
return n == ie || n != ae && ("function" == typeof t ? fails(t) : !!t)
}, re = isForced.normalize = function(e) {
return String(e).replace(ne, ".").toLowerCase()
}
, oe = isForced.data = {}, ae = isForced.NATIVE = "N", ie = isForced.POLYFILL = "P", ue = isForced, ce = d.f, _export = function(e, n) {
var r, o, a, i, u, c = e.target, s = e.global, l = e.stat;
if (r = s ? t : l ? t[c] || setGlobal(c, {}) : (t[c] || {}).prototype)
for (o in n) {
if (i = n[o],
a = e.noTargetGet ? (u = ce(r, o)) && u.value : r[o],
!ue(s ? o : c + (l ? "." : "#") + o, e.forced) && void 0 !== a) {
if (typeof i == typeof a)
continue;
copyConstructorProperties(i, a)
}
(e.sham || a && a.sham) && g(i, "sham", !0),
N(r, o, i, e)
}
}, se = Array.isArray || function isArray(e) {
return "Array" == classofRaw(e)
}
, toObject = function(e) {
return Object(requireObjectCoercible(e))
}, createProperty = function(e, t, n) {
var r = toPrimitive(t);
r in e ? v.f(e, r, createPropertyDescriptor(0, n)) : e[r] = n
}, le = !!Object.getOwnPropertySymbols && !fails((function() {
return !String(Symbol())
}
)), fe = le && !Symbol.sham && "symbol" == typeof Symbol.iterator, he = E("wks"), pe = t.Symbol, de = fe ? pe : pe && pe.withoutSetter || uid, wellKnownSymbol = function(e) {
return has(he, e) || (le && has(pe, e) ? he[e] = pe[e] : he[e] = de("Symbol." + e)),
he[e]
}, ye = wellKnownSymbol("species"), arraySpeciesCreate = function(e, t) {
var n;
return se(e) && ("function" != typeof (n = e.constructor) || n !== Array && !se(n.prototype) ? isObject(n) && null === (n = n[ye]) && (n = void 0) : n = void 0),
new (void 0 === n ? Array : n)(0 === t ? 0 : t)
}, ve = getBuiltIn("navigator", "userAgent") || "", ge = t.process, me = ge && ge.versions, be = me && me.v8;
be ? B = (U = be.split("."))[0] + U[1] : ve && (!(U = ve.match(/Edge\/(\d+)/)) || U[1] >= 74) && (U = ve.match(/Chrome\/(\d+)/)) && (B = U[1]);
var we = B && +B
, Se = wellKnownSymbol("species")
, arrayMethodHasSpeciesSupport = function(e) {
return we >= 51 || !fails((function() {
var t = [];
return (t.constructor = {})[Se] = function() {
return {
foo: 1
}
}
,
1 !== t[e](Boolean).foo
}
))
}
, _e = wellKnownSymbol("isConcatSpreadable")
, ke = we >= 51 || !fails((function() {
var e = [];
return e[_e] = !1,
e.concat()[0] !== e
}
))
, xe = arrayMethodHasSpeciesSupport("concat")
, isConcatSpreadable = function(e) {
if (!isObject(e))
return !1;
var t = e[_e];
return void 0 !== t ? !!t : se(e)
};
_export({
target: "Array",
proto: !0,
forced: !ke || !xe
}, {
concat: function concat(e) {
var t, n, r, o, a, i = toObject(this), u = arraySpeciesCreate(i, 0), c = 0;
for (t = -1,
r = arguments.length; t < r; t++)
if (isConcatSpreadable(a = -1 === t ? i : arguments[t])) {
if (c + (o = toLength(a.length)) > 9007199254740991)
throw TypeError("Maximum allowed index exceeded");
for (n = 0; n < o; n++,
c++)
n in a && createProperty(u, c, a[n])
} else {
if (c >= 9007199254740991)
throw TypeError("Maximum allowed index exceeded");
createProperty(u, c++, a)
}
return u.length = c,
u
}
});
var aFunction$1 = function(e) {
if ("function" != typeof e)
throw TypeError(String(e) + " is not a function");
return e
}
, functionBindContext = function(e, t, n) {
if (aFunction$1(e),
void 0 === t)
return e;
switch (n) {
case 0:
return function() {
return e.call(t)
}
;
case 1:
return function(n) {
return e.call(t, n)
}
;
case 2:
return function(n, r) {
return e.call(t, n, r)
}
;
case 3:
return function(n, r, o) {
return e.call(t, n, r, o)
}
}
return function() {
return e.apply(t, arguments)
}
}
, Ae = [].push
, createMethod$1 = function(e) {
var t = 1 == e
, n = 2 == e
, r = 3 == e
, o = 4 == e
, a = 6 == e
, i = 5 == e || a;
return function(u, s, l, f) {
for (var h, p, d = toObject(u), y = c(d), v = functionBindContext(s, l, 3), g = toLength(y.length), m = 0, b = f || arraySpeciesCreate, w = t ? b(u, g) : n ? b(u, 0) : void 0; g > m; m++)
if ((i || m in y) && (p = v(h = y[m], m, d),
e))
if (t)
w[m] = p;
else if (p)
switch (e) {
case 3:
return !0;
case 5:
return h;
case 6:
return m;
case 2:
Ae.call(w, h)
}
else if (o)
return !1;
return a ? -1 : r || o ? o : w
}
}
, Ee = {
forEach: createMethod$1(0),
map: createMethod$1(1),
filter: createMethod$1(2),
some: createMethod$1(3),
every: createMethod$1(4),
find: createMethod$1(5),
findIndex: createMethod$1(6)
}
, arrayMethodIsStrict = function(e, t) {
var n = [][e];
return !!n && fails((function() {
n.call(null, t || function() {
throw 1
}
, 1)
}
))
}
, Re = Object.defineProperty
, Ce = {}
, thrower = function(e) {
throw e
}
, arrayMethodUsesToLength = function(e, t) {
if (has(Ce, e))
return Ce[e];
t || (t = {});
var r = [][e]
, o = !!has(t, "ACCESSORS") && t.ACCESSORS
, a = has(t, 0) ? t[0] : thrower
, i = has(t, 1) ? t[1] : void 0;
return Ce[e] = !!r && !fails((function() {
if (o && !n)
return !0;
var e = {
length: -1
};
o ? Re(e, 1, {
enumerable: !0,
get: thrower
}) : e[1] = 1,
r.call(e, a, i)
}
))
}
, Oe = Ee.forEach
, Te = arrayMethodIsStrict("forEach")
, Pe = arrayMethodUsesToLength("forEach")
, Le = Te && Pe ? [].forEach : function forEach(e) {
return Oe(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
;
_export({
target: "Array",
proto: !0,
forced: [].forEach != Le
}, {
forEach: Le
});
var je = Q.indexOf
, Ie = [].indexOf
, Me = !!Ie && 1 / [1].indexOf(1, -0) < 0
, Fe = arrayMethodIsStrict("indexOf")
, De = arrayMethodUsesToLength("indexOf", {
ACCESSORS: !0,
1: 0
});
_export({
target: "Array",
proto: !0,
forced: Me || !Fe || !De
}, {
indexOf: function indexOf(e) {
return Me ? Ie.apply(this, arguments) || 0 : je(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
});
var Ue, $e = Object.keys || function keys(e) {
return objectKeysInternal(e, J)
}
, Be = n ? Object.defineProperties : function defineProperties(e, t) {
anObject(e);
for (var n, r = $e(t), o = r.length, a = 0; o > a; )
v.f(e, n = r[a++], t[n]);
return e
}
, qe = getBuiltIn("document", "documentElement"), Ne = sharedKey("IE_PROTO"), EmptyConstructor = function() {}, scriptTag = function(e) {
return "<script>" + e + "<\/script>"
}, NullProtoObject = function() {
try {
Ue = document.domain && new ActiveXObject("htmlfile")
} catch (e) {}
var e, t;
NullProtoObject = Ue ? function(e) {
e.write(scriptTag("")),
e.close();
var t = e.parentWindow.Object;
return e = null,
t
}(Ue) : ((t = documentCreateElement("iframe")).style.display = "none",
qe.appendChild(t),
t.src = String("javascript:"),
(e = t.contentWindow.document).open(),
e.write(scriptTag("document.F=Object")),
e.close(),
e.F);
for (var n = J.length; n--; )
delete NullProtoObject.prototype[J[n]];
return NullProtoObject()
};
T[Ne] = !0;
var Ge = Object.create || function create(e, t) {
var n;
return null !== e ? (EmptyConstructor.prototype = anObject(e),
n = new EmptyConstructor,
EmptyConstructor.prototype = null,
n[Ne] = e) : n = NullProtoObject(),
void 0 === t ? n : Be(n, t)
}
, We = wellKnownSymbol("unscopables")
, ze = Array.prototype;
null == ze[We] && v.f(ze, We, {
configurable: !0,
value: Ge(null)
});
var Ve, He, Ye, addToUnscopables = function(e) {
ze[We][e] = !0
}, Qe = {}, Ke = !fails((function() {
function F() {}
return F.prototype.constructor = null,
Object.getPrototypeOf(new F) !== F.prototype
}
)), Je = sharedKey("IE_PROTO"), Xe = Object.prototype, Ze = Ke ? Object.getPrototypeOf : function(e) {
return e = toObject(e),
has(e, Je) ? e[Je] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? Xe : null
}
, et = wellKnownSymbol("iterator"), tt = !1;
[].keys && ("next"in (Ye = [].keys()) ? (He = Ze(Ze(Ye))) !== Object.prototype && (Ve = He) : tt = !0),
null == Ve && (Ve = {}),
has(Ve, et) || g(Ve, et, (function() {
return this
}
));
var nt = {
IteratorPrototype: Ve,
BUGGY_SAFARI_ITERATORS: tt
}
, rt = v.f
, ot = wellKnownSymbol("toStringTag")
, setToStringTag = function(e, t, n) {
e && !has(e = n ? e : e.prototype, ot) && rt(e, ot, {
configurable: !0,
value: t
})
}
, at = nt.IteratorPrototype
, returnThis$1 = function() {
return this
}
, createIteratorConstructor = function(e, t, n) {
var r = t + " Iterator";
return e.prototype = Ge(at, {
next: createPropertyDescriptor(1, n)
}),
setToStringTag(e, r, !1),
Qe[r] = returnThis$1,
e
}
, it = Object.setPrototypeOf || ("__proto__"in {} ? function() {
var e, t = !1, n = {};
try {
(e = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(n, []),
t = n instanceof Array
} catch (e) {}
return function setPrototypeOf(n, r) {
return anObject(n),
function(e) {
if (!isObject(e) && null !== e)
throw TypeError("Can't set " + String(e) + " as a prototype")
}(r),
t ? e.call(n, r) : n.__proto__ = r,
n
}
}() : void 0)
, ut = nt.IteratorPrototype
, ct = nt.BUGGY_SAFARI_ITERATORS
, st = wellKnownSymbol("iterator")
, returnThis$2 = function() {
return this
}
, defineIterator = function(e, t, n, r, o, a, i) {
createIteratorConstructor(n, t, r);
var u, c, s, getIterationMethod = function(e) {
if (e === o && d)
return d;
if (!ct && e in h)
return h[e];
switch (e) {
case "keys":
return function keys() {
return new n(this,e)
}
;
case "values":
return function values() {
return new n(this,e)
}
;
case "entries":
return function entries() {
return new n(this,e)
}
}
return function() {
return new n(this)
}
}, l = t + " Iterator", f = !1, h = e.prototype, p = h[st] || h["@@iterator"] || o && h[o], d = !ct && p || getIterationMethod(o), y = "Array" == t && h.entries || p;
if (y && (u = Ze(y.call(new e)),
ut !== Object.prototype && u.next && (Ze(u) !== ut && (it ? it(u, ut) : "function" != typeof u[st] && g(u, st, returnThis$2)),
setToStringTag(u, l, !0))),
"values" == o && p && "values" !== p.name && (f = !0,
d = function values() {
return p.call(this)
}
),
h[st] !== d && g(h, st, d),
Qe[t] = d,
o)
if (c = {
values: getIterationMethod("values"),
keys: a ? d : getIterationMethod("keys"),
entries: getIterationMethod("entries")
},
i)
for (s in c)
(ct || f || !(s in h)) && N(h, s, c[s]);
else
_export({
target: t,
proto: !0,
forced: ct || f
}, c);
return c
}
, lt = q.set
, ft = q.getterFor("Array Iterator")
, ht = defineIterator(Array, "Array", (function(e, t) {
lt(this, {
type: "Array Iterator",
target: toIndexedObject(e),
index: 0,
kind: t
})
}
), (function() {
var e = ft(this)
, t = e.target
, n = e.kind
, r = e.index++;
return !t || r >= t.length ? (e.target = void 0,
{
value: void 0,
done: !0
}) : "keys" == n ? {
value: r,
done: !1
} : "values" == n ? {
value: t[r],
done: !1
} : {
value: [r, t[r]],
done: !1
}
}
), "values");
Qe.Arguments = Qe.Array,
addToUnscopables("keys"),
addToUnscopables("values"),
addToUnscopables("entries");
var pt = [].join
, dt = c != Object
, yt = arrayMethodIsStrict("join", ",");
_export({
target: "Array",
proto: !0,
forced: dt || !yt
}, {
join: function join(e) {
return pt.call(toIndexedObject(this), void 0 === e ? "," : e)
}
});
var vt = Ee.map
, gt = arrayMethodHasSpeciesSupport("map")
, mt = arrayMethodUsesToLength("map");
_export({
target: "Array",
proto: !0,
forced: !gt || !mt
}, {
map: function map(e) {
return vt(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
});
var bt = "undefined" != typeof ArrayBuffer && "undefined" != typeof DataView
, redefineAll = function(e, t, n) {
for (var r in t)
N(e, r, t[r], n);
return e
}
, anInstance = function(e, t, n) {
if (!(e instanceof t))
throw TypeError("Incorrect " + (n ? n + " " : "") + "invocation");
return e
}
, toIndex = function(e) {
if (void 0 === e)
return 0;
var t = toInteger(e)
, n = toLength(t);
if (t !== n)
throw RangeError("Wrong length or index");
return n
}
, wt = Math.abs
, St = Math.pow
, _t = Math.floor
, kt = Math.log
, xt = Math.LN2
, ieee754_pack = function(e, t, n) {
var r, o, a, i = new Array(n), u = 8 * n - t - 1, c = (1 << u) - 1, s = c >> 1, l = 23 === t ? St(2, -24) - St(2, -77) : 0, f = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0, h = 0;
for ((e = wt(e)) != e || Infinity === e ? (o = e != e ? 1 : 0,
r = c) : (r = _t(kt(e) / xt),
e * (a = St(2, -r)) < 1 && (r--,
a *= 2),
(e += r + s >= 1 ? l / a : l * St(2, 1 - s)) * a >= 2 && (r++,
a /= 2),
r + s >= c ? (o = 0,
r = c) : r + s >= 1 ? (o = (e * a - 1) * St(2, t),
r += s) : (o = e * St(2, s - 1) * St(2, t),
r = 0)); t >= 8; i[h++] = 255 & o,
o /= 256,
t -= 8)
;
for (r = r << t | o,
u += t; u > 0; i[h++] = 255 & r,
r /= 256,
u -= 8)
;
return i[--h] |= 128 * f,
i
}
, ieee754_unpack = function(e, t) {
var n, r = e.length, o = 8 * r - t - 1, a = (1 << o) - 1, i = a >> 1, u = o - 7, c = r - 1, s = e[c--], l = 127 & s;
for (s >>= 7; u > 0; l = 256 * l + e[c],
c--,
u -= 8)
;
for (n = l & (1 << -u) - 1,
l >>= -u,
u += t; u > 0; n = 256 * n + e[c],
c--,
u -= 8)
;
if (0 === l)
l = 1 - i;
else {
if (l === a)
return n ? NaN : s ? -Infinity : Infinity;
n += St(2, t),
l -= i
}
return (s ? -1 : 1) * n * St(2, l - t)
}
, At = function fill(e) {
for (var t = toObject(this), n = toLength(t.length), r = arguments.length, o = toAbsoluteIndex(r > 1 ? arguments[1] : void 0, n), a = r > 2 ? arguments[2] : void 0, i = void 0 === a ? n : toAbsoluteIndex(a, n); i > o; )
t[o++] = e;
return t
}
, Et = Z.f
, Rt = v.f
, Ct = q.get
, Ot = q.set
, Tt = t.ArrayBuffer
, Pt = Tt
, Lt = t.DataView
, jt = Lt && Lt.prototype
, It = Object.prototype
, Mt = t.RangeError
, Ft = ieee754_pack
, Dt = ieee754_unpack
, packInt8 = function(e) {
return [255 & e]
}
, packInt16 = function(e) {
return [255 & e, e >> 8 & 255]
}
, packInt32 = function(e) {
return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255]
}
, unpackInt32 = function(e) {
return e[3] << 24 | e[2] << 16 | e[1] << 8 | e[0]
}
, packFloat32 = function(e) {
return Ft(e, 23, 4)
}
, packFloat64 = function(e) {
return Ft(e, 52, 8)
}
, addGetter = function(e, t) {
Rt(e.prototype, t, {
get: function() {
return Ct(this)[t]
}
})
}
, get$1 = function(e, t, n, r) {
var o = toIndex(n)
, a = Ct(e);
if (o + t > a.byteLength)
throw Mt("Wrong index");
var i = Ct(a.buffer).bytes
, u = o + a.byteOffset
, c = i.slice(u, u + t);
return r ? c : c.reverse()
}
, set$1 = function(e, t, n, r, o, a) {
var i = toIndex(n)
, u = Ct(e);
if (i + t > u.byteLength)
throw Mt("Wrong index");
for (var c = Ct(u.buffer).bytes, s = i + u.byteOffset, l = r(+o), f = 0; f < t; f++)
c[s + f] = l[a ? f : t - f - 1]
};
if (bt) {
if (!fails((function() {
Tt(1)
}
)) || !fails((function() {
new Tt(-1)
}
)) || fails((function() {
return new Tt,
new Tt(1.5),
new Tt(NaN),
"ArrayBuffer" != Tt.name
}
))) {
for (var Ut, $t = (Pt = function ArrayBuffer(e) {
return anInstance(this, Pt),
new Tt(toIndex(e))
}
).prototype = Tt.prototype, Bt = Et(Tt), qt = 0; Bt.length > qt; )
(Ut = Bt[qt++])in Pt || g(Pt, Ut, Tt[Ut]);
$t.constructor = Pt
}
it && Ze(jt) !== It && it(jt, It);
var Nt = new Lt(new Pt(2))
, Gt = jt.setInt8;
Nt.setInt8(0, 2147483648),
Nt.setInt8(1, 2147483649),
!Nt.getInt8(0) && Nt.getInt8(1) || redefineAll(jt, {
setInt8: function setInt8(e, t) {
Gt.call(this, e, t << 24 >> 24)
},
setUint8: function setUint8(e, t) {
Gt.call(this, e, t << 24 >> 24)
}
}, {
unsafe: !0
})
} else
Pt = function ArrayBuffer(e) {
anInstance(this, Pt, "ArrayBuffer");
var t = toIndex(e);
Ot(this, {
bytes: At.call(new Array(t), 0),
byteLength: t
}),
n || (this.byteLength = t)
}
,
Lt = function DataView(e, t, r) {
anInstance(this, Lt, "DataView"),
anInstance(e, Pt, "DataView");
var o = Ct(e).byteLength
, a = toInteger(t);
if (a < 0 || a > o)
throw Mt("Wrong offset");
if (a + (r = void 0 === r ? o - a : toLength(r)) > o)
throw Mt("Wrong length");
Ot(this, {
buffer: e,
byteLength: r,
byteOffset: a
}),
n || (this.buffer = e,
this.byteLength = r,
this.byteOffset = a)
}
,
n && (addGetter(Pt, "byteLength"),
addGetter(Lt, "buffer"),
addGetter(Lt, "byteLength"),
addGetter(Lt, "byteOffset")),
redefineAll(Lt.prototype, {
getInt8: function getInt8(e) {
return get$1(this, 1, e)[0] << 24 >> 24
},
getUint8: function getUint8(e) {
return get$1(this, 1, e)[0]
},
getInt16: function getInt16(e) {
var t = get$1(this, 2, e, arguments.length > 1 ? arguments[1] : void 0);
return (t[1] << 8 | t[0]) << 16 >> 16
},
getUint16: function getUint16(e) {
var t = get$1(this, 2, e, arguments.length > 1 ? arguments[1] : void 0);
return t[1] << 8 | t[0]
},
getInt32: function getInt32(e) {
return unpackInt32(get$1(this, 4, e, arguments.length > 1 ? arguments[1] : void 0))
},
getUint32: function getUint32(e) {
return unpackInt32(get$1(this, 4, e, arguments.length > 1 ? arguments[1] : void 0)) >>> 0
},
getFloat32: function getFloat32(e) {
return Dt(get$1(this, 4, e, arguments.length > 1 ? arguments[1] : void 0), 23)
},
getFloat64: function getFloat64(e) {
return Dt(get$1(this, 8, e, arguments.length > 1 ? arguments[1] : void 0), 52)
},
setInt8: function setInt8(e, t) {
set$1(this, 1, e, packInt8, t)
},
setUint8: function setUint8(e, t) {
set$1(this, 1, e, packInt8, t)
},
setInt16: function setInt16(e, t) {
set$1(this, 2, e, packInt16, t, arguments.length > 2 ? arguments[2] : void 0)
},
setUint16: function setUint16(e, t) {
set$1(this, 2, e, packInt16, t, arguments.length > 2 ? arguments[2] : void 0)
},
setInt32: function setInt32(e, t) {
set$1(this, 4, e, packInt32, t, arguments.length > 2 ? arguments[2] : void 0)
},
setUint32: function setUint32(e, t) {
set$1(this, 4, e, packInt32, t, arguments.length > 2 ? arguments[2] : void 0)
},
setFloat32: function setFloat32(e, t) {
set$1(this, 4, e, packFloat32, t, arguments.length > 2 ? arguments[2] : void 0)
},
setFloat64: function setFloat64(e, t) {
set$1(this, 8, e, packFloat64, t, arguments.length > 2 ? arguments[2] : void 0)
}
});
setToStringTag(Pt, "ArrayBuffer"),
setToStringTag(Lt, "DataView");
var Wt = {
ArrayBuffer: Pt,
DataView: Lt
}
, zt = wellKnownSymbol("species")
, setSpecies = function(e) {
var t = getBuiltIn(e)
, r = v.f;
n && t && !t[zt] && r(t, zt, {
configurable: !0,
get: function() {
return this
}
})
}
, Vt = Wt.ArrayBuffer
, Ht = t.ArrayBuffer;
_export({
global: !0,
forced: Ht !== Vt
}, {
ArrayBuffer: Vt
}),
setSpecies("ArrayBuffer");
var Yt = wellKnownSymbol("species")
, speciesConstructor = function(e, t) {
var n, r = anObject(e).constructor;
return void 0 === r || null == (n = anObject(r)[Yt]) ? t : aFunction$1(n)
}
, Qt = Wt.ArrayBuffer
, Kt = Wt.DataView
, Jt = Qt.prototype.slice
, Xt = fails((function() {
return !new Qt(2).slice(1, void 0).byteLength
}
));
_export({
target: "ArrayBuffer",
proto: !0,
unsafe: !0,
forced: Xt
}, {
slice: function slice(e, t) {
if (void 0 !== Jt && void 0 === t)
return Jt.call(anObject(this), e);
for (var n = anObject(this).byteLength, r = toAbsoluteIndex(e, n), o = toAbsoluteIndex(void 0 === t ? n : t, n), a = new (speciesConstructor(this, Qt))(toLength(o - r)), i = new Kt(this), u = new Kt(a), c = 0; r < o; )
u.setUint8(c++, i.getUint8(r++));
return a
}
});
var Zt = v.f
, en = Function.prototype
, tn = en.toString
, nn = /^\s*function ([^ (]*)/;
n && !("name"in en) && Zt(en, "name", {
configurable: !0,
get: function() {
try {
return tn.call(this).match(nn)[1]
} catch (e) {
return ""
}
}
});
var rn = {};
rn[wellKnownSymbol("toStringTag")] = "z";
var on = "[object z]" === String(rn)
, an = wellKnownSymbol("toStringTag")
, un = "Arguments" == classofRaw(function() {
return arguments
}())
, cn = on ? classofRaw : function(e) {
var t, n, r;
return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (n = function(e, t) {
try {
return e[t]
} catch (e) {}
}(t = Object(e), an)) ? n : un ? classofRaw(t) : "Object" == (r = classofRaw(t)) && "function" == typeof t.callee ? "Arguments" : r
}
, sn = on ? {}.toString : function toString() {
return "[object " + cn(this) + "]"
}
;
on || N(Object.prototype, "toString", sn, {
unsafe: !0
});
var ln = t.Promise
, fn = wellKnownSymbol("iterator")
, hn = Array.prototype
, isArrayIteratorMethod = function(e) {
return void 0 !== e && (Qe.Array === e || hn[fn] === e)
}
, pn = wellKnownSymbol("iterator")
, getIteratorMethod = function(e) {
if (null != e)
return e[pn] || e["@@iterator"] || Qe[cn(e)]
}
, callWithSafeIterationClosing = function(e, t, n, r) {
try {
return r ? t(anObject(n)[0], n[1]) : t(n)
} catch (t) {
var o = e.return;
throw void 0 !== o && anObject(o.call(e)),
t
}
}
, dn = createCommonjsModule((function(e) {
var Result = function(e, t) {
this.stopped = e,
this.result = t
};
(e.exports = function(e, t, n, r, o) {
var a, i, u, c, s, l, f, h = functionBindContext(t, n, r ? 2 : 1);
if (o)
a = e;
else {
if ("function" != typeof (i = getIteratorMethod(e)))
throw TypeError("Target is not iterable");
if (isArrayIteratorMethod(i)) {
for (u = 0,
c = toLength(e.length); c > u; u++)
if ((s = r ? h(anObject(f = e[u])[0], f[1]) : h(e[u])) && s instanceof Result)
return s;
return new Result(!1)
}
a = i.call(e)
}
for (l = a.next; !(f = l.call(a)).done; )
if ("object" == typeof (s = callWithSafeIterationClosing(a, h, f.value, r)) && s && s instanceof Result)
return s;
return new Result(!1)
}
).stop = function(e) {
return new Result(!0,e)
}
}
))
, yn = wellKnownSymbol("iterator")
, vn = !1;
try {
var gn = 0
, mn = {
next: function() {
return {
done: !!gn++
}
},
return: function() {
vn = !0
}
};
mn[yn] = function() {
return this
}
,
Array.from(mn, (function() {
throw 2
}
))
} catch (e) {}
var bn, wn, Sn, checkCorrectnessOfIteration = function(e, t) {
if (!t && !vn)
return !1;
var n = !1;
try {
var r = {};
r[yn] = function() {
return {
next: function() {
return {
done: n = !0
}
}
}
}
,
e(r)
} catch (e) {}
return n
}, _n = /(iphone|ipod|ipad).*applewebkit/i.test(ve), kn = t.location, xn = t.setImmediate, An = t.clearImmediate, En = t.process, Rn = t.MessageChannel, Cn = t.Dispatch, On = 0, Tn = {}, run = function(e) {
if (Tn.hasOwnProperty(e)) {
var t = Tn[e];
delete Tn[e],
t()
}
}, runner = function(e) {
return function() {
run(e)
}
}, listener = function(e) {
run(e.data)
}, post = function(e) {
t.postMessage(e + "", kn.protocol + "//" + kn.host)
};
xn && An || (xn = function setImmediate(e) {
for (var t = [], n = 1; arguments.length > n; )
t.push(arguments[n++]);
return Tn[++On] = function() {
("function" == typeof e ? e : Function(e)).apply(void 0, t)
}
,
bn(On),
On
}
,
An = function clearImmediate(e) {
delete Tn[e]
}
,
"process" == classofRaw(En) ? bn = function(e) {
En.nextTick(runner(e))
}
: Cn && Cn.now ? bn = function(e) {
Cn.now(runner(e))
}
: Rn && !_n ? (Sn = (wn = new Rn).port2,
wn.port1.onmessage = listener,
bn = functionBindContext(Sn.postMessage, Sn, 1)) : !t.addEventListener || "function" != typeof postMessage || t.importScripts || fails(post) || "file:" === kn.protocol ? bn = "onreadystatechange"in documentCreateElement("script") ? function(e) {
qe.appendChild(documentCreateElement("script")).onreadystatechange = function() {
qe.removeChild(this),
run(e)
}
}
: function(e) {
setTimeout(runner(e), 0)
}
: (bn = post,
t.addEventListener("message", listener, !1)));
var Pn, Ln, jn, In, Mn, Fn, Dn, Un, $n = {
set: xn,
clear: An
}, Bn = d.f, qn = $n.set, Nn = t.MutationObserver || t.WebKitMutationObserver, Gn = t.process, Wn = t.Promise, zn = "process" == classofRaw(Gn), Vn = Bn(t, "queueMicrotask"), Hn = Vn && Vn.value;
Hn || (Pn = function() {
var e, t;
for (zn && (e = Gn.domain) && e.exit(); Ln; ) {
t = Ln.fn,
Ln = Ln.next;
try {
t()
} catch (e) {
throw Ln ? In() : jn = void 0,
e
}
}
jn = void 0,
e && e.enter()
}
,
zn ? In = function() {
Gn.nextTick(Pn)
}
: Nn && !_n ? (Mn = !0,
Fn = document.createTextNode(""),
new Nn(Pn).observe(Fn, {
characterData: !0
}),
In = function() {
Fn.data = Mn = !Mn
}
) : Wn && Wn.resolve ? (Dn = Wn.resolve(void 0),
Un = Dn.then,
In = function() {
Un.call(Dn, Pn)
}
) : In = function() {
qn.call(t, Pn)
}
);
var Yn, Qn, Kn, Jn, Xn = Hn || function(e) {
var t = {
fn: e,
next: void 0
};
jn && (jn.next = t),
Ln || (Ln = t,
In()),
jn = t
}
, PromiseCapability = function(e) {
var t, n;
this.promise = new e((function(e, r) {
if (void 0 !== t || void 0 !== n)
throw TypeError("Bad Promise constructor");
t = e,
n = r
}
)),
this.resolve = aFunction$1(t),
this.reject = aFunction$1(n)
}, Zn = {
f: function(e) {
return new PromiseCapability(e)
}
}, promiseResolve = function(e, t) {
if (anObject(e),
isObject(t) && t.constructor === e)
return t;
var n = Zn.f(e);
return (0,
n.resolve)(t),
n.promise
}, perform = function(e) {
try {
return {
error: !1,
value: e()
}
} catch (e) {
return {
error: !0,
value: e
}
}
}, er = $n.set, tr = wellKnownSymbol("species"), nr = "Promise", rr = q.get, or = q.set, ar = q.getterFor(nr), ir = ln, ur = t.TypeError, cr = t.document, sr = t.process, lr = getBuiltIn("fetch"), fr = Zn.f, hr = fr, pr = "process" == classofRaw(sr), dr = !!(cr && cr.createEvent && t.dispatchEvent), yr = ue(nr, (function() {
if (!(k(ir) !== String(ir))) {
if (66 === we)
return !0;
if (!pr && "function" != typeof PromiseRejectionEvent)
return !0
}
if (we >= 51 && /native code/.test(ir))
return !1;
var e = ir.resolve(1)
, FakePromise = function(e) {
e((function() {}
), (function() {}
))
};
return (e.constructor = {})[tr] = FakePromise,
!(e.then((function() {}
))instanceof FakePromise)
}
)), vr = yr || !checkCorrectnessOfIteration((function(e) {
ir.all(e).catch((function() {}
))
}
)), isThenable = function(e) {
var t;
return !(!isObject(e) || "function" != typeof (t = e.then)) && t
}, notify$1 = function(e, t, n) {
if (!t.notified) {
t.notified = !0;
var r = t.reactions;
Xn((function() {
for (var o = t.value, a = 1 == t.state, i = 0; r.length > i; ) {
var u, c, s, l = r[i++], f = a ? l.ok : l.fail, h = l.resolve, p = l.reject, d = l.domain;
try {
f ? (a || (2 === t.rejection && onHandleUnhandled(e, t),
t.rejection = 1),
!0 === f ? u = o : (d && d.enter(),
u = f(o),
d && (d.exit(),
s = !0)),
u === l.promise ? p(ur("Promise-chain cycle")) : (c = isThenable(u)) ? c.call(u, h, p) : h(u)) : p(o)
} catch (e) {
d && !s && d.exit(),
p(e)
}
}
t.reactions = [],
t.notified = !1,
n && !t.rejection && onUnhandled(e, t)
}
))
}
}, dispatchEvent = function(e, n, r) {
var o, a;
dr ? ((o = cr.createEvent("Event")).promise = n,
o.reason = r,
o.initEvent(e, !1, !0),
t.dispatchEvent(o)) : o = {
promise: n,
reason: r
},
(a = t["on" + e]) ? a(o) : "unhandledrejection" === e && function(e, n) {
var r = t.console;
r && r.error && (1 === arguments.length ? r.error(e) : r.error(e, n))
}("Unhandled promise rejection", r)
}, onUnhandled = function(e, n) {
er.call(t, (function() {
var t, r = n.value;
if (isUnhandled(n) && (t = perform((function() {
pr ? sr.emit("unhandledRejection", r, e) : dispatchEvent("unhandledrejection", e, r)
}
)),
n.rejection = pr || isUnhandled(n) ? 2 : 1,
t.error))
throw t.value
}
))
}, isUnhandled = function(e) {
return 1 !== e.rejection && !e.parent
}, onHandleUnhandled = function(e, n) {
er.call(t, (function() {
pr ? sr.emit("rejectionHandled", e) : dispatchEvent("rejectionhandled", e, n.value)
}
))
}, bind = function(e, t, n, r) {
return function(o) {
e(t, n, o, r)
}
}, internalReject = function(e, t, n, r) {
t.done || (t.done = !0,
r && (t = r),
t.value = n,
t.state = 2,
notify$1(e, t, !0))
}, internalResolve = function(e, t, n, r) {
if (!t.done) {
t.done = !0,
r && (t = r);
try {
if (e === n)
throw ur("Promise can't be resolved itself");
var o = isThenable(n);
o ? Xn((function() {
var r = {
done: !1
};
try {
o.call(n, bind(internalResolve, e, r, t), bind(internalReject, e, r, t))
} catch (n) {
internalReject(e, r, n, t)
}
}
)) : (t.value = n,
t.state = 1,
notify$1(e, t, !1))
} catch (n) {
internalReject(e, {
done: !1
}, n, t)
}
}
};
yr && (ir = function Promise(e) {
anInstance(this, ir, nr),
aFunction$1(e),
Yn.call(this);
var t = rr(this);
try {
e(bind(internalResolve, this, t), bind(internalReject, this, t))
} catch (e) {
internalReject(this, t, e)
}
}
,
(Yn = function Promise(e) {
or(this, {
type: nr,
done: !1,
notified: !1,
parent: !1,
reactions: [],
rejection: !1,
state: 0,
value: void 0
})
}
).prototype = redefineAll(ir.prototype, {
then: function then(e, t) {
var n = ar(this)
, r = fr(speciesConstructor(this, ir));
return r.ok = "function" != typeof e || e,
r.fail = "function" == typeof t && t,
r.domain = pr ? sr.domain : void 0,
n.parent = !0,
n.reactions.push(r),
0 != n.state && notify$1(this, n, !1),
r.promise
},
catch: function(e) {
return this.then(void 0, e)
}
}),
Qn = function() {
var e = new Yn
, t = rr(e);
this.promise = e,
this.resolve = bind(internalResolve, e, t),
this.reject = bind(internalReject, e, t)
}
,
Zn.f = fr = function(e) {
return e === ir || e === Kn ? new Qn(e) : hr(e)
}
,
"function" == typeof ln && (Jn = ln.prototype.then,
N(ln.prototype, "then", (function then(e, t) {
var n = this;
return new ir((function(e, t) {
Jn.call(n, e, t)
}
)).then(e, t)
}
), {
unsafe: !0
}),
"function" == typeof lr && _export({
global: !0,
enumerable: !0,
forced: !0
}, {
fetch: function fetch(e) {
return promiseResolve(ir, lr.apply(t, arguments))
}
}))),
_export({
global: !0,
wrap: !0,
forced: yr
}, {
Promise: ir
}),
setToStringTag(ir, nr, !1),
setSpecies(nr),
Kn = getBuiltIn(nr),
_export({
target: nr,
stat: !0,
forced: yr
}, {
reject: function reject(e) {
var t = fr(this);
return t.reject.call(void 0, e),
t.promise
}
}),
_export({
target: nr,
stat: !0,
forced: yr
}, {
resolve: function resolve(e) {
return promiseResolve(this, e)
}
}),
_export({
target: nr,
stat: !0,
forced: vr
}, {
all: function all(e) {
var t = this
, n = fr(t)
, r = n.resolve
, o = n.reject
, a = perform((function() {
var n = aFunction$1(t.resolve)
, a = []
, i = 0
, u = 1;
dn(e, (function(e) {
var c = i++
, s = !1;
a.push(void 0),
u++,
n.call(t, e).then((function(e) {
s || (s = !0,
a[c] = e,
--u || r(a))
}
), o)
}
)),
--u || r(a)
}
));
return a.error && o(a.value),
n.promise
},
race: function race(e) {
var t = this
, n = fr(t)
, r = n.reject
, o = perform((function() {
var o = aFunction$1(t.resolve);
dn(e, (function(e) {
o.call(t, e).then(n.resolve, r)
}
))
}
));
return o.error && r(o.value),
n.promise
}
});
var regexpFlags = function() {
var e = anObject(this)
, t = "";
return e.global && (t += "g"),
e.ignoreCase && (t += "i"),
e.multiline && (t += "m"),
e.dotAll && (t += "s"),
e.unicode && (t += "u"),
e.sticky && (t += "y"),
t
};
function RE(e, t) {
return RegExp(e, t)
}
var gr, mr, br = {
UNSUPPORTED_Y: fails((function() {
var e = RE("a", "y");
return e.lastIndex = 2,
null != e.exec("abcd")
}
)),
BROKEN_CARET: fails((function() {
var e = RE("^r", "gy");
return e.lastIndex = 2,
null != e.exec("str")
}
))
}, wr = RegExp.prototype.exec, Sr = String.prototype.replace, _r = wr, kr = (gr = /a/,
mr = /b*/g,
wr.call(gr, "a"),
wr.call(mr, "a"),
0 !== gr.lastIndex || 0 !== mr.lastIndex), xr = br.UNSUPPORTED_Y || br.BROKEN_CARET, Ar = void 0 !== /()??/.exec("")[1];
(kr || Ar || xr) && (_r = function exec(e) {
var t, n, r, o, a = this, i = xr && a.sticky, u = regexpFlags.call(a), c = a.source, s = 0, l = e;
return i && (-1 === (u = u.replace("y", "")).indexOf("g") && (u += "g"),
l = String(e).slice(a.lastIndex),
a.lastIndex > 0 && (!a.multiline || a.multiline && "\n" !== e[a.lastIndex - 1]) && (c = "(?: " + c + ")",
l = " " + l,
s++),
n = new RegExp("^(?:" + c + ")",u)),
Ar && (n = new RegExp("^" + c + "$(?!\\s)",u)),
kr && (t = a.lastIndex),
r = wr.call(i ? n : a, l),
i ? r ? (r.input = r.input.slice(s),
r[0] = r[0].slice(s),
r.index = a.lastIndex,
a.lastIndex += r[0].length) : a.lastIndex = 0 : kr && r && (a.lastIndex = a.global ? r.index + r[0].length : t),
Ar && r && r.length > 1 && Sr.call(r[0], n, (function() {
for (o = 1; o < arguments.length - 2; o++)
void 0 === arguments[o] && (r[o] = void 0)
}
)),
r
}
);
var Er = _r;
_export({
target: "RegExp",
proto: !0,
forced: /./.exec !== Er
}, {
exec: Er
});
var createMethod$2 = function(e) {
return function(t, n) {
var r, o, a = String(requireObjectCoercible(t)), i = toInteger(n), u = a.length;
return i < 0 || i >= u ? e ? "" : void 0 : (r = a.charCodeAt(i)) < 55296 || r > 56319 || i + 1 === u || (o = a.charCodeAt(i + 1)) < 56320 || o > 57343 ? e ? a.charAt(i) : r : e ? a.slice(i, i + 2) : o - 56320 + (r - 55296 << 10) + 65536
}
}
, Rr = {
codeAt: createMethod$2(!1),
charAt: createMethod$2(!0)
}
, Cr = Rr.charAt
, Or = q.set
, Tr = q.getterFor("String Iterator");
defineIterator(String, "String", (function(e) {
Or(this, {
type: "String Iterator",
string: String(e),
index: 0
})
}
), (function next() {
var e, t = Tr(this), n = t.string, r = t.index;
return r >= n.length ? {
value: void 0,
done: !0
} : (e = Cr(n, r),
t.index += e.length,
{
value: e,
done: !1
})
}
));
var Pr = wellKnownSymbol("species")
, Lr = !fails((function() {
var e = /./;
return e.exec = function() {
var e = [];
return e.groups = {
a: "7"
},
e
}
,
"7" !== "".replace(e, "$<a>")
}
))
, jr = "$0" === "a".replace(/./, "$0")
, Ir = wellKnownSymbol("replace")
, Mr = !!/./[Ir] && "" === /./[Ir]("a", "$0")
, Fr = !fails((function() {
var e = /(?:)/
, t = e.exec;
e.exec = function() {
return t.apply(this, arguments)
}
;
var n = "ab".split(e);
return 2 !== n.length || "a" !== n[0] || "b" !== n[1]
}
))
, fixRegexpWellKnownSymbolLogic = function(e, t, n, r) {
var o = wellKnownSymbol(e)
, a = !fails((function() {
var t = {};
return t[o] = function() {
return 7
}
,
7 != ""[e](t)
}
))
, i = a && !fails((function() {
var t = !1
, n = /a/;
return "split" === e && ((n = {}).constructor = {},
n.constructor[Pr] = function() {
return n
}
,
n.flags = "",
n[o] = /./[o]),
n.exec = function() {
return t = !0,
null
}
,
n[o](""),
!t
}
));
if (!a || !i || "replace" === e && (!Lr || !jr || Mr) || "split" === e && !Fr) {
var u = /./[o]
, c = n(o, ""[e], (function(e, t, n, r, o) {
return t.exec === Er ? a && !o ? {
done: !0,
value: u.call(t, n, r)
} : {
done: !0,
value: e.call(n, t, r)
} : {
done: !1
}
}
), {
REPLACE_KEEPS_$0: jr,
REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: Mr
})
, s = c[0]
, l = c[1];
N(String.prototype, e, s),
N(RegExp.prototype, o, 2 == t ? function(e, t) {
return l.call(e, this, t)
}
: function(e) {
return l.call(e, this)
}
)
}
r && g(RegExp.prototype[o], "sham", !0)
}
, Dr = Rr.charAt
, advanceStringIndex = function(e, t, n) {
return t + (n ? Dr(e, t).length : 1)
}
, regexpExecAbstract = function(e, t) {
var n = e.exec;
if ("function" == typeof n) {
var r = n.call(e, t);
if ("object" != typeof r)
throw TypeError("RegExp exec method returned something other than an Object or null");
return r
}
if ("RegExp" !== classofRaw(e))
throw TypeError("RegExp#exec called on incompatible receiver");
return Er.call(e, t)
};
fixRegexpWellKnownSymbolLogic("match", 1, (function(e, t, n) {
return [function match(t) {
var n = requireObjectCoercible(this)
, r = null == t ? void 0 : t[e];
return void 0 !== r ? r.call(t, n) : new RegExp(t)[e](String(n))
}
, function(e) {
var r = n(t, e, this);
if (r.done)
return r.value;
var o = anObject(e)
, a = String(this);
if (!o.global)
return regexpExecAbstract(o, a);
var i = o.unicode;
o.lastIndex = 0;
for (var u, c = [], s = 0; null !== (u = regexpExecAbstract(o, a)); ) {
var l = String(u[0]);
c[s] = l,
"" === l && (o.lastIndex = advanceStringIndex(a, toLength(o.lastIndex), i)),
s++
}
return 0 === s ? null : c
}
]
}
));
var Ur = wellKnownSymbol("match")
, isRegexp = function(e) {
var t;
return isObject(e) && (void 0 !== (t = e[Ur]) ? !!t : "RegExp" == classofRaw(e))
}
, $r = [].push
, Br = Math.min
, qr = !fails((function() {
return !RegExp(4294967295, "y")
}
));
fixRegexpWellKnownSymbolLogic("split", 2, (function(e, t, n) {
var r;
return r = "c" == "abbc".split(/(b)*/)[1] || 4 != "test".split(/(?:)/, -1).length || 2 != "ab".split(/(?:ab)*/).length || 4 != ".".split(/(.?)(.?)/).length || ".".split(/()()/).length > 1 || "".split(/.?/).length ? function(e, n) {
var r = String(requireObjectCoercible(this))
, o = void 0 === n ? 4294967295 : n >>> 0;
if (0 === o)
return [];
if (void 0 === e)
return [r];
if (!isRegexp(e))
return t.call(r, e, o);
for (var a, i, u, c = [], s = (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.unicode ? "u" : "") + (e.sticky ? "y" : ""), l = 0, f = new RegExp(e.source,s + "g"); (a = Er.call(f, r)) && !((i = f.lastIndex) > l && (c.push(r.slice(l, a.index)),
a.length > 1 && a.index < r.length && $r.apply(c, a.slice(1)),
u = a[0].length,
l = i,
c.length >= o)); )
f.lastIndex === a.index && f.lastIndex++;
return l === r.length ? !u && f.test("") || c.push("") : c.push(r.slice(l)),
c.length > o ? c.slice(0, o) : c
}
: "0".split(void 0, 0).length ? function(e, n) {
return void 0 === e && 0 === n ? [] : t.call(this, e, n)
}
: t,
[function split(t, n) {
var o = requireObjectCoercible(this)
, a = null == t ? void 0 : t[e];
return void 0 !== a ? a.call(t, o, n) : r.call(String(o), t, n)
}
, function(e, o) {
var a = n(r, e, this, o, r !== t);
if (a.done)
return a.value;
var i = anObject(e)
, u = String(this)
, c = speciesConstructor(i, RegExp)
, s = i.unicode
, l = (i.ignoreCase ? "i" : "") + (i.multiline ? "m" : "") + (i.unicode ? "u" : "") + (qr ? "y" : "g")
, f = new c(qr ? i : "^(?:" + i.source + ")",l)
, h = void 0 === o ? 4294967295 : o >>> 0;
if (0 === h)
return [];
if (0 === u.length)
return null === regexpExecAbstract(f, u) ? [u] : [];
for (var p = 0, d = 0, y = []; d < u.length; ) {
f.lastIndex = qr ? d : 0;
var v, g = regexpExecAbstract(f, qr ? u : u.slice(d));
if (null === g || (v = Br(toLength(f.lastIndex + (qr ? 0 : d)), u.length)) === p)
d = advanceStringIndex(u, d, s);
else {
if (y.push(u.slice(p, d)),
y.length === h)
return y;
for (var m = 1; m <= g.length - 1; m++)
if (y.push(g[m]),
y.length === h)
return y;
d = p = v
}
}
return y.push(u.slice(p)),
y
}
]
}
), !qr);
var Nr, Gr = v.f, Wr = t.Int8Array, zr = Wr && Wr.prototype, Vr = t.Uint8ClampedArray, Hr = Vr && Vr.prototype, Yr = Wr && Ze(Wr), Qr = zr && Ze(zr), Kr = Object.prototype, Jr = Kr.isPrototypeOf, Xr = wellKnownSymbol("toStringTag"), Zr = uid("TYPED_ARRAY_TAG"), eo = bt && !!it && "Opera" !== cn(t.opera), to = !1, no = {
Int8Array: 1,
Uint8Array: 1,
Uint8ClampedArray: 1,
Int16Array: 2,
Uint16Array: 2,
Int32Array: 4,
Uint32Array: 4,
Float32Array: 4,
Float64Array: 8
}, isTypedArray = function(e) {
return isObject(e) && has(no, cn(e))
};
for (Nr in no)
t[Nr] || (eo = !1);
if ((!eo || "function" != typeof Yr || Yr === Function.prototype) && (Yr = function TypedArray() {
throw TypeError("Incorrect invocation")
}
,
eo))
for (Nr in no)
t[Nr] && it(t[Nr], Yr);
if ((!eo || !Qr || Qr === Kr) && (Qr = Yr.prototype,
eo))
for (Nr in no)
t[Nr] && it(t[Nr].prototype, Qr);
if (eo && Ze(Hr) !== Qr && it(Hr, Qr),
n && !has(Qr, Xr))
for (Nr in to = !0,
Gr(Qr, Xr, {
get: function() {
return isObject(this) ? this[Zr] : void 0
}
}),
no)
t[Nr] && g(t[Nr], Zr, Nr);
var ro = {
NATIVE_ARRAY_BUFFER_VIEWS: eo,
TYPED_ARRAY_TAG: to && Zr,
aTypedArray: function(e) {
if (isTypedArray(e))
return e;
throw TypeError("Target is not a typed array")
},
aTypedArrayConstructor: function(e) {
if (it) {
if (Jr.call(Yr, e))
return e
} else
for (var n in no)
if (has(no, Nr)) {
var r = t[n];
if (r && (e === r || Jr.call(r, e)))
return e
}
throw TypeError("Target is not a typed array constructor")
},
exportTypedArrayMethod: function(e, r, o) {
if (n) {
if (o)
for (var a in no) {
var i = t[a];
i && has(i.prototype, e) && delete i.prototype[e]
}
Qr[e] && !o || N(Qr, e, o ? r : eo && zr[e] || r)
}
},
exportTypedArrayStaticMethod: function(e, r, o) {
var a, i;
if (n) {
if (it) {
if (o)
for (a in no)
(i = t[a]) && has(i, e) && delete i[e];
if (Yr[e] && !o)
return;
try {
return N(Yr, e, o ? r : eo && Wr[e] || r)
} catch (e) {}
}
for (a in no)
!(i = t[a]) || i[e] && !o || N(i, e, r)
}
},
isView: function isView(e) {
var t = cn(e);
return "DataView" === t || has(no, t)
},
isTypedArray: isTypedArray,
TypedArray: Yr,
TypedArrayPrototype: Qr
}
, oo = ro.NATIVE_ARRAY_BUFFER_VIEWS
, ao = t.ArrayBuffer
, io = t.Int8Array
, uo = !oo || !fails((function() {
io(1)
}
)) || !fails((function() {
new io(-1)
}
)) || !checkCorrectnessOfIteration((function(e) {
new io,
new io(null),
new io(1.5),
new io(e)
}
), !0) || fails((function() {
return 1 !== new io(new ao(2),1,void 0).length
}
))
, toOffset = function(e, t) {
var n = function(e) {
var t = toInteger(e);
if (t < 0)
throw RangeError("The argument can't be less than 0");
return t
}(e);
if (n % t)
throw RangeError("Wrong offset");
return n
}
, co = ro.aTypedArrayConstructor
, so = function from(e) {
var t, n, r, o, a, i, u = toObject(e), c = arguments.length, s = c > 1 ? arguments[1] : void 0, l = void 0 !== s, f = getIteratorMethod(u);
if (null != f && !isArrayIteratorMethod(f))
for (i = (a = f.call(u)).next,
u = []; !(o = i.call(a)).done; )
u.push(o.value);
for (l && c > 2 && (s = functionBindContext(s, arguments[2], 2)),
n = toLength(u.length),
r = new (co(this))(n),
t = 0; n > t; t++)
r[t] = l ? s(u[t], t) : u[t];
return r
}
, inheritIfRequired = function(e, t, n) {
var r, o;
return it && "function" == typeof (r = t.constructor) && r !== n && isObject(o = r.prototype) && o !== n.prototype && it(e, o),
e
}
, lo = createCommonjsModule((function(e) {
var r = Z.f
, o = Ee.forEach
, a = q.get
, i = q.set
, u = v.f
, c = d.f
, s = Math.round
, l = t.RangeError
, f = Wt.ArrayBuffer
, h = Wt.DataView
, p = ro.NATIVE_ARRAY_BUFFER_VIEWS
, y = ro.TYPED_ARRAY_TAG
, m = ro.TypedArray
, b = ro.TypedArrayPrototype
, w = ro.aTypedArrayConstructor
, S = ro.isTypedArray
, _ = "BYTES_PER_ELEMENT"
, k = "Wrong length"
, fromList = function(e, t) {
for (var n = 0, r = t.length, o = new (w(e))(r); r > n; )
o[n] = t[n++];
return o
}
, addGetter = function(e, t) {
u(e, t, {
get: function() {
return a(this)[t]
}
})
}
, isArrayBuffer = function(e) {
var t;
return e instanceof f || "ArrayBuffer" == (t = cn(e)) || "SharedArrayBuffer" == t
}
, isTypedArrayIndex = function(e, t) {
return S(e) && "symbol" != typeof t && t in e && String(+t) == String(t)
}
, x = function getOwnPropertyDescriptor(e, t) {
return isTypedArrayIndex(e, t = toPrimitive(t, !0)) ? createPropertyDescriptor(2, e[t]) : c(e, t)
}
, A = function defineProperty(e, t, n) {
return !(isTypedArrayIndex(e, t = toPrimitive(t, !0)) && isObject(n) && has(n, "value")) || has(n, "get") || has(n, "set") || n.configurable || has(n, "writable") && !n.writable || has(n, "enumerable") && !n.enumerable ? u(e, t, n) : (e[t] = n.value,
e)
};
n ? (p || (d.f = x,
v.f = A,
addGetter(b, "buffer"),
addGetter(b, "byteOffset"),
addGetter(b, "byteLength"),
addGetter(b, "length")),
_export({
target: "Object",
stat: !0,
forced: !p
}, {
getOwnPropertyDescriptor: x,
defineProperty: A
}),
e.exports = function(e, n, c) {
var d = e.match(/\d+$/)[0] / 8
, v = e + (c ? "Clamped" : "") + "Array"
, w = "get" + e
, x = "set" + e
, A = t[v]
, E = A
, R = E && E.prototype
, C = {}
, addElement = function(e, t) {
u(e, t, {
get: function() {
return function(e, t) {
var n = a(e);
return n.view[w](t * d + n.byteOffset, !0)
}(this, t)
},
set: function(e) {
return function(e, t, n) {
var r = a(e);
c && (n = (n = s(n)) < 0 ? 0 : n > 255 ? 255 : 255 & n),
r.view[x](t * d + r.byteOffset, n, !0)
}(this, t, e)
},
enumerable: !0
})
};
p ? uo && (E = n((function(e, t, n, r) {
return anInstance(e, E, v),
inheritIfRequired(isObject(t) ? isArrayBuffer(t) ? void 0 !== r ? new A(t,toOffset(n, d),r) : void 0 !== n ? new A(t,toOffset(n, d)) : new A(t) : S(t) ? fromList(E, t) : so.call(E, t) : new A(toIndex(t)), e, E)
}
)),
it && it(E, m),
o(r(A), (function(e) {
e in E || g(E, e, A[e])
}
)),
E.prototype = R) : (E = n((function(e, t, n, r) {
anInstance(e, E, v);
var o, a, u, c = 0, s = 0;
if (isObject(t)) {
if (!isArrayBuffer(t))
return S(t) ? fromList(E, t) : so.call(E, t);
o = t,
s = toOffset(n, d);
var p = t.byteLength;
if (void 0 === r) {
if (p % d)
throw l(k);
if ((a = p - s) < 0)
throw l(k)
} else if ((a = toLength(r) * d) + s > p)
throw l(k);
u = a / d
} else
u = toIndex(t),
o = new f(a = u * d);
for (i(e, {
buffer: o,
byteOffset: s,
byteLength: a,
length: u,
view: new h(o)
}); c < u; )
addElement(e, c++)
}
)),
it && it(E, m),
R = E.prototype = Ge(b)),
R.constructor !== E && g(R, "constructor", E),
y && g(R, y, v),
C[v] = E,
_export({
global: !0,
forced: E != A,
sham: !p
}, C),
_ in E || g(E, _, d),
_ in R || g(R, _, d),
setSpecies(v)
}
) : e.exports = function() {}
}
));
lo("Uint8", (function(e) {
return function Uint8Array(t, n, r) {
return e(this, t, n, r)
}
}
));
var fo = Math.min
, ho = [].copyWithin || function copyWithin(e, t) {
var n = toObject(this)
, r = toLength(n.length)
, o = toAbsoluteIndex(e, r)
, a = toAbsoluteIndex(t, r)
, i = arguments.length > 2 ? arguments[2] : void 0
, u = fo((void 0 === i ? r : toAbsoluteIndex(i, r)) - a, r - o)
, c = 1;
for (a < o && o < a + u && (c = -1,
a += u - 1,
o += u - 1); u-- > 0; )
a in n ? n[o] = n[a] : delete n[o],
o += c,
a += c;
return n
}
, po = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("copyWithin", (function copyWithin(e, t) {
return ho.call(po(this), e, t, arguments.length > 2 ? arguments[2] : void 0)
}
));
var yo = Ee.every
, vo = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("every", (function every(e) {
return yo(vo(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var go = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("fill", (function fill(e) {
return At.apply(go(this), arguments)
}
));
var mo = Ee.filter
, bo = ro.aTypedArray
, wo = ro.aTypedArrayConstructor;
(0,
ro.exportTypedArrayMethod)("filter", (function filter(e) {
for (var t = mo(bo(this), e, arguments.length > 1 ? arguments[1] : void 0), n = speciesConstructor(this, this.constructor), r = 0, o = t.length, a = new (wo(n))(o); o > r; )
a[r] = t[r++];
return a
}
));
var So = Ee.find
, _o = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("find", (function find(e) {
return So(_o(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var ko = Ee.findIndex
, xo = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("findIndex", (function findIndex(e) {
return ko(xo(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var Ao = Ee.forEach
, Eo = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("forEach", (function forEach(e) {
Ao(Eo(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var Ro = Q.includes
, Co = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("includes", (function includes(e) {
return Ro(Co(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var Oo = Q.indexOf
, To = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("indexOf", (function indexOf(e) {
return Oo(To(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var Po = wellKnownSymbol("iterator")
, Lo = t.Uint8Array
, jo = ht.values
, Io = ht.keys
, Mo = ht.entries
, Fo = ro.aTypedArray
, Do = ro.exportTypedArrayMethod
, Uo = Lo && Lo.prototype[Po]
, $o = !!Uo && ("values" == Uo.name || null == Uo.name)
, Bo = function values() {
return jo.call(Fo(this))
};
Do("entries", (function entries() {
return Mo.call(Fo(this))
}
)),
Do("keys", (function keys() {
return Io.call(Fo(this))
}
)),
Do("values", Bo, !$o),
Do(Po, Bo, !$o);
var qo = ro.aTypedArray
, No = [].join;
(0,
ro.exportTypedArrayMethod)("join", (function join(e) {
return No.apply(qo(this), arguments)
}
));
var Go = Math.min
, Wo = [].lastIndexOf
, zo = !!Wo && 1 / [1].lastIndexOf(1, -0) < 0
, Vo = arrayMethodIsStrict("lastIndexOf")
, Ho = arrayMethodUsesToLength("indexOf", {
ACCESSORS: !0,
1: 0
})
, Yo = zo || !Vo || !Ho ? function lastIndexOf(e) {
if (zo)
return Wo.apply(this, arguments) || 0;
var t = toIndexedObject(this)
, n = toLength(t.length)
, r = n - 1;
for (arguments.length > 1 && (r = Go(r, toInteger(arguments[1]))),
r < 0 && (r = n + r); r >= 0; r--)
if (r in t && t[r] === e)
return r || 0;
return -1
}
: Wo
, Qo = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("lastIndexOf", (function lastIndexOf(e) {
return Yo.apply(Qo(this), arguments)
}
));
var Ko = Ee.map
, Jo = ro.aTypedArray
, Xo = ro.aTypedArrayConstructor;
(0,
ro.exportTypedArrayMethod)("map", (function map(e) {
return Ko(Jo(this), e, arguments.length > 1 ? arguments[1] : void 0, (function(e, t) {
return new (Xo(speciesConstructor(e, e.constructor)))(t)
}
))
}
));
var createMethod$3 = function(e) {
return function(t, n, r, o) {
aFunction$1(n);
var a = toObject(t)
, i = c(a)
, u = toLength(a.length)
, s = e ? u - 1 : 0
, l = e ? -1 : 1;
if (r < 2)
for (; ; ) {
if (s in i) {
o = i[s],
s += l;
break
}
if (s += l,
e ? s < 0 : u <= s)
throw TypeError("Reduce of empty array with no initial value")
}
for (; e ? s >= 0 : u > s; s += l)
s in i && (o = n(o, i[s], s, a));
return o
}
}
, Zo = {
left: createMethod$3(!1),
right: createMethod$3(!0)
}
, ea = Zo.left
, ta = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("reduce", (function reduce(e) {
return ea(ta(this), e, arguments.length, arguments.length > 1 ? arguments[1] : void 0)
}
));
var na = Zo.right
, ra = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("reduceRight", (function reduceRight(e) {
return na(ra(this), e, arguments.length, arguments.length > 1 ? arguments[1] : void 0)
}
));
var oa = ro.aTypedArray
, aa = ro.exportTypedArrayMethod
, ia = Math.floor;
aa("reverse", (function reverse() {
for (var e, t = this, n = oa(t).length, r = ia(n / 2), o = 0; o < r; )
e = t[o],
t[o++] = t[--n],
t[n] = e;
return t
}
));
var ua = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("set", (function set(e) {
ua(this);
var t = toOffset(arguments.length > 1 ? arguments[1] : void 0, 1)
, n = this.length
, r = toObject(e)
, o = toLength(r.length)
, a = 0;
if (o + t > n)
throw RangeError("Wrong length");
for (; a < o; )
this[t + a] = r[a++]
}
), fails((function() {
new Int8Array(1).set({})
}
)));
var ca = ro.aTypedArray
, sa = ro.aTypedArrayConstructor
, la = [].slice;
(0,
ro.exportTypedArrayMethod)("slice", (function slice(e, t) {
for (var n = la.call(ca(this), e, t), r = speciesConstructor(this, this.constructor), o = 0, a = n.length, i = new (sa(r))(a); a > o; )
i[o] = n[o++];
return i
}
), fails((function() {
new Int8Array(1).slice()
}
)));
var fa = Ee.some
, ha = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("some", (function some(e) {
return fa(ha(this), e, arguments.length > 1 ? arguments[1] : void 0)
}
));
var pa = ro.aTypedArray
, da = [].sort;
(0,
ro.exportTypedArrayMethod)("sort", (function sort(e) {
return da.call(pa(this), e)
}
));
var ya = ro.aTypedArray;
(0,
ro.exportTypedArrayMethod)("subarray", (function subarray(e, t) {
var n = ya(this)
, r = n.length
, o = toAbsoluteIndex(e, r);
return new (speciesConstructor(n, n.constructor))(n.buffer,n.byteOffset + o * n.BYTES_PER_ELEMENT,toLength((void 0 === t ? r : toAbsoluteIndex(t, r)) - o))
}
));
var va = t.Int8Array
, ga = ro.aTypedArray
, ma = ro.exportTypedArrayMethod
, ba = [].toLocaleString
, wa = [].slice
, Sa = !!va && fails((function() {
ba.call(new va(1))
}
));
ma("toLocaleString", (function toLocaleString() {
return ba.apply(Sa ? wa.call(ga(this)) : ga(this), arguments)
}
), fails((function() {
return [1, 2].toLocaleString() != new va([1, 2]).toLocaleString()
}
)) || !fails((function() {
va.prototype.toLocaleString.call([1, 2])
}
)));
var _a = ro.exportTypedArrayMethod
, ka = t.Uint8Array
, xa = ka && ka.prototype || {}
, Aa = [].toString
, Ea = [].join;
fails((function() {
Aa.call({})
}
)) && (Aa = function toString() {
return Ea.call(this)
}
);
var Ra = xa.toString != Aa;
_a("toString", Aa, Ra);
var Ca = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
for (var Oa in Ca) {
var Ta = t[Oa]
, Pa = Ta && Ta.prototype;
if (Pa && Pa.forEach !== Le)
try {
g(Pa, "forEach", Le)
} catch (e) {
Pa.forEach = Le
}
}
var La = wellKnownSymbol("iterator")
, ja = wellKnownSymbol("toStringTag")
, Ia = ht.values;
for (var Ma in Ca) {
var Fa = t[Ma]
, Da = Fa && Fa.prototype;
if (Da) {
if (Da[La] !== Ia)
try {
g(Da, La, Ia)
} catch (e) {
Da[La] = Ia
}
if (Da[ja] || g(Da, ja, Ma),
Ca[Ma])
for (var Ua in ht)
if (Da[Ua] !== ht[Ua])
try {
g(Da, Ua, ht[Ua])
} catch (e) {
Da[Ua] = ht[Ua]
}
}
}
var $a = wellKnownSymbol("iterator")
, Ba = !fails((function() {
var e = new URL("b?a=1&b=2&c=3","http://a")
, t = e.searchParams
, n = "";
return e.pathname = "c%20d",
t.forEach((function(e, r) {
t.delete("b"),
n += r + e
}
)),
!t.sort || "http://a/c%20d?a=1&c=3" !== e.href || "3" !== t.get("c") || "a=1" !== String(new URLSearchParams("?a=1")) || !t[$a] || "a" !== new URL("https://a@b").username || "b" !== new URLSearchParams(new URLSearchParams("a=b")).get("a") || "xn--e1aybc" !== new URL("http://тест").host || "#%D0%B1" !== new URL("http://a#б").hash || "a1c3" !== n || "x" !== new URL("http://x",void 0).host
}
))
, qa = Object.assign
, Na = Object.defineProperty
, Ga = !qa || fails((function() {
if (n && 1 !== qa({
b: 1
}, qa(Na({}, "a", {
enumerable: !0,
get: function() {
Na(this, "b", {
value: 3,
enumerable: !1
})
}
}), {
b: 2
})).b)
return !0;
var e = {}
, t = {}
, r = Symbol()
, o = "abcdefghijklmnopqrst";
return e[r] = 7,
o.split("").forEach((function(e) {
t[e] = e
}
)),
7 != qa({}, e)[r] || $e(qa({}, t)).join("") != o
}
)) ? function assign(e, t) {
for (var r = toObject(e), o = arguments.length, i = 1, u = ee.f, s = a.f; o > i; )
for (var l, f = c(arguments[i++]), h = u ? $e(f).concat(u(f)) : $e(f), p = h.length, d = 0; p > d; )
l = h[d++],
n && !s.call(f, l) || (r[l] = f[l]);
return r
}
: qa
, Wa = function from(e) {
var t, n, r, o, a, i, u = toObject(e), c = "function" == typeof this ? this : Array, s = arguments.length, l = s > 1 ? arguments[1] : void 0, f = void 0 !== l, h = getIteratorMethod(u), p = 0;
if (f && (l = functionBindContext(l, s > 2 ? arguments[2] : void 0, 2)),
null == h || c == Array && isArrayIteratorMethod(h))
for (n = new c(t = toLength(u.length)); t > p; p++)
i = f ? l(u[p], p) : u[p],
createProperty(n, p, i);
else
for (a = (o = h.call(u)).next,
n = new c; !(r = a.call(o)).done; p++)
i = f ? callWithSafeIterationClosing(o, l, [r.value, p], !0) : r.value,
createProperty(n, p, i);
return n.length = p,
n
}
, za = /[^\0-\u007E]/
, Va = /[.\u3002\uFF0E\uFF61]/g
, Ha = "Overflow: input needs wider integers to process"
, Ya = Math.floor
, Qa = String.fromCharCode
, digitToBasic = function(e) {
return e + 22 + 75 * (e < 26)
}
, adapt = function(e, t, n) {
var r = 0;
for (e = n ? Ya(e / 700) : e >> 1,
e += Ya(e / t); e > 455; r += 36)
e = Ya(e / 35);
return Ya(r + 36 * e / (e + 38))
}
, encode = function(e) {
var t, n, r = [], o = (e = function(e) {
for (var t = [], n = 0, r = e.length; n < r; ) {
var o = e.charCodeAt(n++);
if (o >= 55296 && o <= 56319 && n < r) {
var a = e.charCodeAt(n++);
56320 == (64512 & a) ? t.push(((1023 & o) << 10) + (1023 & a) + 65536) : (t.push(o),
n--)
} else
t.push(o)
}
return t
}(e)).length, a = 128, i = 0, u = 72;
for (t = 0; t < e.length; t++)
(n = e[t]) < 128 && r.push(Qa(n));
var c = r.length
, s = c;
for (c && r.push("-"); s < o; ) {
var l = 2147483647;
for (t = 0; t < e.length; t++)
(n = e[t]) >= a && n < l && (l = n);
var f = s + 1;
if (l - a > Ya((2147483647 - i) / f))
throw RangeError(Ha);
for (i += (l - a) * f,
a = l,
t = 0; t < e.length; t++) {
if ((n = e[t]) < a && ++i > 2147483647)
throw RangeError(Ha);
if (n == a) {
for (var h = i, p = 36; ; p += 36) {
var d = p <= u ? 1 : p >= u + 26 ? 26 : p - u;
if (h < d)
break;
var y = h - d
, v = 36 - d;
r.push(Qa(digitToBasic(d + y % v))),
h = Ya(y / v)
}
r.push(Qa(digitToBasic(h))),
u = adapt(i, f, s == c),
i = 0,
++s
}
}
++i,
++a
}
return r.join("")
}
, getIterator = function(e) {
var t = getIteratorMethod(e);
if ("function" != typeof t)
throw TypeError(String(e) + " is not iterable");
return anObject(t.call(e))
}
, Ka = getBuiltIn("fetch")
, Ja = getBuiltIn("Headers")
, Xa = wellKnownSymbol("iterator")
, Za = q.set
, ei = q.getterFor("URLSearchParams")
, ti = q.getterFor("URLSearchParamsIterator")
, ni = /\+/g
, ri = Array(4)
, percentSequence = function(e) {
return ri[e - 1] || (ri[e - 1] = RegExp("((?:%[\\da-f]{2}){" + e + "})", "gi"))
}
, percentDecode = function(e) {
try {
return decodeURIComponent(e)
} catch (t) {
return e
}
}
, deserialize = function(e) {
var t = e.replace(ni, " ")
, n = 4;
try {
return decodeURIComponent(t)
} catch (e) {
for (; n; )
t = t.replace(percentSequence(n--), percentDecode);
return t
}
}
, oi = /[!'()~]|%20/g
, ai = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+"
}
, replacer = function(e) {
return ai[e]
}
, serialize = function(e) {
return encodeURIComponent(e).replace(oi, replacer)
}
, parseSearchParams = function(e, t) {
if (t)
for (var n, r, o = t.split("&"), a = 0; a < o.length; )
(n = o[a++]).length && (r = n.split("="),
e.push({
key: deserialize(r.shift()),
value: deserialize(r.join("="))
}))
}
, updateSearchParams = function(e) {
this.entries.length = 0,
parseSearchParams(this.entries, e)
}
, validateArgumentsLength = function(e, t) {
if (e < t)
throw TypeError("Not enough arguments")
}
, ii = createIteratorConstructor((function Iterator(e, t) {
Za(this, {
type: "URLSearchParamsIterator",
iterator: getIterator(ei(e).entries),
kind: t
})
}
), "Iterator", (function next() {
var e = ti(this)
, t = e.kind
, n = e.iterator.next()
, r = n.value;
return n.done || (n.value = "keys" === t ? r.key : "values" === t ? r.value : [r.key, r.value]),
n
}
))
, ui = function URLSearchParams() {
anInstance(this, ui, "URLSearchParams");
var e, t, n, r, o, a, i, u, c, s = arguments.length > 0 ? arguments[0] : void 0, l = this, f = [];
if (Za(l, {
type: "URLSearchParams",
entries: f,
updateURL: function() {},
updateSearchParams: updateSearchParams
}),
void 0 !== s)
if (isObject(s))
if ("function" == typeof (e = getIteratorMethod(s)))
for (n = (t = e.call(s)).next; !(r = n.call(t)).done; ) {
if ((i = (a = (o = getIterator(anObject(r.value))).next).call(o)).done || (u = a.call(o)).done || !a.call(o).done)
throw TypeError("Expected sequence with length 2");
f.push({
key: i.value + "",
value: u.value + ""
})
}
else
for (c in s)
has(s, c) && f.push({
key: c,
value: s[c] + ""
});
else
parseSearchParams(f, "string" == typeof s ? "?" === s.charAt(0) ? s.slice(1) : s : s + "")
}
, ci = ui.prototype;
redefineAll(ci, {
append: function append(e, t) {
validateArgumentsLength(arguments.length, 2);
var n = ei(this);
n.entries.push({
key: e + "",
value: t + ""
}),
n.updateURL()
},
delete: function(e) {
validateArgumentsLength(arguments.length, 1);
for (var t = ei(this), n = t.entries, r = e + "", o = 0; o < n.length; )
n[o].key === r ? n.splice(o, 1) : o++;
t.updateURL()
},
get: function get(e) {
validateArgumentsLength(arguments.length, 1);
for (var t = ei(this).entries, n = e + "", r = 0; r < t.length; r++)
if (t[r].key === n)
return t[r].value;
return null
},
getAll: function getAll(e) {
validateArgumentsLength(arguments.length, 1);
for (var t = ei(this).entries, n = e + "", r = [], o = 0; o < t.length; o++)
t[o].key === n && r.push(t[o].value);
return r
},
has: function has(e) {
validateArgumentsLength(arguments.length, 1);
for (var t = ei(this).entries, n = e + "", r = 0; r < t.length; )
if (t[r++].key === n)
return !0;
return !1
},
set: function set(e, t) {
validateArgumentsLength(arguments.length, 1);
for (var n, r = ei(this), o = r.entries, a = !1, i = e + "", u = t + "", c = 0; c < o.length; c++)
(n = o[c]).key === i && (a ? o.splice(c--, 1) : (a = !0,
n.value = u));
a || o.push({
key: i,
value: u
}),
r.updateURL()
},
sort: function sort() {
var e, t, n, r = ei(this), o = r.entries, a = o.slice();
for (o.length = 0,
n = 0; n < a.length; n++) {
for (e = a[n],
t = 0; t < n; t++)
if (o[t].key > e.key) {
o.splice(t, 0, e);
break
}
t === n && o.push(e)
}
r.updateURL()
},
forEach: function forEach(e) {
for (var t, n = ei(this).entries, r = functionBindContext(e, arguments.length > 1 ? arguments[1] : void 0, 3), o = 0; o < n.length; )
r((t = n[o++]).value, t.key, this)
},
keys: function keys() {
return new ii(this,"keys")
},
values: function values() {
return new ii(this,"values")
},
entries: function entries() {
return new ii(this,"entries")
}
}, {
enumerable: !0
}),
N(ci, Xa, ci.entries),
N(ci, "toString", (function toString() {
for (var e, t = ei(this).entries, n = [], r = 0; r < t.length; )
e = t[r++],
n.push(serialize(e.key) + "=" + serialize(e.value));
return n.join("&")
}
), {
enumerable: !0
}),
setToStringTag(ui, "URLSearchParams"),
_export({
global: !0,
forced: !Ba
}, {
URLSearchParams: ui
}),
Ba || "function" != typeof Ka || "function" != typeof Ja || _export({
global: !0,
enumerable: !0,
forced: !0
}, {
fetch: function fetch(e) {
var t, n, r, o = [e];
return arguments.length > 1 && (isObject(t = arguments[1]) && (n = t.body,
"URLSearchParams" === cn(n) && ((r = t.headers ? new Ja(t.headers) : new Ja).has("content-type") || r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"),
t = Ge(t, {
body: createPropertyDescriptor(0, String(n)),
headers: createPropertyDescriptor(0, r)
}))),
o.push(t)),
Ka.apply(this, o)
}
});
var si, li = {
URLSearchParams: ui,
getState: ei
}, fi = Rr.codeAt, hi = t.URL, pi = li.URLSearchParams, di = li.getState, yi = q.set, vi = q.getterFor("URL"), gi = Math.floor, mi = Math.pow, bi = /[A-Za-z]/, wi = /[\d+-.A-Za-z]/, Si = /\d/, _i = /^(0x|0X)/, ki = /^[0-7]+$/, xi = /^\d+$/, Ai = /^[\dA-Fa-f]+$/, Ei = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/, Ri = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/, Ci = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g, Oi = /[\u0009\u000A\u000D]/g, parseHost = function(e, t) {
var n, r, o;
if ("[" == t.charAt(0)) {
if ("]" != t.charAt(t.length - 1))
return "Invalid host";
if (!(n = parseIPv6(t.slice(1, -1))))
return "Invalid host";
e.host = n
} else if (isSpecial(e)) {
if (t = function(e) {
var t, n, r = [], o = e.toLowerCase().replace(Va, ".").split(".");
for (t = 0; t < o.length; t++)
n = o[t],
r.push(za.test(n) ? "xn--" + encode(n) : n);
return r.join(".")
}(t),
Ei.test(t))
return "Invalid host";
if (null === (n = parseIPv4(t)))
return "Invalid host";
e.host = n
} else {
if (Ri.test(t))
return "Invalid host";
for (n = "",
r = Wa(t),
o = 0; o < r.length; o++)
n += percentEncode(r[o], Ti);
e.host = n
}
}, parseIPv4 = function(e) {
var t, n, r, o, a, i, u, c = e.split(".");
if (c.length && "" == c[c.length - 1] && c.pop(),
(t = c.length) > 4)
return e;
for (n = [],
r = 0; r < t; r++) {
if ("" == (o = c[r]))
return e;
if (a = 10,
o.length > 1 && "0" == o.charAt(0) && (a = _i.test(o) ? 16 : 8,
o = o.slice(8 == a ? 1 : 2)),
"" === o)
i = 0;
else {
if (!(10 == a ? xi : 8 == a ? ki : Ai).test(o))
return e;
i = parseInt(o, a)
}
n.push(i)
}
for (r = 0; r < t; r++)
if (i = n[r],
r == t - 1) {
if (i >= mi(256, 5 - t))
return null
} else if (i > 255)
return null;
for (u = n.pop(),
r = 0; r < n.length; r++)
u += n[r] * mi(256, 3 - r);
return u
}, parseIPv6 = function(e) {
var t, n, r, o, a, i, u, c = [0, 0, 0, 0, 0, 0, 0, 0], s = 0, l = null, f = 0, char = function() {
return e.charAt(f)
};
if (":" == char()) {
if (":" != e.charAt(1))
return;
f += 2,
l = ++s
}
for (; char(); ) {
if (8 == s)
return;
if (":" != char()) {
for (t = n = 0; n < 4 && Ai.test(char()); )
t = 16 * t + parseInt(char(), 16),
f++,
n++;
if ("." == char()) {
if (0 == n)
return;
if (f -= n,
s > 6)
return;
for (r = 0; char(); ) {
if (o = null,
r > 0) {
if (!("." == char() && r < 4))
return;
f++
}
if (!Si.test(char()))
return;
for (; Si.test(char()); ) {
if (a = parseInt(char(), 10),
null === o)
o = a;
else {
if (0 == o)
return;
o = 10 * o + a
}
if (o > 255)
return;
f++
}
c[s] = 256 * c[s] + o,
2 != ++r && 4 != r || s++
}
if (4 != r)
return;
break
}
if (":" == char()) {
if (f++,
!char())
return
} else if (char())
return;
c[s++] = t
} else {
if (null !== l)
return;
f++,
l = ++s
}
}
if (null !== l)
for (i = s - l,
s = 7; 0 != s && i > 0; )
u = c[s],
c[s--] = c[l + i - 1],
c[l + --i] = u;
else if (8 != s)
return;
return c
}, serializeHost = function(e) {
var t, n, r, o;
if ("number" == typeof e) {
for (t = [],
n = 0; n < 4; n++)
t.unshift(e % 256),
e = gi(e / 256);
return t.join(".")
}
if ("object" == typeof e) {
for (t = "",
r = function(e) {
for (var t = null, n = 1, r = null, o = 0, a = 0; a < 8; a++)
0 !== e[a] ? (o > n && (t = r,
n = o),
r = null,
o = 0) : (null === r && (r = a),
++o);
return o > n && (t = r,
n = o),
t
}(e),
n = 0; n < 8; n++)
o && 0 === e[n] || (o && (o = !1),
r === n ? (t += n ? ":" : "::",
o = !0) : (t += e[n].toString(16),
n < 7 && (t += ":")));
return "[" + t + "]"
}
return e
}, Ti = {}, Pi = Ga({}, Ti, {
" ": 1,
'"': 1,
"<": 1,
">": 1,
"`": 1
}), Li = Ga({}, Pi, {
"#": 1,
"?": 1,
"{": 1,
"}": 1
}), ji = Ga({}, Li, {
"/": 1,
":": 1,
";": 1,
"=": 1,
"@": 1,
"[": 1,
"\\": 1,
"]": 1,
"^": 1,
"|": 1
}), percentEncode = function(e, t) {
var n = fi(e, 0);
return n > 32 && n < 127 && !has(t, e) ? e : encodeURIComponent(e)
}, Ii = {
ftp: 21,
file: null,
http: 80,
https: 443,
ws: 80,
wss: 443
}, isSpecial = function(e) {
return has(Ii, e.scheme)
}, includesCredentials = function(e) {
return "" != e.username || "" != e.password
}, cannotHaveUsernamePasswordPort = function(e) {
return !e.host || e.cannotBeABaseURL || "file" == e.scheme
}, isWindowsDriveLetter = function(e, t) {
var n;
return 2 == e.length && bi.test(e.charAt(0)) && (":" == (n = e.charAt(1)) || !t && "|" == n)
}, startsWithWindowsDriveLetter = function(e) {
var t;
return e.length > 1 && isWindowsDriveLetter(e.slice(0, 2)) && (2 == e.length || "/" === (t = e.charAt(2)) || "\\" === t || "?" === t || "#" === t)
}, shortenURLsPath = function(e) {
var t = e.path
, n = t.length;
!n || "file" == e.scheme && 1 == n && isWindowsDriveLetter(t[0], !0) || t.pop()
}, isSingleDot = function(e) {
return "." === e || "%2e" === e.toLowerCase()
}, Mi = {}, Fi = {}, Di = {}, Ui = {}, $i = {}, Bi = {}, qi = {}, Ni = {}, Gi = {}, Wi = {}, zi = {}, Vi = {}, Hi = {}, Yi = {}, Qi = {}, Ki = {}, Ji = {}, Xi = {}, Zi = {}, eu = {}, tu = {}, parseURL = function(e, t, n, r) {
var o, a, i, u, c, s = n || Mi, l = 0, f = "", h = !1, p = !1, d = !1;
for (n || (e.scheme = "",
e.username = "",
e.password = "",
e.host = null,
e.port = null,
e.path = [],
e.query = null,
e.fragment = null,
e.cannotBeABaseURL = !1,
t = t.replace(Ci, "")),
t = t.replace(Oi, ""),
o = Wa(t); l <= o.length; ) {
switch (a = o[l],
s) {
case Mi:
if (!a || !bi.test(a)) {
if (n)
return "Invalid scheme";
s = Di;
continue
}
f += a.toLowerCase(),
s = Fi;
break;
case Fi:
if (a && (wi.test(a) || "+" == a || "-" == a || "." == a))
f += a.toLowerCase();
else {
if (":" != a) {
if (n)
return "Invalid scheme";
f = "",
s = Di,
l = 0;
continue
}
if (n && (isSpecial(e) != has(Ii, f) || "file" == f && (includesCredentials(e) || null !== e.port) || "file" == e.scheme && !e.host))
return;
if (e.scheme = f,
n)
return void (isSpecial(e) && Ii[e.scheme] == e.port && (e.port = null));
f = "",
"file" == e.scheme ? s = Yi : isSpecial(e) && r && r.scheme == e.scheme ? s = Ui : isSpecial(e) ? s = Ni : "/" == o[l + 1] ? (s = $i,
l++) : (e.cannotBeABaseURL = !0,
e.path.push(""),
s = Zi)
}
break;
case Di:
if (!r || r.cannotBeABaseURL && "#" != a)
return "Invalid scheme";
if (r.cannotBeABaseURL && "#" == a) {
e.scheme = r.scheme,
e.path = r.path.slice(),
e.query = r.query,
e.fragment = "",
e.cannotBeABaseURL = !0,
s = tu;
break
}
s = "file" == r.scheme ? Yi : Bi;
continue;
case Ui:
if ("/" != a || "/" != o[l + 1]) {
s = Bi;
continue
}
s = Gi,
l++;
break;
case $i:
if ("/" == a) {
s = Wi;
break
}
s = Xi;
continue;
case Bi:
if (e.scheme = r.scheme,
a == si)
e.username = r.username,
e.password = r.password,
e.host = r.host,
e.port = r.port,
e.path = r.path.slice(),
e.query = r.query;
else if ("/" == a || "\\" == a && isSpecial(e))
s = qi;
else if ("?" == a)
e.username = r.username,
e.password = r.password,
e.host = r.host,
e.port = r.port,
e.path = r.path.slice(),
e.query = "",
s = eu;
else {
if ("#" != a) {
e.username = r.username,
e.password = r.password,
e.host = r.host,
e.port = r.port,
e.path = r.path.slice(),
e.path.pop(),
s = Xi;
continue
}
e.username = r.username,
e.password = r.password,
e.host = r.host,
e.port = r.port,
e.path = r.path.slice(),
e.query = r.query,
e.fragment = "",
s = tu
}
break;
case qi:
if (!isSpecial(e) || "/" != a && "\\" != a) {
if ("/" != a) {
e.username = r.username,
e.password = r.password,
e.host = r.host,
e.port = r.port,
s = Xi;
continue
}
s = Wi
} else
s = Gi;
break;
case Ni:
if (s = Gi,
"/" != a || "/" != f.charAt(l + 1))
continue;
l++;
break;
case Gi:
if ("/" != a && "\\" != a) {
s = Wi;
continue
}
break;
case Wi:
if ("@" == a) {
h && (f = "%40" + f),
h = !0,
i = Wa(f);
for (var y = 0; y < i.length; y++) {
var v = i[y];
if (":" != v || d) {
var g = percentEncode(v, ji);
d ? e.password += g : e.username += g
} else
d = !0
}
f = ""
} else if (a == si || "/" == a || "?" == a || "#" == a || "\\" == a && isSpecial(e)) {
if (h && "" == f)
return "Invalid authority";
l -= Wa(f).length + 1,
f = "",
s = zi
} else
f += a;
break;
case zi:
case Vi:
if (n && "file" == e.scheme) {
s = Ki;
continue
}
if (":" != a || p) {
if (a == si || "/" == a || "?" == a || "#" == a || "\\" == a && isSpecial(e)) {
if (isSpecial(e) && "" == f)
return "Invalid host";
if (n && "" == f && (includesCredentials(e) || null !== e.port))
return;
if (u = parseHost(e, f))
return u;
if (f = "",
s = Ji,
n)
return;
continue
}
"[" == a ? p = !0 : "]" == a && (p = !1),
f += a
} else {
if ("" == f)
return "Invalid host";
if (u = parseHost(e, f))
return u;
if (f = "",
s = Hi,
n == Vi)
return
}
break;
case Hi:
if (!Si.test(a)) {
if (a == si || "/" == a || "?" == a || "#" == a || "\\" == a && isSpecial(e) || n) {
if ("" != f) {
var m = parseInt(f, 10);
if (m > 65535)
return "Invalid port";
e.port = isSpecial(e) && m === Ii[e.scheme] ? null : m,
f = ""
}
if (n)
return;
s = Ji;
continue
}
return "Invalid port"
}
f += a;
break;
case Yi:
if (e.scheme = "file",
"/" == a || "\\" == a)
s = Qi;
else {
if (!r || "file" != r.scheme) {
s = Xi;
continue
}
if (a == si)
e.host = r.host,
e.path = r.path.slice(),
e.query = r.query;
else if ("?" == a)
e.host = r.host,
e.path = r.path.slice(),
e.query = "",
s = eu;
else {
if ("#" != a) {
startsWithWindowsDriveLetter(o.slice(l).join("")) || (e.host = r.host,
e.path = r.path.slice(),
shortenURLsPath(e)),
s = Xi;
continue
}
e.host = r.host,
e.path = r.path.slice(),
e.query = r.query,
e.fragment = "",
s = tu
}
}
break;
case Qi:
if ("/" == a || "\\" == a) {
s = Ki;
break
}
r && "file" == r.scheme && !startsWithWindowsDriveLetter(o.slice(l).join("")) && (isWindowsDriveLetter(r.path[0], !0) ? e.path.push(r.path[0]) : e.host = r.host),
s = Xi;
continue;
case Ki:
if (a == si || "/" == a || "\\" == a || "?" == a || "#" == a) {
if (!n && isWindowsDriveLetter(f))
s = Xi;
else if ("" == f) {
if (e.host = "",
n)
return;
s = Ji
} else {
if (u = parseHost(e, f))
return u;
if ("localhost" == e.host && (e.host = ""),
n)
return;
f = "",
s = Ji
}
continue
}
f += a;
break;
case Ji:
if (isSpecial(e)) {
if (s = Xi,
"/" != a && "\\" != a)
continue
} else if (n || "?" != a)
if (n || "#" != a) {
if (a != si && (s = Xi,
"/" != a))
continue
} else
e.fragment = "",
s = tu;
else
e.query = "",
s = eu;
break;
case Xi:
if (a == si || "/" == a || "\\" == a && isSpecial(e) || !n && ("?" == a || "#" == a)) {
if (".." === (c = (c = f).toLowerCase()) || "%2e." === c || ".%2e" === c || "%2e%2e" === c ? (shortenURLsPath(e),
"/" == a || "\\" == a && isSpecial(e) || e.path.push("")) : isSingleDot(f) ? "/" == a || "\\" == a && isSpecial(e) || e.path.push("") : ("file" == e.scheme && !e.path.length && isWindowsDriveLetter(f) && (e.host && (e.host = ""),
f = f.charAt(0) + ":"),
e.path.push(f)),
f = "",
"file" == e.scheme && (a == si || "?" == a || "#" == a))
for (; e.path.length > 1 && "" === e.path[0]; )
e.path.shift();
"?" == a ? (e.query = "",
s = eu) : "#" == a && (e.fragment = "",
s = tu)
} else
f += percentEncode(a, Li);
break;
case Zi:
"?" == a ? (e.query = "",
s = eu) : "#" == a ? (e.fragment = "",
s = tu) : a != si && (e.path[0] += percentEncode(a, Ti));
break;
case eu:
n || "#" != a ? a != si && ("'" == a && isSpecial(e) ? e.query += "%27" : e.query += "#" == a ? "%23" : percentEncode(a, Ti)) : (e.fragment = "",
s = tu);
break;
case tu:
a != si && (e.fragment += percentEncode(a, Pi))
}
l++
}
}, nu = function URL(e) {
var t, r, o = anInstance(this, nu, "URL"), a = arguments.length > 1 ? arguments[1] : void 0, i = String(e), u = yi(o, {
type: "URL"
});
if (void 0 !== a)
if (a instanceof nu)
t = vi(a);
else if (r = parseURL(t = {}, String(a)))
throw TypeError(r);
if (r = parseURL(u, i, null, t))
throw TypeError(r);
var c = u.searchParams = new pi
, s = di(c);
s.updateSearchParams(u.query),
s.updateURL = function() {
u.query = String(c) || null
}
,
n || (o.href = serializeURL.call(o),
o.origin = getOrigin.call(o),
o.protocol = getProtocol.call(o),
o.username = getUsername.call(o),
o.password = getPassword.call(o),
o.host = getHost.call(o),
o.hostname = getHostname.call(o),
o.port = getPort.call(o),
o.pathname = getPathname.call(o),
o.search = getSearch.call(o),
o.searchParams = getSearchParams.call(o),
o.hash = getHash.call(o))
}, ru = nu.prototype, serializeURL = function() {
var e = vi(this)
, t = e.scheme
, n = e.username
, r = e.password
, o = e.host
, a = e.port
, i = e.path
, u = e.query
, c = e.fragment
, s = t + ":";
return null !== o ? (s += "//",
includesCredentials(e) && (s += n + (r ? ":" + r : "") + "@"),
s += serializeHost(o),
null !== a && (s += ":" + a)) : "file" == t && (s += "//"),
s += e.cannotBeABaseURL ? i[0] : i.length ? "/" + i.join("/") : "",
null !== u && (s += "?" + u),
null !== c && (s += "#" + c),
s
}, getOrigin = function() {
var e = vi(this)
, t = e.scheme
, n = e.port;
if ("blob" == t)
try {
return new URL(t.path[0]).origin
} catch (e) {
return "null"
}
return "file" != t && isSpecial(e) ? t + "://" + serializeHost(e.host) + (null !== n ? ":" + n : "") : "null"
}, getProtocol = function() {
return vi(this).scheme + ":"
}, getUsername = function() {
return vi(this).username
}, getPassword = function() {
return vi(this).password
}, getHost = function() {
var e = vi(this)
, t = e.host
, n = e.port;
return null === t ? "" : null === n ? serializeHost(t) : serializeHost(t) + ":" + n
}, getHostname = function() {
var e = vi(this).host;
return null === e ? "" : serializeHost(e)
}, getPort = function() {
var e = vi(this).port;
return null === e ? "" : String(e)
}, getPathname = function() {
var e = vi(this)
, t = e.path;
return e.cannotBeABaseURL ? t[0] : t.length ? "/" + t.join("/") : ""
}, getSearch = function() {
var e = vi(this).query;
return e ? "?" + e : ""
}, getSearchParams = function() {
return vi(this).searchParams
}, getHash = function() {
var e = vi(this).fragment;
return e ? "#" + e : ""
}, accessorDescriptor = function(e, t) {
return {
get: e,
set: t,
configurable: !0,
enumerable: !0
}
};
if (n && Be(ru, {
href: accessorDescriptor(serializeURL, (function(e) {
var t = vi(this)
, n = String(e)
, r = parseURL(t, n);
if (r)
throw TypeError(r);
di(t.searchParams).updateSearchParams(t.query)
}
)),
origin: accessorDescriptor(getOrigin),
protocol: accessorDescriptor(getProtocol, (function(e) {
var t = vi(this);
parseURL(t, String(e) + ":", Mi)
}
)),
username: accessorDescriptor(getUsername, (function(e) {
var t = vi(this)
, n = Wa(String(e));
if (!cannotHaveUsernamePasswordPort(t)) {
t.username = "";
for (var r = 0; r < n.length; r++)
t.username += percentEncode(n[r], ji)
}
}
)),
password: accessorDescriptor(getPassword, (function(e) {
var t = vi(this)
, n = Wa(String(e));
if (!cannotHaveUsernamePasswordPort(t)) {
t.password = "";
for (var r = 0; r < n.length; r++)
t.password += percentEncode(n[r], ji)
}
}
)),
host: accessorDescriptor(getHost, (function(e) {
var t = vi(this);
t.cannotBeABaseURL || parseURL(t, String(e), zi)
}
)),
hostname: accessorDescriptor(getHostname, (function(e) {
var t = vi(this);
t.cannotBeABaseURL || parseURL(t, String(e), Vi)
}
)),
port: accessorDescriptor(getPort, (function(e) {
var t = vi(this);
cannotHaveUsernamePasswordPort(t) || ("" == (e = String(e)) ? t.port = null : parseURL(t, e, Hi))
}
)),
pathname: accessorDescriptor(getPathname, (function(e) {
var t = vi(this);
t.cannotBeABaseURL || (t.path = [],
parseURL(t, e + "", Ji))
}
)),
search: accessorDescriptor(getSearch, (function(e) {
var t = vi(this);
"" == (e = String(e)) ? t.query = null : ("?" == e.charAt(0) && (e = e.slice(1)),
t.query = "",
parseURL(t, e, eu)),
di(t.searchParams).updateSearchParams(t.query)
}
)),
searchParams: accessorDescriptor(getSearchParams),
hash: accessorDescriptor(getHash, (function(e) {
var t = vi(this);
"" != (e = String(e)) ? ("#" == e.charAt(0) && (e = e.slice(1)),
t.fragment = "",
parseURL(t, e, tu)) : t.fragment = null
}
))
}),
N(ru, "toJSON", (function toJSON() {
return serializeURL.call(this)
}
), {
enumerable: !0
}),
N(ru, "toString", (function toString() {
return serializeURL.call(this)
}
), {
enumerable: !0
}),
hi) {
var ou = hi.createObjectURL
, au = hi.revokeObjectURL;
ou && N(nu, "createObjectURL", (function createObjectURL(e) {
return ou.apply(hi, arguments)
}
)),
au && N(nu, "revokeObjectURL", (function revokeObjectURL(e) {
return au.apply(hi, arguments)
}
))
}
function asyncGeneratorStep(e, t, n, r, o, a, i) {
try {
var u = e[a](i)
, c = u.value
} catch (e) {
return void n(e)
}
u.done ? t(c) : Promise.resolve(c).then(r, o)
}
function _asyncToGenerator(e) {
return function() {
var t = this
, n = arguments;
return new Promise((function(r, o) {
var a = e.apply(t, n);
function _next(e) {
asyncGeneratorStep(a, r, o, _next, _throw, "next", e)
}
function _throw(e) {
asyncGeneratorStep(a, r, o, _next, _throw, "throw", e)
}
_next(void 0)
}
))
}
}
function _classCallCheck(e, t) {
if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function")
}
function _defineProperties(e, t) {
for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1,
r.configurable = !0,
"value"in r && (r.writable = !0),
Object.defineProperty(e, r.key, r)
}
}
function _createClass(e, t, n) {
return t && _defineProperties(e.prototype, t),
n && _defineProperties(e, n),
e
}
function _defineProperty(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n,
e
}
function ownKeys$1(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 _objectSpread2(e) {
for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? ownKeys$1(Object(n), !0).forEach((function(t) {
_defineProperty(e, t, n[t])
}
)) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ownKeys$1(Object(n)).forEach((function(t) {
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
}
))
}
return e
}
function _inherits(e, t) {
if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function");
e.prototype = Object.create(t && t.prototype, {
constructor: {
value: e,
writable: !0,
configurable: !0
}
}),
t && _setPrototypeOf(e, t)
}
function _getPrototypeOf(e) {
return (_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(e) {
return e.__proto__ || Object.getPrototypeOf(e)
}
)(e)
}
function _setPrototypeOf(e, t) {
return (_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(e, t) {
return e.__proto__ = t,
e
}
)(e, t)
}
function _isNativeReflectConstruct() {
if ("undefined" == typeof Reflect || !Reflect.construct)
return !1;
if (Reflect.construct.sham)
return !1;
if ("function" == typeof Proxy)
return !0;
try {
return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {}
))),
!0
} catch (e) {
return !1
}
}
function _construct(e, t, n) {
return (_construct = _isNativeReflectConstruct() ? Reflect.construct : function _construct(e, t, n) {
var r = [null];
r.push.apply(r, t);
var o = new (Function.bind.apply(e, r));
return n && _setPrototypeOf(o, n.prototype),
o
}
).apply(null, arguments)
}
function _wrapNativeSuper(e) {
var t = "function" == typeof Map ? new Map : void 0;
return (_wrapNativeSuper = function _wrapNativeSuper(e) {
if (null === e || !function _isNativeFunction(e) {
return -1 !== Function.toString.call(e).indexOf("[native code]")
}(e))
return e;
if ("function" != typeof e)
throw new TypeError("Super expression must either be null or a function");
if (void 0 !== t) {
if (t.has(e))
return t.get(e);
t.set(e, Wrapper)
}
function Wrapper() {
return _construct(e, arguments, _getPrototypeOf(this).constructor)
}
return Wrapper.prototype = Object.create(e.prototype, {
constructor: {
value: Wrapper,
enumerable: !1,
writable: !0,
configurable: !0
}
}),
_setPrototypeOf(Wrapper, e)
}
)(e)
}
function _assertThisInitialized(e) {
if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e
}
function _possibleConstructorReturn(e, t) {
return !t || "object" != typeof t && "function" != typeof t ? _assertThisInitialized(e) : t
}
function _createSuper(e) {
var t = _isNativeReflectConstruct();
return function _createSuperInternal() {
var n, r = _getPrototypeOf(e);
if (t) {
var o = _getPrototypeOf(this).constructor;
n = Reflect.construct(r, arguments, o)
} else
n = r.apply(this, arguments);
return _possibleConstructorReturn(this, n)
}
}
function _taggedTemplateLiteral(e, t) {
return t || (t = e.slice(0)),
Object.freeze(Object.defineProperties(e, {
raw: {
value: Object.freeze(t)
}
}))
}
function _slicedToArray(e, t) {
return function _arrayWithHoles(e) {
if (Array.isArray(e))
return e
}(e) || function _iterableToArrayLimit(e, t) {
if ("undefined" == typeof Symbol || !(Symbol.iterator in Object(e)))
return;
var n = []
, r = !0
, o = !1
, a = void 0;
try {
for (var i, u = e[Symbol.iterator](); !(r = (i = u.next()).done) && (n.push(i.value),
!t || n.length !== t); r = !0)
;
} catch (e) {
o = !0,
a = e
} finally {
try {
r || null == u.return || u.return()
} finally {
if (o)
throw a
}
}
return n
}(e, t) || _unsupportedIterableToArray(e, t) || function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
function _toConsumableArray(e) {
return function _arrayWithoutHoles(e) {
if (Array.isArray(e))
return _arrayLikeToArray(e)
}(e) || function _iterableToArray(e) {
if ("undefined" != typeof Symbol && Symbol.iterator in Object(e))
return Array.from(e)
}(e) || _unsupportedIterableToArray(e) || function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}()
}
function _unsupportedIterableToArray(e, t) {
if (e) {
if ("string" == typeof e)
return _arrayLikeToArray(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
return "Object" === n && e.constructor && (n = e.constructor.name),
"Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0
}
}
function _arrayLikeToArray(e, t) {
(null == t || t > e.length) && (t = e.length);
for (var n = 0, r = new Array(t); n < t; n++)
r[n] = e[n];
return r
}
setToStringTag(nu, "URL"),
_export({
global: !0,
forced: !Ba,
sham: !n
}, {
URL: nu
});
createCommonjsModule((function(e) {
var t = function(e) {
var t, n = Object.prototype, r = n.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, a = o.iterator || "@@iterator", i = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag";
function define(e, t, n) {
return Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}),
e[t]
}
try {
define({}, "")
} catch (e) {
define = function(e, t, n) {
return e[t] = n
}
}
function wrap(e, t, n, r) {
var o = t && t.prototype instanceof Generator ? t : Generator
, a = Object.create(o.prototype)
, i = new Context(r || []);
return a._invoke = function makeInvokeMethod(e, t, n) {
var r = c;
return function invoke(o, a) {
if (r === l)
throw new Error("Generator is already running");
if (r === f) {
if ("throw" === o)
throw a;
return doneResult()
}
for (n.method = o,
n.arg = a; ; ) {
var i = n.delegate;
if (i) {
var u = maybeInvokeDelegate(i, n);
if (u) {
if (u === h)
continue;
return u
}
}
if ("next" === n.method)
n.sent = n._sent = n.arg;
else if ("throw" === n.method) {
if (r === c)
throw r = f,
n.arg;
n.dispatchException(n.arg)
} else
"return" === n.method && n.abrupt("return", n.arg);
r = l;
var p = tryCatch(e, t, n);
if ("normal" === p.type) {
if (r = n.done ? f : s,
p.arg === h)
continue;
return {
value: p.arg,
done: n.done
}
}
"throw" === p.type && (r = f,
n.method = "throw",
n.arg = p.arg)
}
}
}(e, n, i),
a
}
function tryCatch(e, t, n) {
try {
return {
type: "normal",
arg: e.call(t, n)
}
} catch (e) {
return {
type: "throw",
arg: e
}
}
}
e.wrap = wrap;
var c = "suspendedStart"
, s = "suspendedYield"
, l = "executing"
, f = "completed"
, h = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var p = {};
p[a] = function() {
return this
}
;
var d = Object.getPrototypeOf
, y = d && d(d(values([])));
y && y !== n && r.call(y, a) && (p = y);
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
function defineIteratorMethods(e) {
["next", "throw", "return"].forEach((function(t) {
define(e, t, (function(e) {
return this._invoke(t, e)
}
))
}
))
}
function AsyncIterator(e, t) {
var n;
this._invoke = function enqueue(o, a) {
function callInvokeWithMethodAndArg() {
return new t((function(n, i) {
!function invoke(n, o, a, i) {
var u = tryCatch(e[n], e, o);
if ("throw" !== u.type) {
var c = u.arg
, s = c.value;
return s && "object" == typeof s && r.call(s, "__await") ? t.resolve(s.__await).then((function(e) {
invoke("next", e, a, i)
}
), (function(e) {
invoke("throw", e, a, i)
}
)) : t.resolve(s).then((function(e) {
c.value = e,
a(c)
}
), (function(e) {
return invoke("throw", e, a, i)
}
))
}
i(u.arg)
}(o, a, n, i)
}
))
}
return n = n ? n.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg()
}
}
function maybeInvokeDelegate(e, n) {
var r = e.iterator[n.method];
if (r === t) {
if (n.delegate = null,
"throw" === n.method) {
if (e.iterator.return && (n.method = "return",
n.arg = t,
maybeInvokeDelegate(e, n),
"throw" === n.method))
return h;
n.method = "throw",
n.arg = new TypeError("The iterator does not provide a 'throw' method")
}
return h
}
var o = tryCatch(r, e.iterator, n.arg);
if ("throw" === o.type)
return n.method = "throw",
n.arg = o.arg,
n.delegate = null,
h;
var a = o.arg;
return a ? a.done ? (n[e.resultName] = a.value,
n.next = e.nextLoc,
"return" !== n.method && (n.method = "next",
n.arg = t),
n.delegate = null,
h) : a : (n.method = "throw",
n.arg = new TypeError("iterator result is not an object"),
n.delegate = null,
h)
}
function pushTryEntry(e) {
var t = {
tryLoc: e[0]
};
1 in e && (t.catchLoc = e[1]),
2 in e && (t.finallyLoc = e[2],
t.afterLoc = e[3]),
this.tryEntries.push(t)
}
function resetTryEntry(e) {
var t = e.completion || {};
t.type = "normal",
delete t.arg,
e.completion = t
}
function Context(e) {
this.tryEntries = [{
tryLoc: "root"
}],
e.forEach(pushTryEntry, this),
this.reset(!0)
}
function values(e) {
if (e) {
var n = e[a];
if (n)
return n.call(e);
if ("function" == typeof e.next)
return e;
if (!isNaN(e.length)) {
var o = -1
, i = function next() {
for (; ++o < e.length; )
if (r.call(e, o))
return next.value = e[o],
next.done = !1,
next;
return next.value = t,
next.done = !0,
next
};
return i.next = i
}
}
return {
next: doneResult
}
}
function doneResult() {
return {
value: t,
done: !0
}
}
return GeneratorFunction.prototype = v.constructor = GeneratorFunctionPrototype,
GeneratorFunctionPrototype.constructor = GeneratorFunction,
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"),
e.isGeneratorFunction = function(e) {
var t = "function" == typeof e && e.constructor;
return !!t && (t === GeneratorFunction || "GeneratorFunction" === (t.displayName || t.name))
}
,
e.mark = function(e) {
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype,
define(e, u, "GeneratorFunction")),
e.prototype = Object.create(v),
e
}
,
e.awrap = function(e) {
return {
__await: e
}
}
,
defineIteratorMethods(AsyncIterator.prototype),
AsyncIterator.prototype[i] = function() {
return this
}
,
e.AsyncIterator = AsyncIterator,
e.async = function(t, n, r, o, a) {
void 0 === a && (a = Promise);
var i = new AsyncIterator(wrap(t, n, r, o),a);
return e.isGeneratorFunction(n) ? i : i.next().then((function(e) {
return e.done ? e.value : i.next()
}
))
}
,
defineIteratorMethods(v),
define(v, u, "Generator"),
v[a] = function() {
return this
}
,
v.toString = function() {
return "[object Generator]"
}
,
e.keys = function(e) {
var t = [];
for (var n in e)
t.push(n);
return t.reverse(),
function next() {
for (; t.length; ) {
var n = t.pop();
if (n in e)
return next.value = n,
next.done = !1,
next
}
return next.done = !0,
next
}
}
,
e.values = values,
Context.prototype = {
constructor: Context,
reset: function(e) {
if (this.prev = 0,
this.next = 0,
this.sent = this._sent = t,
this.done = !1,
this.delegate = null,
this.method = "next",
this.arg = t,
this.tryEntries.forEach(resetTryEntry),
!e)
for (var n in this)
"t" === n.charAt(0) && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = t)
},
stop: function() {
this.done = !0;
var e = this.tryEntries[0].completion;
if ("throw" === e.type)
throw e.arg;
return this.rval
},
dispatchException: function(e) {
if (this.done)
throw e;
var n = this;
function handle(r, o) {
return i.type = "throw",
i.arg = e,
n.next = r,
o && (n.method = "next",
n.arg = t),
!!o
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var a = this.tryEntries[o]
, i = a.completion;
if ("root" === a.tryLoc)
return handle("end");
if (a.tryLoc <= this.prev) {
var u = r.call(a, "catchLoc")
, c = r.call(a, "finallyLoc");
if (u && c) {
if (this.prev < a.catchLoc)
return handle(a.catchLoc, !0);
if (this.prev < a.finallyLoc)
return handle(a.finallyLoc)
} else if (u) {
if (this.prev < a.catchLoc)
return handle(a.catchLoc, !0)
} else {
if (!c)
throw new Error("try statement without catch or finally");
if (this.prev < a.finallyLoc)
return handle(a.finallyLoc)
}
}
}
},
abrupt: function(e, t) {
for (var n = this.tryEntries.length - 1; n >= 0; --n) {
var o = this.tryEntries[n];
if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var a = o;
break
}
}
a && ("break" === e || "continue" === e) && a.tryLoc <= t && t <= a.finallyLoc && (a = null);
var i = a ? a.completion : {};
return i.type = e,
i.arg = t,
a ? (this.method = "next",
this.next = a.finallyLoc,
h) : this.complete(i)
},
complete: function(e, t) {
if ("throw" === e.type)
throw e.arg;
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg,
this.method = "return",
this.next = "end") : "normal" === e.type && t && (this.next = t),
h
},
finish: function(e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.finallyLoc === e)
return this.complete(n.completion, n.afterLoc),
resetTryEntry(n),
h
}
},
catch: function(e) {
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
var n = this.tryEntries[t];
if (n.tryLoc === e) {
var r = n.completion;
if ("throw" === r.type) {
var o = r.arg;
resetTryEntry(n)
}
return o
}
}
throw new Error("illegal catch attempt")
},
delegateYield: function(e, n, r) {
return this.delegate = {
iterator: values(e),
resultName: n,
nextLoc: r
},
"next" === this.method && (this.arg = t),
h
}
},
e
}(e.exports);
try {
regeneratorRuntime = t
} catch (e) {
Function("r", "regeneratorRuntime = r")(t)
}
}
));
var iu = function() {
function SettingsRememberer() {
_classCallCheck(this, SettingsRememberer)
}
return _createClass(SettingsRememberer, null, [{
key: "storeSettings",
value: function storeSettings(e, t) {
try {
localStorage.setItem(e, JSON.stringify(t))
} catch (e) {
console.error(e)
}
}
}, {
key: "getStoredSettings",
value: function getStoredSettings(e) {
try {
var t = localStorage.getItem(e);
return t ? JSON.parse(t) : void 0
} catch (e) {
console.error(e)
}
}
}]),
SettingsRememberer
}();
_export({
target: "Object",
stat: !0,
forced: Object.assign !== Ga
}, {
assign: Ga
});
var uu = !fails((function() {
return Object.isExtensible(Object.preventExtensions({}))
}
))
, cu = createCommonjsModule((function(e) {
var t = v.f
, n = uid("meta")
, r = 0
, o = Object.isExtensible || function() {
return !0
}
, setMetadata = function(e) {
t(e, n, {
value: {
objectID: "O" + ++r,
weakData: {}
}
})
}
, a = e.exports = {
REQUIRED: !1,
fastKey: function(e, t) {
if (!isObject(e))
return "symbol" == typeof e ? e : ("string" == typeof e ? "S" : "P") + e;
if (!has(e, n)) {
if (!o(e))
return "F";
if (!t)
return "E";
setMetadata(e)
}
return e[n].objectID
},
getWeakData: function(e, t) {
if (!has(e, n)) {
if (!o(e))
return !0;
if (!t)
return !1;
setMetadata(e)
}
return e[n].weakData
},
onFreeze: function(e) {
return uu && a.REQUIRED && o(e) && !has(e, n) && setMetadata(e),
e
}
};
T[n] = !0
}
))
, su = (cu.REQUIRED,
cu.fastKey,
cu.getWeakData,
cu.onFreeze,
cu.onFreeze)
, lu = Object.freeze
, fu = fails((function() {
lu(1)
}
));
_export({
target: "Object",
stat: !0,
forced: fu,
sham: !uu
}, {
freeze: function freeze(e) {
return lu && isObject(e) ? lu(su(e)) : e
}
});
var hu = "\t\n\v\f\r    \u2028\u2029\ufeff"
, pu = "[" + hu + "]"
, du = RegExp("^" + pu + pu + "*")
, yu = RegExp(pu + pu + "*$")
, createMethod$4 = function(e) {
return function(t) {
var n = String(requireObjectCoercible(t));
return 1 & e && (n = n.replace(du, "")),
2 & e && (n = n.replace(yu, "")),
n
}
}
, vu = {
start: createMethod$4(1),
end: createMethod$4(2),
trim: createMethod$4(3)
}
, gu = vu.trim;
function audioBufferToWav(e, t) {
return _audioBufferToWav.apply(this, arguments)
}
function _audioBufferToWav() {
return (_audioBufferToWav = _asyncToGenerator(regeneratorRuntime.mark((function _callee(e, t) {
var n, r, o, a, i, u, c, s, l, f;
return regeneratorRuntime.wrap((function _callee$(h) {
for (; ; )
switch (h.prev = h.next) {
case 0:
return n = (t = t || {
detune: 0,
playbackRate: 1
}).playbackRate * Math.pow(2, t.detune / 1200),
r = e.length / n,
o = new OfflineAudioContext(e.numberOfChannels,r,e.sampleRate),
(a = o.createBufferSource()).buffer = e,
a.playbackRate.value = t.playbackRate,
a.detune && (a.detune.value = t.detune),
a.connect(o.destination),
a.start(),
h.next = 12,
o.startRendering();
case 12:
return i = h.sent,
u = i.numberOfChannels,
c = i.sampleRate,
s = t.float32 ? 3 : 1,
l = 3 === s ? 32 : 16,
f = 2 === u ? interleave(i.getChannelData(0), i.getChannelData(1)) : i.getChannelData(0),
h.abrupt("return", URL.createObjectURL(new Blob([encodeWAV(f, s, c, u, l)],{
type: "audio/wav"
})));
case 19:
case "end":
return h.stop()
}
}
), _callee)
}
)))).apply(this, arguments)
}
function encodeWAV(e, t, n, r, o) {
var a = o / 8
, i = r * a
, u = new ArrayBuffer(44 + e.length * a)
, c = new DataView(u);
return writeString(c, 0, "RIFF"),
c.setUint32(4, 36 + e.length * a, !0),
writeString(c, 8, "WAVE"),
writeString(c, 12, "fmt "),
c.setUint32(16, 16, !0),
c.setUint16(20, t, !0),
c.setUint16(22, r, !0),
c.setUint32(24, n, !0),
c.setUint32(28, n * i, !0),
c.setUint16(32, i, !0),
c.setUint16(34, o, !0),
writeString(c, 36, "data"),
c.setUint32(40, e.length * a, !0),
1 === t ? function floatTo16BitPCM(e, t, n) {
for (var r = 0; r < n.length; r++,
t += 2) {
var o = Math.max(-1, Math.min(1, n[r]));
e.setInt16(t, o < 0 ? 32768 * o : 32767 * o, !0)
}
}(c, 44, e) : function writeFloat32(e, t, n) {
for (var r = 0; r < n.length; r++,
t += 4)
e.setFloat32(t, n[r], !0)
}(c, 44, e),
u
}
function interleave(e, t) {
for (var n = e.length + t.length, r = new Float32Array(n), o = 0, a = 0; o < n; )
r[o++] = e[a],
r[o++] = t[a],
a++;
return r
}
function writeString(e, t, n) {
for (var r = 0; r < n.length; r++)
e.setUint8(t + r, n.charCodeAt(r))
}
_export({
target: "String",
proto: !0,
forced: function(e) {
return fails((function() {
return !!hu[e]() || "…" != "…"[e]() || hu[e].name !== e
}
))
}("trim")
}, {
trim: function trim() {
return gu(this)
}
}),
lo("Float32", (function(e) {
return function Float32Array(t, n, r) {
return e(this, t, n, r)
}
}
));
var mu = function() {
function Observer() {
_classCallCheck(this, Observer),
this.observers = []
}
return _createClass(Observer, [{
key: "observe",
value: function observe(e) {
this.observers.push(e)
}
}, {
key: "notifyListeners",
value: function notifyListeners(e) {
this.observers.forEach((function(t) {
return t(e)
}
))
}
}]),
Observer
}()
, bu = document.querySelector("audio")
, wu = !1;
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var Su = new AudioContext
, _u = null
, ku = null
, xu = null
, Au = null
, Eu = null;
function audioContextResume(e) {
return _audioContextResume.apply(this, arguments)
}
function _audioContextResume() {
return (_audioContextResume = _asyncToGenerator(regeneratorRuntime.mark((function _callee5(e) {
return regeneratorRuntime.wrap((function _callee5$(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.abrupt("return", new Promise((function(t, n) {
e.resume().then((function() {
return t()
}
)).catch(n),
setTimeout((function() {
"running" === e.state ? t() : n()
}
), 1e3)
}
)));
case 1:
case "end":
return t.stop()
}
}
), _callee5)
}
)))).apply(this, arguments)
}
Au = Su.createGain(),
ku = Su.createAnalyser(),
Au.connect(ku),
ku.connect(Su.destination);
var Ru = new (function() {
function NightcorePlayer() {
var e = this;
_classCallCheck(this, NightcorePlayer),
this._state = Object.freeze({
startedAtCtxTime: 0,
pausedAt: 0,
detune: 0,
playbackRate: 1.1,
volume: .8,
playing: !1,
currentImage: null,
currentMetadata: null
}),
this.playStateObserver = new mu,
this.playbackRateObserver = new mu,
this.detuneObserver = new mu,
this.volumeObserver = new mu,
this.currentMetadataObserver = new mu,
this.currentImageObserver = new mu,
document.addEventListener("progress-bar:seek", (function(t) {
t instanceof CustomEvent && e.handleProgressSeek(t)
}
)),
document.addEventListener("player:toggle-playback", (function() {
return e.togglePlayback()
}
), !1),
document.addEventListener("player:trigger-download", (function() {
return e.download()
}
), !1)
}
var e, t, n, r;
return _createClass(NightcorePlayer, [{
key: "handleProgressSeek",
value: function handleProgressSeek(e) {
var t = e.detail;
this.seekToPercent(t.percent)
}
}, {
key: "seekToPercent",
value: function seekToPercent(e) {
var t = _u.duration * e;
this.pause(),
this.play(t)
}
}, {
key: "resetPlaybackRate",
value: function resetPlaybackRate() {
this.playbackRate = 1
}
}, {
key: "resume",
value: function resume() {
return audioContextResume(this.audioContext)
}
}, {
key: "dispatchComputedPlaybackRateChange",
value: function dispatchComputedPlaybackRateChange() {
document.dispatchEvent(new CustomEvent("player:computed-playback-rate-change",{
detail: {
computedPlaybackRate: this.computedPlaybackRate
}
}))
}
}, {
key: "resetDetune",
value: function resetDetune() {
this.detune = 0
}
}, {
key: "togglePlayback",
value: function togglePlayback() {
this._state.playing ? this.pause() : this.play()
}
}, {
key: "play",
value: (r = _asyncToGenerator(regeneratorRuntime.mark((function _callee(e) {
var t, n, r, o = this;
return regeneratorRuntime.wrap((function _callee$(a) {
for (; ; )
switch (a.prev = a.next) {
case 0:
return t = this._state.pausedAt,
e = e || t,
wu || (wu = !0,
window.ga && window.performance && (n = Math.round(performance.now()),
window.ga("send", "timing", "First playback", "load", n))),
a.prev = 3,
a.next = 6,
audioContextResume(Su);
case 6:
this.playStateObserver.notifyListeners("PLAYING"),
xu.start(0, e),
this.updateState({
startedAtCtxTime: Su.currentTime,
pausedAt: e,
playing: !0
}),
this.progressInterval = setInterval((function() {
o._state.pausedAt + o.currentTime < _u.duration || (o.pause(),
o.playStateObserver.notifyListeners("ENDED"))
}
), 500),
a.next = 16;
break;
case 12:
a.prev = 12,
a.t0 = a.catch(3),
this.playStateObserver.notifyListeners("PAUSED"),
console.error(a.t0);
case 16:
if (a.prev = 16,
!("mediaSession"in navigator)) {
a.next = 23;
break
}
return a.next = 20,
bu.play();
case 20:
r = {
title: this.currentMetadata.split("-")[1].trim(),
artist: this.currentMetadata.split("-")[0].trim(),
album: "Nightcore App"
},
this.currentImage && (r.artwork = [{
src: this.currentImage
}]),
navigator.mediaSession.metadata = new MediaMetadata(r);
case 23:
a.next = 28;
break;
case 25:
a.prev = 25,
a.t1 = a.catch(16),
console.error(a.t1);
case 28:
case "end":
return a.stop()
}
}
), _callee, this, [[3, 12], [16, 25]])
}
))),
function play(e) {
return r.apply(this, arguments)
}
)
}, {
key: "pause",
value: function pause() {
this.progressInterval && clearInterval(this.progressInterval);
Su.suspend();
var e = this._state.pausedAt + this.currentTime;
this.updateState({
playing: !1,
pausedAt: e
}),
this.playStateObserver.notifyListeners("PAUSED"),
xu && this.reloadSource()
}
}, {
key: "updateState",
value: function updateState(e) {
var t = Object.freeze(Object.assign({}, this._state, e));
this._state = t
}
}, {
key: "download",
value: (n = _asyncToGenerator(regeneratorRuntime.mark((function _callee2() {
var e, t;
return regeneratorRuntime.wrap((function _callee2$(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return document.dispatchEvent(new CustomEvent("status",{
detail: {
message: "Processing download..."
}
})),
n.next = 3,
audioBufferToWav(_u, {
detune: this.detune,
playbackRate: this.playbackRate
});
case 3:
e = n.sent,
t = document.createElement("a"),
document.body.appendChild(t),
t.href = e,
t.setAttribute("download", "".concat(this.currentMetadata, ".S").concat(100 * this.playbackRate, "D").concat(this.detune, ".nightcore.app.wav")),
t.click(),
t.remove(),
URL.revokeObjectURL(e),
document.dispatchEvent(new CustomEvent("status",{
detail: {
message: "Download is done. Enjoy!"
}
}));
case 12:
case "end":
return n.stop()
}
}
), _callee2, this)
}
))),
function download() {
return n.apply(this, arguments)
}
)
}, {
key: "reloadSource",
value: function reloadSource() {
xu.disconnect(),
(xu = Su.createBufferSource()).buffer = _u,
xu.playbackRate.value = this.playbackRate,
xu.detune && (xu.detune.value = this.detune),
xu.connect(Au)
}
}, {
key: "loadAudioFromElement",
value: (t = _asyncToGenerator(regeneratorRuntime.mark((function _callee3() {
return regeneratorRuntime.wrap((function _callee3$(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
xu && xu.disconnect(),
bu.volume = 0,
Eu || (Eu = Su.createMediaElementSource(bu)).connect(this.audioContext.destination);
case 3:
case "end":
return e.stop()
}
}
), _callee3, this)
}
))),
function loadAudioFromElement() {
return t.apply(this, arguments)
}
)
}, {
key: "loadAudio",
value: (e = _asyncToGenerator(regeneratorRuntime.mark((function _callee4(e) {
var t, n, r, o;
return regeneratorRuntime.wrap((function _callee4$(a) {
for (; ; )
switch (a.prev = a.next) {
case 0:
t = e.playToo,
n = void 0 !== t && t,
r = e.audioBuffer,
o = r !== _u,
!r && _u && (r = _u),
xu && xu.disconnect(),
xu = Su.createBufferSource(),
_u = r,
xu.buffer = r,
ku.fftSize = 512;
try {
Au.gain.setValueAtTime(this.volume, Su.currentTime + .1)
} catch (e) {
Au.gain.value = this.volume
}
xu.buffer && (xu.playbackRate.value = this.playbackRate,
xu.detune && (xu.detune.value = this.detune),
xu.connect(Au),
xu.loop = !1,
o && document.dispatchEvent(new CustomEvent("player:duration-change",{
detail: {
duration: this.duration,
orginalDuration: xu.buffer.duration,
playbackRate: this.computedPlaybackRate
}
})),
n && this.play());
case 11:
case "end":
return a.stop()
}
}
), _callee4, this)
}
))),
function loadAudio(t) {
return e.apply(this, arguments)
}
)
}, {
key: "analyser",
get: function get() {
return ku
}
}, {
key: "audioContext",
get: function get() {
return Su
}
}, {
key: "currentTime",
get: function get() {
var e = this._state.startedAtCtxTime;
return Math.abs(e - Su.currentTime) * this.computedPlaybackRate
}
}, {
key: "duration",
get: function get() {
return _u.duration / this.computedPlaybackRate
}
}, {
key: "currentImage",
set: function set(e) {
this.updateState({
currentImage: e
}),
this.currentImageObserver.notifyListeners(e)
},
get: function get() {
return this._state.currentImage
}
}, {
key: "currentMetadata",
set: function set(e) {
this.updateState({
currentMetadata: e
}),
this.currentMetadataObserver.notifyListeners(e)
},
get: function get() {
return this._state.currentMetadata
}
}, {
key: "volume",
set: function set(e) {
if (this.updateState({
volume: e
}),
Au)
try {
Au.gain.setValueAtTime(e, Su.currentTime + .1)
} catch (t) {
Au.gain.value = e
}
this.volumeObserver.notifyListeners(e)
},
get: function get() {
return this._state.volume
}
}, {
key: "playing",
get: function get() {
return this._state.playing
}
}, {
key: "playbackRate",
set: function set(e) {
this.updateState({
playbackRate: e
}),
xu && (xu.playbackRate.value = e),
this.playbackRateObserver.notifyListeners(e),
this.dispatchComputedPlaybackRateChange()
},
get: function get() {
return this._state.playbackRate
}
}, {
key: "detune",
set: function set(e) {
this.updateState({
detune: e
});
try {
xu && xu.detune && (xu.detune.value = e)
} catch (e) {
console.error(e),
document.dispatchEvent(new CustomEvent("player:no-detune"))
}
this.detuneObserver.notifyListeners(e),
this.dispatchComputedPlaybackRateChange()
},
get: function get() {
return this._state.detune
}
}, {
key: "computedPlaybackRate",
get: function get() {
return this.playbackRate * Math.pow(2, this.detune / 1200)
}
}]),
NightcorePlayer
}())
, Cu = Z.f
, Ou = {}.toString
, Tu = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []
, Pu = {
f: function getOwnPropertyNames(e) {
return Tu && "[object Window]" == Ou.call(e) ? function(e) {
try {
return Cu(e)
} catch (e) {
return Tu.slice()
}
}(e) : Cu(toIndexedObject(e))
}
}
, Lu = {
f: wellKnownSymbol
}
, ju = v.f
, defineWellKnownSymbol = function(e) {
var t = G.Symbol || (G.Symbol = {});
has(t, e) || ju(t, e, {
value: Lu.f(e)
})
}
, Iu = Ee.forEach
, Mu = sharedKey("hidden")
, Fu = wellKnownSymbol("toPrimitive")
, Du = q.set
, Uu = q.getterFor("Symbol")
, $u = Object.prototype
, Bu = t.Symbol
, qu = getBuiltIn("JSON", "stringify")
, Nu = d.f
, Gu = v.f
, Wu = Pu.f
, zu = a.f
, Vu = E("symbols")
, Hu = E("op-symbols")
, Yu = E("string-to-symbol-registry")
, Qu = E("symbol-to-string-registry")
, Ku = E("wks")
, Ju = t.QObject
, Xu = !Ju || !Ju.prototype || !Ju.prototype.findChild
, Zu = n && fails((function() {
return 7 != Ge(Gu({}, "a", {
get: function() {
return Gu(this, "a", {
value: 7
}).a
}
})).a
}
)) ? function(e, t, n) {
var r = Nu($u, t);
r && delete $u[t],
Gu(e, t, n),
r && e !== $u && Gu($u, t, r)
}
: Gu
, wrap = function(e, t) {
var r = Vu[e] = Ge(Bu.prototype);
return Du(r, {
type: "Symbol",
tag: e,
description: t
}),
n || (r.description = t),
r
}
, ec = fe ? function(e) {
return "symbol" == typeof e
}
: function(e) {
return Object(e)instanceof Bu
}
, tc = function defineProperty(e, t, n) {
e === $u && tc(Hu, t, n),
anObject(e);
var r = toPrimitive(t, !0);
return anObject(n),
has(Vu, r) ? (n.enumerable ? (has(e, Mu) && e[Mu][r] && (e[Mu][r] = !1),
n = Ge(n, {
enumerable: createPropertyDescriptor(0, !1)
})) : (has(e, Mu) || Gu(e, Mu, createPropertyDescriptor(1, {})),
e[Mu][r] = !0),
Zu(e, r, n)) : Gu(e, r, n)
}
, nc = function defineProperties(e, t) {
anObject(e);
var r = toIndexedObject(t)
, o = $e(r).concat(ic(r));
return Iu(o, (function(t) {
n && !rc.call(r, t) || tc(e, t, r[t])
}
)),
e
}
, rc = function propertyIsEnumerable(e) {
var t = toPrimitive(e, !0)
, n = zu.call(this, t);
return !(this === $u && has(Vu, t) && !has(Hu, t)) && (!(n || !has(this, t) || !has(Vu, t) || has(this, Mu) && this[Mu][t]) || n)
}
, oc = function getOwnPropertyDescriptor(e, t) {
var n = toIndexedObject(e)
, r = toPrimitive(t, !0);
if (n !== $u || !has(Vu, r) || has(Hu, r)) {
var o = Nu(n, r);
return !o || !has(Vu, r) || has(n, Mu) && n[Mu][r] || (o.enumerable = !0),
o
}
}
, ac = function getOwnPropertyNames(e) {
var t = Wu(toIndexedObject(e))
, n = [];
return Iu(t, (function(e) {
has(Vu, e) || has(T, e) || n.push(e)
}
)),
n
}
, ic = function getOwnPropertySymbols(e) {
var t = e === $u
, n = Wu(t ? Hu : toIndexedObject(e))
, r = [];
return Iu(n, (function(e) {
!has(Vu, e) || t && !has($u, e) || r.push(Vu[e])
}
)),
r
};
if (le || (N((Bu = function Symbol() {
if (this instanceof Bu)
throw TypeError("Symbol is not a constructor");
var e = arguments.length && void 0 !== arguments[0] ? String(arguments[0]) : void 0
, t = uid(e)
, setter = function(e) {
this === $u && setter.call(Hu, e),
has(this, Mu) && has(this[Mu], t) && (this[Mu][t] = !1),
Zu(this, t, createPropertyDescriptor(1, e))
};
return n && Xu && Zu($u, t, {
configurable: !0,
set: setter
}),
wrap(t, e)
}
).prototype, "toString", (function toString() {
return Uu(this).tag
}
)),
N(Bu, "withoutSetter", (function(e) {
return wrap(uid(e), e)
}
)),
a.f = rc,
v.f = tc,
d.f = oc,
Z.f = Pu.f = ac,
ee.f = ic,
Lu.f = function(e) {
return wrap(wellKnownSymbol(e), e)
}
,
n && (Gu(Bu.prototype, "description", {
configurable: !0,
get: function description() {
return Uu(this).description
}
}),
N($u, "propertyIsEnumerable", rc, {
unsafe: !0
}))),
_export({
global: !0,
wrap: !0,
forced: !le,
sham: !le
}, {
Symbol: Bu
}),
Iu($e(Ku), (function(e) {
defineWellKnownSymbol(e)
}
)),
_export({
target: "Symbol",
stat: !0,
forced: !le
}, {
for: function(e) {
var t = String(e);
if (has(Yu, t))
return Yu[t];
var n = Bu(t);
return Yu[t] = n,
Qu[n] = t,
n
},
keyFor: function keyFor(e) {
if (!ec(e))
throw TypeError(e + " is not a symbol");
if (has(Qu, e))
return Qu[e]
},
useSetter: function() {
Xu = !0
},
useSimple: function() {
Xu = !1
}
}),
_export({
target: "Object",
stat: !0,
forced: !le,
sham: !n
}, {
create: function create(e, t) {
return void 0 === t ? Ge(e) : nc(Ge(e), t)
},
defineProperty: tc,
defineProperties: nc,
getOwnPropertyDescriptor: oc
}),
_export({
target: "Object",
stat: !0,
forced: !le
}, {
getOwnPropertyNames: ac,
getOwnPropertySymbols: ic
}),
_export({
target: "Object",
stat: !0,
forced: fails((function() {
ee.f(1)
}
))
}, {
getOwnPropertySymbols: function getOwnPropertySymbols(e) {
return ee.f(toObject(e))
}
}),
qu) {
var uc = !le || fails((function() {
var e = Bu();
return "[null]" != qu([e]) || "{}" != qu({
a: e
}) || "{}" != qu(Object(e))
}
));
_export({
target: "JSON",
stat: !0,
forced: uc
}, {
stringify: function stringify(e, t, n) {
for (var r, o = [e], a = 1; arguments.length > a; )
o.push(arguments[a++]);
if (r = t,
(isObject(t) || void 0 !== e) && !ec(e))
return se(t) || (t = function(e, t) {
if ("function" == typeof r && (t = r.call(this, e, t)),
!ec(t))
return t
}
),
o[1] = t,
qu.apply(null, o)
}
})
}
Bu.prototype[Fu] || g(Bu.prototype, Fu, Bu.prototype.valueOf),
setToStringTag(Bu, "Symbol"),
T[Mu] = !0;
var cc = v.f
, sc = t.Symbol;
if (n && "function" == typeof sc && (!("description"in sc.prototype) || void 0 !== sc().description)) {
var lc = {}
, fc = function Symbol() {
var e = arguments.length < 1 || void 0 === arguments[0] ? void 0 : String(arguments[0])
, t = this instanceof fc ? new sc(e) : void 0 === e ? sc() : sc(e);
return "" === e && (lc[t] = !0),
t
};
copyConstructorProperties(fc, sc);
var hc = fc.prototype = sc.prototype;
hc.constructor = fc;
var pc = hc.toString
, dc = "Symbol(test)" == String(sc("test"))
, yc = /^Symbol\((.*)\)[^)]+$/;
cc(hc, "description", {
configurable: !0,
get: function description() {
var e = isObject(this) ? this.valueOf() : this
, t = pc.call(e);
if (has(lc, e))
return "";
var n = dc ? t.slice(7, -1) : t.replace(yc, "$1");
return "" === n ? void 0 : n
}
}),
_export({
global: !0,
forced: !0
}, {
Symbol: fc
})
}
defineWellKnownSymbol("hasInstance");
var vc = Ee.every
, gc = arrayMethodIsStrict("every")
, mc = arrayMethodUsesToLength("every");
_export({
target: "Array",
proto: !0,
forced: !gc || !mc
}, {
every: function every(e) {
return vc(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
});
var bc = Ee.filter
, wc = arrayMethodHasSpeciesSupport("filter")
, Sc = arrayMethodUsesToLength("filter");
_export({
target: "Array",
proto: !0,
forced: !wc || !Sc
}, {
filter: function filter(e) {
return bc(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
});
var _c = !checkCorrectnessOfIteration((function(e) {
Array.from(e)
}
));
_export({
target: "Array",
stat: !0,
forced: _c
}, {
from: Wa
});
var kc = Zo.left
, xc = arrayMethodIsStrict("reduce")
, Ac = arrayMethodUsesToLength("reduce", {
1: 0
});
_export({
target: "Array",
proto: !0,
forced: !xc || !Ac
}, {
reduce: function reduce(e) {
return kc(this, e, arguments.length, arguments.length > 1 ? arguments[1] : void 0)
}
});
var Ec = wellKnownSymbol("hasInstance")
, Rc = Function.prototype;
Ec in Rc || v.f(Rc, Ec, {
value: function(e) {
if ("function" != typeof this || !isObject(e))
return !1;
if (!isObject(this.prototype))
return e instanceof this;
for (; e = Ze(e); )
if (this.prototype === e)
return !0;
return !1
}
});
var collection = function(e, n, r) {
var o = -1 !== e.indexOf("Map")
, a = -1 !== e.indexOf("Weak")
, i = o ? "set" : "add"
, u = t[e]
, c = u && u.prototype
, s = u
, l = {}
, fixMethod = function(e) {
var t = c[e];
N(c, e, "add" == e ? function add(e) {
return t.call(this, 0 === e ? 0 : e),
this
}
: "delete" == e ? function(e) {
return !(a && !isObject(e)) && t.call(this, 0 === e ? 0 : e)
}
: "get" == e ? function get(e) {
return a && !isObject(e) ? void 0 : t.call(this, 0 === e ? 0 : e)
}
: "has" == e ? function has(e) {
return !(a && !isObject(e)) && t.call(this, 0 === e ? 0 : e)
}
: function set(e, n) {
return t.call(this, 0 === e ? 0 : e, n),
this
}
)
};
if (ue(e, "function" != typeof u || !(a || c.forEach && !fails((function() {
(new u).entries().next()
}
)))))
s = r.getConstructor(n, e, o, i),
cu.REQUIRED = !0;
else if (ue(e, !0)) {
var f = new s
, h = f[i](a ? {} : -0, 1) != f
, p = fails((function() {
f.has(1)
}
))
, d = checkCorrectnessOfIteration((function(e) {
new u(e)
}
))
, y = !a && fails((function() {
for (var e = new u, t = 5; t--; )
e[i](t, t);
return !e.has(-0)
}
));
d || ((s = n((function(t, n) {
anInstance(t, s, e);
var r = inheritIfRequired(new u, t, s);
return null != n && dn(n, r[i], r, o),
r
}
))).prototype = c,
c.constructor = s),
(p || y) && (fixMethod("delete"),
fixMethod("has"),
o && fixMethod("get")),
(y || h) && fixMethod(i),
a && c.clear && delete c.clear
}
return l[e] = s,
_export({
global: !0,
forced: s != u
}, l),
setToStringTag(s, e),
a || r.setStrong(s, e, o),
s
}
, Cc = v.f
, Oc = cu.fastKey
, Tc = q.set
, Pc = q.getterFor
, Lc = (collection("Map", (function(e) {
return function Map() {
return e(this, arguments.length ? arguments[0] : void 0)
}
}
), {
getConstructor: function(e, t, r, o) {
var a = e((function(e, i) {
anInstance(e, a, t),
Tc(e, {
type: t,
index: Ge(null),
first: void 0,
last: void 0,
size: 0
}),
n || (e.size = 0),
null != i && dn(i, e[o], e, r)
}
))
, i = Pc(t)
, define = function(e, t, r) {
var o, a, u = i(e), c = getEntry(e, t);
return c ? c.value = r : (u.last = c = {
index: a = Oc(t, !0),
key: t,
value: r,
previous: o = u.last,
next: void 0,
removed: !1
},
u.first || (u.first = c),
o && (o.next = c),
n ? u.size++ : e.size++,
"F" !== a && (u.index[a] = c)),
e
}
, getEntry = function(e, t) {
var n, r = i(e), o = Oc(t);
if ("F" !== o)
return r.index[o];
for (n = r.first; n; n = n.next)
if (n.key == t)
return n
};
return redefineAll(a.prototype, {
clear: function clear() {
for (var e = i(this), t = e.index, r = e.first; r; )
r.removed = !0,
r.previous && (r.previous = r.previous.next = void 0),
delete t[r.index],
r = r.next;
e.first = e.last = void 0,
n ? e.size = 0 : this.size = 0
},
delete: function(e) {
var t = this
, r = i(t)
, o = getEntry(t, e);
if (o) {
var a = o.next
, u = o.previous;
delete r.index[o.index],
o.removed = !0,
u && (u.next = a),
a && (a.previous = u),
r.first == o && (r.first = a),
r.last == o && (r.last = u),
n ? r.size-- : t.size--
}
return !!o
},
forEach: function forEach(e) {
for (var t, n = i(this), r = functionBindContext(e, arguments.length > 1 ? arguments[1] : void 0, 3); t = t ? t.next : n.first; )
for (r(t.value, t.key, this); t && t.removed; )
t = t.previous
},
has: function has(e) {
return !!getEntry(this, e)
}
}),
redefineAll(a.prototype, r ? {
get: function get(e) {
var t = getEntry(this, e);
return t && t.value
},
set: function set(e, t) {
return define(this, 0 === e ? 0 : e, t)
}
} : {
add: function add(e) {
return define(this, e = 0 === e ? 0 : e, e)
}
}),
n && Cc(a.prototype, "size", {
get: function() {
return i(this).size
}
}),
a
},
setStrong: function(e, t, n) {
var r = t + " Iterator"
, o = Pc(t)
, a = Pc(r);
defineIterator(e, t, (function(e, t) {
Tc(this, {
type: r,
target: e,
state: o(e),
kind: t,
last: void 0
})
}
), (function() {
for (var e = a(this), t = e.kind, n = e.last; n && n.removed; )
n = n.previous;
return e.target && (e.last = n = n ? n.next : e.state.first) ? "keys" == t ? {
value: n.key,
done: !1
} : "values" == t ? {
value: n.value,
done: !1
} : {
value: [n.key, n.value],
done: !1
} : (e.target = void 0,
{
value: void 0,
done: !0
})
}
), n ? "entries" : "values", !n, !0),
setSpecies(t)
}
}),
RegExp.prototype)
, jc = Lc.toString
, Ic = fails((function() {
return "/a/b" != jc.call({
source: "a",
flags: "b"
})
}
))
, Mc = "toString" != jc.name;
(Ic || Mc) && N(RegExp.prototype, "toString", (function toString() {
var e = anObject(this)
, t = String(e.source)
, n = e.flags;
return "/" + t + "/" + String(void 0 === n && e instanceof RegExp && !("flags"in Lc) ? regexpFlags.call(e) : n)
}
), {
unsafe: !0
});
var Fc = Math.max
, Dc = Math.min
, Uc = Math.floor
, $c = /\$([$&'`]|\d\d?|<[^>]*>)/g
, Bc = /\$([$&'`]|\d\d?)/g;
fixRegexpWellKnownSymbolLogic("replace", 2, (function(e, t, n, r) {
var o = r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
, a = r.REPLACE_KEEPS_$0
, i = o ? "$" : "$0";
return [function replace(n, r) {
var o = requireObjectCoercible(this)
, a = null == n ? void 0 : n[e];
return void 0 !== a ? a.call(n, o, r) : t.call(String(o), n, r)
}
, function(e, r) {
if (!o && a || "string" == typeof r && -1 === r.indexOf(i)) {
var u = n(t, e, this, r);
if (u.done)
return u.value
}
var c = anObject(e)
, s = String(this)
, l = "function" == typeof r;
l || (r = String(r));
var f = c.global;
if (f) {
var h = c.unicode;
c.lastIndex = 0
}
for (var p = []; ; ) {
var d = regexpExecAbstract(c, s);
if (null === d)
break;
if (p.push(d),
!f)
break;
"" === String(d[0]) && (c.lastIndex = advanceStringIndex(s, toLength(c.lastIndex), h))
}
for (var y, v = "", g = 0, m = 0; m < p.length; m++) {
d = p[m];
for (var b = String(d[0]), w = Fc(Dc(toInteger(d.index), s.length), 0), S = [], _ = 1; _ < d.length; _++)
S.push(void 0 === (y = d[_]) ? y : String(y));
var k = d.groups;
if (l) {
var x = [b].concat(S, w, s);
void 0 !== k && x.push(k);
var A = String(r.apply(void 0, x))
} else
A = getSubstitution(b, s, w, S, k, r);
w >= g && (v += s.slice(g, w) + A,
g = w + b.length)
}
return v + s.slice(g)
}
];
function getSubstitution(e, n, r, o, a, i) {
var u = r + e.length
, c = o.length
, s = Bc;
return void 0 !== a && (a = toObject(a),
s = $c),
t.call(i, s, (function(t, i) {
var s;
switch (i.charAt(0)) {
case "$":
return "$";
case "&":
return e;
case "`":
return n.slice(0, r);
case "'":
return n.slice(u);
case "<":
s = a[i.slice(1, -1)];
break;
default:
var l = +i;
if (0 === l)
return t;
if (l > c) {
var f = Uc(l / 10);
return 0 === f ? t : f <= c ? void 0 === o[f - 1] ? i.charAt(1) : o[f - 1] + i.charAt(1) : t
}
s = o[l - 1]
}
return void 0 === s ? "" : s
}
))
}
}
));
var qc = cu.getWeakData
, Nc = q.set
, Gc = q.getterFor
, Wc = Ee.find
, zc = Ee.findIndex
, Vc = 0
, uncaughtFrozenStore = function(e) {
return e.frozen || (e.frozen = new UncaughtFrozenStore)
}
, UncaughtFrozenStore = function() {
this.entries = []
}
, findUncaughtFrozen = function(e, t) {
return Wc(e.entries, (function(e) {
return e[0] === t
}
))
};
UncaughtFrozenStore.prototype = {
get: function(e) {
var t = findUncaughtFrozen(this, e);
if (t)
return t[1]
},
has: function(e) {
return !!findUncaughtFrozen(this, e)
},
set: function(e, t) {
var n = findUncaughtFrozen(this, e);
n ? n[1] = t : this.entries.push([e, t])
},
delete: function(e) {
var t = zc(this.entries, (function(t) {
return t[0] === e
}
));
return ~t && this.entries.splice(t, 1),
!!~t
}
};
var Hc = {
getConstructor: function(e, t, n, r) {
var o = e((function(e, a) {
anInstance(e, o, t),
Nc(e, {
type: t,
id: Vc++,
frozen: void 0
}),
null != a && dn(a, e[r], e, n)
}
))
, a = Gc(t)
, define = function(e, t, n) {
var r = a(e)
, o = qc(anObject(t), !0);
return !0 === o ? uncaughtFrozenStore(r).set(t, n) : o[r.id] = n,
e
};
return redefineAll(o.prototype, {
delete: function(e) {
var t = a(this);
if (!isObject(e))
return !1;
var n = qc(e);
return !0 === n ? uncaughtFrozenStore(t).delete(e) : n && has(n, t.id) && delete n[t.id]
},
has: function has$1(e) {
var t = a(this);
if (!isObject(e))
return !1;
var n = qc(e);
return !0 === n ? uncaughtFrozenStore(t).has(e) : n && has(n, t.id)
}
}),
redefineAll(o.prototype, n ? {
get: function get(e) {
var t = a(this);
if (isObject(e)) {
var n = qc(e);
return !0 === n ? uncaughtFrozenStore(t).get(e) : n ? n[t.id] : void 0
}
},
set: function set(e, t) {
return define(this, e, t)
}
} : {
add: function add(e) {
return define(this, e, !0)
}
}),
o
}
};
createCommonjsModule((function(e) {
var n, r = q.enforce, o = !t.ActiveXObject && "ActiveXObject"in t, a = Object.isExtensible, wrapper = function(e) {
return function WeakMap() {
return e(this, arguments.length ? arguments[0] : void 0)
}
}, i = e.exports = collection("WeakMap", wrapper, Hc);
if (A && o) {
n = Hc.getConstructor(wrapper, "WeakMap", !0),
cu.REQUIRED = !0;
var u = i.prototype
, c = u.delete
, s = u.has
, l = u.get
, f = u.set;
redefineAll(u, {
delete: function(e) {
if (isObject(e) && !a(e)) {
var t = r(this);
return t.frozen || (t.frozen = new n),
c.call(this, e) || t.frozen.delete(e)
}
return c.call(this, e)
},
has: function has(e) {
if (isObject(e) && !a(e)) {
var t = r(this);
return t.frozen || (t.frozen = new n),
s.call(this, e) || t.frozen.has(e)
}
return s.call(this, e)
},
get: function get(e) {
if (isObject(e) && !a(e)) {
var t = r(this);
return t.frozen || (t.frozen = new n),
s.call(this, e) ? l.call(this, e) : t.frozen.get(e)
}
return l.call(this, e)
},
set: function set(e, t) {
if (isObject(e) && !a(e)) {
var o = r(this);
o.frozen || (o.frozen = new n),
s.call(this, e) ? f.call(this, e, t) : o.frozen.set(e, t)
} else
f.call(this, e, t);
return this
}
})
}
}
));
function camelToKebabCase(e) {
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
}
function attributesToObject(e) {
return e ? Array.from(e).reduce((function(e, t) {
var n = t.localName
, r = t.value;
return _objectSpread2(_objectSpread2({}, e), {}, _defineProperty({}, function kebabToCamelCase(e) {
return e.replace(/(-)([a-z])/g, (function(e) {
return e[1].toUpperCase()
}
))
}(n), r))
}
), {}) : {}
}
function stringToElements(e) {
return document.createRange().createContextualFragment(e)
}
function _css(e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
n[r - 1] = arguments[r];
var o = Array.isArray(e) ? e.reduce((function(e, t, r) {
return e + (n[r] ? t + n[r] : t)
}
), "") : e
, a = new CSSStyleSheet;
return a.replace(o),
a
}
function _html(e) {
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
n[r - 1] = arguments[r];
var o = Array.isArray(e) ? e.reduce((function(e, t, r) {
return e + (n[r] ? t + n[r] : t)
}
), "") : e;
return stringToElements(o)
}
!function() {
if (!("adoptedStyleSheets"in document)) {
var e = "ShadyCSS"in window && !window.ShadyCSS.nativeShadow
, t = []
, n = []
, r = new WeakMap
, o = new WeakMap
, a = new WeakMap
, i = new WeakMap
, u = new WeakMap
, c = {
loaded: !1
}
, s = {
body: null,
CSSStyleSheet: null
}
, l = CSSStyleSheet
, f = /@import\surl(.*?);/gi
, h = ["addImport", "addPageRule", "addRule", "deleteRule", "insertRule", "removeImport", "removeRule"]
, p = ["replace", "replaceSync"]
, d = function() {
function ConstructStyleSheet() {
var e = document.createElement("style");
c.loaded ? s.body.appendChild(e) : (document.head.appendChild(e),
e.disabled = !0,
t.push(e));
var n = e.sheet;
return o.set(n, {
adopters: new Map,
actions: [],
basicStyleElement: e
}),
n
}
var e = ConstructStyleSheet.prototype;
return e.replace = function replace(e) {
var t = this
, n = rejectImports(e);
return new Promise((function(e, r) {
if (o.has(t)) {
var a = o.get(t).basicStyleElement;
a.innerHTML = n,
e(a.sheet),
updateAdopters(t)
} else
r(new Error("Failed to execute 'replace' on 'CSSStyleSheet': Can't call replace on non-constructed CSSStyleSheets."))
}
))
}
,
e.replaceSync = function replaceSync(e) {
var t = rejectImports(e);
if (o.has(this)) {
var n = o.get(this).basicStyleElement;
return n.innerHTML = t,
updateAdopters(this),
n.sheet
}
throw new Error("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.")
}
,
ConstructStyleSheet
}();
Object.defineProperty(d, Symbol.hasInstance, {
configurable: !0,
value: instanceOfStyleSheet
}),
updatePrototype(l.prototype),
window.CSSStyleSheet = d,
function initAdoptedStyleSheets() {
var t = {
configurable: !0,
get: function get() {
return r.get(this) || []
},
set: function set(e) {
var t = r.get(this) || [];
!function checkAndPrepare(e, t) {
var n = t === document ? "Document" : "ShadowRoot";
if (!Array.isArray(e))
throw new TypeError("Failed to set the 'adoptedStyleSheets' property on " + n + ": Iterator getter is not callable.");
if (!e.every(instanceOfStyleSheet))
throw new TypeError("Failed to set the 'adoptedStyleSheets' property on " + n + ": Failed to convert value to 'CSSStyleSheet'");
var o = e.filter((function(t, n) {
return e.indexOf(t) === n
}
));
return r.set(t, o),
o
}(e, this);
var n = this === document ? isDocumentLoading() ? this.head : this.body : this
, a = "isConnected"in n ? n.isConnected : document.body.contains(n);
window.requestAnimationFrame((function() {
a && (adoptStyleSheets(n),
function removeExcludedStyleSheets(e, t) {
var n = getAdoptedStyleSheet(e);
console.log({
location: e,
oldSheets: t
});
for (var r = 0, a = t.length; r < a; r++)
if (!(n.indexOf(t[r]) > -1)) {
var u = o.get(t[r]).adopters
, c = i.get(e)
, s = u.get(e);
s || (s = u.get(document.head)),
c.disconnect(),
s.parentNode.removeChild(s),
c.observe()
}
}(n, t))
}
))
}
};
if (Object.defineProperty(Document.prototype, "adoptedStyleSheets", t),
"undefined" != typeof ShadowRoot) {
var n = HTMLElement.prototype.attachShadow;
HTMLElement.prototype.attachShadow = function() {
var t = e ? this : n.apply(this, arguments);
return createObserver(t),
t
}
,
Object.defineProperty(ShadowRoot.prototype, "adoptedStyleSheets", t)
}
}(),
isDocumentLoading() ? document.addEventListener("DOMContentLoaded", initPolyfill) : initPolyfill()
}
function instanceOfStyleSheet(e) {
return e instanceof l || e instanceof s.CSSStyleSheet
}
function isDocumentLoading() {
return "loading" === document.readyState
}
function getAdoptedStyleSheet(e) {
return r.get(e.parentNode === document.documentElement ? document : e)
}
function rejectImports(e) {
var t = e.match(f, "") || []
, n = e;
return t.length && (console.warn("@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418"),
t.forEach((function(e) {
n = n.replace(e, "")
}
))),
n
}
function updatePrototype(e) {
p.forEach((function(t) {
e[t] = function() {
return d.prototype[t].apply(this, arguments)
}
}
)),
h.forEach((function(t) {
var n = e[t];
e[t] = function() {
var e = arguments
, r = n.apply(this, e);
if (o.has(this)) {
var a = o.get(this)
, i = a.adopters
, u = a.actions;
i.forEach((function(n) {
n.sheet && n.sheet[t].apply(n.sheet, e)
}
)),
u.push([t, e])
}
return r
}
}
))
}
function updateAdopters(e) {
var t = o.get(e)
, n = t.adopters
, r = t.basicStyleElement;
n.forEach((function(e) {
e.innerHTML = r.innerHTML
}
))
}
function adoptStyleSheets(e) {
for (var t = document.createDocumentFragment(), r = getAdoptedStyleSheet(e), c = i.get(e), s = 0, l = r.length; s < l; s++) {
var f = o.get(r[s])
, h = f.adopters
, p = f.basicStyleElement
, d = h.get(e);
d ? (c.disconnect(),
t.appendChild(d),
(!d.innerHTML || d.sheet && !d.sheet.cssText) && (d.innerHTML = p.innerHTML),
c.observe()) : ((d = document.createElement("style")).innerHTML = p.innerHTML,
a.set(d, e),
u.set(d, 0),
h.set(e, d),
t.appendChild(d)),
e === document.head && n.push(d)
}
e.insertBefore(t, e.firstChild);
for (var y = 0, v = r.length; y < v; y++) {
var g = o.get(r[y])
, m = g.adopters
, b = g.actions
, w = m.get(e)
, S = u.get(w);
if (b.length > 0) {
for (var _ = S, k = b.length; _ < k; _++) {
var x = b[_]
, A = x[0]
, E = x[1];
w.sheet[A].apply(w.sheet, E)
}
u.set(w, b.length - 1)
}
}
}
function adoptAndRestoreStylesOnMutationCallback(t) {
for (var n = 0, r = t.length; n < r; n++) {
for (var o = t[n], i = o.addedNodes, u = o.removedNodes, c = 0, s = u.length; c < s; c++) {
var l = a.get(u[c]);
l && adoptStyleSheets(l)
}
if (!e)
for (var f = 0, h = i.length; f < h; f++)
for (var p = document.createNodeIterator(i[f], NodeFilter.SHOW_ELEMENT, (function(e) {
return e.shadowRoot && e.shadowRoot.adoptedStyleSheets.length > 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
}
), null, !1), d = void 0; d = p.nextNode(); )
adoptStyleSheets(d.shadowRoot)
}
}
function createObserver(e) {
var t = new MutationObserver(adoptAndRestoreStylesOnMutationCallback)
, n = {
observe: function observe() {
t.observe(e, {
childList: !0,
subtree: !0
})
},
disconnect: function disconnect() {
t.disconnect()
}
};
i.set(e, n),
n.observe()
}
function initPolyfill() {
var e = document.createElement("iframe");
e.hidden = !0,
document.body.appendChild(e),
s.body = e.contentWindow.document.body,
s.CSSStyleSheet = e.contentWindow.CSSStyleSheet,
updatePrototype(e.contentWindow.CSSStyleSheet.prototype),
createObserver(document.body),
c.loaded = !0;
for (var r = document.createDocumentFragment(), o = 0, a = t.length; o < a; o++)
t[o].disabled = !1,
r.appendChild(t[o]);
s.body.appendChild(r);
for (var i = 0, u = n.length; i < u; i++)
r.appendChild(n[i]);
document.body.insertBefore(r, document.body.firstChild),
t.length = 0,
n.length = 0
}
}();
var Yc, Qc = {}, Kc = {}, Jc = function(e) {
_inherits(Component, _wrapNativeSuper(HTMLElement));
var t, n, r, o, a, i = _createSuper(Component);
function Component(e) {
var t;
return _classCallCheck(this, Component),
t = i.call(this),
e ? t.componentPath = e : (console.warn("You did not send a path to the super method in your constructor. Thus CSS and HTML cannot be read for this component.", _assertThisInitialized(t)),
console.warn("If shipping for modern browser, then call super with import.meta.url. If not, specify a path that is similar to import.meta.url yourself."),
console.warn("Should be the path to the component you are making.")),
t
}
return _createClass(Component, [{
key: "$",
value: function $(e) {
return this._sDOM.querySelector(e)
}
}, {
key: "_render",
value: (a = _asyncToGenerator(regeneratorRuntime.mark((function _callee() {
var e, t;
return regeneratorRuntime.wrap((function _callee$(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if (Kc[this.cssPath] || !this.cssPath) {
n.next = 6;
break
}
return n.next = 4,
this.fetchCSSAsStyleSheet();
case 4:
e = n.sent,
this._sDOM.adoptedStyleSheets = [e];
case 6:
return t = this.render(this.props),
n.abrupt("return", stringToElements(t));
case 8:
case "end":
return n.stop()
}
}
), _callee, this)
}
))),
function _render() {
return a.apply(this, arguments)
}
)
}, {
key: "fetchHTMLAsDocFrag",
value: (o = _asyncToGenerator(regeneratorRuntime.mark((function _callee2() {
var e, t;
return regeneratorRuntime.wrap((function _callee2$(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.next = 2,
fetch(this.htmlPath);
case 2:
if (!(e = n.sent).ok) {
n.next = 8;
break
}
return n.next = 6,
e.text();
case 6:
return t = n.sent,
n.abrupt("return", stringToElements(t));
case 8:
throw new Error("Fetch failed");
case 9:
case "end":
return n.stop()
}
}
), _callee2, this)
}
))),
function fetchHTMLAsDocFrag() {
return o.apply(this, arguments)
}
)
}, {
key: "fetchCSSAsStyleSheet",
value: (r = _asyncToGenerator(regeneratorRuntime.mark((function _callee3() {
var e, t, n;
return regeneratorRuntime.wrap((function _callee3$(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
return e = new CSSStyleSheet,
r.next = 3,
fetch(this.cssPath);
case 3:
if (!(t = r.sent).ok || -1 === t.headers.get("content-type").indexOf("text/css")) {
r.next = 10;
break
}
return r.next = 7,
t.text();
case 7:
return n = r.sent,
r.next = 10,
e.replace(n);
case 10:
return r.abrupt("return", e);
case 11:
case "end":
return r.stop()
}
}
), _callee3, this)
}
))),
function fetchCSSAsStyleSheet() {
return r.apply(this, arguments)
}
)
}, {
key: "_renderHTMLFile",
value: (n = _asyncToGenerator(regeneratorRuntime.mark((function _callee4() {
var e, t, n, r, o;
return regeneratorRuntime.wrap((function _callee4$(a) {
for (; ; )
switch (a.prev = a.next) {
case 0:
return e = btoa(this.componentPath),
Qc[e] || (Qc[e] = Promise.all([this.fetchHTMLAsDocFrag(), this.fetchCSSAsStyleSheet()])),
a.next = 4,
Qc[e];
case 4:
return t = a.sent,
n = _slicedToArray(t, 2),
r = n[0],
o = n[1],
this._sDOM.adoptedStyleSheets = [o],
a.abrupt("return", r.cloneNode(!0));
case 10:
case "end":
return a.stop()
}
}
), _callee4, this)
}
))),
function _renderHTMLFile() {
return n.apply(this, arguments)
}
)
}, {
key: "componentDidMount",
value: function componentDidMount() {}
}, {
key: "connectedCallback",
value: (t = _asyncToGenerator(regeneratorRuntime.mark((function _callee5() {
var e, t = this;
return regeneratorRuntime.wrap((function _callee5$(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if (this._sDOM = this.attachShadow({
mode: "closed"
}),
!this.render) {
n.next = 7;
break
}
return n.next = 4,
this._render();
case 4:
e = n.sent,
n.next = 14;
break;
case 7:
if (!this.componentPath) {
n.next = 13;
break
}
return n.next = 10,
this._renderHTMLFile();
case 10:
e = n.sent,
n.next = 14;
break;
case 13:
console.error("No render function or component path found for static html/css.");
case 14:
this._sDOM.innerHTML = null,
this._sDOM.appendChild(e),
requestAnimationFrame((function() {
requestAnimationFrame((function() {
t.componentDidMount && t.componentDidMount()
}
))
}
));
case 17:
case "end":
return n.stop()
}
}
), _callee5, this)
}
))),
function connectedCallback() {
return t.apply(this, arguments)
}
)
}, {
key: "cssPath",
get: function get() {
return this.componentPath && this.componentPath.replace(/\.(html|js)/gi, ".css")
}
}, {
key: "htmlPath",
get: function get() {
return this.componentPath && this.componentPath.replace(/\.(css|js)/gi, ".html")
}
}, {
key: "props",
get: function get() {
return attributesToObject(this.attributes)
}
}]),
Component
}();
function registerComponent(e) {
var t = camelToKebabCase("is"in e ? e.is : e.prototype.constructor.name);
return customElements.define(t, e),
t
}
function generateFunctionComponent(e, t) {
var n = t.metaUrl
, r = t.observedAttributes;
return function(t) {
_inherits(_class, _wrapNativeSuper(HTMLElement));
var o, a, i, u = _createSuper(_class);
function _class() {
var e;
return _classCallCheck(this, _class),
(e = u.call(this))._html = void 0,
e._css = void 0,
e._postRender = void 0,
e._propsChanged = void 0,
e._componentPath = n,
e
}
return _createClass(_class, [{
key: "_render",
value: (i = _asyncToGenerator(regeneratorRuntime.mark((function _callee6(t) {
var n = this;
return regeneratorRuntime.wrap((function _callee6$(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
if (this._rendering = e.apply(this.customThis, [t]),
!(this._rendering instanceof Promise)) {
r.next = 4;
break
}
return r.next = 4,
this._rendering;
case 4:
return r.next = 6,
new Promise((function(e) {
n._css ? requestAnimationFrame((function() {
n._sDOM.adoptedStyleSheets = [n._css]
}
)) : console.warn("Missing CSS. Will render without it."),
n._html ? requestAnimationFrame((function() {
n._sDOM.innerHTML = null,
n._sDOM.appendChild(n._html),
e()
}
)) : console.warn("Missing HTML. Will render without it."),
e()
}
));
case 6:
requestAnimationFrame((function() {
n._postRender instanceof Function && n._postRender()
}
));
case 7:
case "end":
return r.stop()
}
}
), _callee6, this)
}
))),
function _render(e) {
return i.apply(this, arguments)
}
)
}, {
key: "attributeChangedCallback",
value: (a = _asyncToGenerator(regeneratorRuntime.mark((function _callee7() {
var e = this;
return regeneratorRuntime.wrap((function _callee7$(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.next = 2,
this._render(attributesToObject(this.attributes));
case 2:
requestAnimationFrame((function() {
e._propsChanged instanceof Function && e._propsChanged(attributesToObject(e.attributes))
}
));
case 3:
case "end":
return t.stop()
}
}
), _callee7, this)
}
))),
function attributeChangedCallback() {
return a.apply(this, arguments)
}
)
}, {
key: "connectedCallback",
value: (o = _asyncToGenerator(regeneratorRuntime.mark((function _callee8() {
return regeneratorRuntime.wrap((function _callee8$(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
this._sDOM = this.attachShadow({
mode: "closed"
}),
this._render(attributesToObject(this.attributes));
case 2:
case "end":
return e.stop()
}
}
), _callee8, this)
}
))),
function connectedCallback() {
return o.apply(this, arguments)
}
)
}, {
key: "cssPath",
get: function get() {
return this._componentPath && this._componentPath.replace(/\.(html|js)/gi, ".css")
}
}, {
key: "htmlPath",
get: function get() {
return this._componentPath && this._componentPath.replace(/\.(css|js)/gi, ".html")
}
}, {
key: "customThis",
get: function get() {
var e, t, n = this;
return {
html: function html(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++)
r[o - 1] = arguments[o];
return n._html = _html.apply(void 0, [e].concat(r)),
n._html
},
css: function css(e) {
for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++)
r[o - 1] = arguments[o];
return n._css = _css.apply(void 0, [e].concat(r)),
n._css
},
useHTML: (t = _asyncToGenerator(regeneratorRuntime.mark((function _callee9(e) {
var t, r;
return regeneratorRuntime.wrap((function _callee9$(o) {
for (; ; )
switch (o.prev = o.next) {
case 0:
if (e = e || n.htmlPath) {
o.next = 3;
break
}
return o.abrupt("return");
case 3:
return e instanceof URL && (e = e.toString()),
o.next = 6,
fetch(e);
case 6:
return t = o.sent,
o.next = 9,
t.text();
case 9:
return r = o.sent,
o.abrupt("return", n.customThis.html([r]));
case 11:
case "end":
return o.stop()
}
}
), _callee9)
}
))),
function useHTML(e) {
return t.apply(this, arguments)
}
),
useCSS: (e = _asyncToGenerator(regeneratorRuntime.mark((function _callee10(e) {
var t, r;
return regeneratorRuntime.wrap((function _callee10$(o) {
for (; ; )
switch (o.prev = o.next) {
case 0:
if (e = e || n.cssPath) {
o.next = 3;
break
}
return o.abrupt("return");
case 3:
return e instanceof URL && (e = e.toString()),
o.next = 6,
fetch(e);
case 6:
return t = o.sent,
o.next = 9,
t.text();
case 9:
return r = o.sent,
o.abrupt("return", n.customThis.css([r]));
case 11:
case "end":
return o.stop()
}
}
), _callee10)
}
))),
function useCSS(t) {
return e.apply(this, arguments)
}
),
postRender: function postRender(e) {
n._postRender = e
},
propsChanged: function propsChanged(e) {
n._propsChanged = e
},
$: function $(e) {
return void 0 === e ? n : ":host" === e ? n._sDOM : n._sDOM.querySelector(e)
},
$$: function $$(e) {
return n._sDOM.querySelectorAll(e)
}
}
}
}], [{
key: "observedAttributes",
get: function get() {
return r
}
}]),
_class
}()
}
function registerFunctionComponent(e) {
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {
metaUrl: void 0,
observedAttributes: []
}
, n = t.metaUrl
, r = t.observedAttributes
, o = camelToKebabCase(e.name);
return customElements.define(o, generateFunctionComponent(e, {
metaUrl: n,
observedAttributes: r
})),
o
}
function stringToElements$1(e) {
return document.createRange().createContextualFragment(e)
}
function handleOpenFile(e) {
"Vibrant"in window || document.head.appendChild(stringToElements$1('\n <script src="https://cdn.jsdelivr.net/npm/node-vibrant@3.1.3/dist/vibrant.min.js"><\/script>\n ')),
"jsmediatags"in window || document.head.appendChild(stringToElements$1('\n <script src="https://cdn.jsdelivr.net/npm/jsmediatags@3.8.1/dist/jsmediatags.min.js"><\/script>\n ')),
document.dispatchEvent(new CustomEvent("app-header:open-files",{
detail: {
files: e.target.files
}
}))
}
function _templateObject2() {
var e = _taggedTemplateLiteral(["\n :host {\n pointer-events: none;\n width: 100%;\n height: 0;\n }\n\n span {\n display: block;\n width: 100%;\n background-color: var(--darker-pink);\n color: white;\n font-size: 10pt;\n padding: 1em;\n border-radius: 4px;\n transform: none;\n transition: all 250ms ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n }\n\n span:empty {\n opacity: 0;\n transform: translateY(-100%);\n }\n "]);
return _templateObject2 = function _templateObject2() {
return e
}
,
e
}
function _templateObject() {
var e = _taggedTemplateLiteral(["\n <span></span>\n "]);
return _templateObject = function _templateObject() {
return e
}
,
e
}
registerComponent(function(e) {
_inherits(AppHeader, Jc);
var t = _createSuper(AppHeader);
function AppHeader() {
return _classCallCheck(this, AppHeader),
t.call(this, "/js/components/app-header/app-header.js")
}
return _createClass(AppHeader, [{
key: "registerEventListeners",
value: function registerEventListeners() {
var e = this.$("#input-file")
, t = this.$("#btn-open-file")
, n = this.$("#btn-info");
t.addEventListener("click", (function() {
return e.click()
}
)),
e.addEventListener("change", handleOpenFile),
n.addEventListener("click", (function() {
return function handleInfoButtonClick() {
var e = document.querySelector("info-box");
e.getAttribute("open") ? e.removeAttribute("open") : e.setAttribute("open", "open")
}()
}
))
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
var e = this;
this.registerEventListeners(),
this.ensureDarkMode(),
document.addEventListener("colorschemechange", (function(t) {
if (t instanceof CustomEvent) {
var n = "dark" === t.detail.colorScheme;
e.ensureDarkMode(n)
}
}
))
}
}, {
key: "ensureDarkMode",
value: function ensureDarkMode(e) {
void 0 === e && (e = window.matchMedia("(prefers-color-scheme: dark)").matches),
this.classList.toggle("dark", e)
}
}]),
AppHeader
}()),
registerFunctionComponent((function StatusText() {
var e = this.html
, t = this.css
, n = this.postRender
, r = this.$;
n((function() {
var e = r("span");
document.addEventListener("status", (function(t) {
var n = t.detail
, r = n.message
, o = n.action;
t instanceof CustomEvent && (Yc && !o && clearTimeout(Yc),
e.textContent = r,
"reload" !== o && (Yc = setTimeout((function() {
e.textContent = null
}
), 4e3)))
}
))
}
)),
e(_templateObject()),
t(_templateObject2())
}
)),
registerComponent(function(e) {
_inherits(LayoutBox, Jc);
var t = _createSuper(LayoutBox);
function LayoutBox() {
return _classCallCheck(this, LayoutBox),
t.call(this, "/js/components/layout-box/layout-box.js")
}
return _createClass(LayoutBox, [{
key: "ensureDarkMode",
value: function ensureDarkMode(e) {
void 0 === e && (e = window.matchMedia("(prefers-color-scheme: dark)").matches),
this.classList.toggle("dark", e)
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
var e = this;
this.ensureDarkMode(),
document.addEventListener("colorschemechange", (function(t) {
if (t instanceof CustomEvent) {
var n = "dark" === t.detail.colorScheme;
e.ensureDarkMode(n)
}
}
))
}
}]),
LayoutBox
}()),
registerComponent(function(e) {
_inherits(InfoBox, Jc);
var t = _createSuper(InfoBox);
function InfoBox() {
return _classCallCheck(this, InfoBox),
t.call(this, "/js/components/info-box/info-box.js")
}
return _createClass(InfoBox, [{
key: "ensureDarkMode",
value: function ensureDarkMode(e) {
void 0 === e && (e = window.matchMedia("(prefers-color-scheme: dark)").matches),
this.classList.toggle("dark", e)
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
var e = this;
this.ensureDarkMode(),
document.addEventListener("colorschemechange", (function(t) {
if (t instanceof CustomEvent) {
var n = "dark" === t.detail.colorScheme;
e.ensureDarkMode(n)
}
}
))
}
}]),
InfoBox
}());
var Xc = Ee.find
, Zc = !0
, es = arrayMethodUsesToLength("find");
"find"in [] && Array(1).find((function() {
Zc = !1
}
)),
_export({
target: "Array",
proto: !0,
forced: Zc || !es
}, {
find: function find(e) {
return Xc(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
}),
addToUnscopables("find");
var ts = Ee.findIndex
, ns = !0
, rs = arrayMethodUsesToLength("findIndex");
function _templateObject2$1() {
var e = _taggedTemplateLiteral(["\n :host {\n all: unset;\n background-color: currentColor;\n padding: 0.5em;\n border-radius: 8px;\n box-sizing: border-box;\n cursor: pointer;\n user-select: none;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n span {\n color: white;\n }\n "]);
return _templateObject2$1 = function _templateObject2() {
return e
}
,
e
}
function _templateObject$1() {
var e = _taggedTemplateLiteral(["\n <span>Shuffle</span>\n "]);
return _templateObject$1 = function _templateObject() {
return e
}
,
e
}
function stringToElements$2(e) {
return _toConsumableArray(document.createRange().createContextualFragment(e).children)
}
"findIndex"in [] && Array(1).findIndex((function() {
ns = !1
}
)),
_export({
target: "Array",
proto: !0,
forced: ns || !rs
}, {
findIndex: function findIndex(e) {
return ts(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
}),
addToUnscopables("findIndex"),
registerFunctionComponent((function ShuffleButton() {
var e = this.html
, t = this.css
, n = this.postRender
, r = this.$;
e(_templateObject$1()),
t(_templateObject2$1()),
n((function() {
r(":host").addEventListener("click", (function() {
document.dispatchEvent(new CustomEvent("play-queue:shuffle"))
}
))
}
))
}
)),
registerComponent(function(e) {
_inherits(PlayQueue, Jc);
var t, n, r = _createSuper(PlayQueue);
function PlayQueue() {
var e;
return _classCallCheck(this, PlayQueue),
(e = r.call(this, "/js/components/play-queue/play-queue.js")).refs = {},
e.queueState = {
items: [],
activeItemId: null
},
e
}
return _createClass(PlayQueue, [{
key: "componentDidMount",
value: function componentDidMount() {
this.refs = {
queue: this.$("#queue"),
activeItemStyles: this.$("#active-item-styles")
},
this.registerEventListeners(),
this.queueState.items.length > 0 && this.renderItems()
}
}, {
key: "updateActiveItemIndication",
value: function updateActiveItemIndication(e) {
this.refs.activeItemStyles.innerHTML = '\n li[data-id="'.concat(e, '"] {\n background-color: var(--player-vibrant) !important;\n color: white !important;\n }\n\n li[data-id="').concat(e, '"] .remove-item-button {\n display: none;\n }\n ')
}
}, {
key: "handleRemove",
value: function handleRemove(e) {
e !== this.queueState.activeItemId && (this.queueState.items = this.queueState.items.filter((function(t) {
return t !== e
}
)),
this.$('li[data-id="'.concat(e, '"]')).remove())
}
}, {
key: "renderItems",
value: function renderItems() {
var e = this;
if (0 !== this.queueState.items.length) {
var t = this.queueState.items.map((function(e) {
var t = e.title
, n = e.artist
, r = e.id
, o = e.imageURL;
return "\n <li data-id=".concat(r, '>\n <figure>\n <img src="').concat(o || "img/missing-cover-2x.png", '" alt="').concat(t, '">\n </figure>\n <div class="wrapper">\n <span>').concat(t, "</span>\n <span>").concat(n, '</span>\n </div>\n <div class="actions"></div>\n </li>\n ')
}
)).map(stringToElements$2).map((function(e) {
return e[0]
}
));
this.refs.queue.innerHTML = null,
t.forEach((function(t) {
var n = document.createElement("button");
n.className = "remove-item-button",
n.addEventListener("click", (function(n) {
n.preventDefault(),
n.stopPropagation(),
e.handleRemove(t.getAttribute("data-id"))
}
)),
n.innerHTML = '\n <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" width="15" height="15"><path d="M4 .5H1.5a1 1 0 00-1 1V4M6 .5h3m2 0h2.5a1 1 0 011 1V4M.5 6v3m14-3v3m-14 2v2.5a1 1 0 001 1H4M14.5 11v2.5a1 1 0 01-1 1H11m-7-7h7m-5 7h3" stroke="currentColor"></path></svg>\n ',
t.querySelector(".actions").appendChild(n),
requestAnimationFrame((function() {
return e.refs.queue.appendChild(t)
}
))
}
))
}
}
}, {
key: "handlePlayQueueAdd",
value: (n = _asyncToGenerator(regeneratorRuntime.mark((function _callee(e) {
var t, n;
return regeneratorRuntime.wrap((function _callee$(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
if (this.queueState.items.length > 0 && -1 !== this.queueState.items[0].title.indexOf("[PROMO]") && (this.queueState.items = []),
t = 0 === this.queueState.items.length,
n = e.detail.items,
this.queueState.items = this.queueState.items.concat(n),
this.renderItems(),
!t) {
r.next = 10;
break
}
return r.next = 9,
Ru.resume();
case 9:
document.dispatchEvent(new CustomEvent("play-queue:request-next-song"));
case 10:
case "end":
return r.stop()
}
}
), _callee, this)
}
))),
function handlePlayQueueAdd(e) {
return n.apply(this, arguments)
}
)
}, {
key: "handlePlayQueueGetNextSong",
value: function handlePlayQueueGetNextSong() {
var e = this
, t = this.queueState.items.findIndex((function(t) {
return t.id === e.queueState.activeItemId
}
)) + 1;
this.queueState.items[t] || (t = 0);
var n = this.queueState.items[t];
document.dispatchEvent(new CustomEvent("play-queue:play-song",{
detail: n
})),
this.queueState.activeItemId = n.id,
this.updateActiveItemIndication(n.id)
}
}, {
key: "handleShuffle",
value: function handleShuffle() {
var e = this
, t = function shuffle(e) {
for (var t, n, r = e.length; r; )
n = Math.floor(Math.random() * r--),
t = e[r],
e[r] = e[n],
e[n] = t;
return e
}(this.queueState.items).sort((function(t, n) {
return t.id === e.queueState.activeItemId ? -1 : n.id === e.queueState.activeItemId ? 1 : 0
}
));
this.queueState.items = t,
this.renderItems()
}
}, {
key: "handleToggleOpen",
value: function handleToggleOpen() {
this.getAttribute("open") ? this.removeAttribute("open") : this.setAttribute("open", "open")
}
}, {
key: "handleClickQueue",
value: (t = _asyncToGenerator(regeneratorRuntime.mark((function _callee2(e) {
var t;
return regeneratorRuntime.wrap((function _callee2$(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
if ("li" !== e.target.tagName.toLowerCase()) {
n.next = 8;
break
}
if (t = e.target.getAttribute("data-id"),
"suspended" !== Ru.audioContext.state) {
n.next = 5;
break
}
return n.next = 5,
Ru.resume();
case 5:
document.dispatchEvent(new CustomEvent("play-queue:play-song",{
detail: this.queueState.items.find((function(e) {
return e.id === t
}
))
})),
this.queueState.activeItemId = t,
this.updateActiveItemIndication(t);
case 8:
case "end":
return n.stop()
}
}
), _callee2, this)
}
))),
function handleClickQueue(e) {
return t.apply(this, arguments)
}
)
}, {
key: "registerEventListeners",
value: function registerEventListeners() {
var e = this;
this.refs.queue.addEventListener("click", (function(t) {
return e.handleClickQueue(t)
}
), !1),
document.addEventListener("play-queue:add", (function(t) {
t instanceof CustomEvent && e.handlePlayQueueAdd(t)
}
), !1),
document.addEventListener("play-queue:request-next-song", (function() {
return e.handlePlayQueueGetNextSong()
}
), !1),
document.addEventListener("play-queue:shuffle", (function() {
return e.handleShuffle()
}
), !1),
document.addEventListener("play-queue:toggle", (function() {
return e.handleToggleOpen()
}
), !1)
}
}]),
PlayQueue
}());
var os = function(e) {
_inherits(CoverArt, Jc);
var t = _createSuper(CoverArt);
function CoverArt() {
return _classCallCheck(this, CoverArt),
t.call(this, "/js/components/cover-art/cover-art.js")
}
return _createClass(CoverArt, [{
key: "componentDidMount",
value: function componentDidMount() {
var e = this.$("img");
Ru.currentImageObserver.observe((function(t) {
e.src = t
}
))
}
}]),
CoverArt
}();
registerComponent(os);
var as = "You need to set duration before you can start/stop the progress bar."
, is = function(e) {
_inherits(ProgressBar, _wrapNativeSuper(HTMLElement));
var t = _createSuper(ProgressBar);
function ProgressBar() {
return _classCallCheck(this, ProgressBar),
t.apply(this, arguments)
}
return _createClass(ProgressBar, [{
key: "connectedCallback",
value: function connectedCallback() {
var e = this
, t = this.attachShadow({
mode: "closed"
});
t.innerHTML = "\n <style>".concat("\n #wrapper {\n width: 100%;\n height: 100%;\n contain: strict;\n background-color: rgba(255, 255, 255, 0.2);\n cursor: pointer;\n }\n\n #indicator {\n width: 100%;\n height: 100%;\n transform: none;\n will-change: transform;\n background-color: currentColor;\n pointer-events: none;\n }\n", '</style>\n <div id="wrapper">\n <div id="indicator"></div>\n </div>\n '),
this.wrapper = t.querySelector("#wrapper"),
this.indicator = t.querySelector("#indicator"),
this.wrapper.addEventListener("click", (function(t) {
t instanceof MouseEvent && e.handleClick(t)
}
), !1)
}
}, {
key: "handleClick",
value: function handleClick(e) {
var t = this.getMousePositionAsPercent(e)
, n = {
percent: t
};
document.dispatchEvent(new CustomEvent("progress-bar:seek",{
detail: n
})),
this.currentTime = this.animationDuration * t
}
}, {
key: "getMousePositionAsPercent",
value: function getMousePositionAsPercent(e) {
var t = this.wrapper.getBoundingClientRect();
return Math.abs(t.left + window.pageXOffset - e.pageX) / Math.round(t.width)
}
}, {
key: "start",
value: function start() {
if (!this.animation)
throw new Error(as);
this.animation.play()
}
}, {
key: "stop",
value: function stop() {
if (!this.animation)
throw new Error(as);
this.animation.pause()
}
}, {
key: "duration",
set: function set(e) {
this.animationDuration = 1e3 * e;
this.animation = this.indicator.animate([{
transform: "translateX(-100%)"
}, {
transform: "translateX(0%)"
}], {
duration: this.animationDuration,
iterations: 1
}),
this.animation.pause()
}
}, {
key: "playbackRate",
set: function set(e) {
this.stop(),
this.animation.playbackRate = e,
this.start()
}
}, {
key: "currentTime",
set: function set(e) {
this.animation && (this.animation.currentTime = e)
}
}]),
ProgressBar
}();
customElements.define("progress-bar", is);
class AudioVisualiser extends HTMLElement {
constructor() {
super(),
this.fillStyle = "#ffffff",
this._analyser = null,
this.resizeObserver = new ResizeObserver(()=>this.updateCanvasSize())
}
set analyser(e) {
if (!(e instanceof AnalyserNode)) {
throw new TypeError(`Passed in parameter needs to be an AnalyserNode. Was a ${typeof e}.`)
}
this._analyser = e
}
static get observedAttributes() {
return ["color"]
}
attributeChangedCallback(e, t, n) {
"color" === e && n && (this.fillStyle = n,
this.canvasContext && (this.canvasContext.fillStyle = n))
}
stop() {
cancelAnimationFrame(this.animationLoop),
this.animationLoop = void 0
}
start() {
const {canvas: e, canvasContext: t, _analyser: n} = this;
if (!n)
throw new ReferenceError("Analyser has not been set");
const r = e.width
, o = e.height
, a = new Uint8Array(n.frequencyBinCount);
n.getByteFrequencyData(a),
t.clearRect(0, 0, r, o),
t.beginPath(),
t.moveTo(0, o),
[...new Array(a.length)].map((e,t)=>function generateCoordinates(e, t, n, r) {
return [~~(e * (n / t.length)), r - ~~(Math.min(255, Math.max(0, t[e])) * (r / 255))]
}(t, a, r, o)).concat([[r, o]]).concat([[0, o]]).forEach(([e,n])=>t.lineTo(e, n)),
t.closePath(),
t.fill(),
this.animationLoop = requestAnimationFrame(this.start.bind(this))
}
updateCanvasSize() {
const {canvas: e} = this;
if (e instanceof HTMLCanvasElement) {
const t = e.getBoundingClientRect()
, n = window.devicePixelRatio || 1;
e.width = t.width * n,
e.height = t.height * n,
this.canvasContext.fillStyle = this.fillStyle,
this.canvasContext.lineCap = "round",
this.canvasContext.lineJoin = "round",
this.resizeObserver.observe(e)
}
}
render() {
this.sDOM.innerHTML = "\n <style>\n :host {\n contain: strict;\n }\n\n canvas {\n width: 100%;\n height: 100%;\n }\n </style>\n <canvas></canvas>\n ",
this.canvas = this.sDOM.querySelector("canvas"),
this.canvasContext = this.canvas.getContext("2d"),
this.fillStyle && (this.canvasContext.fillStyle = this.fillStyle)
}
connectedCallback() {
this.sDOM = this.attachShadow({
mode: "closed"
}),
this.render(),
this.updateCanvasSize()
}
}
function isPatron() {
return _isPatron.apply(this, arguments)
}
function _isPatron() {
return (_isPatron = _asyncToGenerator(regeneratorRuntime.mark((function _callee() {
var e, t, n, r;
return regeneratorRuntime.wrap((function _callee$(o) {
for (; ; )
switch (o.prev = o.next) {
case 0:
if (o.prev = 0,
null !== (e = localStorage.getItem("patreon"))) {
o.next = 4;
break
}
return o.abrupt("return", !1);
case 4:
return t = JSON.parse(e),
n = t.access_token,
o.next = 7,
fetch("https://patreon.nightcore.app/patron", {
headers: {
Authorization: "Bearer ".concat(n)
}
});
case 7:
return r = o.sent,
o.abrupt("return", r.ok);
case 11:
o.prev = 11,
o.t0 = o.catch(0),
console.error(o.t0);
case 14:
case "end":
return o.stop()
}
}
), _callee, null, [[0, 11]])
}
)))).apply(this, arguments)
}
function _templateObject2$2() {
var e = _taggedTemplateLiteral(["\n button {\n all: unset;\n }\n\n svg {\n display: block;\n width: 1rem;\n height: 1rem;\n contain: strict;\n }\n "]);
return _templateObject2$2 = function _templateObject2() {
return e
}
,
e
}
function _templateObject$2() {
var e = _taggedTemplateLiteral(['\n <button type="button">\n <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" width="15" height="15">\n <path d="M7.5 10.5l-3.25-3m3.25 3l3-3m-3 3V1m6 6v6.5h-12V7" stroke="currentColor"></path>\n </svg>\n </button>\n ']);
return _templateObject$2 = function _templateObject() {
return e
}
,
e
}
customElements.define("audio-visualiser", AudioVisualiser),
registerFunctionComponent((function DownloadButton() {
var e = this.html
, t = this.css
, n = this.postRender
, r = this.$;
n((function() {
r(":host").addEventListener("click", _asyncToGenerator(regeneratorRuntime.mark((function _callee() {
var e;
return regeneratorRuntime.wrap((function _callee$(t) {
for (; ; )
switch (t.prev = t.next) {
case 0:
return t.next = 2,
isPatron();
case 2:
e = t.sent,
"OfflineAudioContext"in window || document.dispatchEvent(new CustomEvent("status",{
detail: {
message: "Your browser does not support downloading of songs. Try for example Google Chrome instead."
}
})),
document.dispatchEvent(new CustomEvent("player:trigger-download"))
case 5:
case "end":
return t.stop()
}
}
), _callee)
}
))))
}
)),
e(_templateObject$2()),
t(_templateObject2$2())
}
)),
registerComponent(function(e) {
_inherits(FooterPlayer, Jc);
var t = _createSuper(FooterPlayer);
function FooterPlayer() {
return _classCallCheck(this, FooterPlayer),
t.call(this, "/js/components/footer-player/footer-player.js")
}
return _createClass(FooterPlayer, [{
key: "handleMetadataChange",
value: function handleMetadataChange() {
this.bottomRow.classList.add("visible")
}
}, {
key: "handlePlayerColours",
value: function handlePlayerColours(e) {
var t = _slicedToArray(e.detail.colours, 3)
, n = t[0]
, r = t[1]
, o = t[2];
if (!this.audioVisualiser) {
var a = document.createElement("audio-visualiser");
this.topRow.appendChild(a),
this.audioVisualiser = a
}
this.footer.style.setProperty("--vibrant", n),
this.footer.style.setProperty("--base", o),
document.body.style.setProperty("--player-dark", o),
document.body.style.setProperty("--player-vibrant", r),
document.body.style.setProperty("--player-light", n),
this.audioVisualiser.setAttribute("color", r)
}
}, {
key: "handleDurationChange",
value: function handleDurationChange(e) {
var t = e.detail
, n = t.orginalDuration
, r = t.playbackRate;
this.progressBar.duration = n,
this.progressBar.playbackRate = r
}
}, {
key: "handlePlayStateChange",
value: function handlePlayStateChange(e) {
"PLAYING" === e.detail.playState ? (this.togglePlaybackButton.querySelector("#play").style.display = "none",
this.togglePlaybackButton.querySelector("#pause").style.display = "block",
this.audioVisualiser.analyser = Ru.analyser,
this.audioVisualiser.start(),
this.progressBar.start()) : (this.togglePlaybackButton.querySelector("#play").style.display = "block",
this.togglePlaybackButton.querySelector("#pause").style.display = "none",
this.audioVisualiser.stop(),
this.progressBar.stop())
}
}, {
key: "handleComputedPlaybackRateChange",
value: function handleComputedPlaybackRateChange(e) {
var t = e.detail.computedPlaybackRate;
this.progressBar.playbackRate = t
}
}, {
key: "registerEventListeners",
value: function registerEventListeners() {
var e = this;
document.addEventListener("metadata-change", (function() {
return e.handleMetadataChange()
}
)),
document.addEventListener("player:colours", (function(t) {
return e.handlePlayerColours(t)
}
)),
document.addEventListener("player:duration-change", (function(t) {
return e.handleDurationChange(t)
}
)),
document.addEventListener("player:play-state-change", (function(t) {
return e.handlePlayStateChange(t)
}
)),
document.addEventListener("player:computed-playback-rate-change", (function(t) {
return e.handleComputedPlaybackRateChange(t)
}
)),
this.togglePlaybackButton.addEventListener("click", (function() {
return document.dispatchEvent(new CustomEvent("player:toggle-playback"))
}
)),
this.toggleQueueButton.addEventListener("click", (function() {
document.dispatchEvent(new CustomEvent("play-queue:toggle"))
}
)),
this.coverArtWrapper.addEventListener("click", (function() {
return e.toggleNowPlaying()
}
))
}
}, {
key: "toggleNowPlaying",
value: function toggleNowPlaying() {
this.nowPlaying = !this.nowPlaying,
this.nowPlaying ? (this.classList.add("now-playing"),
this.footer.classList.add("now-playing")) : (this.classList.remove("now-playing"),
this.footer.classList.remove("now-playing"))
}
}, {
key: "cacheDOMRefs",
value: function cacheDOMRefs() {
this.coverArtWrapper = this.$(".cover-art-wrapper"),
this.footer = this.$("footer"),
this.topRow = this.$(".top-row"),
this.bottomRow = this.$(".bottom-row"),
this.togglePlaybackButton = this.$("#toggle-playback"),
this.toggleQueueButton = this.$("#toggle-queue");
var e = this.$("progress-bar")
, t = this.$("cover-art");
t instanceof os && (this.coverArt = t),
e instanceof is && (this.progressBar = e)
}
}, {
key: "componentDidMount",
value: function componentDidMount() {
this.cacheDOMRefs(),
this.registerEventListeners()
}
}]),
FooterPlayer
}());
var us = Q.includes
, cs = arrayMethodUsesToLength("indexOf", {
ACCESSORS: !0,
1: 0
});
_export({
target: "Array",
proto: !0,
forced: !cs
}, {
includes: function includes(e) {
return us(this, e, arguments.length > 1 ? arguments[1] : void 0)
}
}),
addToUnscopables("includes");
var notARegexp = function(e) {
if (isRegexp(e))
throw TypeError("The method doesn't accept regular expressions");
return e
}
, ss = wellKnownSymbol("match");
function _templateObject2$3() {
var e = _taggedTemplateLiteral(["\n a {\n text-decoration: none;\n cursor: pointer;\n background-color: #F76959;\n color: #052D48;\n padding: 0.5em 1em;\n border-radius: 4px;\n display: inline-block;\n }\n "]);
return _templateObject2$3 = function _templateObject2() {
return e
}
,
e
}
function _templateObject$3() {
var e = _taggedTemplateLiteral(['\n <a href="">Login with Patreon</a>\n ']);
return _templateObject$3 = function _templateObject() {
return e
}
,
e
}
function _templateObject2$4() {
var e = _taggedTemplateLiteral(["\n :host {\n text-decoration: none;\n cursor: pointer;\n background-color: #F76959;\n color: #052D48;\n padding: 0.5em 1em;\n border-radius: 4px;\n display: inline-block;\n }\n "]);
return _templateObject2$4 = function _templateObject2() {
return e
}
,
e
}
function _templateObject$4() {
var e = _taggedTemplateLiteral(["\n Log out\n "]);
return _templateObject$4 = function _templateObject() {
return e
}
,
e
}
function _templateObject2$5() {
var e = _taggedTemplateLiteral(["\n a {\n text-decoration: none;\n cursor: pointer;\n background-color: #F76959;\n color: #052D48;\n padding: 0.5em 1em;\n border-radius: 4px;\n display: inline-block;\n }\n "]);
return _templateObject2$5 = function _templateObject2() {
return e
}
,
e
}
function _templateObject$5() {
var e = _taggedTemplateLiteral(['\n <a href="https://www.patreon.com/nightcoreapp">Support on Patreon</a>\n ']);
return _templateObject$5 = function _templateObject() {
return e
}
,
e
}
function _templateObject2$6() {
var e = _taggedTemplateLiteral(["\n .flex-row {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n }\n\n figure {\n width: 64px;\n height: 64px;\n border-radius: 6px;\n contain: strict;\n overflow: hidden;\n background-color: pink;\n margin: 0;\n margin-right: 1rem;\n }\n\n img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n filter: grayscale(100%);\n mix-blend-mode: luminosity;\n }\n\n patreon-login + patreon-support {\n margin-left: 1rem;\n }\n "]);
return _templateObject2$6 = function _templateObject2() {
return e
}
,
e
}
function _templateObject$6() {
var e = _taggedTemplateLiteral(['\n <div id="wrapper">\n <div class="flex-row" id="login-status"><div>\n </div>\n ']);
return _templateObject$6 = function _templateObject() {
return e
}
,
e
}
function _templateObject$7() {
var e = _taggedTemplateLiteral(['\n <iframe title="Facebook Likes" src="" width="100%" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>\n ']);
return _templateObject$7 = function _templateObject() {
return e
}
,
e
}
_export({
target: "String",
proto: !0,
forced: !function(e) {
var t = /./;
try {
"/./"[e](t)
} catch (n) {
try {
return t[ss] = !1,
"/./"[e](t)
} catch (e) {}
}
return !1
}("includes")
}, {
includes: function includes(e) {
return !!~String(requireObjectCoercible(this)).indexOf(notARegexp(e), arguments.length > 1 ? arguments[1] : void 0)
}
}),
registerFunctionComponent((function PatreonLogin() {
var e = this.html
, t = this.css
, n = this.postRender
, r = this.$
, o = document.location.href.includes("localhost") ? "http://localhost:3000" : "https://nightcore.app";
n((function() {
r("a").href = "https://www.patreon.com/oauth2/authorize?response_type=code&client_id=CogoiA8AvZFxNxqYkQZDIp7I2LjPBdx9--9QseAoHastyMcvsDL8V3Es-thvLQbW&redirect_uri=" + o
}
)),
e(_templateObject$3()),
t(_templateObject2$3())
}
)),
registerFunctionComponent((function PatreonLogout() {
var e = this.html
, t = this.css
, n = this.postRender
, r = this.$;
n((function() {
r().addEventListener("click", (function() {
localStorage.removeItem("patreon"),
document.location.reload()
}
))
}
)),
e(_templateObject$4()),
t(_templateObject2$4())
}
)),
registerFunctionComponent((function PatreonSupport() {
var e = this.html
, t = this.css;
e(_templateObject$5()),
t(_templateObject2$5())
}
)),
registerFunctionComponent((function PatreonUser() {
var e = this.html
, t = this.css
, n = this.postRender
, r = this.$;
e(_templateObject$6()),
t(_templateObject2$6()),
n(_asyncToGenerator(regeneratorRuntime.mark((function _callee() {
var e, t, n, o, a, i, u, c, s, l;
return regeneratorRuntime.wrap((function _callee$(f) {
for (; ; )
switch (f.prev = f.next) {
case 0:
if (e = r("#login-status"),
null === (t = localStorage.getItem("patreon"))) {
f.next = 22;
break
}
return n = JSON.parse(t),
o = n.access_token,
f.next = 6,
fetch("https://patreon.nightcore.app/identity", {
headers: {
Authorization: "Bearer ".concat(o)
}
});
case 6:
return a = f.sent,
f.next = 9,
a.json();
case 9:
if ((i = f.sent).errors && (localStorage.removeItem("patreon"),
document.location.reload()),
!i) {
f.next = 20;
break
}
return u = r("#wrapper"),
c = i.data.attributes,
s = c.full_name,
l = c.image_url,
e.innerHTML = '\n <figure>\n <img src="'.concat(l, '" alt="Image of ').concat(s, '">\n </figure>\n Welcome,&nbsp;<span>').concat(s, "</span>!\n "),
f.next = 17,
fetch("https://patreon.nightcore.app/patron", {
headers: {
Authorization: "Bearer ".concat(o)
}
});
case 17:
f.sent.ok ? u.innerHTML += "<p>You are supporting the app on Patreon! Thank you!<br />You will now be able to download songs.</p>" : u.innerHTML += "<p>You are currently not supporting the app on Patreon!<br />When you do you will gain more features, like being able to download songs.<br /><patreon-support></patreon-support></p>",
u.innerHTML += "<patreon-logout></patreon-logout>";
case 20:
f.next = 23;
break;
case 22:
null === new URL(document.location.href).searchParams.get("code") && (e.innerHTML = "⊂二二二(^ω^)二⊃");
case 23:
case "end":
return f.stop()
}
}
), _callee)
}
))))
}
)),
registerFunctionComponent((function VersionNumber() {
var e = this.$;
(0,
this.postRender)(_asyncToGenerator(regeneratorRuntime.mark((function _callee() {
var t, n;
return regeneratorRuntime.wrap((function _callee$(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
return r.next = 2,
fetch("/package.json");
case 2:
return t = r.sent,
r.next = 5,
t.json();
case 5:
n = r.sent,
e(":host").innerHTML = "".concat(n.version),
"ga"in window && window.ga("send", "event", "version", n.version);
case 8:
case "end":
return r.stop()
}
}
), _callee)
}
))))
}
)),
registerFunctionComponent((function LazyLoadedFacebookLikes() {
var e = this.html
, t = this.postRender
, n = this.$;
e(_templateObject$7()),
t((function() {
new IntersectionObserver((function(e) {
return e.forEach((function(e) {
e.isIntersecting && function loadFacebook() {
n("iframe").src = "https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fncorerocks&width=450&layout=standard&action=like&size=small&show_faces=true&share=true&height=80&appId=155661588327985"
}()
}
))
}
)).observe(n())
}
))
}
)),
_asyncToGenerator(regeneratorRuntime.mark((function _callee() {
var e, t, n, r, o, a;
return regeneratorRuntime.wrap((function _callee$(i) {
for (; ; )
switch (i.prev = i.next) {
case 0:
if (e = new URL(document.location.href).searchParams.get("code"),
t = document.location.href.includes("localhost"),
n = t ? "http://localhost:3000" : "https://nightcore.app",
!e) {
i.next = 15;
break
}
return (r = new URL("https://patreon.nightcore.app/login")).searchParams.append("code", e),
r.searchParams.append("redirectUri", n),
i.next = 9,
fetch(r.toString());
case 9:
return o = i.sent,
i.next = 12,
o.json();
case 12:
a = i.sent,
localStorage.setItem("patreon", JSON.stringify(a)),
document.location.href = document.location.href.split("?")[0];
case 15:
case "end":
return i.stop()
}
}
), _callee)
}
)))();
var ls = !1;
function removeAllAds() {
_toConsumableArray(document.querySelectorAll(".pengar")).forEach((function(e) {
return e.remove()
}
))
}
function _maybeRemoveAds() {
return (_maybeRemoveAds = _asyncToGenerator(regeneratorRuntime.mark((function _callee() {
return regeneratorRuntime.wrap((function _callee$(e) {
for (; ; )
switch (e.prev = e.next) {
case 0:
return e.next = 2,
isPatron();
case 2:
e.sent && removeAllAds();
case 4:
case "end":
return e.stop()
}
}
), _callee)
}
)))).apply(this, arguments)
}
!function maybeRemoveAds() {
return _maybeRemoveAds.apply(this, arguments)
}();
var fs, hs = function $(e) {
return document.querySelector(e)
}, ps = {
volumeSliderRangeValue: hs(".volume-controls .range-value"),
pitchSliderRangeValue: hs(".playback-rate-controls .range-value"),
detuneSliderRangeValue: hs(".detune-controls .range-value"),
pitchSliderResetButton: hs(".playback-rate-controls .reset-button"),
detuneSliderResetButton: hs(".detune-controls .reset-button"),
rememberSettingButton: hs("#btn-remember-setting"),
pitchRange: hs("#pitch"),
detuneRange: hs("#detune"),
volumeRange: hs("#volume-slider")
};
function readMediaTagsFromFile(e) {
return new Promise((function(t) {
jsmediatags.read(e, {
onSuccess: function onSuccess(n) {
var r, o = e.name, a = "Unknown artist";
n.tags && n.tags.title && (o = n.tags.title),
n.tags && n.tags.artist && (a = n.tags.artist),
n.tags && n.tags.picture && (r = n.tags.picture);
var i = function pictureDataToURL(e) {
if (e) {
var t = new Uint8Array(e.data)
, n = new Blob([t],{
type: e.format
});
return URL.createObjectURL(n)
}
}(r)
, u = e.name.match(/(.+)[\s]-[\s](.+)[.]/i);
if (null !== u) {
var c = _slicedToArray(u, 3);
a = c[1],
o = c[2]
}
t({
title: o,
artist: a,
imageURL: i
})
},
onError: function onError() {
try {
var n = _slicedToArray(e.name.match(/(.+)[\s]-[\s](.+)[.]/i), 3)
, r = n[1]
, o = n[2];
t({
title: o,
artist: r
})
} catch (n) {
t({
title: e.name,
artist: ""
})
}
}
})
}
))
}
function waitForScripts() {
return new Promise((function(e) {
var t, n, r = setInterval((function() {
t = "Vibrant"in window,
n = "jsmediatags"in window,
t && n && (clearInterval(r),
e())
}
), 100)
}
))
}
function _openFile() {
return (_openFile = _asyncToGenerator(regeneratorRuntime.mark((function _callee2(e) {
var t, n;
return regeneratorRuntime.wrap((function _callee2$(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
return r.next = 2,
waitForScripts();
case 2:
return r.next = 4,
Promise.all(_toConsumableArray(e).map(readMediaTagsFromFile));
case 4:
t = r.sent,
n = _toConsumableArray(e).map((function(e, n) {
return _objectSpread2({
fileName: e.name,
url: URL.createObjectURL(e)
}, t[n])
}
)).map((function(e) {
return _objectSpread2(_objectSpread2({}, e), {}, {
id: e.url.split("/").pop()
})
}
)),
document.dispatchEvent(new CustomEvent("play-queue:add",{
detail: {
items: n
}
}));
case 7:
case "end":
return r.stop()
}
}
), _callee2)
}
)))).apply(this, arguments)
}
function _playSongFromQueue() {
return (_playSongFromQueue = _asyncToGenerator(regeneratorRuntime.mark((function _callee3(e) {
var t, n, r, o, a, i, u;
return regeneratorRuntime.wrap((function _callee3$(c) {
for (; ; )
switch (c.prev = c.next) {
case 0:
if (e.url) {
c.next = 2;
break
}
return c.abrupt("return");
case 2:
return c.next = 4,
fetch(e.url);
case 4:
return t = c.sent,
c.next = 7,
t.blob();
case 7:
n = c.sent,
void 0 !== e.title && void 0 !== e.artist ? Ru.currentMetadata = "".concat(e.artist, " - ").concat(e.title) : Ru.currentMetadata = e.fileName.split(".")[0],
r = e.imageURL || "img/missing-cover-2x.png",
Ru.currentImage = r,
Vibrant.from(r).getPalette((function(e, t) {
e && console.error(e);
var n = [t.LightVibrant || t.Vibrant, t.Vibrant, t.DarkMuted].map((function(e) {
var t = [e.r, e.g, e.b].map(Math.floor);
return "rgb(".concat(t.join(","), ")")
}
));
document.dispatchEvent(new CustomEvent("player:colours",{
detail: {
colours: n
}
}))
}
)),
Ru.playing && Ru.pause(),
fs = e.fileName,
Ru.updateState({
pausedAt: null
}),
(o = iu.getStoredSettings(e.fileName)) && (a = o.playbackRate,
i = o.detune,
Ru.playbackRate = parseFloat(a),
Ru.detune = parseInt(i, 10)),
document.querySelector("audio").src = URL.createObjectURL(n),
Ru.loadAudioFromElement(),
(u = new FileReader).onload = function() {
var e = new (window.AudioContext || window.webkitAudioContext)
, t = u.result;
t instanceof ArrayBuffer ? e.decodeAudioData(t, (function(t) {
t instanceof AudioBuffer ? (e.close(),
Ru.loadAudio({
audioBuffer: t,
playToo: !0
})) : console.error("Did not get AudioBuffer from decodeAudioData.")
}
)) : console.error("Did not get ArrayBuffer from FileReader.")
}
,
u.readAsArrayBuffer(n);
case 22:
case "end":
return c.stop()
}
}
), _callee3)
}
)))).apply(this, arguments)
}
function _maybeBootFromCache() {
return (_maybeBootFromCache = _asyncToGenerator(regeneratorRuntime.mark((function _callee6() {
var e, t, n, r;
return regeneratorRuntime.wrap((function _callee6$(o) {
for (; ; )
switch (o.prev = o.next) {
case 0:
if (t = function _getCachedMediaMetada2() {
return (t = _asyncToGenerator(regeneratorRuntime.mark((function _callee5() {
var e, t;
return regeneratorRuntime.wrap((function _callee5$(n) {
for (; ; )
switch (n.prev = n.next) {
case 0:
return n.next = 2,
caches.open("nightcoreApp");
case 2:
return e = n.sent,
n.next = 5,
e.keys();
case 5:
return t = n.sent,
n.abrupt("return", Promise.all(t.reverse().map(function() {
var t = _asyncToGenerator(regeneratorRuntime.mark((function _callee4(t) {
var n;
return regeneratorRuntime.wrap((function _callee4$(r) {
for (; ; )
switch (r.prev = r.next) {
case 0:
return r.next = 2,
e.match(t);
case 2:
return n = r.sent,
r.abrupt("return", {
contentType: n.headers.get("content-type"),
src: t.url
});
case 4:
case "end":
return r.stop()
}
}
), _callee4)
}
)));
return function(e) {
return t.apply(this, arguments)
}
}())));
case 7:
case "end":
return n.stop()
}
}
), _callee5)
}
)))).apply(this, arguments)
}
,
e = function _getCachedMediaMetada() {
return t.apply(this, arguments)
}
,
-1 !== document.location.hash.indexOf("#shared-audio")) {
o.next = 4;
break
}
return o.abrupt("return");
case 4:
return n = e(),
o.next = 7,
n;
case 7:
return r = o.sent,
o.abrupt("return", r.map((function(e) {
return {
fileName: e.src.split("/").pop(),
url: e.src,
title: e.src.split("/").pop(),
artist: "Unknown",
id: btoa(e.src)
}
}
)));
case 9:
case "end":
return o.stop()
}
}
), _callee6)
}
)))).apply(this, arguments)
}
if (document.addEventListener("play-queue:play-song", (function(e) {
e instanceof CustomEvent && function playSongFromQueue(e) {
return _playSongFromQueue.apply(this, arguments)
}(e.detail)
}
)),
function registerEventListeners() {
var e = ps.detuneRange
, t = ps.volumeRange
, n = ps.pitchSliderResetButton
, r = ps.detuneSliderResetButton
, o = ps.rememberSettingButton;
ps.pitchRange.addEventListener("input", (function(e) {
var t = e.target;
Ru.playbackRate = t.value / 100
}
)),
e.addEventListener("input", (function(e) {
var t = e.target;
Ru.detune = t.value
}
)),
document.addEventListener("player:no-detune", (function() {
ls || (alert("Your browser does not support detune. :( Try Firefox or Google Chrome."),
hs(".detune-controls").remove(),
ls = !0)
}
)),
t.addEventListener("input", (function(e) {
var t = e.target;
Ru.volume = t.value / 100
}
)),
n.addEventListener("click", (function() {
return Ru.resetPlaybackRate()
}
)),
r.addEventListener("click", (function() {
return Ru.resetDetune()
}
)),
Ru.playStateObserver.observe((function(e) {
return function reactToPlayStateChange(e) {
switch (e) {
case "PLAYING":
case "PAUSED":
document.body.classList.add("has-media");
break;
case "ENDED":
document.dispatchEvent(new CustomEvent("play-queue:request-next-song"))
}
document.dispatchEvent(new CustomEvent("player:play-state-change",{
detail: {
playState: e
}
}))
}(e)
}
)),
Ru.currentMetadataObserver.observe((function(e) {
document.dispatchEvent(new CustomEvent("metadata-change",{
detail: {
currentMetadata: e
}
}))
}
)),
Ru.playbackRateObserver.observe((function(e) {
return function updatePlaybackRateSliderView(e) {
var t = Math.floor(100 * e)
, n = ps.pitchRange
, r = ps.pitchSliderRangeValue;
n.value !== t && (n.value = t),
r.textContent = "".concat(t, " %")
}(e)
}
)),
Ru.detuneObserver.observe((function(e) {
return function updateDetuneSliderView(e) {
var t = ps.detuneRange
, n = ps.detuneSliderRangeValue;
t.value !== e && (t.value = e);
var r = e / 100
, o = 1 === Math.abs(r) ? "tone" : "tones";
n.textContent = "".concat(r > 0 ? "+" : "").concat(e / 100, " ").concat(o)
}(e)
}
)),
Ru.volumeObserver.observe((function(e) {
return function updateVolumeSliderView(e) {
var t = ps.volumeRange
, n = ps.volumeSliderRangeValue
, r = Math.floor(100 * e);
t.value !== r && (t.value = r),
n.textContent = "".concat(r, " %")
}(e)
}
)),
document.addEventListener("app-header:open-files", (function(e) {
e instanceof CustomEvent && "files"in e.detail && function openFile(e) {
return _openFile.apply(this, arguments)
}(e.detail.files)
}
)),
function maybeBootFromCache() {
return _maybeBootFromCache.apply(this, arguments)
}().then((function(e) {
return document.dispatchEvent(new CustomEvent("play-queue:add",{
detail: {
items: e
}
}))
}
)).catch((function(e) {
return console.error(e)
}
)),
o.addEventListener("click", (function() {
var e = Ru.playbackRate
, t = Ru.detune;
iu.storeSettings(fs, {
playbackRate: e,
detune: t
});
var n = String(o.textContent);
o.innerHTML = "Saved! :)",
setTimeout((function() {
o.innerHTML = n
}
), 1e3)
}
), !1)
}(),
iu.storeSettings("Elevate Promotions - [PROMO] Dance All Night.mp3", {
playbackRate: 1.28,
detune: 0
}),
window.ga && window.performance) {
var ds = Math.round(performance.now());
window.ga("send", "timing", "JS Dependencies", "load", ds)
}
//# sourceMappingURL=app.esm.js.map
// Your code here...
})();