From 2cd054e296a788e9143abde5bbf06a4dee7d4121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Sun, 26 May 2024 23:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E6=89=80=E4=BD=BF=E7=94=A8=20bignumbe?= =?UTF-8?q?r.js=20=E5=88=86=E7=A6=BB=E6=88=90=E7=8B=AC=E7=AB=8Bjs=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 + wp-includes/js/base.js | 954 ------------------ wp-includes/lib/bignumber.js/bignumber.js | 573 +++++++++++ wp-includes/lib/bignumber.js/from.txt | 1 + .../lib/clipboard.js-2.0.11/dist/clipboard.js | 890 ++++++++++++++++ .../clipboard.js-2.0.11/dist/clipboard.min.js | 7 + .../lib/clipboard.js-2.0.11/github.txt | 1 + 7 files changed, 1474 insertions(+), 954 deletions(-) create mode 100644 wp-includes/lib/bignumber.js/bignumber.js create mode 100644 wp-includes/lib/bignumber.js/from.txt create mode 100644 wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.js create mode 100644 wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.min.js create mode 100644 wp-includes/lib/clipboard.js-2.0.11/github.txt diff --git a/index.html b/index.html index f455d60..9a451e9 100644 --- a/index.html +++ b/index.html @@ -237,6 +237,8 @@ + + \ No newline at end of file diff --git a/wp-includes/js/base.js b/wp-includes/js/base.js index 1dd585d..832a68f 100644 --- a/wp-includes/js/base.js +++ b/wp-includes/js/base.js @@ -1,957 +1,3 @@ -/* bignumber.js v2.4.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ -! function (e) { - "use strict"; - - function n(e) { - function a(e, n) { - var t, r, i, o, u, s, f = this; - if (!(f instanceof a)) return j && L(26, "constructor call without new", e), new a(e, n); - if (null != n && H(n, 2, 64, M, "base")) { - if (n = 0 | n, s = e + "", 10 == n) return f = new a(e instanceof a ? e : s), U(f, P + f.e + 1, B); - if ((o = "number" == typeof e) && 0 * e != 0 || !new RegExp("^-?" + (t = "[" + b.slice(0, n) + "]+") + "(?:\\." + t + ")?$", 37 > n ? "i" : "").test(s)) return g(f, s, o, n); - o ? (f.s = 0 > 1 / e ? (s = s.slice(1), -1) : 1, j && s.replace(/^0\.0*|\./, "").length > 15 && L(M, N, e), o = !1) : f.s = 45 === s.charCodeAt(0) ? (s = s.slice(1), -1) : 1, s = D(s, 10, n, f.s) - } else { - if (e instanceof a) return f.s = e.s, f.e = e.e, f.c = (e = e.c) ? e.slice() : e, void (M = 0); - if ((o = "number" == typeof e) && 0 * e == 0) { - if (f.s = 0 > 1 / e ? (e = -e, -1) : 1, e === ~~e) { - for (r = 0, i = e; i >= 10; i /= 10, r++); - return f.e = r, f.c = [e], void (M = 0) - } - s = e + "" - } else { - if (!p.test(s = e + "")) return g(f, s, o); - f.s = 45 === s.charCodeAt(0) ? (s = s.slice(1), -1) : 1 - } - } - for ((r = s.indexOf(".")) > -1 && (s = s.replace(".", "")), (i = s.search(/e/i)) > 0 ? (0 > r && (r = i), r += +s.slice(i + 1), s = s.substring(0, i)) : 0 > r && (r = s.length), i = 0; 48 === s.charCodeAt(i); i++); - for (u = s.length; 48 === s.charCodeAt(--u);); - if (s = s.slice(i, u + 1)) - if (u = s.length, o && j && u > 15 && (e > S || e !== m(e)) && L(M, N, f.s * e), r = r - i - 1, r > z) f.c = f.e = null; - else if (G > r) f.c = [f.e = 0]; - else { - if (f.e = r, f.c = [], i = (r + 1) % y, 0 > r && (i += y), u > i) { - for (i && f.c.push(+s.slice(0, i)), u -= y; u > i;) f.c.push(+s.slice(i, i += y)); - s = s.slice(i), i = y - s.length - } else i -= u; - for (; i--; s += "0"); - f.c.push(+s) - } else f.c = [f.e = 0]; - M = 0 - } - - function D(e, n, t, i) { - var o, u, f, c, h, g, p, d = e.indexOf("."), - m = P, - w = B; - for (37 > t && (e = e.toLowerCase()), d >= 0 && (f = J, J = 0, e = e.replace(".", ""), p = new a(t), h = p.pow(e.length - d), J = f, p.c = s(l(r(h.c), h.e), 10, n), p.e = p.c.length), g = s(e, t, n), u = f = g.length; 0 == g[--f]; g.pop()); - if (!g[0]) return "0"; - if (0 > d ? --u : (h.c = g, h.e = u, h.s = i, h = C(h, p, m, w, n), g = h.c, c = h.r, u = h.e), o = u + m + 1, d = g[o], f = n / 2, c = c || 0 > o || null != g[o + 1], c = 4 > w ? (null != d || c) && (0 == w || w == (h.s < 0 ? 3 : 2)) : d > f || d == f && (4 == w || c || 6 == w && 1 & g[o - 1] || w == (h.s < 0 ? 8 : 7)), 1 > o || !g[0]) e = c ? l("1", -m) : "0"; - else { - if (g.length = o, c) - for (--n; ++g[--o] > n;) g[o] = 0, o || (++u, g.unshift(1)); - for (f = g.length; !g[--f];); - for (d = 0, e = ""; f >= d; e += b.charAt(g[d++])); - e = l(e, u) - } - return e - } - - function F(e, n, t, i) { - var o, u, s, c, h; - if (t = null != t && H(t, 0, 8, i, v) ? 0 | t : B, !e.c) return e.toString(); - if (o = e.c[0], s = e.e, null == n) h = r(e.c), h = 19 == i || 24 == i && k >= s ? f(h, s) : l(h, s); - else if (e = U(new a(e), n, t), u = e.e, h = r(e.c), c = h.length, 19 == i || 24 == i && (u >= n || k >= u)) { - for (; n > c; h += "0", c++); - h = f(h, u) - } else if (n -= s, h = l(h, u), u + 1 > c) { - if (--n > 0) - for (h += "."; n--; h += "0"); - } else if (n += u - c, n > 0) - for (u + 1 == c && (h += "."); n--; h += "0"); - return e.s < 0 && o ? "-" + h : h - } - - function _(e, n) { - var t, r, i = 0; - for (u(e[0]) && (e = e[0]), t = new a(e[0]); ++i < e.length;) { - if (r = new a(e[i]), !r.s) { - t = r; - break - } - n.call(t, r) && (t = r) - } - return t - } - - function x(e, n, t, r, i) { - return (n > e || e > t || e != c(e)) && L(r, (i || "decimal places") + (n > e || e > t ? " out of range" : " not an integer"), e), !0 - } - - function I(e, n, t) { - for (var r = 1, i = n.length; !n[--i]; n.pop()); - for (i = n[0]; i >= 10; i /= 10, r++); - return (t = r + t * y - 1) > z ? e.c = e.e = null : G > t ? e.c = [e.e = 0] : (e.e = t, e.c = n), e - } - - function L(e, n, t) { - var r = new Error(["new BigNumber", "cmp", "config", "div", "divToInt", "eq", "gt", "gte", "lt", "lte", "minus", "mod", "plus", "precision", "random", "round", "shift", "times", "toDigits", "toExponential", "toFixed", "toFormat", "toFraction", "pow", "toPrecision", "toString", "BigNumber"][e] + "() " + n + ": " + t); - throw r.name = "BigNumber Error", M = 0, r - } - - function U(e, n, t, r) { - var i, o, u, s, f, l, c, a = e.c, - h = R; - if (a) { - e: { - for (i = 1, s = a[0]; s >= 10; s /= 10, i++); - if (o = n - i, 0 > o) o += y, - u = n, - f = a[l = 0], - c = f / h[i - u - 1] % 10 | 0; - else if (l = d((o + 1) / y), l >= a.length) { - if (!r) break e; - for (; a.length <= l; a.push(0)); - f = c = 0, i = 1, o %= y, u = o - y + 1 - } else { - for (f = s = a[l], i = 1; s >= 10; s /= 10, i++); - o %= y, u = o - y + i, c = 0 > u ? 0 : f / h[i - u - 1] % 10 | 0 - } - if (r = r || 0 > n || null != a[l + 1] || (0 > u ? f : f % h[i - u - 1]), r = 4 > t ? (c || r) && (0 == t || t == (e.s < 0 ? 3 : 2)) : c > 5 || 5 == c && (4 == t || r || 6 == t && (o > 0 ? u > 0 ? f / h[i - u] : 0 : a[l - 1]) % 10 & 1 || t == (e.s < 0 ? 8 : 7)), 1 > n || !a[0]) return a.length = 0, - r ? (n -= e.e + 1, a[0] = h[(y - n % y) % y], e.e = -n || 0) : a[0] = e.e = 0, - e; - if (0 == o ? (a.length = l, s = 1, l--) : (a.length = l + 1, s = h[y - o], a[l] = u > 0 ? m(f / h[i - u] % h[u]) * s : 0), r) - for (; ;) { - if (0 == l) { - for (o = 1, u = a[0]; u >= 10; u /= 10, o++); - for (u = a[0] += s, s = 1; u >= 10; u /= 10, s++); - o != s && (e.e++, a[0] == O && (a[0] = 1)); - break - } - if (a[l] += s, a[l] != O) break; - a[l--] = 0, s = 1 - } - for (o = a.length; 0 === a[--o]; a.pop()); - } - e.e > z ? e.c = e.e = null : e.e < G && (e.c = [e.e = 0]) - } - return e - } - var C, M = 0, - T = a.prototype, - q = new a(1), - P = 20, - B = 4, - k = -7, - $ = 21, - G = -1e7, - z = 1e7, - j = !0, - H = x, - V = !1, - W = 1, - J = 100, - X = { - decimalSeparator: ".", - groupSeparator: ",", - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: " ", - fractionGroupSize: 0 - }; - return a.another = n, a.ROUND_UP = 0, a.ROUND_DOWN = 1, a.ROUND_CEIL = 2, a.ROUND_FLOOR = 3, a.ROUND_HALF_UP = 4, a.ROUND_HALF_DOWN = 5, a.ROUND_HALF_EVEN = 6, a.ROUND_HALF_CEIL = 7, a.ROUND_HALF_FLOOR = 8, a.EUCLID = 9, a.config = function () { - var e, n, t = 0, - r = {}, - i = arguments, - s = i[0], - f = s && "object" == typeof s ? function () { - return s.hasOwnProperty(n) ? null != (e = s[n]) : void 0 - } : function () { - return i.length > t ? null != (e = i[t++]) : void 0 - }; - return f(n = "DECIMAL_PLACES") && H(e, 0, E, 2, n) && (P = 0 | e), r[n] = P, f(n = "ROUNDING_MODE") && H(e, 0, 8, 2, n) && (B = 0 | e), r[n] = B, f(n = "EXPONENTIAL_AT") && (u(e) ? H(e[0], -E, 0, 2, n) && H(e[1], 0, E, 2, n) && (k = 0 | e[0], $ = 0 | e[1]) : H(e, -E, E, 2, n) && (k = -($ = 0 | (0 > e ? -e : e)))), r[n] = [k, $], f(n = "RANGE") && (u(e) ? H(e[0], -E, -1, 2, n) && H(e[1], 1, E, 2, n) && (G = 0 | e[0], z = 0 | e[1]) : H(e, -E, E, 2, n) && (0 | e ? G = -(z = 0 | (0 > e ? -e : e)) : j && L(2, n + " cannot be zero", e))), r[n] = [G, z], f(n = "ERRORS") && (e === !!e || 1 === e || 0 === e ? (M = 0, H = (j = !!e) ? x : o) : j && L(2, n + w, e)), r[n] = j, f(n = "CRYPTO") && (e === !!e || 1 === e || 0 === e ? (V = !(!e || !h), e && !V && j && L(2, "crypto unavailable", h)) : j && L(2, n + w, e)), r[n] = V, f(n = "MODULO_MODE") && H(e, 0, 9, 2, n) && (W = 0 | e), r[n] = W, f(n = "POW_PRECISION") && H(e, 0, E, 2, n) && (J = 0 | e), r[n] = J, f(n = "FORMAT") && ("object" == typeof e ? X = e : j && L(2, n + " not an object", e)), r[n] = X, r - }, a.max = function () { - return _(arguments, T.lt) - }, a.min = function () { - return _(arguments, T.gt) - }, a.random = function () { - var e = 9007199254740992, - n = Math.random() * e & 2097151 ? function () { - return m(Math.random() * e) - } : function () { - return 8388608 * (1073741824 * Math.random() | 0) + (8388608 * Math.random() | 0) - }; - return function (e) { - var t, r, i, o, u, s = 0, - f = [], - l = new a(q); - if (e = null != e && H(e, 0, E, 14) ? 0 | e : P, o = d(e / y), V) - if (h && h.getRandomValues) { - for (t = h.getRandomValues(new Uint32Array(o *= 2)); o > s;) u = 131072 * t[s] + (t[s + 1] >>> 11), u >= 9e15 ? (r = h.getRandomValues(new Uint32Array(2)), t[s] = r[0], t[s + 1] = r[1]) : (f.push(u % 1e14), s += 2); - s = o / 2 - } else if (h && h.randomBytes) { - for (t = h.randomBytes(o *= 7); o > s;) u = 281474976710656 * (31 & t[s]) + 1099511627776 * t[s + 1] + 4294967296 * t[s + 2] + 16777216 * t[s + 3] + (t[s + 4] << 16) + (t[s + 5] << 8) + t[s + 6], u >= 9e15 ? h.randomBytes(7).copy(t, s) : (f.push(u % 1e14), s += 7); - s = o / 7 - } else j && L(14, "crypto unavailable", h); - if (!s) - for (; o > s;) u = n(), 9e15 > u && (f[s++] = u % 1e14); - for (o = f[--s], e %= y, o && e && (u = R[y - e], f[s] = m(o / u) * u); 0 === f[s]; f.pop(), s--); - if (0 > s) f = [i = 0]; - else { - for (i = -1; 0 === f[0]; f.shift(), i -= y); - for (s = 1, u = f[0]; u >= 10; u /= 10, s++); - y > s && (i -= y - s) - } - return l.e = i, l.c = f, l - } - }(), C = function () { - function e(e, n, t) { - var r, i, o, u, s = 0, - f = e.length, - l = n % A, - c = n / A | 0; - for (e = e.slice(); f--;) o = e[f] % A, u = e[f] / A | 0, r = c * o + u * l, i = l * o + r % A * A + s, s = (i / t | 0) + (r / A | 0) + c * u, e[f] = i % t; - return s && e.unshift(s), e - } - - function n(e, n, t, r) { - var i, o; - if (t != r) o = t > r ? 1 : -1; - else - for (i = o = 0; t > i; i++) - if (e[i] != n[i]) { - o = e[i] > n[i] ? 1 : -1; - break - } return o - } - - function r(e, n, t, r) { - for (var i = 0; t--;) e[t] -= i, i = e[t] < n[t] ? 1 : 0, e[t] = i * r + e[t] - n[t]; - for (; !e[0] && e.length > 1; e.shift()); - } - return function (i, o, u, s, f) { - var l, c, h, g, p, d, w, v, N, b, S, R, A, E, D, F, _, x = i.s == o.s ? 1 : -1, - I = i.c, - L = o.c; - if (!(I && I[0] && L && L[0])) return new a(i.s && o.s && (I ? !L || I[0] != L[0] : L) ? I && 0 == I[0] || !L ? 0 * x : x / 0 : NaN); - for (v = new a(x), N = v.c = [], c = i.e - o.e, x = u + c + 1, f || (f = O, c = t(i.e / y) - t(o.e / y), x = x / y | 0), h = 0; L[h] == (I[h] || 0); h++); - if (L[h] > (I[h] || 0) && c--, 0 > x) N.push(1), g = !0; - else { - for (E = I.length, F = L.length, h = 0, x += 2, p = m(f / (L[0] + 1)), p > 1 && (L = e(L, p, f), I = e(I, p, f), F = L.length, E = I.length), A = F, b = I.slice(0, F), S = b.length; F > S; b[S++] = 0); - _ = L.slice(), _.unshift(0), D = L[0], L[1] >= f / 2 && D++; - do { - if (p = 0, l = n(L, b, F, S), 0 > l) { - if (R = b[0], F != S && (R = R * f + (b[1] || 0)), p = m(R / D), p > 1) - for (p >= f && (p = f - 1), d = e(L, p, f), w = d.length, S = b.length; 1 == n(d, b, w, S);) p--, r(d, w > F ? _ : L, w, f), w = d.length, l = 1; - else 0 == p && (l = p = 1), d = L.slice(), w = d.length; - if (S > w && d.unshift(0), r(b, d, S, f), S = b.length, -1 == l) - for (; n(L, b, F, S) < 1;) p++, r(b, S > F ? _ : L, S, f), S = b.length - } else 0 === l && (p++, b = [0]); - N[h++] = p, b[0] ? b[S++] = I[A] || 0 : (b = [I[A]], S = 1) - } while ((A++ < E || null != b[0]) && x--); - g = null != b[0], N[0] || N.shift() - } - if (f == O) { - for (h = 1, x = N[0]; x >= 10; x /= 10, h++); - U(v, u + (v.e = h + c * y - 1) + 1, s, g) - } else v.e = c, v.r = +g; - return v - } - }(), g = function () { - var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, - n = /^([^.]+)\.$/, - t = /^\.([^.]+)$/, - r = /^-?(Infinity|NaN)$/, - i = /^\s*\+(?=[\w.])|^\s+|\s+$/g; - return function (o, u, s, f) { - var l, c = s ? u : u.replace(i, ""); - if (r.test(c)) o.s = isNaN(c) ? null : 0 > c ? -1 : 1; - else { - if (!s && (c = c.replace(e, function (e, n, t) { - return l = "x" == (t = t.toLowerCase()) ? 16 : "b" == t ? 2 : 8, f && f != l ? e : n - }), f && (l = f, c = c.replace(n, "$1").replace(t, "0.$1")), u != c)) return new a(c, l); - j && L(M, "not a" + (f ? " base " + f : "") + " number", u), o.s = null - } - o.c = o.e = null, M = 0 - } - }(), T.absoluteValue = T.abs = function () { - var e = new a(this); - return e.s < 0 && (e.s = 1), e - }, T.ceil = function () { - return U(new a(this), this.e + 1, 2) - }, T.comparedTo = T.cmp = function (e, n) { - return M = 1, i(this, new a(e, n)) - }, T.decimalPlaces = T.dp = function () { - var e, n, r = this.c; - if (!r) return null; - if (e = ((n = r.length - 1) - t(this.e / y)) * y, n = r[n]) - for (; n % 10 == 0; n /= 10, e--); - return 0 > e && (e = 0), e - }, T.dividedBy = T.div = function (e, n) { - return M = 3, C(this, new a(e, n), P, B) - }, T.dividedToIntegerBy = T.divToInt = function (e, n) { - return M = 4, C(this, new a(e, n), 0, 1) - }, T.equals = T.eq = function (e, n) { - return M = 5, 0 === i(this, new a(e, n)) - }, T.floor = function () { - return U(new a(this), this.e + 1, 3) - }, T.greaterThan = T.gt = function (e, n) { - return M = 6, i(this, new a(e, n)) > 0 - }, T.greaterThanOrEqualTo = T.gte = function (e, n) { - return M = 7, 1 === (n = i(this, new a(e, n))) || 0 === n - }, T.isFinite = function () { - return !!this.c - }, T.isInteger = T.isInt = function () { - return !!this.c && t(this.e / y) > this.c.length - 2 - }, T.isNaN = function () { - return !this.s - }, T.isNegative = T.isNeg = function () { - return this.s < 0 - }, T.isZero = function () { - return !!this.c && 0 == this.c[0] - }, T.lessThan = T.lt = function (e, n) { - return M = 8, i(this, new a(e, n)) < 0 - }, T.lessThanOrEqualTo = T.lte = function (e, n) { - return M = 9, -1 === (n = i(this, new a(e, n))) || 0 === n - }, T.minus = T.sub = function (e, n) { - var r, i, o, u, s = this, - f = s.s; - if (M = 10, e = new a(e, n), n = e.s, !f || !n) return new a(NaN); - if (f != n) return e.s = -n, s.plus(e); - var l = s.e / y, - c = e.e / y, - h = s.c, - g = e.c; - if (!l || !c) { - if (!h || !g) return h ? (e.s = -n, e) : new a(g ? s : NaN); - if (!h[0] || !g[0]) return g[0] ? (e.s = -n, e) : new a(h[0] ? s : 3 == B ? -0 : 0) - } - if (l = t(l), c = t(c), h = h.slice(), f = l - c) { - for ((u = 0 > f) ? (f = -f, o = h) : (c = l, o = g), o.reverse(), n = f; n--; o.push(0)); - o.reverse() - } else - for (i = (u = (f = h.length) < (n = g.length)) ? f : n, f = n = 0; i > n; n++) - if (h[n] != g[n]) { - u = h[n] < g[n]; - break - } if (u && (o = h, h = g, g = o, e.s = -e.s), n = (i = g.length) - (r = h.length), n > 0) - for (; n--; h[r++] = 0); - for (n = O - 1; i > f;) { - if (h[--i] < g[i]) { - for (r = i; r && !h[--r]; h[r] = n); - --h[r], h[i] += O - } - h[i] -= g[i] - } - for (; 0 == h[0]; h.shift(), --c); - return h[0] ? I(e, h, c) : (e.s = 3 == B ? -1 : 1, e.c = [e.e = 0], e) - }, T.modulo = T.mod = function (e, n) { - var t, r, i = this; - return M = 11, e = new a(e, n), !i.c || !e.s || e.c && !e.c[0] ? new a(NaN) : !e.c || i.c && !i.c[0] ? new a(i) : (9 == W ? (r = e.s, e.s = 1, t = C(i, e, 0, 3), e.s = r, t.s *= r) : t = C(i, e, 0, W), i.minus(t.times(e))) - }, T.negated = T.neg = function () { - var e = new a(this); - return e.s = -e.s || null, e - }, T.plus = T.add = function (e, n) { - var r, i = this, - o = i.s; - if (M = 12, e = new a(e, n), n = e.s, !o || !n) return new a(NaN); - if (o != n) return e.s = -n, i.minus(e); - var u = i.e / y, - s = e.e / y, - f = i.c, - l = e.c; - if (!u || !s) { - if (!f || !l) return new a(o / 0); - if (!f[0] || !l[0]) return l[0] ? e : new a(f[0] ? i : 0 * o) - } - if (u = t(u), s = t(s), f = f.slice(), o = u - s) { - for (o > 0 ? (s = u, r = l) : (o = -o, r = f), r.reverse(); o--; r.push(0)); - r.reverse() - } - for (o = f.length, n = l.length, 0 > o - n && (r = l, l = f, f = r, n = o), o = 0; n;) o = (f[--n] = f[n] + l[n] + o) / O | 0, f[n] %= O; - return o && (f.unshift(o), ++s), I(e, f, s) - }, T.precision = T.sd = function (e) { - var n, t, r = this, - i = r.c; - if (null != e && e !== !!e && 1 !== e && 0 !== e && (j && L(13, "argument" + w, e), e != !!e && (e = null)), !i) return null; - if (t = i.length - 1, n = t * y + 1, t = i[t]) { - for (; t % 10 == 0; t /= 10, n--); - for (t = i[0]; t >= 10; t /= 10, n++); - } - return e && r.e + 1 > n && (n = r.e + 1), n - }, T.round = function (e, n) { - var t = new a(this); - return (null == e || H(e, 0, E, 15)) && U(t, ~~e + this.e + 1, null != n && H(n, 0, 8, 15, v) ? 0 | n : B), t - }, T.shift = function (e) { - var n = this; - return H(e, -S, S, 16, "argument") ? n.times("1e" + c(e)) : new a(n.c && n.c[0] && (-S > e || e > S) ? n.s * (0 > e ? 0 : 1 / 0) : n) - }, T.squareRoot = T.sqrt = function () { - var e, n, i, o, u, s = this, - f = s.c, - l = s.s, - c = s.e, - h = P + 4, - g = new a("0.5"); - if (1 !== l || !f || !f[0]) return new a(!l || 0 > l && (!f || f[0]) ? NaN : f ? s : 1 / 0); - if (l = Math.sqrt(+s), 0 == l || l == 1 / 0 ? (n = r(f), (n.length + c) % 2 == 0 && (n += "0"), l = Math.sqrt(n), c = t((c + 1) / 2) - (0 > c || c % 2), l == 1 / 0 ? n = "1e" + c : (n = l.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + c), i = new a(n)) : i = new a(l + ""), i.c[0]) - for (c = i.e, l = c + h, 3 > l && (l = 0); ;) - if (u = i, i = g.times(u.plus(C(s, u, h, 1))), r(u.c).slice(0, l) === (n = r(i.c)).slice(0, l)) { - if (i.e < c && --l, n = n.slice(l - 3, l + 1), "9999" != n && (o || "4999" != n)) { - (!+n || !+n.slice(1) && "5" == n.charAt(0)) && (U(i, i.e + P + 2, 1), e = !i.times(i).eq(s)); - break - } - if (!o && (U(u, u.e + P + 2, 0), u.times(u).eq(s))) { - i = u; - break - } - h += 4, l += 4, o = 1 - } return U(i, i.e + P + 1, B, e) - }, T.times = T.mul = function (e, n) { - var r, i, o, u, s, f, l, c, h, g, p, d, m, w, v, N = this, - b = N.c, - S = (M = 17, e = new a(e, n)).c; - if (!(b && S && b[0] && S[0])) return !N.s || !e.s || b && !b[0] && !S || S && !S[0] && !b ? e.c = e.e = e.s = null : (e.s *= N.s, b && S ? (e.c = [0], e.e = 0) : e.c = e.e = null), e; - for (i = t(N.e / y) + t(e.e / y), e.s *= N.s, l = b.length, g = S.length, g > l && (m = b, b = S, S = m, o = l, l = g, g = o), o = l + g, m = []; o--; m.push(0)); - for (w = O, v = A, o = g; --o >= 0;) { - for (r = 0, p = S[o] % v, d = S[o] / v | 0, s = l, u = o + s; u > o;) c = b[--s] % v, h = b[s] / v | 0, f = d * c + h * p, c = p * c + f % v * v + m[u] + r, r = (c / w | 0) + (f / v | 0) + d * h, m[u--] = c % w; - m[u] = r - } - return r ? ++i : m.shift(), I(e, m, i) - }, T.toDigits = function (e, n) { - var t = new a(this); - return e = null != e && H(e, 1, E, 18, "precision") ? 0 | e : null, n = null != n && H(n, 0, 8, 18, v) ? 0 | n : B, e ? U(t, e, n) : t - }, T.toExponential = function (e, n) { - return F(this, null != e && H(e, 0, E, 19) ? ~~e + 1 : null, n, 19) - }, T.toFixed = function (e, n) { - return F(this, null != e && H(e, 0, E, 20) ? ~~e + this.e + 1 : null, n, 20) - }, T.toFormat = function (e, n) { - var t = F(this, null != e && H(e, 0, E, 21) ? ~~e + this.e + 1 : null, n, 21); - if (this.c) { - var r, i = t.split("."), - o = +X.groupSize, - u = +X.secondaryGroupSize, - s = X.groupSeparator, - f = i[0], - l = i[1], - c = this.s < 0, - a = c ? f.slice(1) : f, - h = a.length; - if (u && (r = o, o = u, u = r, h -= r), o > 0 && h > 0) { - for (r = h % o || o, f = a.substr(0, r); h > r; r += o) f += s + a.substr(r, o); - u > 0 && (f += s + a.slice(r)), c && (f = "-" + f) - } - t = l ? f + X.decimalSeparator + ((u = +X.fractionGroupSize) ? l.replace(new RegExp("\\d{" + u + "}\\B", "g"), "$&" + X.fractionGroupSeparator) : l) : f - } - return t - }, T.toFraction = function (e) { - var n, t, i, o, u, s, f, l, c, h = j, - g = this, - p = g.c, - d = new a(q), - m = t = new a(q), - w = f = new a(q); - if (null != e && (j = !1, s = new a(e), j = h, (!(h = s.isInt()) || s.lt(q)) && (j && L(22, "max denominator " + (h ? "out of range" : "not an integer"), e), e = !h && s.c && U(s, s.e + 1, 1).gte(q) ? s : null)), !p) return g.toString(); - for (c = r(p), o = d.e = c.length - g.e - 1, d.c[0] = R[(u = o % y) < 0 ? y + u : u], e = !e || s.cmp(d) > 0 ? o > 0 ? d : m : s, u = z, z = 1 / 0, s = new a(c), f.c[0] = 0; l = C(s, d, 0, 1), i = t.plus(l.times(w)), 1 != i.cmp(e);) t = w, w = i, m = f.plus(l.times(i = m)), f = i, d = s.minus(l.times(i = d)), s = i; - return i = C(e.minus(t), w, 0, 1), f = f.plus(i.times(m)), t = t.plus(i.times(w)), f.s = m.s = g.s, o *= 2, n = C(m, w, o, B).minus(g).abs().cmp(C(f, t, o, B).minus(g).abs()) < 1 ? [m.toString(), w.toString()] : [f.toString(), t.toString()], z = u, n - }, T.toNumber = function () { - return +this - }, T.toPower = T.pow = function (e, n) { - var t, r, i, o = m(0 > e ? -e : +e), - u = this; - if (null != n && (M = 23, n = new a(n)), !H(e, -S, S, 23, "exponent") && (!isFinite(e) || o > S && (e /= 0) || parseFloat(e) != e && !(e = NaN)) || 0 == e) return t = Math.pow(+u, e), new a(n ? t % n : t); - for (n ? e > 1 && u.gt(q) && u.isInt() && n.gt(q) && n.isInt() ? u = u.mod(n) : (i = n, n = null) : J && (t = d(J / y + 2)), r = new a(q); ;) { - if (o % 2) { - if (r = r.times(u), !r.c) break; - t ? r.c.length > t && (r.c.length = t) : n && (r = r.mod(n)) - } - if (o = m(o / 2), !o) break; - u = u.times(u), t ? u.c && u.c.length > t && (u.c.length = t) : n && (u = u.mod(n)) - } - return n ? r : (0 > e && (r = q.div(r)), i ? r.mod(i) : t ? U(r, J, B) : r) - }, T.toPrecision = function (e, n) { - return F(this, null != e && H(e, 1, E, 24, "precision") ? 0 | e : null, n, 24) - }, T.toString = function (e) { - var n, t = this, - i = t.s, - o = t.e; - return null === o ? i ? (n = "Infinity", 0 > i && (n = "-" + n)) : n = "NaN" : (n = r(t.c), n = null != e && H(e, 2, 64, 25, "base") ? D(l(n, o), 0 | e, 10, i) : k >= o || o >= $ ? f(n, o) : l(n, o), 0 > i && t.c[0] && (n = "-" + n)), n - }, T.truncated = T.trunc = function () { - return U(new a(this), this.e + 1, 1) - }, T.valueOf = T.toJSON = function () { - var e, n = this, - t = n.e; - return null === t ? n.toString() : (e = r(n.c), e = k >= t || t >= $ ? f(e, t) : l(e, t), n.s < 0 ? "-" + e : e) - }, null != e && a.config(e), a - } - - function t(e) { - var n = 0 | e; - return e > 0 || e === n ? n : n - 1 - } - - function r(e) { - for (var n, t, r = 1, i = e.length, o = e[0] + ""; i > r;) { - for (n = e[r++] + "", t = y - n.length; t--; n = "0" + n); - o += n - } - for (i = o.length; 48 === o.charCodeAt(--i);); - return o.slice(0, i + 1 || 1) - } - - function i(e, n) { - var t, r, i = e.c, - o = n.c, - u = e.s, - s = n.s, - f = e.e, - l = n.e; - if (!u || !s) return null; - if (t = i && !i[0], r = o && !o[0], t || r) return t ? r ? 0 : -s : u; - if (u != s) return u; - if (t = 0 > u, r = f == l, !i || !o) return r ? 0 : !i ^ t ? 1 : -1; - if (!r) return f > l ^ t ? 1 : -1; - for (s = (f = i.length) < (l = o.length) ? f : l, u = 0; s > u; u++) - if (i[u] != o[u]) return i[u] > o[u] ^ t ? 1 : -1; - return f == l ? 0 : f > l ^ t ? 1 : -1 - } - - function o(e, n, t) { - return (e = c(e)) >= n && t >= e - } - - function u(e) { - return "[object Array]" == Object.prototype.toString.call(e) - } - - function s(e, n, t) { - for (var r, i, o = [0], u = 0, s = e.length; s > u;) { - for (i = o.length; i--; o[i] *= n); - for (o[r = 0] += b.indexOf(e.charAt(u++)); r < o.length; r++) o[r] > t - 1 && (null == o[r + 1] && (o[r + 1] = 0), o[r + 1] += o[r] / t | 0, o[r] %= t) - } - return o.reverse() - } - - function f(e, n) { - return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (0 > n ? "e" : "e+") + n - } - - function l(e, n) { - var t, r; - if (0 > n) { - for (r = "0."; ++n; r += "0"); - e = r + e - } else if (t = e.length, ++n > t) { - for (r = "0", n -= t; --n; r += "0"); - e += r - } else t > n && (e = e.slice(0, n) + "." + e.slice(n)); - return e - } - - function c(e) { - return e = parseFloat(e), 0 > e ? d(e) : m(e) - } - var a, h, g, p = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, - d = Math.ceil, - m = Math.floor, - w = " not a boolean or binary digit", - v = "rounding mode", - N = "number type has more than 15 significant digits", - b = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", - O = 1e14, - y = 14, - S = 9007199254740991, - R = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], - A = 1e7, - E = 1e9; - if ("undefined" != typeof crypto && (h = crypto), a = n(), a["default"] = a.BigNumber = a, "function" == typeof define && define.amd) define(function () { - return a - }); - else if ("undefined" != typeof module && module.exports) { - if (module.exports = a, !h) try { - h = require("crypto") - } catch (D) { } - } else e || (e = "undefined" != typeof self ? self : Function("return this")()), e.BigNumber = a -}(this); - - -! function (t, e) { - "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.ClipboardJS = e() : t.ClipboardJS = e() -}(this, function () { - return o = {}, r.m = n = [function (t, e) { - t.exports = function (t) { - var e; - if ("SELECT" === t.nodeName) t.focus(), e = t.value; - else if ("INPUT" === t.nodeName || "TEXTAREA" === t.nodeName) { - var n = t.hasAttribute("readonly"); - n || t.setAttribute("readonly", ""), t.select(), t.setSelectionRange(0, t.value.length), n || t.removeAttribute("readonly"), e = t.value - } else { - t.hasAttribute("contenteditable") && t.focus(); - var o = window.getSelection(), - r = document.createRange(); - r.selectNodeContents(t), o.removeAllRanges(), o.addRange(r), e = o.toString() - } - return e - } - }, function (t, e) { - function n() { } - n.prototype = { - on: function (t, e, n) { - var o = this.e || (this.e = {}); - return (o[t] || (o[t] = [])).push({ - fn: e, - ctx: n - }), this - }, - once: function (t, e, n) { - var o = this; - - function r() { - o.off(t, r), e.apply(n, arguments) - } - return r._ = e, this.on(t, r, n) - }, - emit: function (t) { - for (var e = [].slice.call(arguments, 1), n = ((this.e || (this.e = {}))[t] || []).slice(), o = 0, r = n.length; o < r; o++) n[o].fn.apply(n[o].ctx, e); - return this - }, - off: function (t, e) { - var n = this.e || (this.e = {}), - o = n[t], - r = []; - if (o && e) - for (var i = 0, a = o.length; i < a; i++) o[i].fn !== e && o[i].fn._ !== e && r.push(o[i]); - return r.length ? n[t] = r : delete n[t], this - } - }, t.exports = n, t.exports.TinyEmitter = n - }, function (t, e, n) { - var d = n(3), - h = n(4); - t.exports = function (t, e, n) { - if (!t && !e && !n) throw new Error("Missing required arguments"); - if (!d.string(e)) throw new TypeError("Second argument must be a String"); - if (!d.fn(n)) throw new TypeError("Third argument must be a Function"); - if (d.node(t)) return s = e, f = n, (u = t).addEventListener(s, f), { - destroy: function () { - u.removeEventListener(s, f) - } - }; - if (d.nodeList(t)) return a = t, c = e, l = n, Array.prototype.forEach.call(a, function (t) { - t.addEventListener(c, l) - }), { - destroy: function () { - Array.prototype.forEach.call(a, function (t) { - t.removeEventListener(c, l) - }) - } - }; - if (d.string(t)) return o = t, r = e, i = n, h(document.body, o, r, i); - throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList"); - var o, r, i, a, c, l, u, s, f - } - }, function (t, n) { - n.node = function (t) { - return void 0 !== t && t instanceof HTMLElement && 1 === t.nodeType - }, n.nodeList = function (t) { - var e = Object.prototype.toString.call(t); - return void 0 !== t && ("[object NodeList]" === e || "[object HTMLCollection]" === e) && "length" in t && (0 === t.length || n.node(t[0])) - }, n.string = function (t) { - return "string" == typeof t || t instanceof String - }, n.fn = function (t) { - return "[object Function]" === Object.prototype.toString.call(t) - } - }, function (t, e, n) { - var a = n(5); - - function i(t, e, n, o, r) { - var i = function (e, n, t, o) { - return function (t) { - t.delegateTarget = a(t.target, n), t.delegateTarget && o.call(e, t) - } - }.apply(this, arguments); - return t.addEventListener(n, i, r), { - destroy: function () { - t.removeEventListener(n, i, r) - } - } - } - t.exports = function (t, e, n, o, r) { - return "function" == typeof t.addEventListener ? i.apply(null, arguments) : "function" == typeof n ? i.bind(null, document).apply(null, arguments) : ("string" == typeof t && (t = document.querySelectorAll(t)), Array.prototype.map.call(t, function (t) { - return i(t, e, n, o, r) - })) - } - }, function (t, e) { - if ("undefined" != typeof Element && !Element.prototype.matches) { - var n = Element.prototype; - n.matches = n.matchesSelector || n.mozMatchesSelector || n.msMatchesSelector || n.oMatchesSelector || n.webkitMatchesSelector - } - t.exports = function (t, e) { - for (; t && 9 !== t.nodeType;) { - if ("function" == typeof t.matches && t.matches(e)) return t; - t = t.parentNode - } - } - }, function (t, e, n) { - "use strict"; - n.r(e); - var o = n(0), - r = n.n(o), - i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { - return typeof t - } : function (t) { - return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t - }; - - function a(t, e) { - for (var n = 0; n < e.length; n++) { - var o = e[n]; - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) - } - } - - function c(t) { - ! function (t, e) { - if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") - }(this, c), this.resolveOptions(t), this.initSelection() - } - var l = (function (t, e, n) { - return e && a(t.prototype, e), n && a(t, n), t - }(c, [{ - key: "resolveOptions", - value: function (t) { - var e = 0 < arguments.length && void 0 !== t ? t : {}; - this.action = e.action, this.container = e.container, this.emitter = e.emitter, this.target = e.target, this.text = e.text, this.trigger = e.trigger, this.selectedText = "" - } - }, { - key: "initSelection", - value: function () { - this.text ? this.selectFake() : this.target && this.selectTarget() - } - }, { - key: "selectFake", - value: function () { - var t = this, - e = "rtl" == document.documentElement.getAttribute("dir"); - this.removeFake(), this.fakeHandlerCallback = function () { - return t.removeFake() - }, this.fakeHandler = this.container.addEventListener("click", this.fakeHandlerCallback) || !0, this.fakeElem = document.createElement("textarea"), this.fakeElem.style.fontSize = "12pt", this.fakeElem.style.border = "0", this.fakeElem.style.padding = "0", this.fakeElem.style.margin = "0", this.fakeElem.style.position = "absolute", this.fakeElem.style[e ? "right" : "left"] = "-9999px"; - var n = window.pageYOffset || document.documentElement.scrollTop; - this.fakeElem.style.top = n + "px", this.fakeElem.setAttribute("readonly", ""), this.fakeElem.value = this.text, this.container.appendChild(this.fakeElem), this.selectedText = r()(this.fakeElem), this.copyText() - } - }, { - key: "removeFake", - value: function () { - this.fakeHandler && (this.container.removeEventListener("click", this.fakeHandlerCallback), this.fakeHandler = null, this.fakeHandlerCallback = null), this.fakeElem && (this.container.removeChild(this.fakeElem), this.fakeElem = null) - } - }, { - key: "selectTarget", - value: function () { - this.selectedText = r()(this.target), this.copyText() - } - }, { - key: "copyText", - value: function () { - var e = void 0; - try { - e = document.execCommand(this.action) - } catch (t) { - e = !1 - } - this.handleResult(e) - } - }, { - key: "handleResult", - value: function (t) { - this.emitter.emit(t ? "success" : "error", { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }) - } - }, { - key: "clearSelection", - value: function () { - this.trigger && this.trigger.focus(), document.activeElement.blur(), window.getSelection().removeAllRanges() - } - }, { - key: "destroy", - value: function () { - this.removeFake() - } - }, { - key: "action", - set: function (t) { - var e = 0 < arguments.length && void 0 !== t ? t : "copy"; - if (this._action = e, "copy" !== this._action && "cut" !== this._action) throw new Error('Invalid "action" value, use either "copy" or "cut"') - }, - get: function () { - return this._action - } - }, { - key: "target", - set: function (t) { - if (void 0 !== t) { - if (!t || "object" !== (void 0 === t ? "undefined" : i(t)) || 1 !== t.nodeType) throw new Error('Invalid "target" value, use a valid Element'); - if ("copy" === this.action && t.hasAttribute("disabled")) throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); - if ("cut" === this.action && (t.hasAttribute("readonly") || t.hasAttribute("disabled"))) throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); - this._target = t - } - }, - get: function () { - return this._target - } - }]), c), - u = n(1), - s = n.n(u), - f = n(2), - d = n.n(f), - h = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { - return typeof t - } : function (t) { - return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t - }, - p = function (t, e, n) { - return e && y(t.prototype, e), n && y(t, n), t - }; - - function y(t, e) { - for (var n = 0; n < e.length; n++) { - var o = e[n]; - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o) - } - } - var m = (function (t, e) { - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e); - t.prototype = Object.create(e && e.prototype, { - constructor: { - value: t, - enumerable: !1, - writable: !0, - configurable: !0 - } - }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e) - }(v, s.a), p(v, [{ - key: "resolveOptions", - value: function (t) { - var e = 0 < arguments.length && void 0 !== t ? t : {}; - this.action = "function" == typeof e.action ? e.action : this.defaultAction, this.target = "function" == typeof e.target ? e.target : this.defaultTarget, this.text = "function" == typeof e.text ? e.text : this.defaultText, this.container = "object" === h(e.container) ? e.container : document.body - } - }, { - key: "listenClick", - value: function (t) { - var e = this; - this.listener = d()(t, "click", function (t) { - return e.onClick(t) - }) - } - }, { - key: "onClick", - value: function (t) { - var e = t.delegateTarget || t.currentTarget; - this.clipboardAction && (this.clipboardAction = null), this.clipboardAction = new l({ - action: this.action(e), - target: this.target(e), - text: this.text(e), - container: this.container, - trigger: e, - emitter: this - }) - } - }, { - key: "defaultAction", - value: function (t) { - return b("action", t) - } - }, { - key: "defaultTarget", - value: function (t) { - var e = b("target", t); - if (e) return document.querySelector(e) - } - }, { - key: "defaultText", - value: function (t) { - return b("text", t) - } - }, { - key: "destroy", - value: function () { - this.listener.destroy(), this.clipboardAction && (this.clipboardAction.destroy(), this.clipboardAction = null) - } - }], [{ - key: "isSupported", - value: function (t) { - var e = 0 < arguments.length && void 0 !== t ? t : ["copy", "cut"], - n = "string" == typeof e ? [e] : e, - o = !!document.queryCommandSupported; - return n.forEach(function (t) { - o = o && !!document.queryCommandSupported(t) - }), o - } - }]), v); - - function v(t, e) { - ! function (t, e) { - if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") - }(this, v); - var n = function (t, e) { - if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return !e || "object" != typeof e && "function" != typeof e ? t : e - }(this, (v.__proto__ || Object.getPrototypeOf(v)).call(this)); - return n.resolveOptions(e), n.listenClick(t), n - } - - function b(t, e) { - var n = "data-clipboard-" + t; - if (e.hasAttribute(n)) return e.getAttribute(n) - } - e.default = m - }], r.c = o, r.d = function (t, e, n) { - r.o(t, e) || Object.defineProperty(t, e, { - enumerable: !0, - get: n - }) - }, r.r = function (t) { - "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { - value: "Module" - }), Object.defineProperty(t, "__esModule", { - value: !0 - }) - }, r.t = function (e, t) { - if (1 & t && (e = r(e)), 8 & t) return e; - if (4 & t && "object" == typeof e && e && e.__esModule) return e; - var n = Object.create(null); - if (r.r(n), Object.defineProperty(n, "default", { - enumerable: !0, - value: e - }), 2 & t && "string" != typeof e) - for (var o in e) r.d(n, o, function (t) { - return e[t] - }.bind(null, o)); - return n - }, r.n = function (t) { - var e = t && t.__esModule ? function () { - return t.default - } : function () { - return t - }; - return r.d(e, "a", e), e - }, r.o = function (t, e) { - return Object.prototype.hasOwnProperty.call(t, e) - }, r.p = "", r(r.s = 6).default; - - function r(t) { - if (o[t]) return o[t].exports; - var e = o[t] = { - i: t, - l: !1, - exports: {} - }; - return n[t].call(e.exports, e, e.exports, r), e.l = !0, e.exports - } - var n, o -}); - - var clipboard = new ClipboardJS('.btn-copy'); var xelem = document.getElementById("d"); var sel1elem = document.getElementById("form"); diff --git a/wp-includes/lib/bignumber.js/bignumber.js b/wp-includes/lib/bignumber.js/bignumber.js new file mode 100644 index 0000000..155153a --- /dev/null +++ b/wp-includes/lib/bignumber.js/bignumber.js @@ -0,0 +1,573 @@ +/* bignumber.js v2.4.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ +! function (e) { + "use strict"; + + function n(e) { + function a(e, n) { + var t, r, i, o, u, s, f = this; + if (!(f instanceof a)) return j && L(26, "constructor call without new", e), new a(e, n); + if (null != n && H(n, 2, 64, M, "base")) { + if (n = 0 | n, s = e + "", 10 == n) return f = new a(e instanceof a ? e : s), U(f, P + f.e + 1, B); + if ((o = "number" == typeof e) && 0 * e != 0 || !new RegExp("^-?" + (t = "[" + b.slice(0, n) + "]+") + "(?:\\." + t + ")?$", 37 > n ? "i" : "").test(s)) return g(f, s, o, n); + o ? (f.s = 0 > 1 / e ? (s = s.slice(1), -1) : 1, j && s.replace(/^0\.0*|\./, "").length > 15 && L(M, N, e), o = !1) : f.s = 45 === s.charCodeAt(0) ? (s = s.slice(1), -1) : 1, s = D(s, 10, n, f.s) + } else { + if (e instanceof a) return f.s = e.s, f.e = e.e, f.c = (e = e.c) ? e.slice() : e, void (M = 0); + if ((o = "number" == typeof e) && 0 * e == 0) { + if (f.s = 0 > 1 / e ? (e = -e, -1) : 1, e === ~~e) { + for (r = 0, i = e; i >= 10; i /= 10, r++); + return f.e = r, f.c = [e], void (M = 0) + } + s = e + "" + } else { + if (!p.test(s = e + "")) return g(f, s, o); + f.s = 45 === s.charCodeAt(0) ? (s = s.slice(1), -1) : 1 + } + } + for ((r = s.indexOf(".")) > -1 && (s = s.replace(".", "")), (i = s.search(/e/i)) > 0 ? (0 > r && (r = i), r += +s.slice(i + 1), s = s.substring(0, i)) : 0 > r && (r = s.length), i = 0; 48 === s.charCodeAt(i); i++); + for (u = s.length; 48 === s.charCodeAt(--u);); + if (s = s.slice(i, u + 1)) + if (u = s.length, o && j && u > 15 && (e > S || e !== m(e)) && L(M, N, f.s * e), r = r - i - 1, r > z) f.c = f.e = null; + else if (G > r) f.c = [f.e = 0]; + else { + if (f.e = r, f.c = [], i = (r + 1) % y, 0 > r && (i += y), u > i) { + for (i && f.c.push(+s.slice(0, i)), u -= y; u > i;) f.c.push(+s.slice(i, i += y)); + s = s.slice(i), i = y - s.length + } else i -= u; + for (; i--; s += "0"); + f.c.push(+s) + } else f.c = [f.e = 0]; + M = 0 + } + + function D(e, n, t, i) { + var o, u, f, c, h, g, p, d = e.indexOf("."), + m = P, + w = B; + for (37 > t && (e = e.toLowerCase()), d >= 0 && (f = J, J = 0, e = e.replace(".", ""), p = new a(t), h = p.pow(e.length - d), J = f, p.c = s(l(r(h.c), h.e), 10, n), p.e = p.c.length), g = s(e, t, n), u = f = g.length; 0 == g[--f]; g.pop()); + if (!g[0]) return "0"; + if (0 > d ? --u : (h.c = g, h.e = u, h.s = i, h = C(h, p, m, w, n), g = h.c, c = h.r, u = h.e), o = u + m + 1, d = g[o], f = n / 2, c = c || 0 > o || null != g[o + 1], c = 4 > w ? (null != d || c) && (0 == w || w == (h.s < 0 ? 3 : 2)) : d > f || d == f && (4 == w || c || 6 == w && 1 & g[o - 1] || w == (h.s < 0 ? 8 : 7)), 1 > o || !g[0]) e = c ? l("1", -m) : "0"; + else { + if (g.length = o, c) + for (--n; ++g[--o] > n;) g[o] = 0, o || (++u, g.unshift(1)); + for (f = g.length; !g[--f];); + for (d = 0, e = ""; f >= d; e += b.charAt(g[d++])); + e = l(e, u) + } + return e + } + + function F(e, n, t, i) { + var o, u, s, c, h; + if (t = null != t && H(t, 0, 8, i, v) ? 0 | t : B, !e.c) return e.toString(); + if (o = e.c[0], s = e.e, null == n) h = r(e.c), h = 19 == i || 24 == i && k >= s ? f(h, s) : l(h, s); + else if (e = U(new a(e), n, t), u = e.e, h = r(e.c), c = h.length, 19 == i || 24 == i && (u >= n || k >= u)) { + for (; n > c; h += "0", c++); + h = f(h, u) + } else if (n -= s, h = l(h, u), u + 1 > c) { + if (--n > 0) + for (h += "."; n--; h += "0"); + } else if (n += u - c, n > 0) + for (u + 1 == c && (h += "."); n--; h += "0"); + return e.s < 0 && o ? "-" + h : h + } + + function _(e, n) { + var t, r, i = 0; + for (u(e[0]) && (e = e[0]), t = new a(e[0]); ++i < e.length;) { + if (r = new a(e[i]), !r.s) { + t = r; + break + } + n.call(t, r) && (t = r) + } + return t + } + + function x(e, n, t, r, i) { + return (n > e || e > t || e != c(e)) && L(r, (i || "decimal places") + (n > e || e > t ? " out of range" : " not an integer"), e), !0 + } + + function I(e, n, t) { + for (var r = 1, i = n.length; !n[--i]; n.pop()); + for (i = n[0]; i >= 10; i /= 10, r++); + return (t = r + t * y - 1) > z ? e.c = e.e = null : G > t ? e.c = [e.e = 0] : (e.e = t, e.c = n), e + } + + function L(e, n, t) { + var r = new Error(["new BigNumber", "cmp", "config", "div", "divToInt", "eq", "gt", "gte", "lt", "lte", "minus", "mod", "plus", "precision", "random", "round", "shift", "times", "toDigits", "toExponential", "toFixed", "toFormat", "toFraction", "pow", "toPrecision", "toString", "BigNumber"][e] + "() " + n + ": " + t); + throw r.name = "BigNumber Error", M = 0, r + } + + function U(e, n, t, r) { + var i, o, u, s, f, l, c, a = e.c, + h = R; + if (a) { + e: { + for (i = 1, s = a[0]; s >= 10; s /= 10, i++); + if (o = n - i, 0 > o) o += y, + u = n, + f = a[l = 0], + c = f / h[i - u - 1] % 10 | 0; + else if (l = d((o + 1) / y), l >= a.length) { + if (!r) break e; + for (; a.length <= l; a.push(0)); + f = c = 0, i = 1, o %= y, u = o - y + 1 + } else { + for (f = s = a[l], i = 1; s >= 10; s /= 10, i++); + o %= y, u = o - y + i, c = 0 > u ? 0 : f / h[i - u - 1] % 10 | 0 + } + if (r = r || 0 > n || null != a[l + 1] || (0 > u ? f : f % h[i - u - 1]), r = 4 > t ? (c || r) && (0 == t || t == (e.s < 0 ? 3 : 2)) : c > 5 || 5 == c && (4 == t || r || 6 == t && (o > 0 ? u > 0 ? f / h[i - u] : 0 : a[l - 1]) % 10 & 1 || t == (e.s < 0 ? 8 : 7)), 1 > n || !a[0]) return a.length = 0, + r ? (n -= e.e + 1, a[0] = h[(y - n % y) % y], e.e = -n || 0) : a[0] = e.e = 0, + e; + if (0 == o ? (a.length = l, s = 1, l--) : (a.length = l + 1, s = h[y - o], a[l] = u > 0 ? m(f / h[i - u] % h[u]) * s : 0), r) + for (; ;) { + if (0 == l) { + for (o = 1, u = a[0]; u >= 10; u /= 10, o++); + for (u = a[0] += s, s = 1; u >= 10; u /= 10, s++); + o != s && (e.e++, a[0] == O && (a[0] = 1)); + break + } + if (a[l] += s, a[l] != O) break; + a[l--] = 0, s = 1 + } + for (o = a.length; 0 === a[--o]; a.pop()); + } + e.e > z ? e.c = e.e = null : e.e < G && (e.c = [e.e = 0]) + } + return e + } + var C, M = 0, + T = a.prototype, + q = new a(1), + P = 20, + B = 4, + k = -7, + $ = 21, + G = -1e7, + z = 1e7, + j = !0, + H = x, + V = !1, + W = 1, + J = 100, + X = { + decimalSeparator: ".", + groupSeparator: ",", + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: " ", + fractionGroupSize: 0 + }; + return a.another = n, a.ROUND_UP = 0, a.ROUND_DOWN = 1, a.ROUND_CEIL = 2, a.ROUND_FLOOR = 3, a.ROUND_HALF_UP = 4, a.ROUND_HALF_DOWN = 5, a.ROUND_HALF_EVEN = 6, a.ROUND_HALF_CEIL = 7, a.ROUND_HALF_FLOOR = 8, a.EUCLID = 9, a.config = function () { + var e, n, t = 0, + r = {}, + i = arguments, + s = i[0], + f = s && "object" == typeof s ? function () { + return s.hasOwnProperty(n) ? null != (e = s[n]) : void 0 + } : function () { + return i.length > t ? null != (e = i[t++]) : void 0 + }; + return f(n = "DECIMAL_PLACES") && H(e, 0, E, 2, n) && (P = 0 | e), r[n] = P, f(n = "ROUNDING_MODE") && H(e, 0, 8, 2, n) && (B = 0 | e), r[n] = B, f(n = "EXPONENTIAL_AT") && (u(e) ? H(e[0], -E, 0, 2, n) && H(e[1], 0, E, 2, n) && (k = 0 | e[0], $ = 0 | e[1]) : H(e, -E, E, 2, n) && (k = -($ = 0 | (0 > e ? -e : e)))), r[n] = [k, $], f(n = "RANGE") && (u(e) ? H(e[0], -E, -1, 2, n) && H(e[1], 1, E, 2, n) && (G = 0 | e[0], z = 0 | e[1]) : H(e, -E, E, 2, n) && (0 | e ? G = -(z = 0 | (0 > e ? -e : e)) : j && L(2, n + " cannot be zero", e))), r[n] = [G, z], f(n = "ERRORS") && (e === !!e || 1 === e || 0 === e ? (M = 0, H = (j = !!e) ? x : o) : j && L(2, n + w, e)), r[n] = j, f(n = "CRYPTO") && (e === !!e || 1 === e || 0 === e ? (V = !(!e || !h), e && !V && j && L(2, "crypto unavailable", h)) : j && L(2, n + w, e)), r[n] = V, f(n = "MODULO_MODE") && H(e, 0, 9, 2, n) && (W = 0 | e), r[n] = W, f(n = "POW_PRECISION") && H(e, 0, E, 2, n) && (J = 0 | e), r[n] = J, f(n = "FORMAT") && ("object" == typeof e ? X = e : j && L(2, n + " not an object", e)), r[n] = X, r + }, a.max = function () { + return _(arguments, T.lt) + }, a.min = function () { + return _(arguments, T.gt) + }, a.random = function () { + var e = 9007199254740992, + n = Math.random() * e & 2097151 ? function () { + return m(Math.random() * e) + } : function () { + return 8388608 * (1073741824 * Math.random() | 0) + (8388608 * Math.random() | 0) + }; + return function (e) { + var t, r, i, o, u, s = 0, + f = [], + l = new a(q); + if (e = null != e && H(e, 0, E, 14) ? 0 | e : P, o = d(e / y), V) + if (h && h.getRandomValues) { + for (t = h.getRandomValues(new Uint32Array(o *= 2)); o > s;) u = 131072 * t[s] + (t[s + 1] >>> 11), u >= 9e15 ? (r = h.getRandomValues(new Uint32Array(2)), t[s] = r[0], t[s + 1] = r[1]) : (f.push(u % 1e14), s += 2); + s = o / 2 + } else if (h && h.randomBytes) { + for (t = h.randomBytes(o *= 7); o > s;) u = 281474976710656 * (31 & t[s]) + 1099511627776 * t[s + 1] + 4294967296 * t[s + 2] + 16777216 * t[s + 3] + (t[s + 4] << 16) + (t[s + 5] << 8) + t[s + 6], u >= 9e15 ? h.randomBytes(7).copy(t, s) : (f.push(u % 1e14), s += 7); + s = o / 7 + } else j && L(14, "crypto unavailable", h); + if (!s) + for (; o > s;) u = n(), 9e15 > u && (f[s++] = u % 1e14); + for (o = f[--s], e %= y, o && e && (u = R[y - e], f[s] = m(o / u) * u); 0 === f[s]; f.pop(), s--); + if (0 > s) f = [i = 0]; + else { + for (i = -1; 0 === f[0]; f.shift(), i -= y); + for (s = 1, u = f[0]; u >= 10; u /= 10, s++); + y > s && (i -= y - s) + } + return l.e = i, l.c = f, l + } + }(), C = function () { + function e(e, n, t) { + var r, i, o, u, s = 0, + f = e.length, + l = n % A, + c = n / A | 0; + for (e = e.slice(); f--;) o = e[f] % A, u = e[f] / A | 0, r = c * o + u * l, i = l * o + r % A * A + s, s = (i / t | 0) + (r / A | 0) + c * u, e[f] = i % t; + return s && e.unshift(s), e + } + + function n(e, n, t, r) { + var i, o; + if (t != r) o = t > r ? 1 : -1; + else + for (i = o = 0; t > i; i++) + if (e[i] != n[i]) { + o = e[i] > n[i] ? 1 : -1; + break + } return o + } + + function r(e, n, t, r) { + for (var i = 0; t--;) e[t] -= i, i = e[t] < n[t] ? 1 : 0, e[t] = i * r + e[t] - n[t]; + for (; !e[0] && e.length > 1; e.shift()); + } + return function (i, o, u, s, f) { + var l, c, h, g, p, d, w, v, N, b, S, R, A, E, D, F, _, x = i.s == o.s ? 1 : -1, + I = i.c, + L = o.c; + if (!(I && I[0] && L && L[0])) return new a(i.s && o.s && (I ? !L || I[0] != L[0] : L) ? I && 0 == I[0] || !L ? 0 * x : x / 0 : NaN); + for (v = new a(x), N = v.c = [], c = i.e - o.e, x = u + c + 1, f || (f = O, c = t(i.e / y) - t(o.e / y), x = x / y | 0), h = 0; L[h] == (I[h] || 0); h++); + if (L[h] > (I[h] || 0) && c--, 0 > x) N.push(1), g = !0; + else { + for (E = I.length, F = L.length, h = 0, x += 2, p = m(f / (L[0] + 1)), p > 1 && (L = e(L, p, f), I = e(I, p, f), F = L.length, E = I.length), A = F, b = I.slice(0, F), S = b.length; F > S; b[S++] = 0); + _ = L.slice(), _.unshift(0), D = L[0], L[1] >= f / 2 && D++; + do { + if (p = 0, l = n(L, b, F, S), 0 > l) { + if (R = b[0], F != S && (R = R * f + (b[1] || 0)), p = m(R / D), p > 1) + for (p >= f && (p = f - 1), d = e(L, p, f), w = d.length, S = b.length; 1 == n(d, b, w, S);) p--, r(d, w > F ? _ : L, w, f), w = d.length, l = 1; + else 0 == p && (l = p = 1), d = L.slice(), w = d.length; + if (S > w && d.unshift(0), r(b, d, S, f), S = b.length, -1 == l) + for (; n(L, b, F, S) < 1;) p++, r(b, S > F ? _ : L, S, f), S = b.length + } else 0 === l && (p++, b = [0]); + N[h++] = p, b[0] ? b[S++] = I[A] || 0 : (b = [I[A]], S = 1) + } while ((A++ < E || null != b[0]) && x--); + g = null != b[0], N[0] || N.shift() + } + if (f == O) { + for (h = 1, x = N[0]; x >= 10; x /= 10, h++); + U(v, u + (v.e = h + c * y - 1) + 1, s, g) + } else v.e = c, v.r = +g; + return v + } + }(), g = function () { + var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, + n = /^([^.]+)\.$/, + t = /^\.([^.]+)$/, + r = /^-?(Infinity|NaN)$/, + i = /^\s*\+(?=[\w.])|^\s+|\s+$/g; + return function (o, u, s, f) { + var l, c = s ? u : u.replace(i, ""); + if (r.test(c)) o.s = isNaN(c) ? null : 0 > c ? -1 : 1; + else { + if (!s && (c = c.replace(e, function (e, n, t) { + return l = "x" == (t = t.toLowerCase()) ? 16 : "b" == t ? 2 : 8, f && f != l ? e : n + }), f && (l = f, c = c.replace(n, "$1").replace(t, "0.$1")), u != c)) return new a(c, l); + j && L(M, "not a" + (f ? " base " + f : "") + " number", u), o.s = null + } + o.c = o.e = null, M = 0 + } + }(), T.absoluteValue = T.abs = function () { + var e = new a(this); + return e.s < 0 && (e.s = 1), e + }, T.ceil = function () { + return U(new a(this), this.e + 1, 2) + }, T.comparedTo = T.cmp = function (e, n) { + return M = 1, i(this, new a(e, n)) + }, T.decimalPlaces = T.dp = function () { + var e, n, r = this.c; + if (!r) return null; + if (e = ((n = r.length - 1) - t(this.e / y)) * y, n = r[n]) + for (; n % 10 == 0; n /= 10, e--); + return 0 > e && (e = 0), e + }, T.dividedBy = T.div = function (e, n) { + return M = 3, C(this, new a(e, n), P, B) + }, T.dividedToIntegerBy = T.divToInt = function (e, n) { + return M = 4, C(this, new a(e, n), 0, 1) + }, T.equals = T.eq = function (e, n) { + return M = 5, 0 === i(this, new a(e, n)) + }, T.floor = function () { + return U(new a(this), this.e + 1, 3) + }, T.greaterThan = T.gt = function (e, n) { + return M = 6, i(this, new a(e, n)) > 0 + }, T.greaterThanOrEqualTo = T.gte = function (e, n) { + return M = 7, 1 === (n = i(this, new a(e, n))) || 0 === n + }, T.isFinite = function () { + return !!this.c + }, T.isInteger = T.isInt = function () { + return !!this.c && t(this.e / y) > this.c.length - 2 + }, T.isNaN = function () { + return !this.s + }, T.isNegative = T.isNeg = function () { + return this.s < 0 + }, T.isZero = function () { + return !!this.c && 0 == this.c[0] + }, T.lessThan = T.lt = function (e, n) { + return M = 8, i(this, new a(e, n)) < 0 + }, T.lessThanOrEqualTo = T.lte = function (e, n) { + return M = 9, -1 === (n = i(this, new a(e, n))) || 0 === n + }, T.minus = T.sub = function (e, n) { + var r, i, o, u, s = this, + f = s.s; + if (M = 10, e = new a(e, n), n = e.s, !f || !n) return new a(NaN); + if (f != n) return e.s = -n, s.plus(e); + var l = s.e / y, + c = e.e / y, + h = s.c, + g = e.c; + if (!l || !c) { + if (!h || !g) return h ? (e.s = -n, e) : new a(g ? s : NaN); + if (!h[0] || !g[0]) return g[0] ? (e.s = -n, e) : new a(h[0] ? s : 3 == B ? -0 : 0) + } + if (l = t(l), c = t(c), h = h.slice(), f = l - c) { + for ((u = 0 > f) ? (f = -f, o = h) : (c = l, o = g), o.reverse(), n = f; n--; o.push(0)); + o.reverse() + } else + for (i = (u = (f = h.length) < (n = g.length)) ? f : n, f = n = 0; i > n; n++) + if (h[n] != g[n]) { + u = h[n] < g[n]; + break + } if (u && (o = h, h = g, g = o, e.s = -e.s), n = (i = g.length) - (r = h.length), n > 0) + for (; n--; h[r++] = 0); + for (n = O - 1; i > f;) { + if (h[--i] < g[i]) { + for (r = i; r && !h[--r]; h[r] = n); + --h[r], h[i] += O + } + h[i] -= g[i] + } + for (; 0 == h[0]; h.shift(), --c); + return h[0] ? I(e, h, c) : (e.s = 3 == B ? -1 : 1, e.c = [e.e = 0], e) + }, T.modulo = T.mod = function (e, n) { + var t, r, i = this; + return M = 11, e = new a(e, n), !i.c || !e.s || e.c && !e.c[0] ? new a(NaN) : !e.c || i.c && !i.c[0] ? new a(i) : (9 == W ? (r = e.s, e.s = 1, t = C(i, e, 0, 3), e.s = r, t.s *= r) : t = C(i, e, 0, W), i.minus(t.times(e))) + }, T.negated = T.neg = function () { + var e = new a(this); + return e.s = -e.s || null, e + }, T.plus = T.add = function (e, n) { + var r, i = this, + o = i.s; + if (M = 12, e = new a(e, n), n = e.s, !o || !n) return new a(NaN); + if (o != n) return e.s = -n, i.minus(e); + var u = i.e / y, + s = e.e / y, + f = i.c, + l = e.c; + if (!u || !s) { + if (!f || !l) return new a(o / 0); + if (!f[0] || !l[0]) return l[0] ? e : new a(f[0] ? i : 0 * o) + } + if (u = t(u), s = t(s), f = f.slice(), o = u - s) { + for (o > 0 ? (s = u, r = l) : (o = -o, r = f), r.reverse(); o--; r.push(0)); + r.reverse() + } + for (o = f.length, n = l.length, 0 > o - n && (r = l, l = f, f = r, n = o), o = 0; n;) o = (f[--n] = f[n] + l[n] + o) / O | 0, f[n] %= O; + return o && (f.unshift(o), ++s), I(e, f, s) + }, T.precision = T.sd = function (e) { + var n, t, r = this, + i = r.c; + if (null != e && e !== !!e && 1 !== e && 0 !== e && (j && L(13, "argument" + w, e), e != !!e && (e = null)), !i) return null; + if (t = i.length - 1, n = t * y + 1, t = i[t]) { + for (; t % 10 == 0; t /= 10, n--); + for (t = i[0]; t >= 10; t /= 10, n++); + } + return e && r.e + 1 > n && (n = r.e + 1), n + }, T.round = function (e, n) { + var t = new a(this); + return (null == e || H(e, 0, E, 15)) && U(t, ~~e + this.e + 1, null != n && H(n, 0, 8, 15, v) ? 0 | n : B), t + }, T.shift = function (e) { + var n = this; + return H(e, -S, S, 16, "argument") ? n.times("1e" + c(e)) : new a(n.c && n.c[0] && (-S > e || e > S) ? n.s * (0 > e ? 0 : 1 / 0) : n) + }, T.squareRoot = T.sqrt = function () { + var e, n, i, o, u, s = this, + f = s.c, + l = s.s, + c = s.e, + h = P + 4, + g = new a("0.5"); + if (1 !== l || !f || !f[0]) return new a(!l || 0 > l && (!f || f[0]) ? NaN : f ? s : 1 / 0); + if (l = Math.sqrt(+s), 0 == l || l == 1 / 0 ? (n = r(f), (n.length + c) % 2 == 0 && (n += "0"), l = Math.sqrt(n), c = t((c + 1) / 2) - (0 > c || c % 2), l == 1 / 0 ? n = "1e" + c : (n = l.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + c), i = new a(n)) : i = new a(l + ""), i.c[0]) + for (c = i.e, l = c + h, 3 > l && (l = 0); ;) + if (u = i, i = g.times(u.plus(C(s, u, h, 1))), r(u.c).slice(0, l) === (n = r(i.c)).slice(0, l)) { + if (i.e < c && --l, n = n.slice(l - 3, l + 1), "9999" != n && (o || "4999" != n)) { + (!+n || !+n.slice(1) && "5" == n.charAt(0)) && (U(i, i.e + P + 2, 1), e = !i.times(i).eq(s)); + break + } + if (!o && (U(u, u.e + P + 2, 0), u.times(u).eq(s))) { + i = u; + break + } + h += 4, l += 4, o = 1 + } return U(i, i.e + P + 1, B, e) + }, T.times = T.mul = function (e, n) { + var r, i, o, u, s, f, l, c, h, g, p, d, m, w, v, N = this, + b = N.c, + S = (M = 17, e = new a(e, n)).c; + if (!(b && S && b[0] && S[0])) return !N.s || !e.s || b && !b[0] && !S || S && !S[0] && !b ? e.c = e.e = e.s = null : (e.s *= N.s, b && S ? (e.c = [0], e.e = 0) : e.c = e.e = null), e; + for (i = t(N.e / y) + t(e.e / y), e.s *= N.s, l = b.length, g = S.length, g > l && (m = b, b = S, S = m, o = l, l = g, g = o), o = l + g, m = []; o--; m.push(0)); + for (w = O, v = A, o = g; --o >= 0;) { + for (r = 0, p = S[o] % v, d = S[o] / v | 0, s = l, u = o + s; u > o;) c = b[--s] % v, h = b[s] / v | 0, f = d * c + h * p, c = p * c + f % v * v + m[u] + r, r = (c / w | 0) + (f / v | 0) + d * h, m[u--] = c % w; + m[u] = r + } + return r ? ++i : m.shift(), I(e, m, i) + }, T.toDigits = function (e, n) { + var t = new a(this); + return e = null != e && H(e, 1, E, 18, "precision") ? 0 | e : null, n = null != n && H(n, 0, 8, 18, v) ? 0 | n : B, e ? U(t, e, n) : t + }, T.toExponential = function (e, n) { + return F(this, null != e && H(e, 0, E, 19) ? ~~e + 1 : null, n, 19) + }, T.toFixed = function (e, n) { + return F(this, null != e && H(e, 0, E, 20) ? ~~e + this.e + 1 : null, n, 20) + }, T.toFormat = function (e, n) { + var t = F(this, null != e && H(e, 0, E, 21) ? ~~e + this.e + 1 : null, n, 21); + if (this.c) { + var r, i = t.split("."), + o = +X.groupSize, + u = +X.secondaryGroupSize, + s = X.groupSeparator, + f = i[0], + l = i[1], + c = this.s < 0, + a = c ? f.slice(1) : f, + h = a.length; + if (u && (r = o, o = u, u = r, h -= r), o > 0 && h > 0) { + for (r = h % o || o, f = a.substr(0, r); h > r; r += o) f += s + a.substr(r, o); + u > 0 && (f += s + a.slice(r)), c && (f = "-" + f) + } + t = l ? f + X.decimalSeparator + ((u = +X.fractionGroupSize) ? l.replace(new RegExp("\\d{" + u + "}\\B", "g"), "$&" + X.fractionGroupSeparator) : l) : f + } + return t + }, T.toFraction = function (e) { + var n, t, i, o, u, s, f, l, c, h = j, + g = this, + p = g.c, + d = new a(q), + m = t = new a(q), + w = f = new a(q); + if (null != e && (j = !1, s = new a(e), j = h, (!(h = s.isInt()) || s.lt(q)) && (j && L(22, "max denominator " + (h ? "out of range" : "not an integer"), e), e = !h && s.c && U(s, s.e + 1, 1).gte(q) ? s : null)), !p) return g.toString(); + for (c = r(p), o = d.e = c.length - g.e - 1, d.c[0] = R[(u = o % y) < 0 ? y + u : u], e = !e || s.cmp(d) > 0 ? o > 0 ? d : m : s, u = z, z = 1 / 0, s = new a(c), f.c[0] = 0; l = C(s, d, 0, 1), i = t.plus(l.times(w)), 1 != i.cmp(e);) t = w, w = i, m = f.plus(l.times(i = m)), f = i, d = s.minus(l.times(i = d)), s = i; + return i = C(e.minus(t), w, 0, 1), f = f.plus(i.times(m)), t = t.plus(i.times(w)), f.s = m.s = g.s, o *= 2, n = C(m, w, o, B).minus(g).abs().cmp(C(f, t, o, B).minus(g).abs()) < 1 ? [m.toString(), w.toString()] : [f.toString(), t.toString()], z = u, n + }, T.toNumber = function () { + return +this + }, T.toPower = T.pow = function (e, n) { + var t, r, i, o = m(0 > e ? -e : +e), + u = this; + if (null != n && (M = 23, n = new a(n)), !H(e, -S, S, 23, "exponent") && (!isFinite(e) || o > S && (e /= 0) || parseFloat(e) != e && !(e = NaN)) || 0 == e) return t = Math.pow(+u, e), new a(n ? t % n : t); + for (n ? e > 1 && u.gt(q) && u.isInt() && n.gt(q) && n.isInt() ? u = u.mod(n) : (i = n, n = null) : J && (t = d(J / y + 2)), r = new a(q); ;) { + if (o % 2) { + if (r = r.times(u), !r.c) break; + t ? r.c.length > t && (r.c.length = t) : n && (r = r.mod(n)) + } + if (o = m(o / 2), !o) break; + u = u.times(u), t ? u.c && u.c.length > t && (u.c.length = t) : n && (u = u.mod(n)) + } + return n ? r : (0 > e && (r = q.div(r)), i ? r.mod(i) : t ? U(r, J, B) : r) + }, T.toPrecision = function (e, n) { + return F(this, null != e && H(e, 1, E, 24, "precision") ? 0 | e : null, n, 24) + }, T.toString = function (e) { + var n, t = this, + i = t.s, + o = t.e; + return null === o ? i ? (n = "Infinity", 0 > i && (n = "-" + n)) : n = "NaN" : (n = r(t.c), n = null != e && H(e, 2, 64, 25, "base") ? D(l(n, o), 0 | e, 10, i) : k >= o || o >= $ ? f(n, o) : l(n, o), 0 > i && t.c[0] && (n = "-" + n)), n + }, T.truncated = T.trunc = function () { + return U(new a(this), this.e + 1, 1) + }, T.valueOf = T.toJSON = function () { + var e, n = this, + t = n.e; + return null === t ? n.toString() : (e = r(n.c), e = k >= t || t >= $ ? f(e, t) : l(e, t), n.s < 0 ? "-" + e : e) + }, null != e && a.config(e), a + } + + function t(e) { + var n = 0 | e; + return e > 0 || e === n ? n : n - 1 + } + + function r(e) { + for (var n, t, r = 1, i = e.length, o = e[0] + ""; i > r;) { + for (n = e[r++] + "", t = y - n.length; t--; n = "0" + n); + o += n + } + for (i = o.length; 48 === o.charCodeAt(--i);); + return o.slice(0, i + 1 || 1) + } + + function i(e, n) { + var t, r, i = e.c, + o = n.c, + u = e.s, + s = n.s, + f = e.e, + l = n.e; + if (!u || !s) return null; + if (t = i && !i[0], r = o && !o[0], t || r) return t ? r ? 0 : -s : u; + if (u != s) return u; + if (t = 0 > u, r = f == l, !i || !o) return r ? 0 : !i ^ t ? 1 : -1; + if (!r) return f > l ^ t ? 1 : -1; + for (s = (f = i.length) < (l = o.length) ? f : l, u = 0; s > u; u++) + if (i[u] != o[u]) return i[u] > o[u] ^ t ? 1 : -1; + return f == l ? 0 : f > l ^ t ? 1 : -1 + } + + function o(e, n, t) { + return (e = c(e)) >= n && t >= e + } + + function u(e) { + return "[object Array]" == Object.prototype.toString.call(e) + } + + function s(e, n, t) { + for (var r, i, o = [0], u = 0, s = e.length; s > u;) { + for (i = o.length; i--; o[i] *= n); + for (o[r = 0] += b.indexOf(e.charAt(u++)); r < o.length; r++) o[r] > t - 1 && (null == o[r + 1] && (o[r + 1] = 0), o[r + 1] += o[r] / t | 0, o[r] %= t) + } + return o.reverse() + } + + function f(e, n) { + return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (0 > n ? "e" : "e+") + n + } + + function l(e, n) { + var t, r; + if (0 > n) { + for (r = "0."; ++n; r += "0"); + e = r + e + } else if (t = e.length, ++n > t) { + for (r = "0", n -= t; --n; r += "0"); + e += r + } else t > n && (e = e.slice(0, n) + "." + e.slice(n)); + return e + } + + function c(e) { + return e = parseFloat(e), 0 > e ? d(e) : m(e) + } + var a, h, g, p = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, + d = Math.ceil, + m = Math.floor, + w = " not a boolean or binary digit", + v = "rounding mode", + N = "number type has more than 15 significant digits", + b = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", + O = 1e14, + y = 14, + S = 9007199254740991, + R = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], + A = 1e7, + E = 1e9; + if ("undefined" != typeof crypto && (h = crypto), a = n(), a["default"] = a.BigNumber = a, "function" == typeof define && define.amd) define(function () { + return a + }); + else if ("undefined" != typeof module && module.exports) { + if (module.exports = a, !h) try { + h = require("crypto") + } catch (D) { } + } else e || (e = "undefined" != typeof self ? self : Function("return this")()), e.BigNumber = a +}(this); diff --git a/wp-includes/lib/bignumber.js/from.txt b/wp-includes/lib/bignumber.js/from.txt new file mode 100644 index 0000000..3956590 --- /dev/null +++ b/wp-includes/lib/bignumber.js/from.txt @@ -0,0 +1 @@ +从源代码中分离出来,未找到源码 \ No newline at end of file diff --git a/wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.js b/wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.js new file mode 100644 index 0000000..aeb826f --- /dev/null +++ b/wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.js @@ -0,0 +1,890 @@ +/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["ClipboardJS"] = factory(); + else + root["ClipboardJS"] = factory(); +})(this, function() { +return /******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 686: +/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + "default": function() { return /* binding */ clipboard; } +}); + +// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js +var tiny_emitter = __webpack_require__(279); +var tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter); +// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js +var listen = __webpack_require__(370); +var listen_default = /*#__PURE__*/__webpack_require__.n(listen); +// EXTERNAL MODULE: ./node_modules/select/src/select.js +var src_select = __webpack_require__(817); +var select_default = /*#__PURE__*/__webpack_require__.n(src_select); +;// CONCATENATED MODULE: ./src/common/command.js +/** + * Executes a given operation type. + * @param {String} type + * @return {Boolean} + */ +function command(type) { + try { + return document.execCommand(type); + } catch (err) { + return false; + } +} +;// CONCATENATED MODULE: ./src/actions/cut.js + + +/** + * Cut action wrapper. + * @param {String|HTMLElement} target + * @return {String} + */ + +var ClipboardActionCut = function ClipboardActionCut(target) { + var selectedText = select_default()(target); + command('cut'); + return selectedText; +}; + +/* harmony default export */ var actions_cut = (ClipboardActionCut); +;// CONCATENATED MODULE: ./src/common/create-fake-element.js +/** + * Creates a fake textarea element with a value. + * @param {String} value + * @return {HTMLElement} + */ +function createFakeElement(value) { + var isRTL = document.documentElement.getAttribute('dir') === 'rtl'; + var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS + + fakeElement.style.fontSize = '12pt'; // Reset box model + + fakeElement.style.border = '0'; + fakeElement.style.padding = '0'; + fakeElement.style.margin = '0'; // Move element out of screen horizontally + + fakeElement.style.position = 'absolute'; + fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically + + var yPosition = window.pageYOffset || document.documentElement.scrollTop; + fakeElement.style.top = "".concat(yPosition, "px"); + fakeElement.setAttribute('readonly', ''); + fakeElement.value = value; + return fakeElement; +} +;// CONCATENATED MODULE: ./src/actions/copy.js + + + +/** + * Create fake copy action wrapper using a fake element. + * @param {String} target + * @param {Object} options + * @return {String} + */ + +var fakeCopyAction = function fakeCopyAction(value, options) { + var fakeElement = createFakeElement(value); + options.container.appendChild(fakeElement); + var selectedText = select_default()(fakeElement); + command('copy'); + fakeElement.remove(); + return selectedText; +}; +/** + * Copy action wrapper. + * @param {String|HTMLElement} target + * @param {Object} options + * @return {String} + */ + + +var ClipboardActionCopy = function ClipboardActionCopy(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + var selectedText = ''; + + if (typeof target === 'string') { + selectedText = fakeCopyAction(target, options); + } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) { + // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange + selectedText = fakeCopyAction(target.value, options); + } else { + selectedText = select_default()(target); + command('copy'); + } + + return selectedText; +}; + +/* harmony default export */ var actions_copy = (ClipboardActionCopy); +;// CONCATENATED MODULE: ./src/actions/default.js +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + + + +/** + * Inner function which performs selection from either `text` or `target` + * properties and then executes copy or cut operations. + * @param {Object} options + */ + +var ClipboardActionDefault = function ClipboardActionDefault() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // Defines base properties passed from constructor. + var _options$action = options.action, + action = _options$action === void 0 ? 'copy' : _options$action, + container = options.container, + target = options.target, + text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'. + + if (action !== 'copy' && action !== 'cut') { + throw new Error('Invalid "action" value, use either "copy" or "cut"'); + } // Sets the `target` property using an element that will be have its content copied. + + + if (target !== undefined) { + if (target && _typeof(target) === 'object' && target.nodeType === 1) { + if (action === 'copy' && target.hasAttribute('disabled')) { + throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); + } + + if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { + throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); + } + } else { + throw new Error('Invalid "target" value, use a valid Element'); + } + } // Define selection strategy based on `text` property. + + + if (text) { + return actions_copy(text, { + container: container + }); + } // Defines which selection strategy based on `target` property. + + + if (target) { + return action === 'cut' ? actions_cut(target) : actions_copy(target, { + container: container + }); + } +}; + +/* harmony default export */ var actions_default = (ClipboardActionDefault); +;// CONCATENATED MODULE: ./src/clipboard.js +function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } + +function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + + + + + + +/** + * Helper function to retrieve attribute value. + * @param {String} suffix + * @param {Element} element + */ + +function getAttributeValue(suffix, element) { + var attribute = "data-clipboard-".concat(suffix); + + if (!element.hasAttribute(attribute)) { + return; + } + + return element.getAttribute(attribute); +} +/** + * Base class which takes one or more elements, adds event listeners to them, + * and instantiates a new `ClipboardAction` on each click. + */ + + +var Clipboard = /*#__PURE__*/function (_Emitter) { + _inherits(Clipboard, _Emitter); + + var _super = _createSuper(Clipboard); + + /** + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + * @param {Object} options + */ + function Clipboard(trigger, options) { + var _this; + + _classCallCheck(this, Clipboard); + + _this = _super.call(this); + + _this.resolveOptions(options); + + _this.listenClick(trigger); + + return _this; + } + /** + * Defines if attributes would be resolved using internal setter functions + * or custom functions that were passed in the constructor. + * @param {Object} options + */ + + + _createClass(Clipboard, [{ + key: "resolveOptions", + value: function resolveOptions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.action = typeof options.action === 'function' ? options.action : this.defaultAction; + this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; + this.text = typeof options.text === 'function' ? options.text : this.defaultText; + this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body; + } + /** + * Adds a click event listener to the passed trigger. + * @param {String|HTMLElement|HTMLCollection|NodeList} trigger + */ + + }, { + key: "listenClick", + value: function listenClick(trigger) { + var _this2 = this; + + this.listener = listen_default()(trigger, 'click', function (e) { + return _this2.onClick(e); + }); + } + /** + * Defines a new `ClipboardAction` on each click event. + * @param {Event} e + */ + + }, { + key: "onClick", + value: function onClick(e) { + var trigger = e.delegateTarget || e.currentTarget; + var action = this.action(trigger) || 'copy'; + var text = actions_default({ + action: action, + container: this.container, + target: this.target(trigger), + text: this.text(trigger) + }); // Fires an event based on the copy operation result. + + this.emit(text ? 'success' : 'error', { + action: action, + text: text, + trigger: trigger, + clearSelection: function clearSelection() { + if (trigger) { + trigger.focus(); + } + + window.getSelection().removeAllRanges(); + } + }); + } + /** + * Default `action` lookup function. + * @param {Element} trigger + */ + + }, { + key: "defaultAction", + value: function defaultAction(trigger) { + return getAttributeValue('action', trigger); + } + /** + * Default `target` lookup function. + * @param {Element} trigger + */ + + }, { + key: "defaultTarget", + value: function defaultTarget(trigger) { + var selector = getAttributeValue('target', trigger); + + if (selector) { + return document.querySelector(selector); + } + } + /** + * Allow fire programmatically a copy action + * @param {String|HTMLElement} target + * @param {Object} options + * @returns Text copied. + */ + + }, { + key: "defaultText", + + /** + * Default `text` lookup function. + * @param {Element} trigger + */ + value: function defaultText(trigger) { + return getAttributeValue('text', trigger); + } + /** + * Destroy lifecycle. + */ + + }, { + key: "destroy", + value: function destroy() { + this.listener.destroy(); + } + }], [{ + key: "copy", + value: function copy(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + container: document.body + }; + return actions_copy(target, options); + } + /** + * Allow fire programmatically a cut action + * @param {String|HTMLElement} target + * @returns Text cutted. + */ + + }, { + key: "cut", + value: function cut(target) { + return actions_cut(target); + } + /** + * Returns the support of the given action, or all actions if no action is + * given. + * @param {String} [action] + */ + + }, { + key: "isSupported", + value: function isSupported() { + var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; + var actions = typeof action === 'string' ? [action] : action; + var support = !!document.queryCommandSupported; + actions.forEach(function (action) { + support = support && !!document.queryCommandSupported(action); + }); + return support; + } + }]); + + return Clipboard; +}((tiny_emitter_default())); + +/* harmony default export */ var clipboard = (Clipboard); + +/***/ }), + +/***/ 828: +/***/ (function(module) { + +var DOCUMENT_NODE_TYPE = 9; + +/** + * A polyfill for Element.matches() + */ +if (typeof Element !== 'undefined' && !Element.prototype.matches) { + var proto = Element.prototype; + + proto.matches = proto.matchesSelector || + proto.mozMatchesSelector || + proto.msMatchesSelector || + proto.oMatchesSelector || + proto.webkitMatchesSelector; +} + +/** + * Finds the closest parent that matches a selector. + * + * @param {Element} element + * @param {String} selector + * @return {Function} + */ +function closest (element, selector) { + while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { + if (typeof element.matches === 'function' && + element.matches(selector)) { + return element; + } + element = element.parentNode; + } +} + +module.exports = closest; + + +/***/ }), + +/***/ 438: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var closest = __webpack_require__(828); + +/** + * Delegates event to a selector. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @param {Boolean} useCapture + * @return {Object} + */ +function _delegate(element, selector, type, callback, useCapture) { + var listenerFn = listener.apply(this, arguments); + + element.addEventListener(type, listenerFn, useCapture); + + return { + destroy: function() { + element.removeEventListener(type, listenerFn, useCapture); + } + } +} + +/** + * Delegates event to a selector. + * + * @param {Element|String|Array} [elements] + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @param {Boolean} useCapture + * @return {Object} + */ +function delegate(elements, selector, type, callback, useCapture) { + // Handle the regular Element usage + if (typeof elements.addEventListener === 'function') { + return _delegate.apply(null, arguments); + } + + // Handle Element-less usage, it defaults to global delegation + if (typeof type === 'function') { + // Use `document` as the first parameter, then apply arguments + // This is a short way to .unshift `arguments` without running into deoptimizations + return _delegate.bind(null, document).apply(null, arguments); + } + + // Handle Selector-based usage + if (typeof elements === 'string') { + elements = document.querySelectorAll(elements); + } + + // Handle Array-like based usage + return Array.prototype.map.call(elements, function (element) { + return _delegate(element, selector, type, callback, useCapture); + }); +} + +/** + * Finds closest match and invokes callback. + * + * @param {Element} element + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Function} + */ +function listener(element, selector, type, callback) { + return function(e) { + e.delegateTarget = closest(e.target, selector); + + if (e.delegateTarget) { + callback.call(element, e); + } + } +} + +module.exports = delegate; + + +/***/ }), + +/***/ 879: +/***/ (function(__unused_webpack_module, exports) { + +/** + * Check if argument is a HTML element. + * + * @param {Object} value + * @return {Boolean} + */ +exports.node = function(value) { + return value !== undefined + && value instanceof HTMLElement + && value.nodeType === 1; +}; + +/** + * Check if argument is a list of HTML elements. + * + * @param {Object} value + * @return {Boolean} + */ +exports.nodeList = function(value) { + var type = Object.prototype.toString.call(value); + + return value !== undefined + && (type === '[object NodeList]' || type === '[object HTMLCollection]') + && ('length' in value) + && (value.length === 0 || exports.node(value[0])); +}; + +/** + * Check if argument is a string. + * + * @param {Object} value + * @return {Boolean} + */ +exports.string = function(value) { + return typeof value === 'string' + || value instanceof String; +}; + +/** + * Check if argument is a function. + * + * @param {Object} value + * @return {Boolean} + */ +exports.fn = function(value) { + var type = Object.prototype.toString.call(value); + + return type === '[object Function]'; +}; + + +/***/ }), + +/***/ 370: +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { + +var is = __webpack_require__(879); +var delegate = __webpack_require__(438); + +/** + * Validates all params and calls the right + * listener function based on its target type. + * + * @param {String|HTMLElement|HTMLCollection|NodeList} target + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listen(target, type, callback) { + if (!target && !type && !callback) { + throw new Error('Missing required arguments'); + } + + if (!is.string(type)) { + throw new TypeError('Second argument must be a String'); + } + + if (!is.fn(callback)) { + throw new TypeError('Third argument must be a Function'); + } + + if (is.node(target)) { + return listenNode(target, type, callback); + } + else if (is.nodeList(target)) { + return listenNodeList(target, type, callback); + } + else if (is.string(target)) { + return listenSelector(target, type, callback); + } + else { + throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); + } +} + +/** + * Adds an event listener to a HTML element + * and returns a remove listener function. + * + * @param {HTMLElement} node + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listenNode(node, type, callback) { + node.addEventListener(type, callback); + + return { + destroy: function() { + node.removeEventListener(type, callback); + } + } +} + +/** + * Add an event listener to a list of HTML elements + * and returns a remove listener function. + * + * @param {NodeList|HTMLCollection} nodeList + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listenNodeList(nodeList, type, callback) { + Array.prototype.forEach.call(nodeList, function(node) { + node.addEventListener(type, callback); + }); + + return { + destroy: function() { + Array.prototype.forEach.call(nodeList, function(node) { + node.removeEventListener(type, callback); + }); + } + } +} + +/** + * Add an event listener to a selector + * and returns a remove listener function. + * + * @param {String} selector + * @param {String} type + * @param {Function} callback + * @return {Object} + */ +function listenSelector(selector, type, callback) { + return delegate(document.body, selector, type, callback); +} + +module.exports = listen; + + +/***/ }), + +/***/ 817: +/***/ (function(module) { + +function select(element) { + var selectedText; + + if (element.nodeName === 'SELECT') { + element.focus(); + + selectedText = element.value; + } + else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { + var isReadOnly = element.hasAttribute('readonly'); + + if (!isReadOnly) { + element.setAttribute('readonly', ''); + } + + element.select(); + element.setSelectionRange(0, element.value.length); + + if (!isReadOnly) { + element.removeAttribute('readonly'); + } + + selectedText = element.value; + } + else { + if (element.hasAttribute('contenteditable')) { + element.focus(); + } + + var selection = window.getSelection(); + var range = document.createRange(); + + range.selectNodeContents(element); + selection.removeAllRanges(); + selection.addRange(range); + + selectedText = selection.toString(); + } + + return selectedText; +} + +module.exports = select; + + +/***/ }), + +/***/ 279: +/***/ (function(module) { + +function E () { + // Keep this empty so it's easier to inherit from + // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3) +} + +E.prototype = { + on: function (name, callback, ctx) { + var e = this.e || (this.e = {}); + + (e[name] || (e[name] = [])).push({ + fn: callback, + ctx: ctx + }); + + return this; + }, + + once: function (name, callback, ctx) { + var self = this; + function listener () { + self.off(name, listener); + callback.apply(ctx, arguments); + }; + + listener._ = callback + return this.on(name, listener, ctx); + }, + + emit: function (name) { + var data = [].slice.call(arguments, 1); + var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); + var i = 0; + var len = evtArr.length; + + for (i; i < len; i++) { + evtArr[i].fn.apply(evtArr[i].ctx, data); + } + + return this; + }, + + off: function (name, callback) { + var e = this.e || (this.e = {}); + var evts = e[name]; + var liveEvents = []; + + if (evts && callback) { + for (var i = 0, len = evts.length; i < len; i++) { + if (evts[i].fn !== callback && evts[i].fn._ !== callback) + liveEvents.push(evts[i]); + } + } + + // Remove event from queue to prevent memory leak + // Suggested by https://github.com/lazd + // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910 + + (liveEvents.length) + ? e[name] = liveEvents + : delete e[name]; + + return this; + } +}; + +module.exports = E; +module.exports.TinyEmitter = E; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ if(__webpack_module_cache__[moduleId]) { +/******/ return __webpack_module_cache__[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ !function() { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function() { return module['default']; } : +/******/ function() { return module; }; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ !function() { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = function(exports, definition) { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ }(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ !function() { +/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } +/******/ }(); +/******/ +/************************************************************************/ +/******/ // module exports must be returned from runtime so entry inlining is disabled +/******/ // startup +/******/ // Load entry module and return exports +/******/ return __webpack_require__(686); +/******/ })() +.default; +}); \ No newline at end of file diff --git a/wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.min.js b/wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.min.js new file mode 100644 index 0000000..1103f81 --- /dev/null +++ b/wp-includes/lib/clipboard.js-2.0.11/dist/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1