diff options
author | Node.js GitHub Bot <github-bot@iojs.org> | 2023-01-31 01:51:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 00:51:13 +0000 |
commit | a8de8e204608523c0339a2e53886e95b8928966c (patch) | |
tree | 661d0b53a5e439d4bfe8639805018fe475d6a346 /tools/node_modules/eslint/node_modules/js-sdsl | |
parent | 9e7093f41609e00dbb64acfa9145f1b7b04429d1 (diff) | |
download | node-new-a8de8e204608523c0339a2e53886e95b8928966c.tar.gz |
tools: update eslint to 8.33.0
PR-URL: https://github.com/nodejs/node/pull/46400
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools/node_modules/eslint/node_modules/js-sdsl')
32 files changed, 2029 insertions, 2016 deletions
diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js index 3f17d9beba..387cb60366 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js @@ -69,7 +69,7 @@ class HashContainer extends _ContainerBase.Container { this.h = {}; this.h.L = this.h.B = this.p = this._ = this.h; } - K(t) { + V(t) { const {L: e, B: i} = t; e.B = i; i.L = e; @@ -160,7 +160,7 @@ class HashContainer extends _ContainerBase.Container { if (i === undefined) return false; delete this.g[t]; } - this.K(i); + this.V(i); return true; } eraseElementByIterator(t) { @@ -168,7 +168,7 @@ class HashContainer extends _ContainerBase.Container { if (e === this.h) { (0, _throwError.throwIteratorAccessError)(); } - this.K(e); + this.V(e); return t.next(); } eraseElementByPos(t) { @@ -179,7 +179,7 @@ class HashContainer extends _ContainerBase.Container { while (t--) { e = e.B; } - this.K(e); + this.V(e); return this.i; } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js index 2af65dff6f..7bbae243c4 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js @@ -19,6 +19,10 @@ function _interopRequireDefault(t) { } class HashMapIterator extends _Base.HashContainerIterator { + constructor(t, e, r, s) { + super(t, e, s); + this.container = r; + } get pointer() { if (this.o === this.h) { (0, _throwError.throwIteratorAccessError)(); @@ -38,7 +42,7 @@ class HashMapIterator extends _Base.HashContainerIterator { }); } copy() { - return new HashMapIterator(this.o, this.h, this.iteratorType); + return new HashMapIterator(this.o, this.h, this.container, this.iteratorType); } } @@ -51,16 +55,16 @@ class HashMap extends _Base.HashContainer { })); } begin() { - return new HashMapIterator(this.p, this.h); + return new HashMapIterator(this.p, this.h, this); } end() { - return new HashMapIterator(this.h, this.h); + return new HashMapIterator(this.h, this.h, this); } rBegin() { - return new HashMapIterator(this._, this.h, 1); + return new HashMapIterator(this._, this.h, this, 1); } rEnd() { - return new HashMapIterator(this.h, this.h, 1); + return new HashMapIterator(this.h, this.h, this, 1); } front() { if (this.i === 0) return; @@ -94,7 +98,7 @@ class HashMap extends _Base.HashContainer { } find(t, e) { const r = this.I(t, e); - return new HashMapIterator(r, this.h); + return new HashMapIterator(r, this.h, this); } forEach(t) { let e = 0; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js index 89290ae685..6c75f33865 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js @@ -11,6 +11,10 @@ var _Base = require("./Base"); var _throwError = require("../../utils/throwError"); class HashSetIterator extends _Base.HashContainerIterator { + constructor(t, e, r, s) { + super(t, e, s); + this.container = r; + } get pointer() { if (this.o === this.h) { (0, _throwError.throwIteratorAccessError)(); @@ -18,7 +22,7 @@ class HashSetIterator extends _Base.HashContainerIterator { return this.o.u; } copy() { - return new HashSetIterator(this.o, this.h, this.iteratorType); + return new HashSetIterator(this.o, this.h, this.container, this.iteratorType); } } @@ -31,16 +35,16 @@ class HashSet extends _Base.HashContainer { })); } begin() { - return new HashSetIterator(this.p, this.h); + return new HashSetIterator(this.p, this.h, this); } end() { - return new HashSetIterator(this.h, this.h); + return new HashSetIterator(this.h, this.h, this); } rBegin() { - return new HashSetIterator(this._, this.h, 1); + return new HashSetIterator(this._, this.h, this, 1); } rEnd() { - return new HashSetIterator(this.h, this.h, 1); + return new HashSetIterator(this.h, this.h, this, 1); } front() { return this.p.u; @@ -63,7 +67,7 @@ class HashSet extends _Base.HashContainer { } find(t, e) { const r = this.I(t, e); - return new HashSetIterator(r, this.h); + return new HashSetIterator(r, this.h, this); } forEach(t) { let e = 0; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js index 2053a5946c..cd09701fa1 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js @@ -8,36 +8,41 @@ exports.default = void 0; var _ContainerBase = require("../ContainerBase"); -var _Deque = _interopRequireDefault(require("../SequentialContainer/Deque")); - -function _interopRequireDefault(e) { - return e && e.t ? e : { - default: e - }; -} - class Queue extends _ContainerBase.Base { - constructor(e = []) { + constructor(t = []) { super(); - this.q = new _Deque.default(e); - this.i = this.q.size(); + this.j = 0; + this.q = []; + const s = this; + t.forEach((function(t) { + s.push(t); + })); } clear() { - this.q.clear(); - this.i = 0; + this.q = []; + this.i = this.j = 0; } - push(e) { - this.q.pushBack(e); - this.i += 1; - return this.i; + push(t) { + const s = this.q.length; + if (this.j / s > .5 && this.j + this.i >= s && s > 4096) { + const s = this.i; + for (let t = 0; t < s; ++t) { + this.q[t] = this.q[this.j + t]; + } + this.j = 0; + this.q[this.i] = t; + } else this.q[this.j + this.i] = t; + return ++this.i; } pop() { if (this.i === 0) return; + const t = this.q[this.j++]; this.i -= 1; - return this.q.popFront(); + return t; } front() { - return this.q.front(); + if (this.i === 0) return; + return this.q[this.j]; } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js index 74d2de7c38..509d2265fd 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js @@ -11,12 +11,9 @@ var _ContainerBase = require("../../ContainerBase"); var _throwError = require("../../../utils/throwError"); class RandomIterator extends _ContainerBase.ContainerIterator { - constructor(t, r, i, s, h) { - super(h); + constructor(t, r) { + super(r); this.o = t; - this.D = r; - this.R = i; - this.N = s; if (this.iteratorType === 0) { this.pre = function() { if (this.o === 0) { @@ -26,7 +23,7 @@ class RandomIterator extends _ContainerBase.ContainerIterator { return this; }; this.next = function() { - if (this.o === this.D()) { + if (this.o === this.container.size()) { (0, _throwError.throwIteratorAccessError)(); } this.o += 1; @@ -34,7 +31,7 @@ class RandomIterator extends _ContainerBase.ContainerIterator { }; } else { this.pre = function() { - if (this.o === this.D() - 1) { + if (this.o === this.container.size() - 1) { (0, _throwError.throwIteratorAccessError)(); } this.o += 1; @@ -50,16 +47,10 @@ class RandomIterator extends _ContainerBase.ContainerIterator { } } get pointer() { - if (this.o < 0 || this.o > this.D() - 1) { - throw new RangeError; - } - return this.R(this.o); + return this.container.getElementByPos(this.o); } set pointer(t) { - if (this.o < 0 || this.o > this.D() - 1) { - throw new RangeError; - } - this.N(this.o, t); + this.container.setElementByPos(this.o, t); } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js index d6e9cf916e..924b1b2b3c 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js @@ -17,136 +17,132 @@ function _interopRequireDefault(t) { } class DequeIterator extends _RandomIterator.RandomIterator { + constructor(t, i, s) { + super(t, s); + this.container = i; + } copy() { - return new DequeIterator(this.o, this.D, this.R, this.N, this.iteratorType); + return new DequeIterator(this.o, this.container, this.iteratorType); } } class Deque extends _Base.default { - constructor(t = [], s = 1 << 12) { + constructor(t = [], i = 1 << 12) { super(); - this.P = 0; - this.A = 0; - this.F = 0; this.j = 0; - this.O = 0; - this.T = []; - let i; - if ("size" in t) { - if (typeof t.size === "number") { - i = t.size; - } else { - i = t.size(); - } - } else if ("length" in t) { - i = t.length; - } else { - throw new RangeError("Can't get container's size!"); - } - this.V = s; - this.O = Math.max(Math.ceil(i / this.V), 1); - for (let t = 0; t < this.O; ++t) { - this.T.push(new Array(this.V)); + this.D = 0; + this.R = 0; + this.N = 0; + this.P = 0; + this.A = []; + const s = (() => { + if (typeof t.length === "number") return t.length; + if (typeof t.size === "number") return t.size; + if (typeof t.size === "function") return t.size(); + throw new TypeError("Cannot get the length or size of the container"); + })(); + this.F = i; + this.P = Math.max(Math.ceil(s / this.F), 1); + for (let t = 0; t < this.P; ++t) { + this.A.push(new Array(this.F)); } - const h = Math.ceil(i / this.V); - this.P = this.F = (this.O >> 1) - (h >> 1); - this.A = this.j = this.V - i % this.V >> 1; + const h = Math.ceil(s / this.F); + this.j = this.R = (this.P >> 1) - (h >> 1); + this.D = this.N = this.F - s % this.F >> 1; const e = this; t.forEach((function(t) { e.pushBack(t); })); - this.size = this.size.bind(this); - this.getElementByPos = this.getElementByPos.bind(this); - this.setElementByPos = this.setElementByPos.bind(this); } - G() { + T() { const t = []; - const s = Math.max(this.O >> 1, 1); - for (let i = 0; i < s; ++i) { - t[i] = new Array(this.V); + const i = Math.max(this.P >> 1, 1); + for (let s = 0; s < i; ++s) { + t[s] = new Array(this.F); } - for (let s = this.P; s < this.O; ++s) { - t[t.length] = this.T[s]; + for (let i = this.j; i < this.P; ++i) { + t[t.length] = this.A[i]; } - for (let s = 0; s < this.F; ++s) { - t[t.length] = this.T[s]; + for (let i = 0; i < this.R; ++i) { + t[t.length] = this.A[i]; } - t[t.length] = [ ...this.T[this.F] ]; - this.P = s; - this.F = t.length - 1; - for (let i = 0; i < s; ++i) { - t[t.length] = new Array(this.V); + t[t.length] = [ ...this.A[this.R] ]; + this.j = i; + this.R = t.length - 1; + for (let s = 0; s < i; ++s) { + t[t.length] = new Array(this.F); } - this.T = t; - this.O = t.length; + this.A = t; + this.P = t.length; } - J(t) { - const s = this.A + t + 1; - const i = s % this.V; - let h = i - 1; - let e = this.P + (s - i) / this.V; - if (i === 0) e -= 1; - e %= this.O; - if (h < 0) h += this.V; + O(t) { + const i = this.D + t + 1; + const s = i % this.F; + let h = s - 1; + let e = this.j + (i - s) / this.F; + if (s === 0) e -= 1; + e %= this.P; + if (h < 0) h += this.F; return { curNodeBucketIndex: e, curNodePointerIndex: h }; } clear() { - this.T = [ [] ]; - this.O = 1; - this.P = this.F = this.i = 0; - this.A = this.j = this.V >> 1; + this.A = [ new Array(this.F) ]; + this.P = 1; + this.j = this.R = this.i = 0; + this.D = this.N = this.F >> 1; } begin() { - return new DequeIterator(0, this.size, this.getElementByPos, this.setElementByPos); + return new DequeIterator(0, this); } end() { - return new DequeIterator(this.i, this.size, this.getElementByPos, this.setElementByPos); + return new DequeIterator(this.i, this); } rBegin() { - return new DequeIterator(this.i - 1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new DequeIterator(this.i - 1, this, 1); } rEnd() { - return new DequeIterator(-1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new DequeIterator(-1, this, 1); } front() { - return this.T[this.P][this.A]; + if (this.i === 0) return; + return this.A[this.j][this.D]; } back() { - return this.T[this.F][this.j]; + if (this.i === 0) return; + return this.A[this.R][this.N]; } pushBack(t) { if (this.i) { - if (this.j < this.V - 1) { - this.j += 1; - } else if (this.F < this.O - 1) { - this.F += 1; - this.j = 0; + if (this.N < this.F - 1) { + this.N += 1; + } else if (this.R < this.P - 1) { + this.R += 1; + this.N = 0; } else { - this.F = 0; - this.j = 0; + this.R = 0; + this.N = 0; } - if (this.F === this.P && this.j === this.A) this.G(); + if (this.R === this.j && this.N === this.D) this.T(); } this.i += 1; - this.T[this.F][this.j] = t; + this.A[this.R][this.N] = t; return this.i; } popBack() { if (this.i === 0) return; - const t = this.T[this.F][this.j]; - delete this.T[this.F][this.j]; + const t = this.A[this.R][this.N]; if (this.i !== 1) { - if (this.j > 0) { - this.j -= 1; - } else if (this.F > 0) { - this.F -= 1; - this.j = this.V - 1; + if (this.N > 0) { + this.N -= 1; + } else if (this.R > 0) { + this.R -= 1; + this.N = this.F - 1; } else { - this.F = this.O - 1; - this.j = this.V - 1; + this.R = this.P - 1; + this.N = this.F - 1; } } this.i -= 1; @@ -154,34 +150,33 @@ class Deque extends _Base.default { } pushFront(t) { if (this.i) { - if (this.A > 0) { - this.A -= 1; - } else if (this.P > 0) { - this.P -= 1; - this.A = this.V - 1; + if (this.D > 0) { + this.D -= 1; + } else if (this.j > 0) { + this.j -= 1; + this.D = this.F - 1; } else { - this.P = this.O - 1; - this.A = this.V - 1; + this.j = this.P - 1; + this.D = this.F - 1; } - if (this.P === this.F && this.A === this.j) this.G(); + if (this.j === this.R && this.D === this.N) this.T(); } this.i += 1; - this.T[this.P][this.A] = t; + this.A[this.j][this.D] = t; return this.i; } popFront() { if (this.i === 0) return; - const t = this.T[this.P][this.A]; - delete this.T[this.P][this.A]; + const t = this.A[this.j][this.D]; if (this.i !== 1) { - if (this.A < this.V - 1) { - this.A += 1; - } else if (this.P < this.O - 1) { - this.P += 1; - this.A = 0; + if (this.D < this.F - 1) { + this.D += 1; + } else if (this.j < this.P - 1) { + this.j += 1; + this.D = 0; } else { - this.P = 0; - this.A = 0; + this.j = 0; + this.D = 0; } } this.i -= 1; @@ -191,31 +186,31 @@ class Deque extends _Base.default { if (t < 0 || t > this.i - 1) { throw new RangeError; } - const {curNodeBucketIndex: s, curNodePointerIndex: i} = this.J(t); - return this.T[s][i]; + const {curNodeBucketIndex: i, curNodePointerIndex: s} = this.O(t); + return this.A[i][s]; } - setElementByPos(t, s) { + setElementByPos(t, i) { if (t < 0 || t > this.i - 1) { throw new RangeError; } - const {curNodeBucketIndex: i, curNodePointerIndex: h} = this.J(t); - this.T[i][h] = s; + const {curNodeBucketIndex: s, curNodePointerIndex: h} = this.O(t); + this.A[s][h] = i; } - insert(t, s, i = 1) { + insert(t, i, s = 1) { if (t < 0 || t > this.i) { throw new RangeError; } if (t === 0) { - while (i--) this.pushFront(s); + while (s--) this.pushFront(i); } else if (t === this.i) { - while (i--) this.pushBack(s); + while (s--) this.pushBack(i); } else { const h = []; - for (let s = t; s < this.i; ++s) { - h.push(this.getElementByPos(s)); + for (let i = t; i < this.i; ++i) { + h.push(this.getElementByPos(i)); } this.cut(t - 1); - for (let t = 0; t < i; ++t) this.pushBack(s); + for (let t = 0; t < s; ++t) this.pushBack(i); for (let t = 0; t < h.length; ++t) this.pushBack(h[t]); } return this.i; @@ -225,9 +220,9 @@ class Deque extends _Base.default { this.clear(); return 0; } - const {curNodeBucketIndex: s, curNodePointerIndex: i} = this.J(t); - this.F = s; - this.j = i; + const {curNodeBucketIndex: i, curNodePointerIndex: s} = this.O(t); + this.R = i; + this.N = s; this.i = t + 1; return this.i; } @@ -236,53 +231,53 @@ class Deque extends _Base.default { throw new RangeError; } if (t === 0) this.popFront(); else if (t === this.i - 1) this.popBack(); else { - const s = []; - for (let i = t + 1; i < this.i; ++i) { - s.push(this.getElementByPos(i)); + const i = []; + for (let s = t + 1; s < this.i; ++s) { + i.push(this.getElementByPos(s)); } this.cut(t); this.popBack(); - const i = this; - s.forEach((function(t) { - i.pushBack(t); + const s = this; + i.forEach((function(t) { + s.pushBack(t); })); } return this.i; } eraseElementByValue(t) { if (this.i === 0) return 0; - const s = []; - for (let i = 0; i < this.i; ++i) { - const h = this.getElementByPos(i); - if (h !== t) s.push(h); + const i = []; + for (let s = 0; s < this.i; ++s) { + const h = this.getElementByPos(s); + if (h !== t) i.push(h); } - const i = s.length; - for (let t = 0; t < i; ++t) this.setElementByPos(t, s[t]); - return this.cut(i - 1); + const s = i.length; + for (let t = 0; t < s; ++t) this.setElementByPos(t, i[t]); + return this.cut(s - 1); } eraseElementByIterator(t) { - const s = t.o; - this.eraseElementByPos(s); + const i = t.o; + this.eraseElementByPos(i); t = t.next(); return t; } find(t) { - for (let s = 0; s < this.i; ++s) { - if (this.getElementByPos(s) === t) { - return new DequeIterator(s, this.size, this.getElementByPos, this.setElementByPos); + for (let i = 0; i < this.i; ++i) { + if (this.getElementByPos(i) === t) { + return new DequeIterator(i, this); } } return this.end(); } reverse() { let t = 0; - let s = this.i - 1; - while (t < s) { - const i = this.getElementByPos(t); - this.setElementByPos(t, this.getElementByPos(s)); - this.setElementByPos(s, i); + let i = this.i - 1; + while (t < i) { + const s = this.getElementByPos(t); + this.setElementByPos(t, this.getElementByPos(i)); + this.setElementByPos(i, s); t += 1; - s -= 1; + i -= 1; } } unique() { @@ -290,11 +285,11 @@ class Deque extends _Base.default { return this.i; } let t = 1; - let s = this.getElementByPos(0); - for (let i = 1; i < this.i; ++i) { - const h = this.getElementByPos(i); - if (h !== s) { - s = h; + let i = this.getElementByPos(0); + for (let s = 1; s < this.i; ++s) { + const h = this.getElementByPos(s); + if (h !== i) { + i = h; this.setElementByPos(t++, h); } } @@ -302,30 +297,30 @@ class Deque extends _Base.default { return this.i; } sort(t) { - const s = []; + const i = []; for (let t = 0; t < this.i; ++t) { - s.push(this.getElementByPos(t)); + i.push(this.getElementByPos(t)); } - s.sort(t); - for (let t = 0; t < this.i; ++t) this.setElementByPos(t, s[t]); + i.sort(t); + for (let t = 0; t < this.i; ++t) this.setElementByPos(t, i[t]); } shrinkToFit() { if (this.i === 0) return; const t = []; - this.forEach((function(s) { - t.push(s); + this.forEach((function(i) { + t.push(i); })); - this.O = Math.max(Math.ceil(this.i / this.V), 1); - this.i = this.P = this.F = this.A = this.j = 0; - this.T = []; - for (let t = 0; t < this.O; ++t) { - this.T.push(new Array(this.V)); + this.P = Math.max(Math.ceil(this.i / this.F), 1); + this.i = this.j = this.R = this.D = this.N = 0; + this.A = []; + for (let t = 0; t < this.P; ++t) { + this.A.push(new Array(this.F)); } - for (let s = 0; s < t.length; ++s) this.pushBack(t[s]); + for (let i = 0; i < t.length; ++i) this.pushBack(t[i]); } forEach(t) { - for (let s = 0; s < this.i; ++s) { - t(this.getElementByPos(s), s, this); + for (let i = 0; i < this.i; ++i) { + t(this.getElementByPos(i), i, this); } } [Symbol.iterator]() { diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js index 6587ea6edb..068a8573d0 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js @@ -19,10 +19,11 @@ function _interopRequireDefault(t) { } class LinkListIterator extends _ContainerBase.ContainerIterator { - constructor(t, i, s) { - super(s); + constructor(t, i, s, r) { + super(r); this.o = t; this.h = i; + this.container = s; if (this.iteratorType === 0) { this.pre = function() { if (this.o.L === this.h) { @@ -68,7 +69,7 @@ class LinkListIterator extends _ContainerBase.ContainerIterator { this.o.l = t; } copy() { - return new LinkListIterator(this.o, this.h, this.iteratorType); + return new LinkListIterator(this.o, this.h, this.container, this.iteratorType); } } @@ -82,7 +83,7 @@ class LinkList extends _Base.default { i.pushBack(t); })); } - K(t) { + V(t) { const {L: i, B: s} = t; i.B = s; s.L = i; @@ -94,7 +95,7 @@ class LinkList extends _Base.default { } this.i -= 1; } - U(t, i) { + G(t, i) { const s = i.B; const r = { l: t, @@ -116,16 +117,16 @@ class LinkList extends _Base.default { this.p = this._ = this.h.L = this.h.B = this.h; } begin() { - return new LinkListIterator(this.p, this.h); + return new LinkListIterator(this.p, this.h, this); } end() { - return new LinkListIterator(this.h, this.h); + return new LinkListIterator(this.h, this.h, this); } rBegin() { - return new LinkListIterator(this._, this.h, 1); + return new LinkListIterator(this._, this.h, this, 1); } rEnd() { - return new LinkListIterator(this.h, this.h, 1); + return new LinkListIterator(this.h, this.h, this, 1); } front() { return this.p.l; @@ -151,14 +152,14 @@ class LinkList extends _Base.default { while (t--) { i = i.B; } - this.K(i); + this.V(i); return this.i; } eraseElementByValue(t) { let i = this.p; while (i !== this.h) { if (i.l === t) { - this.K(i); + this.V(i); } i = i.B; } @@ -170,27 +171,27 @@ class LinkList extends _Base.default { (0, _throwError.throwIteratorAccessError)(); } t = t.next(); - this.K(i); + this.V(i); return t; } pushBack(t) { - this.U(t, this._); + this.G(t, this._); return this.i; } popBack() { if (this.i === 0) return; const t = this._.l; - this.K(this._); + this.V(this._); return t; } pushFront(t) { - this.U(t, this.h); + this.G(t, this.h); return this.i; } popFront() { if (this.i === 0) return; const t = this.p.l; - this.K(this.p); + this.V(this.p); return t; } setElementByPos(t, i) { @@ -236,7 +237,7 @@ class LinkList extends _Base.default { let i = this.p; while (i !== this.h) { if (i.l === t) { - return new LinkListIterator(i, this.h); + return new LinkListIterator(i, this.h, this); } i = i.B; } @@ -298,7 +299,7 @@ class LinkList extends _Base.default { while (s !== i.h && s.l <= t) { s = s.B; } - i.U(t, s.L); + i.G(t, s.L); })); } return this.i; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js index bcd8c29bc5..b61d3a9192 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js @@ -17,8 +17,12 @@ function _interopRequireDefault(t) { } class VectorIterator extends _RandomIterator.RandomIterator { + constructor(t, r, e) { + super(t, e); + this.container = r; + } copy() { - return new VectorIterator(this.o, this.D, this.R, this.N, this.iteratorType); + return new VectorIterator(this.o, this.container, this.iteratorType); } } @@ -26,63 +30,60 @@ class Vector extends _Base.default { constructor(t = [], r = true) { super(); if (Array.isArray(t)) { - this.W = r ? [ ...t ] : t; + this.J = r ? [ ...t ] : t; this.i = t.length; } else { - this.W = []; + this.J = []; const r = this; t.forEach((function(t) { r.pushBack(t); })); } - this.size = this.size.bind(this); - this.getElementByPos = this.getElementByPos.bind(this); - this.setElementByPos = this.setElementByPos.bind(this); } clear() { this.i = 0; - this.W.length = 0; + this.J.length = 0; } begin() { - return new VectorIterator(0, this.size, this.getElementByPos, this.setElementByPos); + return new VectorIterator(0, this); } end() { - return new VectorIterator(this.i, this.size, this.getElementByPos, this.setElementByPos); + return new VectorIterator(this.i, this); } rBegin() { - return new VectorIterator(this.i - 1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new VectorIterator(this.i - 1, this, 1); } rEnd() { - return new VectorIterator(-1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new VectorIterator(-1, this, 1); } front() { - return this.W[0]; + return this.J[0]; } back() { - return this.W[this.i - 1]; + return this.J[this.i - 1]; } getElementByPos(t) { if (t < 0 || t > this.i - 1) { throw new RangeError; } - return this.W[t]; + return this.J[t]; } eraseElementByPos(t) { if (t < 0 || t > this.i - 1) { throw new RangeError; } - this.W.splice(t, 1); + this.J.splice(t, 1); this.i -= 1; return this.i; } eraseElementByValue(t) { let r = 0; for (let e = 0; e < this.i; ++e) { - if (this.W[e] !== t) { - this.W[r++] = this.W[e]; + if (this.J[e] !== t) { + this.J[r++] = this.J[e]; } } - this.i = this.W.length = r; + this.i = this.J.length = r; return this.i; } eraseElementByIterator(t) { @@ -92,61 +93,61 @@ class Vector extends _Base.default { return t; } pushBack(t) { - this.W.push(t); + this.J.push(t); this.i += 1; return this.i; } popBack() { if (this.i === 0) return; this.i -= 1; - return this.W.pop(); + return this.J.pop(); } setElementByPos(t, r) { if (t < 0 || t > this.i - 1) { throw new RangeError; } - this.W[t] = r; + this.J[t] = r; } insert(t, r, e = 1) { if (t < 0 || t > this.i) { throw new RangeError; } - this.W.splice(t, 0, ...new Array(e).fill(r)); + this.J.splice(t, 0, ...new Array(e).fill(r)); this.i += e; return this.i; } find(t) { for (let r = 0; r < this.i; ++r) { - if (this.W[r] === t) { - return new VectorIterator(r, this.size, this.getElementByPos, this.getElementByPos); + if (this.J[r] === t) { + return new VectorIterator(r, this); } } return this.end(); } reverse() { - this.W.reverse(); + this.J.reverse(); } unique() { let t = 1; for (let r = 1; r < this.i; ++r) { - if (this.W[r] !== this.W[r - 1]) { - this.W[t++] = this.W[r]; + if (this.J[r] !== this.J[r - 1]) { + this.J[t++] = this.J[r]; } } - this.i = this.W.length = t; + this.i = this.J.length = t; return this.i; } sort(t) { - this.W.sort(t); + this.J.sort(t); } forEach(t) { for (let r = 0; r < this.i; ++r) { - t(this.W[r], r, this); + t(this.J[r], r, this); } } [Symbol.iterator]() { return function*() { - yield* this.W; + yield* this.J; }.bind(this)(); } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js index d0e2f00e04..f238b856b0 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js @@ -17,7 +17,7 @@ class TreeIterator extends _ContainerBase.ContainerIterator { this.h = r; if (this.iteratorType === 0) { this.pre = function() { - if (this.o === this.h.Y) { + if (this.o === this.h.U) { (0, _throwError.throwIteratorAccessError)(); } this.o = this.o.L(); @@ -32,7 +32,7 @@ class TreeIterator extends _ContainerBase.ContainerIterator { }; } else { this.pre = function() { - if (this.o === this.h.Z) { + if (this.o === this.h.W) { (0, _throwError.throwIteratorAccessError)(); } this.o = this.o.B(); @@ -57,15 +57,15 @@ class TreeIterator extends _ContainerBase.ContainerIterator { return 0; } let i = 0; - if (t.Y) { - i += t.Y.rt; + if (t.U) { + i += t.U.rt; } while (t !== r) { const r = t.tt; - if (t === r.Z) { + if (t === r.W) { i += 1; - if (r.Y) { - i += r.Y.rt; + if (r.U) { + i += r.U.rt; } } t = r; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js index a2687c0b2a..108fcf1fb6 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js @@ -11,8 +11,8 @@ class TreeNode { this.ee = 1; this.u = undefined; this.l = undefined; - this.Y = undefined; - this.Z = undefined; + this.U = undefined; + this.W = undefined; this.tt = undefined; this.u = e; this.l = t; @@ -20,15 +20,15 @@ class TreeNode { L() { let e = this; if (e.ee === 1 && e.tt.tt === e) { - e = e.Z; - } else if (e.Y) { - e = e.Y; - while (e.Z) { - e = e.Z; + e = e.W; + } else if (e.U) { + e = e.U; + while (e.W) { + e = e.W; } } else { let t = e.tt; - while (t.Y === e) { + while (t.U === e) { e = t; t = e.tt; } @@ -38,44 +38,44 @@ class TreeNode { } B() { let e = this; - if (e.Z) { - e = e.Z; - while (e.Y) { - e = e.Y; + if (e.W) { + e = e.W; + while (e.U) { + e = e.U; } return e; } else { let t = e.tt; - while (t.Z === e) { + while (t.W === e) { e = t; t = e.tt; } - if (e.Z !== t) { + if (e.W !== t) { return t; } else return e; } } te() { const e = this.tt; - const t = this.Z; - const s = t.Y; - if (e.tt === this) e.tt = t; else if (e.Y === this) e.Y = t; else e.Z = t; + const t = this.W; + const s = t.U; + if (e.tt === this) e.tt = t; else if (e.U === this) e.U = t; else e.W = t; t.tt = e; - t.Y = this; + t.U = this; this.tt = t; - this.Z = s; + this.W = s; if (s) s.tt = this; return t; } se() { const e = this.tt; - const t = this.Y; - const s = t.Z; - if (e.tt === this) e.tt = t; else if (e.Y === this) e.Y = t; else e.Z = t; + const t = this.U; + const s = t.W; + if (e.tt === this) e.tt = t; else if (e.U === this) e.U = t; else e.W = t; t.tt = e; - t.Z = this; + t.W = this; this.tt = t; - this.Y = s; + this.U = s; if (s) s.tt = this; return t; } @@ -102,11 +102,11 @@ class TreeNodeEnableIndex extends TreeNode { } ie() { this.rt = 1; - if (this.Y) { - this.rt += this.Y.rt; + if (this.U) { + this.rt += this.U.rt; } - if (this.Z) { - this.rt += this.Z.rt; + if (this.W) { + this.rt += this.W.rt; } } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js index 93da412852..1ba0069296 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js @@ -19,7 +19,7 @@ class TreeContainer extends _ContainerBase.Container { return 0; }, t = false) { super(); - this.rr = undefined; + this.Y = undefined; this.v = e; if (t) { this.re = _TreeNode.TreeNodeEnableIndex; @@ -41,7 +41,7 @@ class TreeContainer extends _ContainerBase.Container { } return this.i; }; - this.K = function(e) { + this.V = function(e) { let t = this.fe(e); while (t !== this.h) { t.rt -= 1; @@ -55,58 +55,58 @@ class TreeContainer extends _ContainerBase.Container { if (s) this.he(s); return this.i; }; - this.K = this.fe; + this.V = this.fe; } this.h = new this.re; } - $(e, t) { + X(e, t) { let i = this.h; while (e) { const s = this.v(e.u, t); if (s < 0) { - e = e.Z; + e = e.W; } else if (s > 0) { i = e; - e = e.Y; + e = e.U; } else return e; } return i; } - er(e, t) { + Z(e, t) { let i = this.h; while (e) { const s = this.v(e.u, t); if (s <= 0) { - e = e.Z; + e = e.W; } else { i = e; - e = e.Y; + e = e.U; } } return i; } - tr(e, t) { + $(e, t) { let i = this.h; while (e) { const s = this.v(e.u, t); if (s < 0) { i = e; - e = e.Z; + e = e.W; } else if (s > 0) { - e = e.Y; + e = e.U; } else return e; } return i; } - sr(e, t) { + rr(e, t) { let i = this.h; while (e) { const s = this.v(e.u, t); if (s < 0) { i = e; - e = e.Z; + e = e.W; } else { - e = e.Y; + e = e.U; } } return i; @@ -119,26 +119,26 @@ class TreeContainer extends _ContainerBase.Container { e.ee = 0; return; } - if (e === t.Y) { - const i = t.Z; + if (e === t.U) { + const i = t.W; if (i.ee === 1) { i.ee = 0; t.ee = 1; - if (t === this.rr) { - this.rr = t.te(); + if (t === this.Y) { + this.Y = t.te(); } else t.te(); } else { - if (i.Z && i.Z.ee === 1) { + if (i.W && i.W.ee === 1) { i.ee = t.ee; t.ee = 0; - i.Z.ee = 0; - if (t === this.rr) { - this.rr = t.te(); + i.W.ee = 0; + if (t === this.Y) { + this.Y = t.te(); } else t.te(); return; - } else if (i.Y && i.Y.ee === 1) { + } else if (i.U && i.U.ee === 1) { i.ee = 1; - i.Y.ee = 0; + i.U.ee = 0; i.se(); } else { i.ee = 1; @@ -146,25 +146,25 @@ class TreeContainer extends _ContainerBase.Container { } } } else { - const i = t.Y; + const i = t.U; if (i.ee === 1) { i.ee = 0; t.ee = 1; - if (t === this.rr) { - this.rr = t.se(); + if (t === this.Y) { + this.Y = t.se(); } else t.se(); } else { - if (i.Y && i.Y.ee === 1) { + if (i.U && i.U.ee === 1) { i.ee = t.ee; t.ee = 0; - i.Y.ee = 0; - if (t === this.rr) { - this.rr = t.se(); + i.U.ee = 0; + if (t === this.Y) { + this.Y = t.se(); } else t.se(); return; - } else if (i.Z && i.Z.ee === 1) { + } else if (i.W && i.W.ee === 1) { i.ee = 1; - i.Z.ee = 0; + i.W.ee = 0; i.te(); } else { i.ee = 1; @@ -180,67 +180,67 @@ class TreeContainer extends _ContainerBase.Container { return this.h; } let t = e; - while (t.Y || t.Z) { - if (t.Z) { - t = t.Z; - while (t.Y) t = t.Y; + while (t.U || t.W) { + if (t.W) { + t = t.W; + while (t.U) t = t.U; } else { - t = t.Y; + t = t.U; } [e.u, t.u] = [ t.u, e.u ]; [e.l, t.l] = [ t.l, e.l ]; e = t; } - if (this.h.Y === t) { - this.h.Y = t.tt; - } else if (this.h.Z === t) { - this.h.Z = t.tt; + if (this.h.U === t) { + this.h.U = t.tt; + } else if (this.h.W === t) { + this.h.W = t.tt; } this.ue(t); const i = t.tt; - if (t === i.Y) { - i.Y = undefined; - } else i.Z = undefined; + if (t === i.U) { + i.U = undefined; + } else i.W = undefined; this.i -= 1; - this.rr.ee = 0; + this.Y.ee = 0; return i; } oe(e, t) { if (e === undefined) return false; - const i = this.oe(e.Y, t); + const i = this.oe(e.U, t); if (i) return true; if (t(e)) return true; - return this.oe(e.Z, t); + return this.oe(e.W, t); } he(e) { while (true) { const t = e.tt; if (t.ee === 0) return; const i = t.tt; - if (t === i.Y) { - const s = i.Z; + if (t === i.U) { + const s = i.W; if (s && s.ee === 1) { s.ee = t.ee = 0; - if (i === this.rr) return; + if (i === this.Y) return; i.ee = 1; e = i; continue; - } else if (e === t.Z) { + } else if (e === t.W) { e.ee = 0; - if (e.Y) e.Y.tt = t; - if (e.Z) e.Z.tt = i; - t.Z = e.Y; - i.Y = e.Z; - e.Y = t; - e.Z = i; - if (i === this.rr) { - this.rr = e; + if (e.U) e.U.tt = t; + if (e.W) e.W.tt = i; + t.W = e.U; + i.U = e.W; + e.U = t; + e.W = i; + if (i === this.Y) { + this.Y = e; this.h.tt = e; } else { const t = i.tt; - if (t.Y === i) { - t.Y = e; - } else t.Z = e; + if (t.U === i) { + t.U = e; + } else t.W = e; } e.tt = i.tt; t.tt = e; @@ -253,35 +253,35 @@ class TreeContainer extends _ContainerBase.Container { }; } else { t.ee = 0; - if (i === this.rr) { - this.rr = i.se(); + if (i === this.Y) { + this.Y = i.se(); } else i.se(); i.ee = 1; } } else { - const s = i.Y; + const s = i.U; if (s && s.ee === 1) { s.ee = t.ee = 0; - if (i === this.rr) return; + if (i === this.Y) return; i.ee = 1; e = i; continue; - } else if (e === t.Y) { + } else if (e === t.U) { e.ee = 0; - if (e.Y) e.Y.tt = i; - if (e.Z) e.Z.tt = t; - i.Z = e.Y; - t.Y = e.Z; - e.Y = i; - e.Z = t; - if (i === this.rr) { - this.rr = e; + if (e.U) e.U.tt = i; + if (e.W) e.W.tt = t; + i.W = e.U; + t.U = e.W; + e.U = i; + e.W = t; + if (i === this.Y) { + this.Y = e; this.h.tt = e; } else { const t = i.tt; - if (t.Y === i) { - t.Y = e; - } else t.Z = e; + if (t.U === i) { + t.U = e; + } else t.W = e; } e.tt = i.tt; t.tt = e; @@ -294,8 +294,8 @@ class TreeContainer extends _ContainerBase.Container { }; } else { t.ee = 0; - if (i === this.rr) { - this.rr = i.te(); + if (i === this.Y) { + this.Y = i.te(); } else i.te(); i.ee = 1; } @@ -304,38 +304,38 @@ class TreeContainer extends _ContainerBase.Container { } } ne(e, t, i) { - if (this.rr === undefined) { + if (this.Y === undefined) { this.i += 1; - this.rr = new this.re(e, t); - this.rr.ee = 0; - this.rr.tt = this.h; - this.h.tt = this.rr; - this.h.Y = this.rr; - this.h.Z = this.rr; + this.Y = new this.re(e, t); + this.Y.ee = 0; + this.Y.tt = this.h; + this.h.tt = this.Y; + this.h.U = this.Y; + this.h.W = this.Y; return; } let s; - const r = this.h.Y; + const r = this.h.U; const n = this.v(r.u, e); if (n === 0) { r.l = t; return; } else if (n > 0) { - r.Y = new this.re(e, t); - r.Y.tt = r; - s = r.Y; - this.h.Y = s; + r.U = new this.re(e, t); + r.U.tt = r; + s = r.U; + this.h.U = s; } else { - const r = this.h.Z; + const r = this.h.W; const n = this.v(r.u, e); if (n === 0) { r.l = t; return; } else if (n < 0) { - r.Z = new this.re(e, t); - r.Z.tt = r; - s = r.Z; - this.h.Z = s; + r.W = new this.re(e, t); + r.W.tt = r; + s = r.W; + this.h.W = s; } else { if (i !== undefined) { const r = i.o; @@ -352,11 +352,11 @@ class TreeContainer extends _ContainerBase.Container { return; } else if (n < 0) { s = new this.re(e, t); - if (i.Z === undefined) { - i.Z = s; + if (i.W === undefined) { + i.W = s; s.tt = i; } else { - r.Y = s; + r.U = s; s.tt = r; } } @@ -364,25 +364,25 @@ class TreeContainer extends _ContainerBase.Container { } } if (s === undefined) { - s = this.rr; + s = this.Y; while (true) { const i = this.v(s.u, e); if (i > 0) { - if (s.Y === undefined) { - s.Y = new this.re(e, t); - s.Y.tt = s; - s = s.Y; + if (s.U === undefined) { + s.U = new this.re(e, t); + s.U.tt = s; + s = s.U; break; } - s = s.Y; + s = s.U; } else if (i < 0) { - if (s.Z === undefined) { - s.Z = new this.re(e, t); - s.Z.tt = s; - s = s.Z; + if (s.W === undefined) { + s.W = new this.re(e, t); + s.W.tt = s; + s = s.W; break; } - s = s.Z; + s = s.W; } else { s.l = t; return; @@ -398,18 +398,18 @@ class TreeContainer extends _ContainerBase.Container { while (e) { const i = this.v(e.u, t); if (i < 0) { - e = e.Z; + e = e.W; } else if (i > 0) { - e = e.Y; + e = e.U; } else return e; } return e || this.h; } clear() { this.i = 0; - this.rr = undefined; + this.Y = undefined; this.h.tt = undefined; - this.h.Y = this.h.Z = undefined; + this.h.U = this.h.W = undefined; } updateKeyByIterator(e, t) { const i = e.o; @@ -420,14 +420,14 @@ class TreeContainer extends _ContainerBase.Container { i.u = t; return true; } - if (i === this.h.Y) { + if (i === this.h.U) { if (this.v(i.B().u, t) > 0) { i.u = t; return true; } return false; } - if (i === this.h.Z) { + if (i === this.h.W) { if (this.v(i.L().u, t) < 0) { i.u = t; return true; @@ -447,9 +447,9 @@ class TreeContainer extends _ContainerBase.Container { } let t = 0; const i = this; - this.oe(this.rr, (function(s) { + this.oe(this.Y, (function(s) { if (e === t) { - i.K(s); + i.V(s); return true; } t += 1; @@ -459,9 +459,9 @@ class TreeContainer extends _ContainerBase.Container { } eraseElementByKey(e) { if (this.i === 0) return false; - const t = this.I(this.rr, e); + const t = this.I(this.Y, e); if (t === this.h) return false; - this.K(t); + this.V(t); return true; } eraseElementByIterator(e) { @@ -469,14 +469,14 @@ class TreeContainer extends _ContainerBase.Container { if (t === this.h) { (0, _throwError.throwIteratorAccessError)(); } - const i = t.Z === undefined; + const i = t.W === undefined; const s = e.iteratorType === 0; if (s) { if (i) e.next(); } else { - if (!i || t.Y === undefined) e.next(); + if (!i || t.U === undefined) e.next(); } - this.K(t); + this.V(t); return e; } forEach(e) { @@ -502,9 +502,9 @@ class TreeContainer extends _ContainerBase.Container { if (this.i === 0) return 0; const traversal = function(e) { if (!e) return 0; - return Math.max(traversal(e.Y), traversal(e.Z)) + 1; + return Math.max(traversal(e.U), traversal(e.W)) + 1; }; - return traversal(this.rr); + return traversal(this.Y); } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js index e1eb4ae63c..79fdc0280f 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js @@ -19,17 +19,21 @@ function _interopRequireDefault(r) { } class OrderedMapIterator extends _TreeIterator.default { + constructor(r, t, e, s) { + super(r, t, s); + this.container = e; + } get pointer() { if (this.o === this.h) { (0, _throwError.throwIteratorAccessError)(); } const r = this; return new Proxy([], { - get(e, t) { - if (t === "0") return r.o.u; else if (t === "1") return r.o.l; + get(t, e) { + if (e === "0") return r.o.u; else if (e === "1") return r.o.l; }, - set(e, t, s) { - if (t !== "1") { + set(t, e, s) { + if (e !== "1") { throw new TypeError("props must be 1"); } r.o.l = s; @@ -38,82 +42,82 @@ class OrderedMapIterator extends _TreeIterator.default { }); } copy() { - return new OrderedMapIterator(this.o, this.h, this.iteratorType); + return new OrderedMapIterator(this.o, this.h, this.container, this.iteratorType); } } class OrderedMap extends _Base.default { - constructor(r = [], e, t) { - super(e, t); + constructor(r = [], t, e) { + super(t, e); const s = this; r.forEach((function(r) { s.setElement(r[0], r[1]); })); } - * X(r) { + * K(r) { if (r === undefined) return; - yield* this.X(r.Y); + yield* this.K(r.U); yield [ r.u, r.l ]; - yield* this.X(r.Z); + yield* this.K(r.W); } begin() { - return new OrderedMapIterator(this.h.Y || this.h, this.h); + return new OrderedMapIterator(this.h.U || this.h, this.h, this); } end() { - return new OrderedMapIterator(this.h, this.h); + return new OrderedMapIterator(this.h, this.h, this); } rBegin() { - return new OrderedMapIterator(this.h.Z || this.h, this.h, 1); + return new OrderedMapIterator(this.h.W || this.h, this.h, this, 1); } rEnd() { - return new OrderedMapIterator(this.h, this.h, 1); + return new OrderedMapIterator(this.h, this.h, this, 1); } front() { if (this.i === 0) return; - const r = this.h.Y; + const r = this.h.U; return [ r.u, r.l ]; } back() { if (this.i === 0) return; - const r = this.h.Z; + const r = this.h.W; return [ r.u, r.l ]; } lowerBound(r) { - const e = this.$(this.rr, r); - return new OrderedMapIterator(e, this.h); + const t = this.X(this.Y, r); + return new OrderedMapIterator(t, this.h, this); } upperBound(r) { - const e = this.er(this.rr, r); - return new OrderedMapIterator(e, this.h); + const t = this.Z(this.Y, r); + return new OrderedMapIterator(t, this.h, this); } reverseLowerBound(r) { - const e = this.tr(this.rr, r); - return new OrderedMapIterator(e, this.h); + const t = this.$(this.Y, r); + return new OrderedMapIterator(t, this.h, this); } reverseUpperBound(r) { - const e = this.sr(this.rr, r); - return new OrderedMapIterator(e, this.h); + const t = this.rr(this.Y, r); + return new OrderedMapIterator(t, this.h, this); } - setElement(r, e, t) { - return this.M(r, e, t); + setElement(r, t, e) { + return this.M(r, t, e); } find(r) { - const e = this.I(this.rr, r); - return new OrderedMapIterator(e, this.h); + const t = this.I(this.Y, r); + return new OrderedMapIterator(t, this.h, this); } getElementByKey(r) { - const e = this.I(this.rr, r); - return e.l; + const t = this.I(this.Y, r); + return t.l; } union(r) { - const e = this; + const t = this; r.forEach((function(r) { - e.setElement(r[0], r[1]); + t.setElement(r[0], r[1]); })); return this.i; } [Symbol.iterator]() { - return this.X(this.rr); + return this.K(this.Y); } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js index c668f28bfc..c7af14df26 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js @@ -19,6 +19,10 @@ function _interopRequireDefault(e) { } class OrderedSetIterator extends _TreeIterator.default { + constructor(e, t, r, i) { + super(e, t, i); + this.container = r; + } get pointer() { if (this.o === this.h) { (0, _throwError.throwIteratorAccessError)(); @@ -26,74 +30,74 @@ class OrderedSetIterator extends _TreeIterator.default { return this.o.u; } copy() { - return new OrderedSetIterator(this.o, this.h, this.iteratorType); + return new OrderedSetIterator(this.o, this.h, this.container, this.iteratorType); } } class OrderedSet extends _Base.default { - constructor(e = [], r, t) { - super(r, t); + constructor(e = [], t, r) { + super(t, r); const i = this; e.forEach((function(e) { i.insert(e); })); } - * X(e) { + * K(e) { if (e === undefined) return; - yield* this.X(e.Y); + yield* this.K(e.U); yield e.u; - yield* this.X(e.Z); + yield* this.K(e.W); } begin() { - return new OrderedSetIterator(this.h.Y || this.h, this.h); + return new OrderedSetIterator(this.h.U || this.h, this.h, this); } end() { - return new OrderedSetIterator(this.h, this.h); + return new OrderedSetIterator(this.h, this.h, this); } rBegin() { - return new OrderedSetIterator(this.h.Z || this.h, this.h, 1); + return new OrderedSetIterator(this.h.W || this.h, this.h, this, 1); } rEnd() { - return new OrderedSetIterator(this.h, this.h, 1); + return new OrderedSetIterator(this.h, this.h, this, 1); } front() { - return this.h.Y ? this.h.Y.u : undefined; + return this.h.U ? this.h.U.u : undefined; } back() { - return this.h.Z ? this.h.Z.u : undefined; + return this.h.W ? this.h.W.u : undefined; } - insert(e, r) { - return this.M(e, undefined, r); + insert(e, t) { + return this.M(e, undefined, t); } find(e) { - const r = this.I(this.rr, e); - return new OrderedSetIterator(r, this.h); + const t = this.I(this.Y, e); + return new OrderedSetIterator(t, this.h, this); } lowerBound(e) { - const r = this.$(this.rr, e); - return new OrderedSetIterator(r, this.h); + const t = this.X(this.Y, e); + return new OrderedSetIterator(t, this.h, this); } upperBound(e) { - const r = this.er(this.rr, e); - return new OrderedSetIterator(r, this.h); + const t = this.Z(this.Y, e); + return new OrderedSetIterator(t, this.h, this); } reverseLowerBound(e) { - const r = this.tr(this.rr, e); - return new OrderedSetIterator(r, this.h); + const t = this.$(this.Y, e); + return new OrderedSetIterator(t, this.h, this); } reverseUpperBound(e) { - const r = this.sr(this.rr, e); - return new OrderedSetIterator(r, this.h); + const t = this.rr(this.Y, e); + return new OrderedSetIterator(t, this.h, this); } union(e) { - const r = this; + const t = this; e.forEach((function(e) { - r.insert(e); + t.insert(e); })); return this.i; } [Symbol.iterator]() { - return this.X(this.rr); + return this.K(this.Y); } } diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js index ce49ce81ba..d5e10db88a 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js @@ -36,20 +36,20 @@ export { ContainerIterator }; var Base = function() { function Base() { - this.i = 0; + this.M = 0; } Object.defineProperty(Base.prototype, "length", { get: function() { - return this.i; + return this.M; }, enumerable: false, configurable: true }); Base.prototype.size = function() { - return this.i; + return this.M; }; Base.prototype.empty = function() { - return this.i === 0; + return this.M === 0; }; return Base; }(); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js index 3f0e5eaefc..028b7d484a 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js @@ -33,10 +33,10 @@ var HashContainerIterator = function(t) { n.h = r; if (n.iteratorType === 0) { n.pre = function() { - if (this.o.W === this.h) { + if (this.o.L === this.h) { throwIteratorAccessError(); } - this.o = this.o.W; + this.o = this.o.L; return this; }; n.next = function() { @@ -58,7 +58,7 @@ var HashContainerIterator = function(t) { if (this.o === this.h) { throwIteratorAccessError(); } - this.o = this.o.W; + this.o = this.o.L; return this; }; } @@ -78,20 +78,20 @@ var HashContainer = function(t) { i.HASH_TAG = Symbol("@@HASH_TAG"); Object.setPrototypeOf(i.I, null); i.h = {}; - i.h.W = i.h.m = i.l = i.M = i.h; + i.h.L = i.h.m = i.H = i.l = i.h; return i; } - HashContainer.prototype.X = function(t) { - var i = t.W, r = t.m; + HashContainer.prototype.G = function(t) { + var i = t.L, r = t.m; i.m = r; - r.W = i; - if (t === this.l) { - this.l = r; + r.L = i; + if (t === this.H) { + this.H = r; } - if (t === this.M) { - this.M = i; + if (t === this.l) { + this.l = i; } - this.i -= 1; + this.M -= 1; }; HashContainer.prototype.v = function(t, i, r) { if (r === undefined) r = checkObject(t); @@ -99,43 +99,43 @@ var HashContainer = function(t) { if (r) { var n = t[this.HASH_TAG]; if (n !== undefined) { - this._[n].H = i; - return this.i; + this._[n].p = i; + return this.M; } Object.defineProperty(t, this.HASH_TAG, { value: this._.length, configurable: true }); e = { - p: t, - H: i, - W: this.M, + u: t, + p: i, + L: this.l, m: this.h }; this._.push(e); } else { var s = this.I[t]; if (s) { - s.H = i; - return this.i; + s.p = i; + return this.M; } e = { - p: t, - H: i, - W: this.M, + u: t, + p: i, + L: this.l, m: this.h }; this.I[t] = e; } - if (this.i === 0) { - this.l = e; + if (this.M === 0) { + this.H = e; this.h.m = e; } else { - this.M.m = e; + this.l.m = e; } - this.M = e; - this.h.W = e; - return ++this.i; + this.l = e; + this.h.L = e; + return ++this.M; }; HashContainer.prototype.g = function(t, i) { if (i === undefined) i = checkObject(t); @@ -150,13 +150,13 @@ var HashContainer = function(t) { HashContainer.prototype.clear = function() { var t = this.HASH_TAG; this._.forEach((function(i) { - delete i.p[t]; + delete i.u[t]; })); this._ = []; this.I = {}; Object.setPrototypeOf(this.I, null); - this.i = 0; - this.l = this.M = this.h.W = this.h.m = this.h; + this.M = 0; + this.H = this.l = this.h.L = this.h.m = this.h; }; HashContainer.prototype.eraseElementByKey = function(t, i) { var r; @@ -172,7 +172,7 @@ var HashContainer = function(t) { if (r === undefined) return false; delete this.I[t]; } - this.X(r); + this.G(r); return true; }; HashContainer.prototype.eraseElementByIterator = function(t) { @@ -180,19 +180,19 @@ var HashContainer = function(t) { if (i === this.h) { throwIteratorAccessError(); } - this.X(i); + this.G(i); return t.next(); }; HashContainer.prototype.eraseElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var i = this.l; + var i = this.H; while (t--) { i = i.m; } - this.X(i); - return this.i; + this.G(i); + return this.M; }; return HashContainer; }(Container); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js index 338469da44..af08bfb77d 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __generator = this && this.u || function(t, r) { +var __generator = this && this.i || function(t, r) { var n = { label: 0, sent: function() { @@ -117,8 +117,10 @@ import { throwIteratorAccessError } from "../../utils/throwError"; var HashMapIterator = function(t) { __extends(HashMapIterator, t); - function HashMapIterator() { - return t !== null && t.apply(this, arguments) || this; + function HashMapIterator(r, n, e, i) { + var a = t.call(this, r, n, i) || this; + a.container = e; + return a; } Object.defineProperty(HashMapIterator.prototype, "pointer", { get: function() { @@ -128,13 +130,13 @@ var HashMapIterator = function(t) { var t = this; return new Proxy([], { get: function(r, n) { - if (n === "0") return t.o.p; else if (n === "1") return t.o.H; + if (n === "0") return t.o.u; else if (n === "1") return t.o.p; }, set: function(r, n, e) { if (n !== "1") { throw new TypeError("props must be 1"); } - t.o.H = e; + t.o.p = e; return true; } }); @@ -143,7 +145,7 @@ var HashMapIterator = function(t) { configurable: true }); HashMapIterator.prototype.copy = function() { - return new HashMapIterator(this.o, this.h, this.iteratorType); + return new HashMapIterator(this.o, this.h, this.container, this.iteratorType); }; return HashMapIterator; }(HashContainerIterator); @@ -162,24 +164,24 @@ var HashMap = function(t) { return n; } HashMap.prototype.begin = function() { - return new HashMapIterator(this.l, this.h); + return new HashMapIterator(this.H, this.h, this); }; HashMap.prototype.end = function() { - return new HashMapIterator(this.h, this.h); + return new HashMapIterator(this.h, this.h, this); }; HashMap.prototype.rBegin = function() { - return new HashMapIterator(this.M, this.h, 1); + return new HashMapIterator(this.l, this.h, this, 1); }; HashMap.prototype.rEnd = function() { - return new HashMapIterator(this.h, this.h, 1); + return new HashMapIterator(this.h, this.h, this, 1); }; HashMap.prototype.front = function() { - if (this.i === 0) return; - return [ this.l.p, this.l.H ]; + if (this.M === 0) return; + return [ this.H.u, this.H.p ]; }; HashMap.prototype.back = function() { - if (this.i === 0) return; - return [ this.M.p, this.M.H ]; + if (this.M === 0) return; + return [ this.l.u, this.l.p ]; }; HashMap.prototype.setElement = function(t, r, n) { return this.v(t, r, n); @@ -188,30 +190,30 @@ var HashMap = function(t) { if (r === undefined) r = checkObject(t); if (r) { var n = t[this.HASH_TAG]; - return n !== undefined ? this._[n].H : undefined; + return n !== undefined ? this._[n].p : undefined; } var e = this.I[t]; - return e ? e.H : undefined; + return e ? e.p : undefined; }; HashMap.prototype.getElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var r = this.l; + var r = this.H; while (t--) { r = r.m; } - return [ r.p, r.H ]; + return [ r.u, r.p ]; }; HashMap.prototype.find = function(t, r) { var n = this.g(t, r); - return new HashMapIterator(n, this.h); + return new HashMapIterator(n, this.h, this); }; HashMap.prototype.forEach = function(t) { var r = 0; - var n = this.l; + var n = this.H; while (n !== this.h) { - t([ n.p, n.H ], r++, this); + t([ n.u, n.p ], r++, this); n = n.m; } }; @@ -221,12 +223,12 @@ var HashMap = function(t) { return __generator(this, (function(r) { switch (r.label) { case 0: - t = this.l; + t = this.H; r.label = 1; case 1: if (!(t !== this.h)) return [ 3, 3 ]; - return [ 4, [ t.p, t.H ] ]; + return [ 4, [ t.u, t.p ] ]; case 2: r.sent(); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js index f4b6b41126..df0565855f 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __generator = this && this.u || function(t, r) { +var __generator = this && this.i || function(t, r) { var e = { label: 0, sent: function() { @@ -115,21 +115,23 @@ import { throwIteratorAccessError } from "../../utils/throwError"; var HashSetIterator = function(t) { __extends(HashSetIterator, t); - function HashSetIterator() { - return t !== null && t.apply(this, arguments) || this; + function HashSetIterator(r, e, n, i) { + var s = t.call(this, r, e, i) || this; + s.container = n; + return s; } Object.defineProperty(HashSetIterator.prototype, "pointer", { get: function() { if (this.o === this.h) { throwIteratorAccessError(); } - return this.o.p; + return this.o.u; }, enumerable: false, configurable: true }); HashSetIterator.prototype.copy = function() { - return new HashSetIterator(this.o, this.h, this.iteratorType); + return new HashSetIterator(this.o, this.h, this.container, this.iteratorType); }; return HashSetIterator; }(HashContainerIterator); @@ -148,45 +150,45 @@ var HashSet = function(t) { return e; } HashSet.prototype.begin = function() { - return new HashSetIterator(this.l, this.h); + return new HashSetIterator(this.H, this.h, this); }; HashSet.prototype.end = function() { - return new HashSetIterator(this.h, this.h); + return new HashSetIterator(this.h, this.h, this); }; HashSet.prototype.rBegin = function() { - return new HashSetIterator(this.M, this.h, 1); + return new HashSetIterator(this.l, this.h, this, 1); }; HashSet.prototype.rEnd = function() { - return new HashSetIterator(this.h, this.h, 1); + return new HashSetIterator(this.h, this.h, this, 1); }; HashSet.prototype.front = function() { - return this.l.p; + return this.H.u; }; HashSet.prototype.back = function() { - return this.M.p; + return this.l.u; }; HashSet.prototype.insert = function(t, r) { return this.v(t, undefined, r); }; HashSet.prototype.getElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var r = this.l; + var r = this.H; while (t--) { r = r.m; } - return r.p; + return r.u; }; HashSet.prototype.find = function(t, r) { var e = this.g(t, r); - return new HashSetIterator(e, this.h); + return new HashSetIterator(e, this.h, this); }; HashSet.prototype.forEach = function(t) { var r = 0; - var e = this.l; + var e = this.H; while (e !== this.h) { - t(e.p, r++, this); + t(e.u, r++, this); e = e.m; } }; @@ -196,12 +198,12 @@ var HashSet = function(t) { return __generator(this, (function(r) { switch (r.label) { case 0: - t = this.l; + t = this.H; r.label = 1; case 1: if (!(t !== this.h)) return [ 3, 3 ]; - return [ 4, t.p ]; + return [ 4, t.u ]; case 2: r.sent(); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js index 03355ad71a..54e5f492df 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __read = this && this.P || function(i, r) { +var __read = this && this.q || function(i, r) { var t = typeof Symbol === "function" && i[Symbol.iterator]; if (!t) return i; var e = t.call(i), n, u = [], s; @@ -39,7 +39,7 @@ var __read = this && this.P || function(i, r) { return u; }; -var __spreadArray = this && this.A || function(i, r, t) { +var __spreadArray = this && this.D || function(i, r, t) { if (t || arguments.length === 2) for (var e = 0, n = r.length, u; e < n; e++) { if (u || !(e in r)) { if (!u) u = Array.prototype.slice.call(r, 0, e); @@ -68,101 +68,101 @@ var PriorityQueue = function(i) { e = true; } var n = i.call(this) || this; - n.j = t; + n.$ = t; if (Array.isArray(r)) { - n.B = e ? __spreadArray([], __read(r), false) : r; + n.ii = e ? __spreadArray([], __read(r), false) : r; } else { - n.B = []; + n.ii = []; var u = n; r.forEach((function(i) { - u.B.push(i); + u.ii.push(i); })); } - n.i = n.B.length; - var s = n.i >> 1; - for (var o = n.i - 1 >> 1; o >= 0; --o) { - n.O(o, s); + n.M = n.ii.length; + var s = n.M >> 1; + for (var o = n.M - 1 >> 1; o >= 0; --o) { + n.ri(o, s); } return n; } - PriorityQueue.prototype.S = function(i) { - var r = this.B[i]; + PriorityQueue.prototype.ti = function(i) { + var r = this.ii[i]; while (i > 0) { var t = i - 1 >> 1; - var e = this.B[t]; - if (this.j(e, r) <= 0) break; - this.B[i] = e; + var e = this.ii[t]; + if (this.$(e, r) <= 0) break; + this.ii[i] = e; i = t; } - this.B[i] = r; + this.ii[i] = r; }; - PriorityQueue.prototype.O = function(i, r) { - var t = this.B[i]; + PriorityQueue.prototype.ri = function(i, r) { + var t = this.ii[i]; while (i < r) { var e = i << 1 | 1; var n = e + 1; - var u = this.B[e]; - if (n < this.i && this.j(u, this.B[n]) > 0) { + var u = this.ii[e]; + if (n < this.M && this.$(u, this.ii[n]) > 0) { e = n; - u = this.B[n]; + u = this.ii[n]; } - if (this.j(u, t) >= 0) break; - this.B[i] = u; + if (this.$(u, t) >= 0) break; + this.ii[i] = u; i = e; } - this.B[i] = t; + this.ii[i] = t; }; PriorityQueue.prototype.clear = function() { - this.i = 0; - this.B.length = 0; + this.M = 0; + this.ii.length = 0; }; PriorityQueue.prototype.push = function(i) { - this.B.push(i); - this.S(this.i); - this.i += 1; + this.ii.push(i); + this.ti(this.M); + this.M += 1; }; PriorityQueue.prototype.pop = function() { - if (this.i === 0) return; - var i = this.B[0]; - var r = this.B.pop(); - this.i -= 1; - if (this.i) { - this.B[0] = r; - this.O(0, this.i >> 1); + if (this.M === 0) return; + var i = this.ii[0]; + var r = this.ii.pop(); + this.M -= 1; + if (this.M) { + this.ii[0] = r; + this.ri(0, this.M >> 1); } return i; }; PriorityQueue.prototype.top = function() { - return this.B[0]; + return this.ii[0]; }; PriorityQueue.prototype.find = function(i) { - return this.B.indexOf(i) >= 0; + return this.ii.indexOf(i) >= 0; }; PriorityQueue.prototype.remove = function(i) { - var r = this.B.indexOf(i); + var r = this.ii.indexOf(i); if (r < 0) return false; if (r === 0) { this.pop(); - } else if (r === this.i - 1) { - this.B.pop(); - this.i -= 1; + } else if (r === this.M - 1) { + this.ii.pop(); + this.M -= 1; } else { - this.B.splice(r, 1, this.B.pop()); - this.i -= 1; - this.S(r); - this.O(r, this.i >> 1); + this.ii.splice(r, 1, this.ii.pop()); + this.M -= 1; + this.ti(r); + this.ri(r, this.M >> 1); } return true; }; PriorityQueue.prototype.updateItem = function(i) { - var r = this.B.indexOf(i); + var r = this.ii.indexOf(i); if (r < 0) return false; - this.S(r); - this.O(r, this.i >> 1); + this.ti(r); + this.ri(r, this.M >> 1); return true; }; PriorityQueue.prototype.toArray = function() { - return __spreadArray([], __read(this.B), false); + return __spreadArray([], __read(this.ii), false); }; return PriorityQueue; }(Base); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js index fd8ddde4ad..9d8e965877 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js @@ -1,55 +1,66 @@ var __extends = this && this.t || function() { - var extendStatics = function(e, t) { + var extendStatics = function(t, i) { extendStatics = Object.setPrototypeOf || { __proto__: [] - } instanceof Array && function(e, t) { - e.__proto__ = t; - } || function(e, t) { - for (var n in t) if (Object.prototype.hasOwnProperty.call(t, n)) e[n] = t[n]; + } instanceof Array && function(t, i) { + t.__proto__ = i; + } || function(t, i) { + for (var n in i) if (Object.prototype.hasOwnProperty.call(i, n)) t[n] = i[n]; }; - return extendStatics(e, t); + return extendStatics(t, i); }; - return function(e, t) { - if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); - extendStatics(e, t); + return function(t, i) { + if (typeof i !== "function" && i !== null) throw new TypeError("Class extends value " + String(i) + " is not a constructor or null"); + extendStatics(t, i); function __() { - this.constructor = e; + this.constructor = t; } - e.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __); + t.prototype = i === null ? Object.create(i) : (__.prototype = i.prototype, new __); }; }(); import { Base } from "../ContainerBase"; -import Deque from "../SequentialContainer/Deque"; - -var Queue = function(e) { - __extends(Queue, e); - function Queue(t) { - if (t === void 0) { - t = []; +var Queue = function(t) { + __extends(Queue, t); + function Queue(i) { + if (i === void 0) { + i = []; } - var n = e.call(this) || this; - n.q = new Deque(t); - n.i = n.q.size(); + var n = t.call(this) || this; + n.A = 0; + n.tt = []; + var e = n; + i.forEach((function(t) { + e.push(t); + })); return n; } Queue.prototype.clear = function() { - this.q.clear(); - this.i = 0; + this.tt = []; + this.M = this.A = 0; }; - Queue.prototype.push = function(e) { - this.q.pushBack(e); - this.i += 1; - return this.i; + Queue.prototype.push = function(t) { + var i = this.tt.length; + if (this.A / i > .5 && this.A + this.M >= i && i > 4096) { + var n = this.M; + for (var e = 0; e < n; ++e) { + this.tt[e] = this.tt[this.A + e]; + } + this.A = 0; + this.tt[this.M] = t; + } else this.tt[this.A + this.M] = t; + return ++this.M; }; Queue.prototype.pop = function() { - if (this.i === 0) return; - this.i -= 1; - return this.q.popFront(); + if (this.M === 0) return; + var t = this.tt[this.A++]; + this.M -= 1; + return t; }; Queue.prototype.front = function() { - return this.q.front(); + if (this.M === 0) return; + return this.tt[this.A]; }; return Queue; }(Base); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js index fde124f2b1..a7cd3bddc8 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js @@ -28,7 +28,7 @@ var Stack = function(t) { n = []; } var i = t.call(this) || this; - i.k = []; + i.nt = []; var r = i; n.forEach((function(t) { r.push(t); @@ -36,21 +36,21 @@ var Stack = function(t) { return i; } Stack.prototype.clear = function() { - this.i = 0; - this.k = []; + this.M = 0; + this.nt = []; }; Stack.prototype.push = function(t) { - this.k.push(t); - this.i += 1; - return this.i; + this.nt.push(t); + this.M += 1; + return this.M; }; Stack.prototype.pop = function() { - if (this.i === 0) return; - this.i -= 1; - return this.k.pop(); + if (this.M === 0) return; + this.M -= 1; + return this.nt.pop(); }; Stack.prototype.top = function() { - return this.k[this.i - 1]; + return this.nt[this.M - 1]; }; return Stack; }(Base); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js index acee76d4d2..cf0b824015 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js @@ -25,36 +25,33 @@ import { throwIteratorAccessError } from "../../../utils/throwError"; var RandomIterator = function(t) { __extends(RandomIterator, t); - function RandomIterator(r, n, o, i, e) { - var s = t.call(this, e) || this; - s.o = r; - s.D = n; - s.R = o; - s.C = i; - if (s.iteratorType === 0) { - s.pre = function() { + function RandomIterator(r, n) { + var o = t.call(this, n) || this; + o.o = r; + if (o.iteratorType === 0) { + o.pre = function() { if (this.o === 0) { throwIteratorAccessError(); } this.o -= 1; return this; }; - s.next = function() { - if (this.o === this.D()) { + o.next = function() { + if (this.o === this.container.size()) { throwIteratorAccessError(); } this.o += 1; return this; }; } else { - s.pre = function() { - if (this.o === this.D() - 1) { + o.pre = function() { + if (this.o === this.container.size() - 1) { throwIteratorAccessError(); } this.o += 1; return this; }; - s.next = function() { + o.next = function() { if (this.o === -1) { throwIteratorAccessError(); } @@ -62,20 +59,14 @@ var RandomIterator = function(t) { return this; }; } - return s; + return o; } Object.defineProperty(RandomIterator.prototype, "pointer", { get: function() { - if (this.o < 0 || this.o > this.D() - 1) { - throw new RangeError; - } - return this.R(this.o); + return this.container.getElementByPos(this.o); }, set: function(t) { - if (this.o < 0 || this.o > this.D() - 1) { - throw new RangeError; - } - this.C(this.o, t); + this.container.setElementByPos(this.o, t); }, enumerable: false, configurable: true diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js index 641612d407..7020e00efc 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js @@ -5,7 +5,7 @@ var __extends = this && this.t || function() { } instanceof Array && function(t, i) { t.__proto__ = i; } || function(t, i) { - for (var e in i) if (Object.prototype.hasOwnProperty.call(i, e)) t[e] = i[e]; + for (var r in i) if (Object.prototype.hasOwnProperty.call(i, r)) t[r] = i[r]; }; return extendStatics(t, i); }; @@ -19,8 +19,8 @@ var __extends = this && this.t || function() { }; }(); -var __generator = this && this.u || function(t, i) { - var e = { +var __generator = this && this.i || function(t, i) { + var r = { label: 0, sent: function() { if (h[0] & 1) throw h[1]; @@ -28,7 +28,7 @@ var __generator = this && this.u || function(t, i) { }, trys: [], ops: [] - }, r, s, h, n; + }, e, s, h, n; return n = { next: verb(0), throw: verb(1), @@ -42,9 +42,9 @@ var __generator = this && this.u || function(t, i) { }; } function step(n) { - if (r) throw new TypeError("Generator is already executing."); - while (e) try { - if (r = 1, s && (h = n[0] & 2 ? s["return"] : n[0] ? s["throw"] || ((h = s["return"]) && h.call(s), + if (e) throw new TypeError("Generator is already executing."); + while (r) try { + if (e = 1, s && (h = n[0] & 2 ? s["return"] : n[0] ? s["throw"] || ((h = s["return"]) && h.call(s), 0) : s.next) && !(h = h.call(s, n[1])).done) return h; if (s = 0, h) n = [ n[0] & 2, h.value ]; switch (n[0]) { @@ -54,52 +54,52 @@ var __generator = this && this.u || function(t, i) { break; case 4: - e.label++; + r.label++; return { value: n[1], done: false }; case 5: - e.label++; + r.label++; s = n[1]; n = [ 0 ]; continue; case 7: - n = e.ops.pop(); - e.trys.pop(); + n = r.ops.pop(); + r.trys.pop(); continue; default: - if (!(h = e.trys, h = h.length > 0 && h[h.length - 1]) && (n[0] === 6 || n[0] === 2)) { - e = 0; + if (!(h = r.trys, h = h.length > 0 && h[h.length - 1]) && (n[0] === 6 || n[0] === 2)) { + r = 0; continue; } if (n[0] === 3 && (!h || n[1] > h[0] && n[1] < h[3])) { - e.label = n[1]; + r.label = n[1]; break; } - if (n[0] === 6 && e.label < h[1]) { - e.label = h[1]; + if (n[0] === 6 && r.label < h[1]) { + r.label = h[1]; h = n; break; } - if (h && e.label < h[2]) { - e.label = h[2]; - e.ops.push(n); + if (h && r.label < h[2]) { + r.label = h[2]; + r.ops.push(n); break; } - if (h[2]) e.ops.pop(); - e.trys.pop(); + if (h[2]) r.ops.pop(); + r.trys.pop(); continue; } - n = i.call(t, e); + n = i.call(t, r); } catch (t) { n = [ 6, t ]; s = 0; } finally { - r = h = 0; + e = h = 0; } if (n[0] & 5) throw n[1]; return { @@ -109,19 +109,19 @@ var __generator = this && this.u || function(t, i) { } }; -var __read = this && this.P || function(t, i) { - var e = typeof Symbol === "function" && t[Symbol.iterator]; - if (!e) return t; - var r = e.call(t), s, h = [], n; +var __read = this && this.q || function(t, i) { + var r = typeof Symbol === "function" && t[Symbol.iterator]; + if (!r) return t; + var e = r.call(t), s, h = [], n; try { - while ((i === void 0 || i-- > 0) && !(s = r.next()).done) h.push(s.value); + while ((i === void 0 || i-- > 0) && !(s = e.next()).done) h.push(s.value); } catch (t) { n = { error: t }; } finally { try { - if (s && !s.done && (e = r["return"])) e.call(r); + if (s && !s.done && (r = e["return"])) r.call(e); } finally { if (n) throw n.error; } @@ -129,11 +129,11 @@ var __read = this && this.P || function(t, i) { return h; }; -var __spreadArray = this && this.A || function(t, i, e) { - if (e || arguments.length === 2) for (var r = 0, s = i.length, h; r < s; r++) { - if (h || !(r in i)) { - if (!h) h = Array.prototype.slice.call(i, 0, r); - h[r] = i[r]; +var __spreadArray = this && this.D || function(t, i, r) { + if (r || arguments.length === 2) for (var e = 0, s = i.length, h; e < s; e++) { + if (h || !(e in i)) { + if (!h) h = Array.prototype.slice.call(i, 0, e); + h[e] = i[e]; } } return t.concat(h || Array.prototype.slice.call(i)); @@ -145,262 +145,255 @@ import { RandomIterator } from "./Base/RandomIterator"; var DequeIterator = function(t) { __extends(DequeIterator, t); - function DequeIterator() { - return t !== null && t.apply(this, arguments) || this; + function DequeIterator(i, r, e) { + var s = t.call(this, i, e) || this; + s.container = r; + return s; } DequeIterator.prototype.copy = function() { - return new DequeIterator(this.o, this.D, this.R, this.C, this.iteratorType); + return new DequeIterator(this.o, this.container, this.iteratorType); }; return DequeIterator; }(RandomIterator); var Deque = function(t) { __extends(Deque, t); - function Deque(i, e) { + function Deque(i, r) { if (i === void 0) { i = []; } - if (e === void 0) { - e = 1 << 12; - } - var r = t.call(this) || this; - r.N = 0; - r.T = 0; - r.G = 0; - r.F = 0; - r.J = 0; - r.K = []; - var s; - if ("size" in i) { - if (typeof i.size === "number") { - s = i.size; - } else { - s = i.size(); - } - } else if ("length" in i) { - s = i.length; - } else { - throw new RangeError("Can't get container's size!"); - } - r.L = e; - r.J = Math.max(Math.ceil(s / r.L), 1); - for (var h = 0; h < r.J; ++h) { - r.K.push(new Array(r.L)); - } - var n = Math.ceil(s / r.L); - r.N = r.G = (r.J >> 1) - (n >> 1); - r.T = r.F = r.L - s % r.L >> 1; - var u = r; + if (r === void 0) { + r = 1 << 12; + } + var e = t.call(this) || this; + e.A = 0; + e.S = 0; + e.R = 0; + e.k = 0; + e.C = 0; + e.j = []; + var s = function() { + if (typeof i.length === "number") return i.length; + if (typeof i.size === "number") return i.size; + if (typeof i.size === "function") return i.size(); + throw new TypeError("Cannot get the length or size of the container"); + }(); + e.B = r; + e.C = Math.max(Math.ceil(s / e.B), 1); + for (var h = 0; h < e.C; ++h) { + e.j.push(new Array(e.B)); + } + var n = Math.ceil(s / e.B); + e.A = e.R = (e.C >> 1) - (n >> 1); + e.S = e.k = e.B - s % e.B >> 1; + var u = e; i.forEach((function(t) { u.pushBack(t); })); - r.size = r.size.bind(r); - r.getElementByPos = r.getElementByPos.bind(r); - r.setElementByPos = r.setElementByPos.bind(r); - return r; + return e; } - Deque.prototype.U = function() { + Deque.prototype.O = function() { var t = []; - var i = Math.max(this.J >> 1, 1); - for (var e = 0; e < i; ++e) { - t[e] = new Array(this.L); + var i = Math.max(this.C >> 1, 1); + for (var r = 0; r < i; ++r) { + t[r] = new Array(this.B); } - for (var e = this.N; e < this.J; ++e) { - t[t.length] = this.K[e]; + for (var r = this.A; r < this.C; ++r) { + t[t.length] = this.j[r]; } - for (var e = 0; e < this.G; ++e) { - t[t.length] = this.K[e]; + for (var r = 0; r < this.R; ++r) { + t[t.length] = this.j[r]; } - t[t.length] = __spreadArray([], __read(this.K[this.G]), false); - this.N = i; - this.G = t.length - 1; - for (var e = 0; e < i; ++e) { - t[t.length] = new Array(this.L); + t[t.length] = __spreadArray([], __read(this.j[this.R]), false); + this.A = i; + this.R = t.length - 1; + for (var r = 0; r < i; ++r) { + t[t.length] = new Array(this.B); } - this.K = t; - this.J = t.length; + this.j = t; + this.C = t.length; }; - Deque.prototype.V = function(t) { - var i = this.T + t + 1; - var e = i % this.L; - var r = e - 1; - var s = this.N + (i - e) / this.L; - if (e === 0) s -= 1; - s %= this.J; - if (r < 0) r += this.L; + Deque.prototype.T = function(t) { + var i = this.S + t + 1; + var r = i % this.B; + var e = r - 1; + var s = this.A + (i - r) / this.B; + if (r === 0) s -= 1; + s %= this.C; + if (e < 0) e += this.B; return { curNodeBucketIndex: s, - curNodePointerIndex: r + curNodePointerIndex: e }; }; Deque.prototype.clear = function() { - this.K = [ [] ]; - this.J = 1; - this.N = this.G = this.i = 0; - this.T = this.F = this.L >> 1; + this.j = [ new Array(this.B) ]; + this.C = 1; + this.A = this.R = this.M = 0; + this.S = this.k = this.B >> 1; }; Deque.prototype.begin = function() { - return new DequeIterator(0, this.size, this.getElementByPos, this.setElementByPos); + return new DequeIterator(0, this); }; Deque.prototype.end = function() { - return new DequeIterator(this.i, this.size, this.getElementByPos, this.setElementByPos); + return new DequeIterator(this.M, this); }; Deque.prototype.rBegin = function() { - return new DequeIterator(this.i - 1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new DequeIterator(this.M - 1, this, 1); }; Deque.prototype.rEnd = function() { - return new DequeIterator(-1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new DequeIterator(-1, this, 1); }; Deque.prototype.front = function() { - return this.K[this.N][this.T]; + if (this.M === 0) return; + return this.j[this.A][this.S]; }; Deque.prototype.back = function() { - return this.K[this.G][this.F]; + if (this.M === 0) return; + return this.j[this.R][this.k]; }; Deque.prototype.pushBack = function(t) { - if (this.i) { - if (this.F < this.L - 1) { - this.F += 1; - } else if (this.G < this.J - 1) { - this.G += 1; - this.F = 0; + if (this.M) { + if (this.k < this.B - 1) { + this.k += 1; + } else if (this.R < this.C - 1) { + this.R += 1; + this.k = 0; } else { - this.G = 0; - this.F = 0; + this.R = 0; + this.k = 0; } - if (this.G === this.N && this.F === this.T) this.U(); + if (this.R === this.A && this.k === this.S) this.O(); } - this.i += 1; - this.K[this.G][this.F] = t; - return this.i; + this.M += 1; + this.j[this.R][this.k] = t; + return this.M; }; Deque.prototype.popBack = function() { - if (this.i === 0) return; - var t = this.K[this.G][this.F]; - delete this.K[this.G][this.F]; - if (this.i !== 1) { - if (this.F > 0) { - this.F -= 1; - } else if (this.G > 0) { - this.G -= 1; - this.F = this.L - 1; + if (this.M === 0) return; + var t = this.j[this.R][this.k]; + if (this.M !== 1) { + if (this.k > 0) { + this.k -= 1; + } else if (this.R > 0) { + this.R -= 1; + this.k = this.B - 1; } else { - this.G = this.J - 1; - this.F = this.L - 1; + this.R = this.C - 1; + this.k = this.B - 1; } } - this.i -= 1; + this.M -= 1; return t; }; Deque.prototype.pushFront = function(t) { - if (this.i) { - if (this.T > 0) { - this.T -= 1; - } else if (this.N > 0) { - this.N -= 1; - this.T = this.L - 1; + if (this.M) { + if (this.S > 0) { + this.S -= 1; + } else if (this.A > 0) { + this.A -= 1; + this.S = this.B - 1; } else { - this.N = this.J - 1; - this.T = this.L - 1; + this.A = this.C - 1; + this.S = this.B - 1; } - if (this.N === this.G && this.T === this.F) this.U(); + if (this.A === this.R && this.S === this.k) this.O(); } - this.i += 1; - this.K[this.N][this.T] = t; - return this.i; + this.M += 1; + this.j[this.A][this.S] = t; + return this.M; }; Deque.prototype.popFront = function() { - if (this.i === 0) return; - var t = this.K[this.N][this.T]; - delete this.K[this.N][this.T]; - if (this.i !== 1) { - if (this.T < this.L - 1) { - this.T += 1; - } else if (this.N < this.J - 1) { - this.N += 1; - this.T = 0; + if (this.M === 0) return; + var t = this.j[this.A][this.S]; + if (this.M !== 1) { + if (this.S < this.B - 1) { + this.S += 1; + } else if (this.A < this.C - 1) { + this.A += 1; + this.S = 0; } else { - this.N = 0; - this.T = 0; + this.A = 0; + this.S = 0; } } - this.i -= 1; + this.M -= 1; return t; }; Deque.prototype.getElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var i = this.V(t), e = i.curNodeBucketIndex, r = i.curNodePointerIndex; - return this.K[e][r]; + var i = this.T(t), r = i.curNodeBucketIndex, e = i.curNodePointerIndex; + return this.j[r][e]; }; Deque.prototype.setElementByPos = function(t, i) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var e = this.V(t), r = e.curNodeBucketIndex, s = e.curNodePointerIndex; - this.K[r][s] = i; + var r = this.T(t), e = r.curNodeBucketIndex, s = r.curNodePointerIndex; + this.j[e][s] = i; }; - Deque.prototype.insert = function(t, i, e) { - if (e === void 0) { - e = 1; + Deque.prototype.insert = function(t, i, r) { + if (r === void 0) { + r = 1; } - if (t < 0 || t > this.i) { + if (t < 0 || t > this.M) { throw new RangeError; } if (t === 0) { - while (e--) this.pushFront(i); - } else if (t === this.i) { - while (e--) this.pushBack(i); + while (r--) this.pushFront(i); + } else if (t === this.M) { + while (r--) this.pushBack(i); } else { - var r = []; - for (var s = t; s < this.i; ++s) { - r.push(this.getElementByPos(s)); + var e = []; + for (var s = t; s < this.M; ++s) { + e.push(this.getElementByPos(s)); } this.cut(t - 1); - for (var s = 0; s < e; ++s) this.pushBack(i); - for (var s = 0; s < r.length; ++s) this.pushBack(r[s]); + for (var s = 0; s < r; ++s) this.pushBack(i); + for (var s = 0; s < e.length; ++s) this.pushBack(e[s]); } - return this.i; + return this.M; }; Deque.prototype.cut = function(t) { if (t < 0) { this.clear(); return 0; } - var i = this.V(t), e = i.curNodeBucketIndex, r = i.curNodePointerIndex; - this.G = e; - this.F = r; - this.i = t + 1; - return this.i; + var i = this.T(t), r = i.curNodeBucketIndex, e = i.curNodePointerIndex; + this.R = r; + this.k = e; + this.M = t + 1; + return this.M; }; Deque.prototype.eraseElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - if (t === 0) this.popFront(); else if (t === this.i - 1) this.popBack(); else { + if (t === 0) this.popFront(); else if (t === this.M - 1) this.popBack(); else { var i = []; - for (var e = t + 1; e < this.i; ++e) { - i.push(this.getElementByPos(e)); + for (var r = t + 1; r < this.M; ++r) { + i.push(this.getElementByPos(r)); } this.cut(t); this.popBack(); - var r = this; + var e = this; i.forEach((function(t) { - r.pushBack(t); + e.pushBack(t); })); } - return this.i; + return this.M; }; Deque.prototype.eraseElementByValue = function(t) { - if (this.i === 0) return 0; + if (this.M === 0) return 0; var i = []; - for (var e = 0; e < this.i; ++e) { - var r = this.getElementByPos(e); - if (r !== t) i.push(r); + for (var r = 0; r < this.M; ++r) { + var e = this.getElementByPos(r); + if (e !== t) i.push(e); } var s = i.length; - for (var e = 0; e < s; ++e) this.setElementByPos(e, i[e]); + for (var r = 0; r < s; ++r) this.setElementByPos(r, i[r]); return this.cut(s - 1); }; Deque.prototype.eraseElementByIterator = function(t) { @@ -410,64 +403,64 @@ var Deque = function(t) { return t; }; Deque.prototype.find = function(t) { - for (var i = 0; i < this.i; ++i) { + for (var i = 0; i < this.M; ++i) { if (this.getElementByPos(i) === t) { - return new DequeIterator(i, this.size, this.getElementByPos, this.setElementByPos); + return new DequeIterator(i, this); } } return this.end(); }; Deque.prototype.reverse = function() { var t = 0; - var i = this.i - 1; + var i = this.M - 1; while (t < i) { - var e = this.getElementByPos(t); + var r = this.getElementByPos(t); this.setElementByPos(t, this.getElementByPos(i)); - this.setElementByPos(i, e); + this.setElementByPos(i, r); t += 1; i -= 1; } }; Deque.prototype.unique = function() { - if (this.i <= 1) { - return this.i; + if (this.M <= 1) { + return this.M; } var t = 1; var i = this.getElementByPos(0); - for (var e = 1; e < this.i; ++e) { - var r = this.getElementByPos(e); - if (r !== i) { - i = r; - this.setElementByPos(t++, r); + for (var r = 1; r < this.M; ++r) { + var e = this.getElementByPos(r); + if (e !== i) { + i = e; + this.setElementByPos(t++, e); } } - while (this.i > t) this.popBack(); - return this.i; + while (this.M > t) this.popBack(); + return this.M; }; Deque.prototype.sort = function(t) { var i = []; - for (var e = 0; e < this.i; ++e) { - i.push(this.getElementByPos(e)); + for (var r = 0; r < this.M; ++r) { + i.push(this.getElementByPos(r)); } i.sort(t); - for (var e = 0; e < this.i; ++e) this.setElementByPos(e, i[e]); + for (var r = 0; r < this.M; ++r) this.setElementByPos(r, i[r]); }; Deque.prototype.shrinkToFit = function() { - if (this.i === 0) return; + if (this.M === 0) return; var t = []; this.forEach((function(i) { t.push(i); })); - this.J = Math.max(Math.ceil(this.i / this.L), 1); - this.i = this.N = this.G = this.T = this.F = 0; - this.K = []; - for (var i = 0; i < this.J; ++i) { - this.K.push(new Array(this.L)); + this.C = Math.max(Math.ceil(this.M / this.B), 1); + this.M = this.A = this.R = this.S = this.k = 0; + this.j = []; + for (var i = 0; i < this.C; ++i) { + this.j.push(new Array(this.B)); } for (var i = 0; i < t.length; ++i) this.pushBack(t[i]); }; Deque.prototype.forEach = function(t) { - for (var i = 0; i < this.i; ++i) { + for (var i = 0; i < this.M; ++i) { t(this.getElementByPos(i), i, this); } }; @@ -481,7 +474,7 @@ var Deque = function(t) { i.label = 1; case 1: - if (!(t < this.i)) return [ 3, 4 ]; + if (!(t < this.M)) return [ 3, 4 ]; return [ 4, this.getElementByPos(t) ]; case 2: diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js index 5f275d7cda..17ce3e8a55 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __generator = this && this.u || function(t, i) { +var __generator = this && this.i || function(t, i) { var r = { label: 0, sent: function() { @@ -117,19 +117,20 @@ import { throwIteratorAccessError } from "../../utils/throwError"; var LinkListIterator = function(t) { __extends(LinkListIterator, t); - function LinkListIterator(i, r, n) { - var s = t.call(this, n) || this; - s.o = i; - s.h = r; - if (s.iteratorType === 0) { - s.pre = function() { - if (this.o.W === this.h) { + function LinkListIterator(i, r, n, s) { + var e = t.call(this, s) || this; + e.o = i; + e.h = r; + e.container = n; + if (e.iteratorType === 0) { + e.pre = function() { + if (this.o.L === this.h) { throwIteratorAccessError(); } - this.o = this.o.W; + this.o = this.o.L; return this; }; - s.next = function() { + e.next = function() { if (this.o === this.h) { throwIteratorAccessError(); } @@ -137,41 +138,41 @@ var LinkListIterator = function(t) { return this; }; } else { - s.pre = function() { + e.pre = function() { if (this.o.m === this.h) { throwIteratorAccessError(); } this.o = this.o.m; return this; }; - s.next = function() { + e.next = function() { if (this.o === this.h) { throwIteratorAccessError(); } - this.o = this.o.W; + this.o = this.o.L; return this; }; } - return s; + return e; } Object.defineProperty(LinkListIterator.prototype, "pointer", { get: function() { if (this.o === this.h) { throwIteratorAccessError(); } - return this.o.H; + return this.o.p; }, set: function(t) { if (this.o === this.h) { throwIteratorAccessError(); } - this.o.H = t; + this.o.p = t; }, enumerable: false, configurable: true }); LinkListIterator.prototype.copy = function() { - return new LinkListIterator(this.o, this.h, this.iteratorType); + return new LinkListIterator(this.o, this.h, this.container, this.iteratorType); }; return LinkListIterator; }(ContainerIterator); @@ -184,94 +185,94 @@ var LinkList = function(t) { } var r = t.call(this) || this; r.h = {}; - r.l = r.M = r.h.W = r.h.m = r.h; + r.H = r.l = r.h.L = r.h.m = r.h; var n = r; i.forEach((function(t) { n.pushBack(t); })); return r; } - LinkList.prototype.X = function(t) { - var i = t.W, r = t.m; + LinkList.prototype.G = function(t) { + var i = t.L, r = t.m; i.m = r; - r.W = i; - if (t === this.l) { - this.l = r; + r.L = i; + if (t === this.H) { + this.H = r; } - if (t === this.M) { - this.M = i; + if (t === this.l) { + this.l = i; } - this.i -= 1; + this.M -= 1; }; - LinkList.prototype.Y = function(t, i) { + LinkList.prototype.F = function(t, i) { var r = i.m; var n = { - H: t, - W: i, + p: t, + L: i, m: r }; i.m = n; - r.W = n; + r.L = n; if (i === this.h) { - this.l = n; + this.H = n; } if (r === this.h) { - this.M = n; + this.l = n; } - this.i += 1; + this.M += 1; }; LinkList.prototype.clear = function() { - this.i = 0; - this.l = this.M = this.h.W = this.h.m = this.h; + this.M = 0; + this.H = this.l = this.h.L = this.h.m = this.h; }; LinkList.prototype.begin = function() { - return new LinkListIterator(this.l, this.h); + return new LinkListIterator(this.H, this.h, this); }; LinkList.prototype.end = function() { - return new LinkListIterator(this.h, this.h); + return new LinkListIterator(this.h, this.h, this); }; LinkList.prototype.rBegin = function() { - return new LinkListIterator(this.M, this.h, 1); + return new LinkListIterator(this.l, this.h, this, 1); }; LinkList.prototype.rEnd = function() { - return new LinkListIterator(this.h, this.h, 1); + return new LinkListIterator(this.h, this.h, this, 1); }; LinkList.prototype.front = function() { - return this.l.H; + return this.H.p; }; LinkList.prototype.back = function() { - return this.M.H; + return this.l.p; }; LinkList.prototype.getElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var i = this.l; + var i = this.H; while (t--) { i = i.m; } - return i.H; + return i.p; }; LinkList.prototype.eraseElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var i = this.l; + var i = this.H; while (t--) { i = i.m; } - this.X(i); - return this.i; + this.G(i); + return this.M; }; LinkList.prototype.eraseElementByValue = function(t) { - var i = this.l; + var i = this.H; while (i !== this.h) { - if (i.H === t) { - this.X(i); + if (i.p === t) { + this.G(i); } i = i.m; } - return this.i; + return this.M; }; LinkList.prototype.eraseElementByIterator = function(t) { var i = t.o; @@ -279,147 +280,147 @@ var LinkList = function(t) { throwIteratorAccessError(); } t = t.next(); - this.X(i); + this.G(i); return t; }; LinkList.prototype.pushBack = function(t) { - this.Y(t, this.M); - return this.i; + this.F(t, this.l); + return this.M; }; LinkList.prototype.popBack = function() { - if (this.i === 0) return; - var t = this.M.H; - this.X(this.M); + if (this.M === 0) return; + var t = this.l.p; + this.G(this.l); return t; }; LinkList.prototype.pushFront = function(t) { - this.Y(t, this.h); - return this.i; + this.F(t, this.h); + return this.M; }; LinkList.prototype.popFront = function() { - if (this.i === 0) return; - var t = this.l.H; - this.X(this.l); + if (this.M === 0) return; + var t = this.H.p; + this.G(this.H); return t; }; LinkList.prototype.setElementByPos = function(t, i) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - var r = this.l; + var r = this.H; while (t--) { r = r.m; } - r.H = i; + r.p = i; }; LinkList.prototype.insert = function(t, i, r) { if (r === void 0) { r = 1; } - if (t < 0 || t > this.i) { + if (t < 0 || t > this.M) { throw new RangeError; } - if (r <= 0) return this.i; + if (r <= 0) return this.M; if (t === 0) { while (r--) this.pushFront(i); - } else if (t === this.i) { + } else if (t === this.M) { while (r--) this.pushBack(i); } else { - var n = this.l; + var n = this.H; for (var s = 1; s < t; ++s) { n = n.m; } var e = n.m; - this.i += r; + this.M += r; while (r--) { n.m = { - H: i, - W: n + p: i, + L: n }; - n.m.W = n; + n.m.L = n; n = n.m; } n.m = e; - e.W = n; + e.L = n; } - return this.i; + return this.M; }; LinkList.prototype.find = function(t) { - var i = this.l; + var i = this.H; while (i !== this.h) { - if (i.H === t) { - return new LinkListIterator(i, this.h); + if (i.p === t) { + return new LinkListIterator(i, this.h, this); } i = i.m; } return this.end(); }; LinkList.prototype.reverse = function() { - if (this.i <= 1) return; - var t = this.l; - var i = this.M; + if (this.M <= 1) return; + var t = this.H; + var i = this.l; var r = 0; - while (r << 1 < this.i) { - var n = t.H; - t.H = i.H; - i.H = n; + while (r << 1 < this.M) { + var n = t.p; + t.p = i.p; + i.p = n; t = t.m; - i = i.W; + i = i.L; r += 1; } }; LinkList.prototype.unique = function() { - if (this.i <= 1) { - return this.i; + if (this.M <= 1) { + return this.M; } - var t = this.l; + var t = this.H; while (t !== this.h) { var i = t; - while (i.m !== this.h && i.H === i.m.H) { + while (i.m !== this.h && i.p === i.m.p) { i = i.m; - this.i -= 1; + this.M -= 1; } t.m = i.m; - t.m.W = t; + t.m.L = t; t = t.m; } - return this.i; + return this.M; }; LinkList.prototype.sort = function(t) { - if (this.i <= 1) return; + if (this.M <= 1) return; var i = []; this.forEach((function(t) { i.push(t); })); i.sort(t); - var r = this.l; + var r = this.H; i.forEach((function(t) { - r.H = t; + r.p = t; r = r.m; })); }; LinkList.prototype.merge = function(t) { var i = this; - if (this.i === 0) { + if (this.M === 0) { t.forEach((function(t) { i.pushBack(t); })); } else { - var r = this.l; + var r = this.H; t.forEach((function(t) { - while (r !== i.h && r.H <= t) { + while (r !== i.h && r.p <= t) { r = r.m; } - i.Y(t, r.W); + i.F(t, r.L); })); } - return this.i; + return this.M; }; LinkList.prototype.forEach = function(t) { - var i = this.l; + var i = this.H; var r = 0; while (i !== this.h) { - t(i.H, r++, this); + t(i.p, r++, this); i = i.m; } }; @@ -429,13 +430,13 @@ var LinkList = function(t) { return __generator(this, (function(i) { switch (i.label) { case 0: - if (this.i === 0) return [ 2 ]; - t = this.l; + if (this.M === 0) return [ 2 ]; + t = this.H; i.label = 1; case 1: if (!(t !== this.h)) return [ 3, 3 ]; - return [ 4, t.H ]; + return [ 4, t.p ]; case 2: i.sent(); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js index bfa09aead7..deaa342706 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __generator = this && this.u || function(t, r) { +var __generator = this && this.i || function(t, r) { var e = { label: 0, sent: function() { @@ -28,108 +28,108 @@ var __generator = this && this.u || function(t, r) { }, trys: [], ops: [] - }, n, i, o, s; - return s = { + }, n, i, o, u; + return u = { next: verb(0), throw: verb(1), return: verb(2) - }, typeof Symbol === "function" && (s[Symbol.iterator] = function() { + }, typeof Symbol === "function" && (u[Symbol.iterator] = function() { return this; - }), s; + }), u; function verb(t) { return function(r) { return step([ t, r ]); }; } - function step(s) { + function step(u) { if (n) throw new TypeError("Generator is already executing."); while (e) try { - if (n = 1, i && (o = s[0] & 2 ? i["return"] : s[0] ? i["throw"] || ((o = i["return"]) && o.call(i), - 0) : i.next) && !(o = o.call(i, s[1])).done) return o; - if (i = 0, o) s = [ s[0] & 2, o.value ]; - switch (s[0]) { + if (n = 1, i && (o = u[0] & 2 ? i["return"] : u[0] ? i["throw"] || ((o = i["return"]) && o.call(i), + 0) : i.next) && !(o = o.call(i, u[1])).done) return o; + if (i = 0, o) u = [ u[0] & 2, o.value ]; + switch (u[0]) { case 0: case 1: - o = s; + o = u; break; case 4: e.label++; return { - value: s[1], + value: u[1], done: false }; case 5: e.label++; - i = s[1]; - s = [ 0 ]; + i = u[1]; + u = [ 0 ]; continue; case 7: - s = e.ops.pop(); + u = e.ops.pop(); e.trys.pop(); continue; default: - if (!(o = e.trys, o = o.length > 0 && o[o.length - 1]) && (s[0] === 6 || s[0] === 2)) { + if (!(o = e.trys, o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) { e = 0; continue; } - if (s[0] === 3 && (!o || s[1] > o[0] && s[1] < o[3])) { - e.label = s[1]; + if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) { + e.label = u[1]; break; } - if (s[0] === 6 && e.label < o[1]) { + if (u[0] === 6 && e.label < o[1]) { e.label = o[1]; - o = s; + o = u; break; } if (o && e.label < o[2]) { e.label = o[2]; - e.ops.push(s); + e.ops.push(u); break; } if (o[2]) e.ops.pop(); e.trys.pop(); continue; } - s = r.call(t, e); + u = r.call(t, e); } catch (t) { - s = [ 6, t ]; + u = [ 6, t ]; i = 0; } finally { n = o = 0; } - if (s[0] & 5) throw s[1]; + if (u[0] & 5) throw u[1]; return { - value: s[0] ? s[1] : void 0, + value: u[0] ? u[1] : void 0, done: true }; } }; -var __read = this && this.P || function(t, r) { +var __read = this && this.q || function(t, r) { var e = typeof Symbol === "function" && t[Symbol.iterator]; if (!e) return t; - var n = e.call(t), i, o = [], s; + var n = e.call(t), i, o = [], u; try { while ((r === void 0 || r-- > 0) && !(i = n.next()).done) o.push(i.value); } catch (t) { - s = { + u = { error: t }; } finally { try { if (i && !i.done && (e = n["return"])) e.call(n); } finally { - if (s) throw s.error; + if (u) throw u.error; } } return o; }; -var __spreadArray = this && this.A || function(t, r, e) { +var __spreadArray = this && this.D || function(t, r, e) { if (e || arguments.length === 2) for (var n = 0, i = r.length, o; n < i; n++) { if (o || !(n in r)) { if (!o) o = Array.prototype.slice.call(r, 0, n); @@ -139,7 +139,7 @@ var __spreadArray = this && this.A || function(t, r, e) { return t.concat(o || Array.prototype.slice.call(r)); }; -var __values = this && this.Z || function(t) { +var __values = this && this.V || function(t) { var r = typeof Symbol === "function" && Symbol.iterator, e = r && t[r], n = 0; if (e) return e.call(t); if (t && typeof t.length === "number") return { @@ -160,11 +160,13 @@ import { RandomIterator } from "./Base/RandomIterator"; var VectorIterator = function(t) { __extends(VectorIterator, t); - function VectorIterator() { - return t !== null && t.apply(this, arguments) || this; + function VectorIterator(r, e, n) { + var i = t.call(this, r, n) || this; + i.container = e; + return i; } VectorIterator.prototype.copy = function() { - return new VectorIterator(this.o, this.D, this.R, this.C, this.iteratorType); + return new VectorIterator(this.o, this.container, this.iteratorType); }; return VectorIterator; }(RandomIterator); @@ -180,65 +182,62 @@ var Vector = function(t) { } var n = t.call(this) || this; if (Array.isArray(r)) { - n.$ = e ? __spreadArray([], __read(r), false) : r; - n.i = r.length; + n.J = e ? __spreadArray([], __read(r), false) : r; + n.M = r.length; } else { - n.$ = []; + n.J = []; var i = n; r.forEach((function(t) { i.pushBack(t); })); } - n.size = n.size.bind(n); - n.getElementByPos = n.getElementByPos.bind(n); - n.setElementByPos = n.setElementByPos.bind(n); return n; } Vector.prototype.clear = function() { - this.i = 0; - this.$.length = 0; + this.M = 0; + this.J.length = 0; }; Vector.prototype.begin = function() { - return new VectorIterator(0, this.size, this.getElementByPos, this.setElementByPos); + return new VectorIterator(0, this); }; Vector.prototype.end = function() { - return new VectorIterator(this.i, this.size, this.getElementByPos, this.setElementByPos); + return new VectorIterator(this.M, this); }; Vector.prototype.rBegin = function() { - return new VectorIterator(this.i - 1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new VectorIterator(this.M - 1, this, 1); }; Vector.prototype.rEnd = function() { - return new VectorIterator(-1, this.size, this.getElementByPos, this.setElementByPos, 1); + return new VectorIterator(-1, this, 1); }; Vector.prototype.front = function() { - return this.$[0]; + return this.J[0]; }; Vector.prototype.back = function() { - return this.$[this.i - 1]; + return this.J[this.M - 1]; }; Vector.prototype.getElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - return this.$[t]; + return this.J[t]; }; Vector.prototype.eraseElementByPos = function(t) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - this.$.splice(t, 1); - this.i -= 1; - return this.i; + this.J.splice(t, 1); + this.M -= 1; + return this.M; }; Vector.prototype.eraseElementByValue = function(t) { var r = 0; - for (var e = 0; e < this.i; ++e) { - if (this.$[e] !== t) { - this.$[r++] = this.$[e]; + for (var e = 0; e < this.M; ++e) { + if (this.J[e] !== t) { + this.J[r++] = this.J[e]; } } - this.i = this.$.length = r; - return this.i; + this.M = this.J.length = r; + return this.M; }; Vector.prototype.eraseElementByIterator = function(t) { var r = t.o; @@ -247,60 +246,60 @@ var Vector = function(t) { return t; }; Vector.prototype.pushBack = function(t) { - this.$.push(t); - this.i += 1; - return this.i; + this.J.push(t); + this.M += 1; + return this.M; }; Vector.prototype.popBack = function() { - if (this.i === 0) return; - this.i -= 1; - return this.$.pop(); + if (this.M === 0) return; + this.M -= 1; + return this.J.pop(); }; Vector.prototype.setElementByPos = function(t, r) { - if (t < 0 || t > this.i - 1) { + if (t < 0 || t > this.M - 1) { throw new RangeError; } - this.$[t] = r; + this.J[t] = r; }; Vector.prototype.insert = function(t, r, e) { var n; if (e === void 0) { e = 1; } - if (t < 0 || t > this.i) { + if (t < 0 || t > this.M) { throw new RangeError; } - (n = this.$).splice.apply(n, __spreadArray([ t, 0 ], __read(new Array(e).fill(r)), false)); - this.i += e; - return this.i; + (n = this.J).splice.apply(n, __spreadArray([ t, 0 ], __read(new Array(e).fill(r)), false)); + this.M += e; + return this.M; }; Vector.prototype.find = function(t) { - for (var r = 0; r < this.i; ++r) { - if (this.$[r] === t) { - return new VectorIterator(r, this.size, this.getElementByPos, this.getElementByPos); + for (var r = 0; r < this.M; ++r) { + if (this.J[r] === t) { + return new VectorIterator(r, this); } } return this.end(); }; Vector.prototype.reverse = function() { - this.$.reverse(); + this.J.reverse(); }; Vector.prototype.unique = function() { var t = 1; - for (var r = 1; r < this.i; ++r) { - if (this.$[r] !== this.$[r - 1]) { - this.$[t++] = this.$[r]; + for (var r = 1; r < this.M; ++r) { + if (this.J[r] !== this.J[r - 1]) { + this.J[t++] = this.J[r]; } } - this.i = this.$.length = t; - return this.i; + this.M = this.J.length = t; + return this.M; }; Vector.prototype.sort = function(t) { - this.$.sort(t); + this.J.sort(t); }; Vector.prototype.forEach = function(t) { - for (var r = 0; r < this.i; ++r) { - t(this.$[r], r, this); + for (var r = 0; r < this.M; ++r) { + t(this.J[r], r, this); } }; Vector.prototype[Symbol.iterator] = function() { @@ -308,7 +307,7 @@ var Vector = function(t) { return __generator(this, (function(t) { switch (t.label) { case 0: - return [ 5, __values(this.$) ]; + return [ 5, __values(this.J) ]; case 1: t.sent(); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js index 12d4f74aa4..3e4f5c7e12 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js @@ -31,10 +31,10 @@ var TreeIterator = function(r) { n.h = e; if (n.iteratorType === 0) { n.pre = function() { - if (this.o === this.h.er) { + if (this.o === this.h.K) { throwIteratorAccessError(); } - this.o = this.o.W(); + this.o = this.o.L(); return this; }; n.next = function() { @@ -46,7 +46,7 @@ var TreeIterator = function(r) { }; } else { n.pre = function() { - if (this.o === this.h.tr) { + if (this.o === this.h.N) { throwIteratorAccessError(); } this.o = this.o.m(); @@ -56,7 +56,7 @@ var TreeIterator = function(r) { if (this.o === this.h) { throwIteratorAccessError(); } - this.o = this.o.W(); + this.o = this.o.L(); return this; }; } @@ -65,23 +65,23 @@ var TreeIterator = function(r) { Object.defineProperty(TreeIterator.prototype, "index", { get: function() { var r = this.o; - var t = this.h.hr; + var t = this.h.rr; if (r === this.h) { if (t) { - return t.cr - 1; + return t.tr - 1; } return 0; } var e = 0; - if (r.er) { - e += r.er.cr; + if (r.K) { + e += r.K.tr; } while (r !== t) { - var i = r.hr; - if (r === i.tr) { + var i = r.rr; + if (r === i.N) { e += 1; - if (i.er) { - e += i.er.cr; + if (i.K) { + e += i.K.tr; } } r = i; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js index 09ad742ea6..0b58346d17 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js @@ -22,28 +22,28 @@ var __extends = this && this.t || function() { var TreeNode = function() { function TreeNode(e, n) { this.ee = 1; + this.u = undefined; this.p = undefined; - this.H = undefined; - this.er = undefined; - this.tr = undefined; - this.hr = undefined; - this.p = e; - this.H = n; + this.K = undefined; + this.N = undefined; + this.rr = undefined; + this.u = e; + this.p = n; } - TreeNode.prototype.W = function() { + TreeNode.prototype.L = function() { var e = this; - if (e.ee === 1 && e.hr.hr === e) { - e = e.tr; - } else if (e.er) { - e = e.er; - while (e.tr) { - e = e.tr; + if (e.ee === 1 && e.rr.rr === e) { + e = e.N; + } else if (e.K) { + e = e.K; + while (e.N) { + e = e.N; } } else { - var n = e.hr; - while (n.er === e) { + var n = e.rr; + while (n.K === e) { e = n; - n = e.hr; + n = e.rr; } e = n; } @@ -51,45 +51,45 @@ var TreeNode = function() { }; TreeNode.prototype.m = function() { var e = this; - if (e.tr) { - e = e.tr; - while (e.er) { - e = e.er; + if (e.N) { + e = e.N; + while (e.K) { + e = e.K; } return e; } else { - var n = e.hr; - while (n.tr === e) { + var n = e.rr; + while (n.N === e) { e = n; - n = e.hr; + n = e.rr; } - if (e.tr !== n) { + if (e.N !== n) { return n; } else return e; } }; TreeNode.prototype.ne = function() { - var e = this.hr; - var n = this.tr; - var t = n.er; - if (e.hr === this) e.hr = n; else if (e.er === this) e.er = n; else e.tr = n; - n.hr = e; - n.er = this; - this.hr = n; - this.tr = t; - if (t) t.hr = this; + var e = this.rr; + var n = this.N; + var t = n.K; + if (e.rr === this) e.rr = n; else if (e.K === this) e.K = n; else e.N = n; + n.rr = e; + n.K = this; + this.rr = n; + this.N = t; + if (t) t.rr = this; return n; }; TreeNode.prototype.te = function() { - var e = this.hr; - var n = this.er; - var t = n.tr; - if (e.hr === this) e.hr = n; else if (e.er === this) e.er = n; else e.tr = n; - n.hr = e; - n.tr = this; - this.hr = n; - this.er = t; - if (t) t.hr = this; + var e = this.rr; + var n = this.K; + var t = n.N; + if (e.rr === this) e.rr = n; else if (e.K === this) e.K = n; else e.N = n; + n.rr = e; + n.N = this; + this.rr = n; + this.K = t; + if (t) t.rr = this; return n; }; return TreeNode; @@ -101,7 +101,7 @@ var TreeNodeEnableIndex = function(e) { __extends(TreeNodeEnableIndex, e); function TreeNodeEnableIndex() { var n = e !== null && e.apply(this, arguments) || this; - n.cr = 1; + n.tr = 1; return n; } TreeNodeEnableIndex.prototype.ne = function() { @@ -117,12 +117,12 @@ var TreeNodeEnableIndex = function(e) { return n; }; TreeNodeEnableIndex.prototype.ie = function() { - this.cr = 1; - if (this.er) { - this.cr += this.er.cr; + this.tr = 1; + if (this.K) { + this.tr += this.K.tr; } - if (this.tr) { - this.cr += this.tr.cr; + if (this.N) { + this.tr += this.N.tr; } }; return TreeNodeEnableIndex; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js index 10b15ad8a4..5056baf841 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __read = this && this.P || function(e, r) { +var __read = this && this.q || function(e, r) { var i = typeof Symbol === "function" && e[Symbol.iterator]; if (!i) return e; var t = i.call(e), n, s = [], f; @@ -39,7 +39,7 @@ var __read = this && this.P || function(e, r) { return s; }; -var __values = this && this.Z || function(e) { +var __values = this && this.V || function(e) { var r = typeof Symbol === "function" && Symbol.iterator, i = r && e[r], t = 0; if (i) return i.call(e); if (e && typeof e.length === "number") return { @@ -74,17 +74,17 @@ var TreeContainer = function(e) { i = false; } var t = e.call(this) || this; - t.ir = undefined; - t.j = r; + t.W = undefined; + t.$ = r; if (i) { t.re = TreeNodeEnableIndex; t.v = function(e, r, i) { var t = this.se(e, r, i); if (t) { - var n = t.hr; + var n = t.rr; while (n !== this.h) { - n.cr += 1; - n = n.hr; + n.tr += 1; + n = n.rr; } var s = this.fe(t); if (s) { @@ -94,13 +94,13 @@ var TreeContainer = function(e) { a.ie(); } } - return this.i; + return this.M; }; - t.X = function(e) { + t.G = function(e) { var r = this.he(e); while (r !== this.h) { - r.cr -= 1; - r = r.hr; + r.tr -= 1; + r = r.rr; } }; } else { @@ -108,93 +108,93 @@ var TreeContainer = function(e) { t.v = function(e, r, i) { var t = this.se(e, r, i); if (t) this.fe(t); - return this.i; + return this.M; }; - t.X = t.he; + t.G = t.he; } t.h = new t.re; return t; } - TreeContainer.prototype.nr = function(e, r) { + TreeContainer.prototype.U = function(e, r) { var i = this.h; while (e) { - var t = this.j(e.p, r); + var t = this.$(e.u, r); if (t < 0) { - e = e.tr; + e = e.N; } else if (t > 0) { i = e; - e = e.er; + e = e.K; } else return e; } return i; }; - TreeContainer.prototype.ar = function(e, r) { + TreeContainer.prototype.X = function(e, r) { var i = this.h; while (e) { - var t = this.j(e.p, r); + var t = this.$(e.u, r); if (t <= 0) { - e = e.tr; + e = e.N; } else { i = e; - e = e.er; + e = e.K; } } return i; }; - TreeContainer.prototype.ur = function(e, r) { + TreeContainer.prototype.Y = function(e, r) { var i = this.h; while (e) { - var t = this.j(e.p, r); + var t = this.$(e.u, r); if (t < 0) { i = e; - e = e.tr; + e = e.N; } else if (t > 0) { - e = e.er; + e = e.K; } else return e; } return i; }; - TreeContainer.prototype.sr = function(e, r) { + TreeContainer.prototype.Z = function(e, r) { var i = this.h; while (e) { - var t = this.j(e.p, r); + var t = this.$(e.u, r); if (t < 0) { i = e; - e = e.tr; + e = e.N; } else { - e = e.er; + e = e.K; } } return i; }; TreeContainer.prototype.ue = function(e) { while (true) { - var r = e.hr; + var r = e.rr; if (r === this.h) return; if (e.ee === 1) { e.ee = 0; return; } - if (e === r.er) { - var i = r.tr; + if (e === r.K) { + var i = r.N; if (i.ee === 1) { i.ee = 0; r.ee = 1; - if (r === this.ir) { - this.ir = r.ne(); + if (r === this.W) { + this.W = r.ne(); } else r.ne(); } else { - if (i.tr && i.tr.ee === 1) { + if (i.N && i.N.ee === 1) { i.ee = r.ee; r.ee = 0; - i.tr.ee = 0; - if (r === this.ir) { - this.ir = r.ne(); + i.N.ee = 0; + if (r === this.W) { + this.W = r.ne(); } else r.ne(); return; - } else if (i.er && i.er.ee === 1) { + } else if (i.K && i.K.ee === 1) { i.ee = 1; - i.er.ee = 0; + i.K.ee = 0; i.te(); } else { i.ee = 1; @@ -202,25 +202,25 @@ var TreeContainer = function(e) { } } } else { - var i = r.er; + var i = r.K; if (i.ee === 1) { i.ee = 0; r.ee = 1; - if (r === this.ir) { - this.ir = r.te(); + if (r === this.W) { + this.W = r.te(); } else r.te(); } else { - if (i.er && i.er.ee === 1) { + if (i.K && i.K.ee === 1) { i.ee = r.ee; r.ee = 0; - i.er.ee = 0; - if (r === this.ir) { - this.ir = r.te(); + i.K.ee = 0; + if (r === this.W) { + this.W = r.te(); } else r.te(); return; - } else if (i.tr && i.tr.ee === 1) { + } else if (i.N && i.N.ee === 1) { i.ee = 1; - i.tr.ee = 0; + i.N.ee = 0; i.ne(); } else { i.ee = 1; @@ -232,76 +232,76 @@ var TreeContainer = function(e) { }; TreeContainer.prototype.he = function(e) { var r, i; - if (this.i === 1) { + if (this.M === 1) { this.clear(); return this.h; } var t = e; - while (t.er || t.tr) { - if (t.tr) { - t = t.tr; - while (t.er) t = t.er; + while (t.K || t.N) { + if (t.N) { + t = t.N; + while (t.K) t = t.K; } else { - t = t.er; + t = t.K; } - r = __read([ t.p, e.p ], 2), e.p = r[0], t.p = r[1]; - i = __read([ t.H, e.H ], 2), e.H = i[0], t.H = i[1]; + r = __read([ t.u, e.u ], 2), e.u = r[0], t.u = r[1]; + i = __read([ t.p, e.p ], 2), e.p = i[0], t.p = i[1]; e = t; } - if (this.h.er === t) { - this.h.er = t.hr; - } else if (this.h.tr === t) { - this.h.tr = t.hr; + if (this.h.K === t) { + this.h.K = t.rr; + } else if (this.h.N === t) { + this.h.N = t.rr; } this.ue(t); - var n = t.hr; - if (t === n.er) { - n.er = undefined; - } else n.tr = undefined; - this.i -= 1; - this.ir.ee = 0; + var n = t.rr; + if (t === n.K) { + n.K = undefined; + } else n.N = undefined; + this.M -= 1; + this.W.ee = 0; return n; }; TreeContainer.prototype.ae = function(e, r) { if (e === undefined) return false; - var i = this.ae(e.er, r); + var i = this.ae(e.K, r); if (i) return true; if (r(e)) return true; - return this.ae(e.tr, r); + return this.ae(e.N, r); }; TreeContainer.prototype.fe = function(e) { while (true) { - var r = e.hr; + var r = e.rr; if (r.ee === 0) return; - var i = r.hr; - if (r === i.er) { - var t = i.tr; + var i = r.rr; + if (r === i.K) { + var t = i.N; if (t && t.ee === 1) { t.ee = r.ee = 0; - if (i === this.ir) return; + if (i === this.W) return; i.ee = 1; e = i; continue; - } else if (e === r.tr) { + } else if (e === r.N) { e.ee = 0; - if (e.er) e.er.hr = r; - if (e.tr) e.tr.hr = i; - r.tr = e.er; - i.er = e.tr; - e.er = r; - e.tr = i; - if (i === this.ir) { - this.ir = e; - this.h.hr = e; + if (e.K) e.K.rr = r; + if (e.N) e.N.rr = i; + r.N = e.K; + i.K = e.N; + e.K = r; + e.N = i; + if (i === this.W) { + this.W = e; + this.h.rr = e; } else { - var n = i.hr; - if (n.er === i) { - n.er = e; - } else n.tr = e; + var n = i.rr; + if (n.K === i) { + n.K = e; + } else n.N = e; } - e.hr = i.hr; - r.hr = e; - i.hr = e; + e.rr = i.rr; + r.rr = e; + i.rr = e; i.ee = 1; return { parentNode: r, @@ -310,39 +310,39 @@ var TreeContainer = function(e) { }; } else { r.ee = 0; - if (i === this.ir) { - this.ir = i.te(); + if (i === this.W) { + this.W = i.te(); } else i.te(); i.ee = 1; } } else { - var t = i.er; + var t = i.K; if (t && t.ee === 1) { t.ee = r.ee = 0; - if (i === this.ir) return; + if (i === this.W) return; i.ee = 1; e = i; continue; - } else if (e === r.er) { + } else if (e === r.K) { e.ee = 0; - if (e.er) e.er.hr = i; - if (e.tr) e.tr.hr = r; - i.tr = e.er; - r.er = e.tr; - e.er = i; - e.tr = r; - if (i === this.ir) { - this.ir = e; - this.h.hr = e; + if (e.K) e.K.rr = i; + if (e.N) e.N.rr = r; + i.N = e.K; + r.K = e.N; + e.K = i; + e.N = r; + if (i === this.W) { + this.W = e; + this.h.rr = e; } else { - var n = i.hr; - if (n.er === i) { - n.er = e; - } else n.tr = e; + var n = i.rr; + if (n.K === i) { + n.K = e; + } else n.N = e; } - e.hr = i.hr; - r.hr = e; - i.hr = e; + e.rr = i.rr; + r.rr = e; + i.rr = e; i.ee = 1; return { parentNode: r, @@ -351,8 +351,8 @@ var TreeContainer = function(e) { }; } else { r.ee = 0; - if (i === this.ir) { - this.ir = i.ne(); + if (i === this.W) { + this.W = i.ne(); } else i.ne(); i.ee = 1; } @@ -361,164 +361,164 @@ var TreeContainer = function(e) { } }; TreeContainer.prototype.se = function(e, r, i) { - if (this.ir === undefined) { - this.i += 1; - this.ir = new this.re(e, r); - this.ir.ee = 0; - this.ir.hr = this.h; - this.h.hr = this.ir; - this.h.er = this.ir; - this.h.tr = this.ir; + if (this.W === undefined) { + this.M += 1; + this.W = new this.re(e, r); + this.W.ee = 0; + this.W.rr = this.h; + this.h.rr = this.W; + this.h.K = this.W; + this.h.N = this.W; return; } var t; - var n = this.h.er; - var s = this.j(n.p, e); + var n = this.h.K; + var s = this.$(n.u, e); if (s === 0) { - n.H = r; + n.p = r; return; } else if (s > 0) { - n.er = new this.re(e, r); - n.er.hr = n; - t = n.er; - this.h.er = t; + n.K = new this.re(e, r); + n.K.rr = n; + t = n.K; + this.h.K = t; } else { - var f = this.h.tr; - var h = this.j(f.p, e); + var f = this.h.N; + var h = this.$(f.u, e); if (h === 0) { - f.H = r; + f.p = r; return; } else if (h < 0) { - f.tr = new this.re(e, r); - f.tr.hr = f; - t = f.tr; - this.h.tr = t; + f.N = new this.re(e, r); + f.N.rr = f; + t = f.N; + this.h.N = t; } else { if (i !== undefined) { var u = i.o; if (u !== this.h) { - var a = this.j(u.p, e); + var a = this.$(u.u, e); if (a === 0) { - u.H = r; + u.p = r; return; } else if (a > 0) { - var o = u.W(); - var l = this.j(o.p, e); + var o = u.L(); + var l = this.$(o.u, e); if (l === 0) { - o.H = r; + o.p = r; return; } else if (l < 0) { t = new this.re(e, r); - if (o.tr === undefined) { - o.tr = t; - t.hr = o; + if (o.N === undefined) { + o.N = t; + t.rr = o; } else { - u.er = t; - t.hr = u; + u.K = t; + t.rr = u; } } } } } if (t === undefined) { - t = this.ir; + t = this.W; while (true) { - var v = this.j(t.p, e); + var v = this.$(t.u, e); if (v > 0) { - if (t.er === undefined) { - t.er = new this.re(e, r); - t.er.hr = t; - t = t.er; + if (t.K === undefined) { + t.K = new this.re(e, r); + t.K.rr = t; + t = t.K; break; } - t = t.er; + t = t.K; } else if (v < 0) { - if (t.tr === undefined) { - t.tr = new this.re(e, r); - t.tr.hr = t; - t = t.tr; + if (t.N === undefined) { + t.N = new this.re(e, r); + t.N.rr = t; + t = t.N; break; } - t = t.tr; + t = t.N; } else { - t.H = r; + t.p = r; return; } } } } } - this.i += 1; + this.M += 1; return t; }; TreeContainer.prototype.g = function(e, r) { while (e) { - var i = this.j(e.p, r); + var i = this.$(e.u, r); if (i < 0) { - e = e.tr; + e = e.N; } else if (i > 0) { - e = e.er; + e = e.K; } else return e; } return e || this.h; }; TreeContainer.prototype.clear = function() { - this.i = 0; - this.ir = undefined; - this.h.hr = undefined; - this.h.er = this.h.tr = undefined; + this.M = 0; + this.W = undefined; + this.h.rr = undefined; + this.h.K = this.h.N = undefined; }; TreeContainer.prototype.updateKeyByIterator = function(e, r) { var i = e.o; if (i === this.h) { throwIteratorAccessError(); } - if (this.i === 1) { - i.p = r; + if (this.M === 1) { + i.u = r; return true; } - if (i === this.h.er) { - if (this.j(i.m().p, r) > 0) { - i.p = r; + if (i === this.h.K) { + if (this.$(i.m().u, r) > 0) { + i.u = r; return true; } return false; } - if (i === this.h.tr) { - if (this.j(i.W().p, r) < 0) { - i.p = r; + if (i === this.h.N) { + if (this.$(i.L().u, r) < 0) { + i.u = r; return true; } return false; } - var t = i.W().p; - if (this.j(t, r) >= 0) return false; - var n = i.m().p; - if (this.j(n, r) <= 0) return false; - i.p = r; + var t = i.L().u; + if (this.$(t, r) >= 0) return false; + var n = i.m().u; + if (this.$(n, r) <= 0) return false; + i.u = r; return true; }; TreeContainer.prototype.eraseElementByPos = function(e) { - if (e < 0 || e > this.i - 1) { + if (e < 0 || e > this.M - 1) { throw new RangeError; } var r = 0; var i = this; - this.ae(this.ir, (function(t) { + this.ae(this.W, (function(t) { if (e === r) { - i.X(t); + i.G(t); return true; } r += 1; return false; })); - return this.i; + return this.M; }; TreeContainer.prototype.eraseElementByKey = function(e) { - if (this.i === 0) return false; - var r = this.g(this.ir, e); + if (this.M === 0) return false; + var r = this.g(this.W, e); if (r === this.h) return false; - this.X(r); + this.G(r); return true; }; TreeContainer.prototype.eraseElementByIterator = function(e) { @@ -526,14 +526,14 @@ var TreeContainer = function(e) { if (r === this.h) { throwIteratorAccessError(); } - var i = r.tr === undefined; + var i = r.N === undefined; var t = e.iteratorType === 0; if (t) { if (i) e.next(); } else { - if (!i || r.er === undefined) e.next(); + if (!i || r.K === undefined) e.next(); } - this.X(r); + this.G(r); return e; }; TreeContainer.prototype.forEach = function(e) { @@ -558,7 +558,7 @@ var TreeContainer = function(e) { }; TreeContainer.prototype.getElementByPos = function(e) { var r, i; - if (e < 0 || e > this.i - 1) { + if (e < 0 || e > this.M - 1) { throw new RangeError; } var t; @@ -586,12 +586,12 @@ var TreeContainer = function(e) { return t; }; TreeContainer.prototype.getHeight = function() { - if (this.i === 0) return 0; + if (this.M === 0) return 0; var traversal = function(e) { if (!e) return 0; - return Math.max(traversal(e.er), traversal(e.tr)) + 1; + return Math.max(traversal(e.K), traversal(e.N)) + 1; }; - return traversal(this.ir); + return traversal(this.W); }; return TreeContainer; }(Container); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js index f15b224366..90795d5119 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js @@ -19,7 +19,7 @@ var __extends = this && this.t || function() { }; }(); -var __generator = this && this.u || function(r, e) { +var __generator = this && this.i || function(r, e) { var t = { label: 0, sent: function() { @@ -109,7 +109,7 @@ var __generator = this && this.u || function(r, e) { } }; -var __values = this && this.Z || function(r) { +var __values = this && this.V || function(r) { var e = typeof Symbol === "function" && Symbol.iterator, t = e && r[e], n = 0; if (t) return t.call(r); if (r && typeof r.length === "number") return { @@ -132,8 +132,10 @@ import { throwIteratorAccessError } from "../../utils/throwError"; var OrderedMapIterator = function(r) { __extends(OrderedMapIterator, r); - function OrderedMapIterator() { - return r !== null && r.apply(this, arguments) || this; + function OrderedMapIterator(e, t, n, i) { + var o = r.call(this, e, t, i) || this; + o.container = n; + return o; } Object.defineProperty(OrderedMapIterator.prototype, "pointer", { get: function() { @@ -143,13 +145,13 @@ var OrderedMapIterator = function(r) { var r = this; return new Proxy([], { get: function(e, t) { - if (t === "0") return r.o.p; else if (t === "1") return r.o.H; + if (t === "0") return r.o.u; else if (t === "1") return r.o.p; }, set: function(e, t, n) { if (t !== "1") { throw new TypeError("props must be 1"); } - r.o.H = n; + r.o.p = n; return true; } }); @@ -158,7 +160,7 @@ var OrderedMapIterator = function(r) { configurable: true }); OrderedMapIterator.prototype.copy = function() { - return new OrderedMapIterator(this.o, this.h, this.iteratorType); + return new OrderedMapIterator(this.o, this.h, this.container, this.iteratorType); }; return OrderedMapIterator; }(TreeIterator); @@ -176,20 +178,20 @@ var OrderedMap = function(r) { })); return i; } - OrderedMap.prototype.rr = function(r) { + OrderedMap.prototype.P = function(r) { return __generator(this, (function(e) { switch (e.label) { case 0: if (r === undefined) return [ 2 ]; - return [ 5, __values(this.rr(r.er)) ]; + return [ 5, __values(this.P(r.K)) ]; case 1: e.sent(); - return [ 4, [ r.p, r.H ] ]; + return [ 4, [ r.u, r.p ] ]; case 2: e.sent(); - return [ 5, __values(this.rr(r.tr)) ]; + return [ 5, __values(this.P(r.N)) ]; case 3: e.sent(); @@ -198,63 +200,63 @@ var OrderedMap = function(r) { })); }; OrderedMap.prototype.begin = function() { - return new OrderedMapIterator(this.h.er || this.h, this.h); + return new OrderedMapIterator(this.h.K || this.h, this.h, this); }; OrderedMap.prototype.end = function() { - return new OrderedMapIterator(this.h, this.h); + return new OrderedMapIterator(this.h, this.h, this); }; OrderedMap.prototype.rBegin = function() { - return new OrderedMapIterator(this.h.tr || this.h, this.h, 1); + return new OrderedMapIterator(this.h.N || this.h, this.h, this, 1); }; OrderedMap.prototype.rEnd = function() { - return new OrderedMapIterator(this.h, this.h, 1); + return new OrderedMapIterator(this.h, this.h, this, 1); }; OrderedMap.prototype.front = function() { - if (this.i === 0) return; - var r = this.h.er; - return [ r.p, r.H ]; + if (this.M === 0) return; + var r = this.h.K; + return [ r.u, r.p ]; }; OrderedMap.prototype.back = function() { - if (this.i === 0) return; - var r = this.h.tr; - return [ r.p, r.H ]; + if (this.M === 0) return; + var r = this.h.N; + return [ r.u, r.p ]; }; OrderedMap.prototype.lowerBound = function(r) { - var e = this.nr(this.ir, r); - return new OrderedMapIterator(e, this.h); + var e = this.U(this.W, r); + return new OrderedMapIterator(e, this.h, this); }; OrderedMap.prototype.upperBound = function(r) { - var e = this.ar(this.ir, r); - return new OrderedMapIterator(e, this.h); + var e = this.X(this.W, r); + return new OrderedMapIterator(e, this.h, this); }; OrderedMap.prototype.reverseLowerBound = function(r) { - var e = this.ur(this.ir, r); - return new OrderedMapIterator(e, this.h); + var e = this.Y(this.W, r); + return new OrderedMapIterator(e, this.h, this); }; OrderedMap.prototype.reverseUpperBound = function(r) { - var e = this.sr(this.ir, r); - return new OrderedMapIterator(e, this.h); + var e = this.Z(this.W, r); + return new OrderedMapIterator(e, this.h, this); }; OrderedMap.prototype.setElement = function(r, e, t) { return this.v(r, e, t); }; OrderedMap.prototype.find = function(r) { - var e = this.g(this.ir, r); - return new OrderedMapIterator(e, this.h); + var e = this.g(this.W, r); + return new OrderedMapIterator(e, this.h, this); }; OrderedMap.prototype.getElementByKey = function(r) { - var e = this.g(this.ir, r); - return e.H; + var e = this.g(this.W, r); + return e.p; }; OrderedMap.prototype.union = function(r) { var e = this; r.forEach((function(r) { e.setElement(r[0], r[1]); })); - return this.i; + return this.M; }; OrderedMap.prototype[Symbol.iterator] = function() { - return this.rr(this.ir); + return this.P(this.W); }; return OrderedMap; }(TreeContainer); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js index 88c34d6267..0bd127050f 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js @@ -1,26 +1,26 @@ var __extends = this && this.t || function() { - var extendStatics = function(e, r) { + var extendStatics = function(e, t) { extendStatics = Object.setPrototypeOf || { __proto__: [] - } instanceof Array && function(e, r) { - e.__proto__ = r; - } || function(e, r) { - for (var t in r) if (Object.prototype.hasOwnProperty.call(r, t)) e[t] = r[t]; + } instanceof Array && function(e, t) { + e.__proto__ = t; + } || function(e, t) { + for (var r in t) if (Object.prototype.hasOwnProperty.call(t, r)) e[r] = t[r]; }; - return extendStatics(e, r); + return extendStatics(e, t); }; - return function(e, r) { - if (typeof r !== "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); - extendStatics(e, r); + return function(e, t) { + if (typeof t !== "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); + extendStatics(e, t); function __() { this.constructor = e; } - e.prototype = r === null ? Object.create(r) : (__.prototype = r.prototype, new __); + e.prototype = t === null ? Object.create(t) : (__.prototype = t.prototype, new __); }; }(); -var __generator = this && this.u || function(e, r) { - var t = { +var __generator = this && this.i || function(e, t) { + var r = { label: 0, sent: function() { if (o[0] & 1) throw o[1]; @@ -37,13 +37,13 @@ var __generator = this && this.u || function(e, r) { return this; }), u; function verb(e) { - return function(r) { - return step([ e, r ]); + return function(t) { + return step([ e, t ]); }; } function step(u) { if (n) throw new TypeError("Generator is already executing."); - while (t) try { + while (r) try { if (n = 1, i && (o = u[0] & 2 ? i["return"] : u[0] ? i["throw"] || ((o = i["return"]) && o.call(i), 0) : i.next) && !(o = o.call(i, u[1])).done) return o; if (i = 0, o) u = [ u[0] & 2, o.value ]; @@ -54,47 +54,47 @@ var __generator = this && this.u || function(e, r) { break; case 4: - t.label++; + r.label++; return { value: u[1], done: false }; case 5: - t.label++; + r.label++; i = u[1]; u = [ 0 ]; continue; case 7: - u = t.ops.pop(); - t.trys.pop(); + u = r.ops.pop(); + r.trys.pop(); continue; default: - if (!(o = t.trys, o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) { - t = 0; + if (!(o = r.trys, o = o.length > 0 && o[o.length - 1]) && (u[0] === 6 || u[0] === 2)) { + r = 0; continue; } if (u[0] === 3 && (!o || u[1] > o[0] && u[1] < o[3])) { - t.label = u[1]; + r.label = u[1]; break; } - if (u[0] === 6 && t.label < o[1]) { - t.label = o[1]; + if (u[0] === 6 && r.label < o[1]) { + r.label = o[1]; o = u; break; } - if (o && t.label < o[2]) { - t.label = o[2]; - t.ops.push(u); + if (o && r.label < o[2]) { + r.label = o[2]; + r.ops.push(u); break; } - if (o[2]) t.ops.pop(); - t.trys.pop(); + if (o[2]) r.ops.pop(); + r.trys.pop(); continue; } - u = r.call(e, t); + u = t.call(e, r); } catch (e) { u = [ 6, e ]; i = 0; @@ -109,9 +109,9 @@ var __generator = this && this.u || function(e, r) { } }; -var __values = this && this.Z || function(e) { - var r = typeof Symbol === "function" && Symbol.iterator, t = r && e[r], n = 0; - if (t) return t.call(e); +var __values = this && this.V || function(e) { + var t = typeof Symbol === "function" && Symbol.iterator, r = t && e[t], n = 0; + if (r) return r.call(e); if (e && typeof e.length === "number") return { next: function() { if (e && n >= e.length) e = void 0; @@ -121,7 +121,7 @@ var __values = this && this.Z || function(e) { }; } }; - throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined."); + throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined."); }; import TreeContainer from "./Base"; @@ -132,109 +132,111 @@ import { throwIteratorAccessError } from "../../utils/throwError"; var OrderedSetIterator = function(e) { __extends(OrderedSetIterator, e); - function OrderedSetIterator() { - return e !== null && e.apply(this, arguments) || this; + function OrderedSetIterator(t, r, n, i) { + var o = e.call(this, t, r, i) || this; + o.container = n; + return o; } Object.defineProperty(OrderedSetIterator.prototype, "pointer", { get: function() { if (this.o === this.h) { throwIteratorAccessError(); } - return this.o.p; + return this.o.u; }, enumerable: false, configurable: true }); OrderedSetIterator.prototype.copy = function() { - return new OrderedSetIterator(this.o, this.h, this.iteratorType); + return new OrderedSetIterator(this.o, this.h, this.container, this.iteratorType); }; return OrderedSetIterator; }(TreeIterator); var OrderedSet = function(e) { __extends(OrderedSet, e); - function OrderedSet(r, t, n) { - if (r === void 0) { - r = []; + function OrderedSet(t, r, n) { + if (t === void 0) { + t = []; } - var i = e.call(this, t, n) || this; + var i = e.call(this, r, n) || this; var o = i; - r.forEach((function(e) { + t.forEach((function(e) { o.insert(e); })); return i; } - OrderedSet.prototype.rr = function(e) { - return __generator(this, (function(r) { - switch (r.label) { + OrderedSet.prototype.P = function(e) { + return __generator(this, (function(t) { + switch (t.label) { case 0: if (e === undefined) return [ 2 ]; - return [ 5, __values(this.rr(e.er)) ]; + return [ 5, __values(this.P(e.K)) ]; case 1: - r.sent(); - return [ 4, e.p ]; + t.sent(); + return [ 4, e.u ]; case 2: - r.sent(); - return [ 5, __values(this.rr(e.tr)) ]; + t.sent(); + return [ 5, __values(this.P(e.N)) ]; case 3: - r.sent(); + t.sent(); return [ 2 ]; } })); }; OrderedSet.prototype.begin = function() { - return new OrderedSetIterator(this.h.er || this.h, this.h); + return new OrderedSetIterator(this.h.K || this.h, this.h, this); }; OrderedSet.prototype.end = function() { - return new OrderedSetIterator(this.h, this.h); + return new OrderedSetIterator(this.h, this.h, this); }; OrderedSet.prototype.rBegin = function() { - return new OrderedSetIterator(this.h.tr || this.h, this.h, 1); + return new OrderedSetIterator(this.h.N || this.h, this.h, this, 1); }; OrderedSet.prototype.rEnd = function() { - return new OrderedSetIterator(this.h, this.h, 1); + return new OrderedSetIterator(this.h, this.h, this, 1); }; OrderedSet.prototype.front = function() { - return this.h.er ? this.h.er.p : undefined; + return this.h.K ? this.h.K.u : undefined; }; OrderedSet.prototype.back = function() { - return this.h.tr ? this.h.tr.p : undefined; + return this.h.N ? this.h.N.u : undefined; }; - OrderedSet.prototype.insert = function(e, r) { - return this.v(e, undefined, r); + OrderedSet.prototype.insert = function(e, t) { + return this.v(e, undefined, t); }; OrderedSet.prototype.find = function(e) { - var r = this.g(this.ir, e); - return new OrderedSetIterator(r, this.h); + var t = this.g(this.W, e); + return new OrderedSetIterator(t, this.h, this); }; OrderedSet.prototype.lowerBound = function(e) { - var r = this.nr(this.ir, e); - return new OrderedSetIterator(r, this.h); + var t = this.U(this.W, e); + return new OrderedSetIterator(t, this.h, this); }; OrderedSet.prototype.upperBound = function(e) { - var r = this.ar(this.ir, e); - return new OrderedSetIterator(r, this.h); + var t = this.X(this.W, e); + return new OrderedSetIterator(t, this.h, this); }; OrderedSet.prototype.reverseLowerBound = function(e) { - var r = this.ur(this.ir, e); - return new OrderedSetIterator(r, this.h); + var t = this.Y(this.W, e); + return new OrderedSetIterator(t, this.h, this); }; OrderedSet.prototype.reverseUpperBound = function(e) { - var r = this.sr(this.ir, e); - return new OrderedSetIterator(r, this.h); + var t = this.Z(this.W, e); + return new OrderedSetIterator(t, this.h, this); }; OrderedSet.prototype.union = function(e) { - var r = this; + var t = this; e.forEach((function(e) { - r.insert(e); + t.insert(e); })); - return this.i; + return this.M; }; OrderedSet.prototype[Symbol.iterator] = function() { - return this.rr(this.ir); + return this.P(this.W); }; return OrderedSet; }(TreeContainer); diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.js index b28c89cbfe..bdeca24179 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.js @@ -1,5 +1,5 @@ /*! - * js-sdsl v4.2.0 + * js-sdsl v4.3.0 * https://github.com/js-sdsl/js-sdsl * (c) 2021-present ZLY201 <zilongyao1366@gmail.com> * MIT license @@ -301,108 +301,12 @@ return Stack; }(Base); - var SequentialContainer = /** @class */function (_super) { - __extends(SequentialContainer, _super); - function SequentialContainer() { - return _super !== null && _super.apply(this, arguments) || this; - } - return SequentialContainer; - }(Container); - - /** - * @description Throw an iterator access error. - * @internal - */ - function throwIteratorAccessError() { - throw new RangeError('Iterator access denied!'); - } - - var RandomIterator = /** @class */function (_super) { - __extends(RandomIterator, _super); - /** - * @internal - */ - function RandomIterator(index, size, getElementByPos, setElementByPos, iteratorType) { - var _this = _super.call(this, iteratorType) || this; - _this._node = index; - _this._size = size; - _this._getElementByPos = getElementByPos; - _this._setElementByPos = setElementByPos; - if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { - _this.pre = function () { - if (this._node === 0) { - throwIteratorAccessError(); - } - this._node -= 1; - return this; - }; - _this.next = function () { - if (this._node === this._size()) { - throwIteratorAccessError(); - } - this._node += 1; - return this; - }; - } else { - _this.pre = function () { - if (this._node === this._size() - 1) { - throwIteratorAccessError(); - } - this._node += 1; - return this; - }; - _this.next = function () { - if (this._node === -1) { - throwIteratorAccessError(); - } - this._node -= 1; - return this; - }; - } - return _this; - } - Object.defineProperty(RandomIterator.prototype, "pointer", { - get: function () { - if (this._node < 0 || this._node > this._size() - 1) { - throw new RangeError(); - } /** - * @internal - */ - return this._getElementByPos(this._node); - }, - set: function (newValue) { - if (this._node < 0 || this._node > this._size() - 1) { - throw new RangeError(); - } /** - * @internal - */ - this._setElementByPos(this._node, newValue); - }, - enumerable: false, - configurable: true - }); - return RandomIterator; - }(ContainerIterator); - - var DequeIterator = /** @class */function (_super) { - __extends(DequeIterator, _super); - function DequeIterator() { - return _super !== null && _super.apply(this, arguments) || this; - } - DequeIterator.prototype.copy = function () { - return new DequeIterator(this._node, this._size, this._getElementByPos, this._setElementByPos, this.iteratorType); - }; - return DequeIterator; - }(RandomIterator); - var Deque = /** @class */function (_super) { - __extends(Deque, _super); - function Deque(container, _bucketSize) { + var Queue = /** @class */function (_super) { + __extends(Queue, _super); + function Queue(container) { if (container === void 0) { container = []; } - if (_bucketSize === void 0) { - _bucketSize = 1 << 12; - } var _this = _super.call(this) || this; /** * @internal @@ -411,400 +315,16 @@ /** * @internal */ - _this._curFirst = 0; - /** - * @internal - */ - _this._last = 0; - /** - * @internal - */ - _this._curLast = 0; - /** - * @internal - */ - _this._bucketNum = 0; - /** - * @internal - */ - _this._map = []; - var _length; - if ('size' in container) { - if (typeof container.size === 'number') { - _length = container.size; - } else { - _length = container.size(); - } - } else if ('length' in container) { - _length = container.length; - } else { - throw new RangeError('Can\'t get container\'s size!'); - } - _this._bucketSize = _bucketSize; - _this._bucketNum = Math.max(Math.ceil(_length / _this._bucketSize), 1); - for (var i = 0; i < _this._bucketNum; ++i) { - _this._map.push(new Array(_this._bucketSize)); - } - var needBucketNum = Math.ceil(_length / _this._bucketSize); - _this._first = _this._last = (_this._bucketNum >> 1) - (needBucketNum >> 1); - _this._curFirst = _this._curLast = _this._bucketSize - _length % _this._bucketSize >> 1; + _this._queue = []; var self = _this; - container.forEach(function (element) { - self.pushBack(element); - }); - _this.size = _this.size.bind(_this); - _this.getElementByPos = _this.getElementByPos.bind(_this); - _this.setElementByPos = _this.setElementByPos.bind(_this); - return _this; - } - /** - * @description Growth the Deque. - * @internal - */ - Deque.prototype._reAllocate = function () { - var newMap = []; - var addBucketNum = Math.max(this._bucketNum >> 1, 1); - for (var i = 0; i < addBucketNum; ++i) { - newMap[i] = new Array(this._bucketSize); - } - for (var i = this._first; i < this._bucketNum; ++i) { - newMap[newMap.length] = this._map[i]; - } - for (var i = 0; i < this._last; ++i) { - newMap[newMap.length] = this._map[i]; - } - newMap[newMap.length] = __spreadArray([], __read(this._map[this._last]), false); - this._first = addBucketNum; - this._last = newMap.length - 1; - for (var i = 0; i < addBucketNum; ++i) { - newMap[newMap.length] = new Array(this._bucketSize); - } - this._map = newMap; - this._bucketNum = newMap.length; - }; - /** - * @description Get the bucket position of the element and the pointer position by index. - * @param pos - The element's index. - * @internal - */ - Deque.prototype._getElementIndex = function (pos) { - var offset = this._curFirst + pos + 1; - var offsetRemainder = offset % this._bucketSize; - var curNodePointerIndex = offsetRemainder - 1; - var curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize; - if (offsetRemainder === 0) curNodeBucketIndex -= 1; - curNodeBucketIndex %= this._bucketNum; - if (curNodePointerIndex < 0) curNodePointerIndex += this._bucketSize; - return { - curNodeBucketIndex: curNodeBucketIndex, - curNodePointerIndex: curNodePointerIndex - }; - }; - Deque.prototype.clear = function () { - this._map = [[]]; - this._bucketNum = 1; - this._first = this._last = this._length = 0; - this._curFirst = this._curLast = this._bucketSize >> 1; - }; - Deque.prototype.begin = function () { - return new DequeIterator(0, this.size, this.getElementByPos, this.setElementByPos); - }; - Deque.prototype.end = function () { - return new DequeIterator(this._length, this.size, this.getElementByPos, this.setElementByPos); - }; - Deque.prototype.rBegin = function () { - return new DequeIterator(this._length - 1, this.size, this.getElementByPos, this.setElementByPos, 1 /* IteratorType.REVERSE */); - }; - - Deque.prototype.rEnd = function () { - return new DequeIterator(-1, this.size, this.getElementByPos, this.setElementByPos, 1 /* IteratorType.REVERSE */); - }; - - Deque.prototype.front = function () { - return this._map[this._first][this._curFirst]; - }; - Deque.prototype.back = function () { - return this._map[this._last][this._curLast]; - }; - Deque.prototype.pushBack = function (element) { - if (this._length) { - if (this._curLast < this._bucketSize - 1) { - this._curLast += 1; - } else if (this._last < this._bucketNum - 1) { - this._last += 1; - this._curLast = 0; - } else { - this._last = 0; - this._curLast = 0; - } - if (this._last === this._first && this._curLast === this._curFirst) this._reAllocate(); - } - this._length += 1; - this._map[this._last][this._curLast] = element; - return this._length; - }; - Deque.prototype.popBack = function () { - if (this._length === 0) return; - var value = this._map[this._last][this._curLast]; - delete this._map[this._last][this._curLast]; - if (this._length !== 1) { - if (this._curLast > 0) { - this._curLast -= 1; - } else if (this._last > 0) { - this._last -= 1; - this._curLast = this._bucketSize - 1; - } else { - this._last = this._bucketNum - 1; - this._curLast = this._bucketSize - 1; - } - } - this._length -= 1; - return value; - }; - /** - * @description Push the element to the front. - * @param element - The element you want to push. - * @returns The size of queue after pushing. - */ - Deque.prototype.pushFront = function (element) { - if (this._length) { - if (this._curFirst > 0) { - this._curFirst -= 1; - } else if (this._first > 0) { - this._first -= 1; - this._curFirst = this._bucketSize - 1; - } else { - this._first = this._bucketNum - 1; - this._curFirst = this._bucketSize - 1; - } - if (this._first === this._last && this._curFirst === this._curLast) this._reAllocate(); - } - this._length += 1; - this._map[this._first][this._curFirst] = element; - return this._length; - }; - /** - * @description Remove the _first element. - * @returns The element you popped. - */ - Deque.prototype.popFront = function () { - if (this._length === 0) return; - var value = this._map[this._first][this._curFirst]; - delete this._map[this._first][this._curFirst]; - if (this._length !== 1) { - if (this._curFirst < this._bucketSize - 1) { - this._curFirst += 1; - } else if (this._first < this._bucketNum - 1) { - this._first += 1; - this._curFirst = 0; - } else { - this._first = 0; - this._curFirst = 0; - } - } - this._length -= 1; - return value; - }; - Deque.prototype.getElementByPos = function (pos) { - if (pos < 0 || pos > this._length - 1) { - throw new RangeError(); - } - var _a = this._getElementIndex(pos), - curNodeBucketIndex = _a.curNodeBucketIndex, - curNodePointerIndex = _a.curNodePointerIndex; - return this._map[curNodeBucketIndex][curNodePointerIndex]; - }; - Deque.prototype.setElementByPos = function (pos, element) { - if (pos < 0 || pos > this._length - 1) { - throw new RangeError(); - } - var _a = this._getElementIndex(pos), - curNodeBucketIndex = _a.curNodeBucketIndex, - curNodePointerIndex = _a.curNodePointerIndex; - this._map[curNodeBucketIndex][curNodePointerIndex] = element; - }; - Deque.prototype.insert = function (pos, element, num) { - if (num === void 0) { - num = 1; - } - if (pos < 0 || pos > this._length) { - throw new RangeError(); - } - if (pos === 0) { - while (num--) this.pushFront(element); - } else if (pos === this._length) { - while (num--) this.pushBack(element); - } else { - var arr = []; - for (var i = pos; i < this._length; ++i) { - arr.push(this.getElementByPos(i)); - } - this.cut(pos - 1); - for (var i = 0; i < num; ++i) this.pushBack(element); - for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]); - } - return this._length; - }; - /** - * @description Remove all elements after the specified position (excluding the specified position). - * @param pos - The previous position of the first removed element. - * @returns The size of the container after cutting. - * @example - * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1] - */ - Deque.prototype.cut = function (pos) { - if (pos < 0) { - this.clear(); - return 0; - } - var _a = this._getElementIndex(pos), - curNodeBucketIndex = _a.curNodeBucketIndex, - curNodePointerIndex = _a.curNodePointerIndex; - this._last = curNodeBucketIndex; - this._curLast = curNodePointerIndex; - this._length = pos + 1; - return this._length; - }; - Deque.prototype.eraseElementByPos = function (pos) { - if (pos < 0 || pos > this._length - 1) { - throw new RangeError(); - } - if (pos === 0) this.popFront();else if (pos === this._length - 1) this.popBack();else { - var arr = []; - for (var i = pos + 1; i < this._length; ++i) { - arr.push(this.getElementByPos(i)); - } - this.cut(pos); - this.popBack(); - var self_1 = this; - arr.forEach(function (el) { - self_1.pushBack(el); - }); - } - return this._length; - }; - Deque.prototype.eraseElementByValue = function (value) { - if (this._length === 0) return 0; - var arr = []; - for (var i = 0; i < this._length; ++i) { - var element = this.getElementByPos(i); - if (element !== value) arr.push(element); - } - var _length = arr.length; - for (var i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]); - return this.cut(_length - 1); - }; - Deque.prototype.eraseElementByIterator = function (iter) { - var _node = iter._node; - this.eraseElementByPos(_node); - iter = iter.next(); - return iter; - }; - Deque.prototype.find = function (element) { - for (var i = 0; i < this._length; ++i) { - if (this.getElementByPos(i) === element) { - return new DequeIterator(i, this.size, this.getElementByPos, this.setElementByPos); - } - } - return this.end(); - }; - Deque.prototype.reverse = function () { - var l = 0; - var r = this._length - 1; - while (l < r) { - var tmp = this.getElementByPos(l); - this.setElementByPos(l, this.getElementByPos(r)); - this.setElementByPos(r, tmp); - l += 1; - r -= 1; - } - }; - Deque.prototype.unique = function () { - if (this._length <= 1) { - return this._length; - } - var index = 1; - var pre = this.getElementByPos(0); - for (var i = 1; i < this._length; ++i) { - var cur = this.getElementByPos(i); - if (cur !== pre) { - pre = cur; - this.setElementByPos(index++, cur); - } - } - while (this._length > index) this.popBack(); - return this._length; - }; - Deque.prototype.sort = function (cmp) { - var arr = []; - for (var i = 0; i < this._length; ++i) { - arr.push(this.getElementByPos(i)); - } - arr.sort(cmp); - for (var i = 0; i < this._length; ++i) this.setElementByPos(i, arr[i]); - }; - /** - * @description Remove as much useless space as possible. - */ - Deque.prototype.shrinkToFit = function () { - if (this._length === 0) return; - var arr = []; - this.forEach(function (el) { - arr.push(el); + container.forEach(function (el) { + self.push(el); }); - this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1); - this._length = this._first = this._last = this._curFirst = this._curLast = 0; - this._map = []; - for (var i = 0; i < this._bucketNum; ++i) { - this._map.push(new Array(this._bucketSize)); - } - for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]); - }; - Deque.prototype.forEach = function (callback) { - for (var i = 0; i < this._length; ++i) { - callback(this.getElementByPos(i), i, this); - } - }; - Deque.prototype[Symbol.iterator] = function () { - return function () { - var i; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - i = 0; - _a.label = 1; - case 1: - if (!(i < this._length)) return [3 /*break*/, 4]; - return [4 /*yield*/, this.getElementByPos(i)]; - case 2: - _a.sent(); - _a.label = 3; - case 3: - ++i; - return [3 /*break*/, 1]; - case 4: - return [2 /*return*/]; - } - }); - }.bind(this)(); - }; - return Deque; - }(SequentialContainer); - - var Queue = /** @class */function (_super) { - __extends(Queue, _super); - function Queue(container) { - if (container === void 0) { - container = []; - } - var _this = _super.call(this) || this; - _this._queue = new Deque(container); - _this._length = _this._queue.size(); return _this; } Queue.prototype.clear = function () { - this._queue.clear(); - this._length = 0; + this._queue = []; + this._length = this._first = 0; }; /** * @description Inserts element to queue's end. @@ -812,9 +332,16 @@ * @returns The container length after pushing. */ Queue.prototype.push = function (element) { - this._queue.pushBack(element); - this._length += 1; - return this._length; + var capacity = this._queue.length; + if (this._first / capacity > 0.5 /* QUEUE_CONSTANT.ALLOCATE_SIGMA */ && this._first + this._length >= capacity && capacity > 4096 /* QUEUE_CONSTANT.MIN_ALLOCATE_SIZE */) { + var length_1 = this._length; + for (var i = 0; i < length_1; ++i) { + this._queue[i] = this._queue[this._first + i]; + } + this._first = 0; + this._queue[this._length] = element; + } else this._queue[this._first + this._length] = element; + return ++this._length; }; /** * @description Removes the first element. @@ -822,15 +349,17 @@ */ Queue.prototype.pop = function () { if (this._length === 0) return; + var el = this._queue[this._first++]; this._length -= 1; - return this._queue.popFront(); + return el; }; /** * @description Access the first element. * @returns The first element. */ Queue.prototype.front = function () { - return this._queue.front(); + if (this._length === 0) return; + return this._queue[this._first]; }; return Queue; }(Base); @@ -1023,13 +552,85 @@ return PriorityQueue; }(Base); + var SequentialContainer = /** @class */function (_super) { + __extends(SequentialContainer, _super); + function SequentialContainer() { + return _super !== null && _super.apply(this, arguments) || this; + } + return SequentialContainer; + }(Container); + + /** + * @description Throw an iterator access error. + * @internal + */ + function throwIteratorAccessError() { + throw new RangeError('Iterator access denied!'); + } + + var RandomIterator = /** @class */function (_super) { + __extends(RandomIterator, _super); + /** + * @internal + */ + function RandomIterator(index, iteratorType) { + var _this = _super.call(this, iteratorType) || this; + _this._node = index; + if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { + _this.pre = function () { + if (this._node === 0) { + throwIteratorAccessError(); + } + this._node -= 1; + return this; + }; + _this.next = function () { + if (this._node === this.container.size()) { + throwIteratorAccessError(); + } + this._node += 1; + return this; + }; + } else { + _this.pre = function () { + if (this._node === this.container.size() - 1) { + throwIteratorAccessError(); + } + this._node += 1; + return this; + }; + _this.next = function () { + if (this._node === -1) { + throwIteratorAccessError(); + } + this._node -= 1; + return this; + }; + } + return _this; + } + Object.defineProperty(RandomIterator.prototype, "pointer", { + get: function () { + return this.container.getElementByPos(this._node); + }, + set: function (newValue) { + this.container.setElementByPos(this._node, newValue); + }, + enumerable: false, + configurable: true + }); + return RandomIterator; + }(ContainerIterator); + var VectorIterator = /** @class */function (_super) { __extends(VectorIterator, _super); - function VectorIterator() { - return _super !== null && _super.apply(this, arguments) || this; + function VectorIterator(node, container, iteratorType) { + var _this = _super.call(this, node, iteratorType) || this; + _this.container = container; + return _this; } VectorIterator.prototype.copy = function () { - return new VectorIterator(this._node, this._size, this._getElementByPos, this._setElementByPos, this.iteratorType); + return new VectorIterator(this._node, this.container, this.iteratorType); }; return VectorIterator; }(RandomIterator); @@ -1058,9 +659,6 @@ self_1.pushBack(el); }); } - _this.size = _this.size.bind(_this); - _this.getElementByPos = _this.getElementByPos.bind(_this); - _this.setElementByPos = _this.setElementByPos.bind(_this); return _this; } Vector.prototype.clear = function () { @@ -1068,17 +666,17 @@ this._vector.length = 0; }; Vector.prototype.begin = function () { - return new VectorIterator(0, this.size, this.getElementByPos, this.setElementByPos); + return new VectorIterator(0, this); }; Vector.prototype.end = function () { - return new VectorIterator(this._length, this.size, this.getElementByPos, this.setElementByPos); + return new VectorIterator(this._length, this); }; Vector.prototype.rBegin = function () { - return new VectorIterator(this._length - 1, this.size, this.getElementByPos, this.setElementByPos, 1 /* IteratorType.REVERSE */); + return new VectorIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */); }; Vector.prototype.rEnd = function () { - return new VectorIterator(-1, this.size, this.getElementByPos, this.setElementByPos, 1 /* IteratorType.REVERSE */); + return new VectorIterator(-1, this, 1 /* IteratorType.REVERSE */); }; Vector.prototype.front = function () { @@ -1148,7 +746,7 @@ Vector.prototype.find = function (element) { for (var i = 0; i < this._length; ++i) { if (this._vector[i] === element) { - return new VectorIterator(i, this.size, this.getElementByPos, this.getElementByPos); + return new VectorIterator(i, this); } } return this.end(); @@ -1195,10 +793,11 @@ /** * @internal */ - function LinkListIterator(_node, _header, iteratorType) { + function LinkListIterator(_node, _header, container, iteratorType) { var _this = _super.call(this, iteratorType) || this; _this._node = _node; _this._header = _header; + _this.container = container; if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { _this.pre = function () { if (this._node._pre === this._header) { @@ -1249,7 +848,7 @@ configurable: true }); LinkListIterator.prototype.copy = function () { - return new LinkListIterator(this._node, this._header, this.iteratorType); + return new LinkListIterator(this._node, this._header, this.container, this.iteratorType); }; return LinkListIterator; }(ContainerIterator); @@ -1309,17 +908,17 @@ this._head = this._tail = this._header._pre = this._header._next = this._header; }; LinkList.prototype.begin = function () { - return new LinkListIterator(this._head, this._header); + return new LinkListIterator(this._head, this._header, this); }; LinkList.prototype.end = function () { - return new LinkListIterator(this._header, this._header); + return new LinkListIterator(this._header, this._header, this); }; LinkList.prototype.rBegin = function () { - return new LinkListIterator(this._tail, this._header, 1 /* IteratorType.REVERSE */); + return new LinkListIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */); }; LinkList.prototype.rEnd = function () { - return new LinkListIterator(this._header, this._header, 1 /* IteratorType.REVERSE */); + return new LinkListIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; LinkList.prototype.front = function () { @@ -1443,7 +1042,7 @@ var curNode = this._head; while (curNode !== this._header) { if (curNode._value === element) { - return new LinkListIterator(curNode, this._header); + return new LinkListIterator(curNode, this._header, this); } curNode = curNode._next; } @@ -1552,9 +1151,406 @@ return LinkList; }(SequentialContainer); - /** - * @internal - */ + var DequeIterator = /** @class */function (_super) { + __extends(DequeIterator, _super); + function DequeIterator(node, container, iteratorType) { + var _this = _super.call(this, node, iteratorType) || this; + _this.container = container; + return _this; + } + DequeIterator.prototype.copy = function () { + return new DequeIterator(this._node, this.container, this.iteratorType); + }; + return DequeIterator; + }(RandomIterator); + var Deque = /** @class */function (_super) { + __extends(Deque, _super); + function Deque(container, _bucketSize) { + if (container === void 0) { + container = []; + } + if (_bucketSize === void 0) { + _bucketSize = 1 << 12; + } + var _this = _super.call(this) || this; + /** + * @internal + */ + _this._first = 0; + /** + * @internal + */ + _this._curFirst = 0; + /** + * @internal + */ + _this._last = 0; + /** + * @internal + */ + _this._curLast = 0; + /** + * @internal + */ + _this._bucketNum = 0; + /** + * @internal + */ + _this._map = []; + var _length = function () { + if (typeof container.length === "number") return container.length; + if (typeof container.size === "number") return container.size; + if (typeof container.size === "function") return container.size(); + throw new TypeError("Cannot get the length or size of the container"); + }(); + _this._bucketSize = _bucketSize; + _this._bucketNum = Math.max(Math.ceil(_length / _this._bucketSize), 1); + for (var i = 0; i < _this._bucketNum; ++i) { + _this._map.push(new Array(_this._bucketSize)); + } + var needBucketNum = Math.ceil(_length / _this._bucketSize); + _this._first = _this._last = (_this._bucketNum >> 1) - (needBucketNum >> 1); + _this._curFirst = _this._curLast = _this._bucketSize - _length % _this._bucketSize >> 1; + var self = _this; + container.forEach(function (element) { + self.pushBack(element); + }); + return _this; + } + /** + * @description Growth the Deque. + * @internal + */ + Deque.prototype._reAllocate = function () { + var newMap = []; + var addBucketNum = Math.max(this._bucketNum >> 1, 1); + for (var i = 0; i < addBucketNum; ++i) { + newMap[i] = new Array(this._bucketSize); + } + for (var i = this._first; i < this._bucketNum; ++i) { + newMap[newMap.length] = this._map[i]; + } + for (var i = 0; i < this._last; ++i) { + newMap[newMap.length] = this._map[i]; + } + newMap[newMap.length] = __spreadArray([], __read(this._map[this._last]), false); + this._first = addBucketNum; + this._last = newMap.length - 1; + for (var i = 0; i < addBucketNum; ++i) { + newMap[newMap.length] = new Array(this._bucketSize); + } + this._map = newMap; + this._bucketNum = newMap.length; + }; + /** + * @description Get the bucket position of the element and the pointer position by index. + * @param pos - The element's index. + * @internal + */ + Deque.prototype._getElementIndex = function (pos) { + var offset = this._curFirst + pos + 1; + var offsetRemainder = offset % this._bucketSize; + var curNodePointerIndex = offsetRemainder - 1; + var curNodeBucketIndex = this._first + (offset - offsetRemainder) / this._bucketSize; + if (offsetRemainder === 0) curNodeBucketIndex -= 1; + curNodeBucketIndex %= this._bucketNum; + if (curNodePointerIndex < 0) curNodePointerIndex += this._bucketSize; + return { + curNodeBucketIndex: curNodeBucketIndex, + curNodePointerIndex: curNodePointerIndex + }; + }; + Deque.prototype.clear = function () { + this._map = [new Array(this._bucketSize)]; + this._bucketNum = 1; + this._first = this._last = this._length = 0; + this._curFirst = this._curLast = this._bucketSize >> 1; + }; + Deque.prototype.begin = function () { + return new DequeIterator(0, this); + }; + Deque.prototype.end = function () { + return new DequeIterator(this._length, this); + }; + Deque.prototype.rBegin = function () { + return new DequeIterator(this._length - 1, this, 1 /* IteratorType.REVERSE */); + }; + + Deque.prototype.rEnd = function () { + return new DequeIterator(-1, this, 1 /* IteratorType.REVERSE */); + }; + + Deque.prototype.front = function () { + if (this._length === 0) return; + return this._map[this._first][this._curFirst]; + }; + Deque.prototype.back = function () { + if (this._length === 0) return; + return this._map[this._last][this._curLast]; + }; + Deque.prototype.pushBack = function (element) { + if (this._length) { + if (this._curLast < this._bucketSize - 1) { + this._curLast += 1; + } else if (this._last < this._bucketNum - 1) { + this._last += 1; + this._curLast = 0; + } else { + this._last = 0; + this._curLast = 0; + } + if (this._last === this._first && this._curLast === this._curFirst) this._reAllocate(); + } + this._length += 1; + this._map[this._last][this._curLast] = element; + return this._length; + }; + Deque.prototype.popBack = function () { + if (this._length === 0) return; + var value = this._map[this._last][this._curLast]; + if (this._length !== 1) { + if (this._curLast > 0) { + this._curLast -= 1; + } else if (this._last > 0) { + this._last -= 1; + this._curLast = this._bucketSize - 1; + } else { + this._last = this._bucketNum - 1; + this._curLast = this._bucketSize - 1; + } + } + this._length -= 1; + return value; + }; + /** + * @description Push the element to the front. + * @param element - The element you want to push. + * @returns The size of queue after pushing. + */ + Deque.prototype.pushFront = function (element) { + if (this._length) { + if (this._curFirst > 0) { + this._curFirst -= 1; + } else if (this._first > 0) { + this._first -= 1; + this._curFirst = this._bucketSize - 1; + } else { + this._first = this._bucketNum - 1; + this._curFirst = this._bucketSize - 1; + } + if (this._first === this._last && this._curFirst === this._curLast) this._reAllocate(); + } + this._length += 1; + this._map[this._first][this._curFirst] = element; + return this._length; + }; + /** + * @description Remove the _first element. + * @returns The element you popped. + */ + Deque.prototype.popFront = function () { + if (this._length === 0) return; + var value = this._map[this._first][this._curFirst]; + if (this._length !== 1) { + if (this._curFirst < this._bucketSize - 1) { + this._curFirst += 1; + } else if (this._first < this._bucketNum - 1) { + this._first += 1; + this._curFirst = 0; + } else { + this._first = 0; + this._curFirst = 0; + } + } + this._length -= 1; + return value; + }; + Deque.prototype.getElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var _a = this._getElementIndex(pos), + curNodeBucketIndex = _a.curNodeBucketIndex, + curNodePointerIndex = _a.curNodePointerIndex; + return this._map[curNodeBucketIndex][curNodePointerIndex]; + }; + Deque.prototype.setElementByPos = function (pos, element) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + var _a = this._getElementIndex(pos), + curNodeBucketIndex = _a.curNodeBucketIndex, + curNodePointerIndex = _a.curNodePointerIndex; + this._map[curNodeBucketIndex][curNodePointerIndex] = element; + }; + Deque.prototype.insert = function (pos, element, num) { + if (num === void 0) { + num = 1; + } + if (pos < 0 || pos > this._length) { + throw new RangeError(); + } + if (pos === 0) { + while (num--) this.pushFront(element); + } else if (pos === this._length) { + while (num--) this.pushBack(element); + } else { + var arr = []; + for (var i = pos; i < this._length; ++i) { + arr.push(this.getElementByPos(i)); + } + this.cut(pos - 1); + for (var i = 0; i < num; ++i) this.pushBack(element); + for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]); + } + return this._length; + }; + /** + * @description Remove all elements after the specified position (excluding the specified position). + * @param pos - The previous position of the first removed element. + * @returns The size of the container after cutting. + * @example + * deque.cut(1); // Then deque's size will be 2. deque -> [0, 1] + */ + Deque.prototype.cut = function (pos) { + if (pos < 0) { + this.clear(); + return 0; + } + var _a = this._getElementIndex(pos), + curNodeBucketIndex = _a.curNodeBucketIndex, + curNodePointerIndex = _a.curNodePointerIndex; + this._last = curNodeBucketIndex; + this._curLast = curNodePointerIndex; + this._length = pos + 1; + return this._length; + }; + Deque.prototype.eraseElementByPos = function (pos) { + if (pos < 0 || pos > this._length - 1) { + throw new RangeError(); + } + if (pos === 0) this.popFront();else if (pos === this._length - 1) this.popBack();else { + var arr = []; + for (var i = pos + 1; i < this._length; ++i) { + arr.push(this.getElementByPos(i)); + } + this.cut(pos); + this.popBack(); + var self_1 = this; + arr.forEach(function (el) { + self_1.pushBack(el); + }); + } + return this._length; + }; + Deque.prototype.eraseElementByValue = function (value) { + if (this._length === 0) return 0; + var arr = []; + for (var i = 0; i < this._length; ++i) { + var element = this.getElementByPos(i); + if (element !== value) arr.push(element); + } + var _length = arr.length; + for (var i = 0; i < _length; ++i) this.setElementByPos(i, arr[i]); + return this.cut(_length - 1); + }; + Deque.prototype.eraseElementByIterator = function (iter) { + var _node = iter._node; + this.eraseElementByPos(_node); + iter = iter.next(); + return iter; + }; + Deque.prototype.find = function (element) { + for (var i = 0; i < this._length; ++i) { + if (this.getElementByPos(i) === element) { + return new DequeIterator(i, this); + } + } + return this.end(); + }; + Deque.prototype.reverse = function () { + var l = 0; + var r = this._length - 1; + while (l < r) { + var tmp = this.getElementByPos(l); + this.setElementByPos(l, this.getElementByPos(r)); + this.setElementByPos(r, tmp); + l += 1; + r -= 1; + } + }; + Deque.prototype.unique = function () { + if (this._length <= 1) { + return this._length; + } + var index = 1; + var pre = this.getElementByPos(0); + for (var i = 1; i < this._length; ++i) { + var cur = this.getElementByPos(i); + if (cur !== pre) { + pre = cur; + this.setElementByPos(index++, cur); + } + } + while (this._length > index) this.popBack(); + return this._length; + }; + Deque.prototype.sort = function (cmp) { + var arr = []; + for (var i = 0; i < this._length; ++i) { + arr.push(this.getElementByPos(i)); + } + arr.sort(cmp); + for (var i = 0; i < this._length; ++i) this.setElementByPos(i, arr[i]); + }; + /** + * @description Remove as much useless space as possible. + */ + Deque.prototype.shrinkToFit = function () { + if (this._length === 0) return; + var arr = []; + this.forEach(function (el) { + arr.push(el); + }); + this._bucketNum = Math.max(Math.ceil(this._length / this._bucketSize), 1); + this._length = this._first = this._last = this._curFirst = this._curLast = 0; + this._map = []; + for (var i = 0; i < this._bucketNum; ++i) { + this._map.push(new Array(this._bucketSize)); + } + for (var i = 0; i < arr.length; ++i) this.pushBack(arr[i]); + }; + Deque.prototype.forEach = function (callback) { + for (var i = 0; i < this._length; ++i) { + callback(this.getElementByPos(i), i, this); + } + }; + Deque.prototype[Symbol.iterator] = function () { + return function () { + var i; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + i = 0; + _a.label = 1; + case 1: + if (!(i < this._length)) return [3 /*break*/, 4]; + return [4 /*yield*/, this.getElementByPos(i)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + ++i; + return [3 /*break*/, 1]; + case 4: + return [2 /*return*/]; + } + }); + }.bind(this)(); + }; + return Deque; + }(SequentialContainer); + var TreeNode = /** @class */function () { function TreeNode(key, value) { this._color = 1 /* TreeNodeColor.RED */; @@ -1646,9 +1642,6 @@ }; return TreeNode; }(); - /** - * @internal - */ var TreeNodeEnableIndex = /** @class */function (_super) { __extends(TreeNodeEnableIndex, _super); function TreeNodeEnableIndex() { @@ -2292,10 +2285,10 @@ /** * @internal */ - function TreeIterator(_node, _header, iteratorType) { + function TreeIterator(node, header, iteratorType) { var _this = _super.call(this, iteratorType) || this; - _this._node = _node; - _this._header = _header; + _this._node = node; + _this._header = header; if (_this.iteratorType === 0 /* IteratorType.NORMAL */) { _this.pre = function () { if (this._node === this._header._left) { @@ -2372,8 +2365,10 @@ var OrderedSetIterator = /** @class */function (_super) { __extends(OrderedSetIterator, _super); - function OrderedSetIterator() { - return _super !== null && _super.apply(this, arguments) || this; + function OrderedSetIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; } Object.defineProperty(OrderedSetIterator.prototype, "pointer", { get: function () { @@ -2386,7 +2381,7 @@ configurable: true }); OrderedSetIterator.prototype.copy = function () { - return new OrderedSetIterator(this._node, this._header, this.iteratorType); + return new OrderedSetIterator(this._node, this._header, this.container, this.iteratorType); }; return OrderedSetIterator; }(TreeIterator); @@ -2436,17 +2431,17 @@ }; OrderedSet.prototype.begin = function () { - return new OrderedSetIterator(this._header._left || this._header, this._header); + return new OrderedSetIterator(this._header._left || this._header, this._header, this); }; OrderedSet.prototype.end = function () { - return new OrderedSetIterator(this._header, this._header); + return new OrderedSetIterator(this._header, this._header, this); }; OrderedSet.prototype.rBegin = function () { - return new OrderedSetIterator(this._header._right || this._header, this._header, 1 /* IteratorType.REVERSE */); + return new OrderedSetIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; OrderedSet.prototype.rEnd = function () { - return new OrderedSetIterator(this._header, this._header, 1 /* IteratorType.REVERSE */); + return new OrderedSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; OrderedSet.prototype.front = function () { @@ -2470,24 +2465,24 @@ return this._set(key, undefined, hint); }; OrderedSet.prototype.find = function (element) { - var curNode = this._findElementNode(this._root, element); - return new OrderedSetIterator(curNode, this._header); + var resNode = this._findElementNode(this._root, element); + return new OrderedSetIterator(resNode, this._header, this); }; OrderedSet.prototype.lowerBound = function (key) { var resNode = this._lowerBound(this._root, key); - return new OrderedSetIterator(resNode, this._header); + return new OrderedSetIterator(resNode, this._header, this); }; OrderedSet.prototype.upperBound = function (key) { var resNode = this._upperBound(this._root, key); - return new OrderedSetIterator(resNode, this._header); + return new OrderedSetIterator(resNode, this._header, this); }; OrderedSet.prototype.reverseLowerBound = function (key) { var resNode = this._reverseLowerBound(this._root, key); - return new OrderedSetIterator(resNode, this._header); + return new OrderedSetIterator(resNode, this._header, this); }; OrderedSet.prototype.reverseUpperBound = function (key) { var resNode = this._reverseUpperBound(this._root, key); - return new OrderedSetIterator(resNode, this._header); + return new OrderedSetIterator(resNode, this._header, this); }; OrderedSet.prototype.union = function (other) { var self = this; @@ -2504,8 +2499,10 @@ var OrderedMapIterator = /** @class */function (_super) { __extends(OrderedMapIterator, _super); - function OrderedMapIterator() { - return _super !== null && _super.apply(this, arguments) || this; + function OrderedMapIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; } Object.defineProperty(OrderedMapIterator.prototype, "pointer", { get: function () { @@ -2530,7 +2527,7 @@ configurable: true }); OrderedMapIterator.prototype.copy = function () { - return new OrderedMapIterator(this._node, this._header, this.iteratorType); + return new OrderedMapIterator(this._node, this._header, this.container, this.iteratorType); }; return OrderedMapIterator; }(TreeIterator); @@ -2580,17 +2577,17 @@ }; OrderedMap.prototype.begin = function () { - return new OrderedMapIterator(this._header._left || this._header, this._header); + return new OrderedMapIterator(this._header._left || this._header, this._header, this); }; OrderedMap.prototype.end = function () { - return new OrderedMapIterator(this._header, this._header); + return new OrderedMapIterator(this._header, this._header, this); }; OrderedMap.prototype.rBegin = function () { - return new OrderedMapIterator(this._header._right || this._header, this._header, 1 /* IteratorType.REVERSE */); + return new OrderedMapIterator(this._header._right || this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; OrderedMap.prototype.rEnd = function () { - return new OrderedMapIterator(this._header, this._header, 1 /* IteratorType.REVERSE */); + return new OrderedMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; OrderedMap.prototype.front = function () { @@ -2605,19 +2602,19 @@ }; OrderedMap.prototype.lowerBound = function (key) { var resNode = this._lowerBound(this._root, key); - return new OrderedMapIterator(resNode, this._header); + return new OrderedMapIterator(resNode, this._header, this); }; OrderedMap.prototype.upperBound = function (key) { var resNode = this._upperBound(this._root, key); - return new OrderedMapIterator(resNode, this._header); + return new OrderedMapIterator(resNode, this._header, this); }; OrderedMap.prototype.reverseLowerBound = function (key) { var resNode = this._reverseLowerBound(this._root, key); - return new OrderedMapIterator(resNode, this._header); + return new OrderedMapIterator(resNode, this._header, this); }; OrderedMap.prototype.reverseUpperBound = function (key) { var resNode = this._reverseUpperBound(this._root, key); - return new OrderedMapIterator(resNode, this._header); + return new OrderedMapIterator(resNode, this._header, this); }; /** * @description Insert a key-value pair or set value by the given key. @@ -2636,7 +2633,7 @@ }; OrderedMap.prototype.find = function (key) { var curNode = this._findElementNode(this._root, key); - return new OrderedMapIterator(curNode, this._header); + return new OrderedMapIterator(curNode, this._header, this); }; /** * @description Get the value of the element of the specified key. @@ -2875,8 +2872,10 @@ var HashSetIterator = /** @class */function (_super) { __extends(HashSetIterator, _super); - function HashSetIterator() { - return _super !== null && _super.apply(this, arguments) || this; + function HashSetIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; } Object.defineProperty(HashSetIterator.prototype, "pointer", { get: function () { @@ -2889,7 +2888,7 @@ configurable: true }); HashSetIterator.prototype.copy = function () { - return new HashSetIterator(this._node, this._header, this.iteratorType); + return new HashSetIterator(this._node, this._header, this.container, this.iteratorType); }; return HashSetIterator; }(HashContainerIterator); @@ -2907,17 +2906,17 @@ return _this; } HashSet.prototype.begin = function () { - return new HashSetIterator(this._head, this._header); + return new HashSetIterator(this._head, this._header, this); }; HashSet.prototype.end = function () { - return new HashSetIterator(this._header, this._header); + return new HashSetIterator(this._header, this._header, this); }; HashSet.prototype.rBegin = function () { - return new HashSetIterator(this._tail, this._header, 1 /* IteratorType.REVERSE */); + return new HashSetIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */); }; HashSet.prototype.rEnd = function () { - return new HashSetIterator(this._header, this._header, 1 /* IteratorType.REVERSE */); + return new HashSetIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; HashSet.prototype.front = function () { @@ -2955,7 +2954,7 @@ */ HashSet.prototype.find = function (key, isObject) { var node = this._findElementNode(key, isObject); - return new HashSetIterator(node, this._header); + return new HashSetIterator(node, this._header, this); }; HashSet.prototype.forEach = function (callback) { var index = 0; @@ -2991,8 +2990,10 @@ var HashMapIterator = /** @class */function (_super) { __extends(HashMapIterator, _super); - function HashMapIterator() { - return _super !== null && _super.apply(this, arguments) || this; + function HashMapIterator(node, header, container, iteratorType) { + var _this = _super.call(this, node, header, iteratorType) || this; + _this.container = container; + return _this; } Object.defineProperty(HashMapIterator.prototype, "pointer", { get: function () { @@ -3017,7 +3018,7 @@ configurable: true }); HashMapIterator.prototype.copy = function () { - return new HashMapIterator(this._node, this._header, this.iteratorType); + return new HashMapIterator(this._node, this._header, this.container, this.iteratorType); }; return HashMapIterator; }(HashContainerIterator); @@ -3035,17 +3036,17 @@ return _this; } HashMap.prototype.begin = function () { - return new HashMapIterator(this._head, this._header); + return new HashMapIterator(this._head, this._header, this); }; HashMap.prototype.end = function () { - return new HashMapIterator(this._header, this._header); + return new HashMapIterator(this._header, this._header, this); }; HashMap.prototype.rBegin = function () { - return new HashMapIterator(this._tail, this._header, 1 /* IteratorType.REVERSE */); + return new HashMapIterator(this._tail, this._header, this, 1 /* IteratorType.REVERSE */); }; HashMap.prototype.rEnd = function () { - return new HashMapIterator(this._header, this._header, 1 /* IteratorType.REVERSE */); + return new HashMapIterator(this._header, this._header, this, 1 /* IteratorType.REVERSE */); }; HashMap.prototype.front = function () { @@ -3068,13 +3069,6 @@ return this._set(key, value, isObject); }; /** - * @description Check key if exist in container. - * @param key - The element you want to search. - * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/> - * If a `undefined` value is passed in, the type will be automatically judged. - * @returns An iterator pointing to the element if found, or super end if not found. - */ - /** * @description Get the value of the element of the specified key. * @param key - The key want to search. * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/> @@ -3101,9 +3095,16 @@ } return [node._key, node._value]; }; + /** + * @description Check key if exist in container. + * @param key - The element you want to search. + * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/> + * If a `undefined` value is passed in, the type will be automatically judged. + * @returns An iterator pointing to the element if found, or super end if not found. + */ HashMap.prototype.find = function (key, isObject) { var node = this._findElementNode(key, isObject); - return new HashMapIterator(node, this._header); + return new HashMapIterator(node, this._header, this); }; HashMap.prototype.forEach = function (callback) { var index = 0; diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.min.js b/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.min.js index fac6f4ab2a..d9e814ccfc 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.min.js +++ b/tools/node_modules/eslint/node_modules/js-sdsl/dist/umd/js-sdsl.min.js @@ -1,8 +1,8 @@ /*! - * js-sdsl v4.2.0 + * js-sdsl v4.3.0 * https://github.com/js-sdsl/js-sdsl * (c) 2021-present ZLY201 <zilongyao1366@gmail.com> * MIT license */ -!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).sdsl={})}(this,function(t){"use strict";var k=function(t,i){return(k=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,i){t.__proto__=i}:function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}))(t,i)};function i(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}k(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}function r(e,n){var s,o,h,u={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},p={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(p[Symbol.iterator]=function(){return this}),p;function t(r){return function(t){var i=[r,t];if(s)throw new TypeError("Generator is already executing.");for(;u=p&&i[p=0]?0:u;)try{if(s=1,o&&(h=2&i[0]?o.return:i[0]?o.throw||((h=o.return)&&h.call(o),0):o.next)&&!(h=h.call(o,i[1])).done)return h;switch(o=0,(i=h?[2&i[0],h.value]:i)[0]){case 0:case 1:h=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,o=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(h=0<(h=u.trys).length&&h[h.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!h||i[1]>h[0]&&i[1]<h[3]))u.label=i[1];else if(6===i[0]&&u.label<h[1])u.label=h[1],h=i;else{if(!(h&&u.label<h[2])){h[2]&&u.ops.pop(),u.trys.pop();continue}u.label=h[2],u.ops.push(i)}}i=n.call(e,u)}catch(t){i=[6,t],o=0}finally{s=h=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}function u(t){var i="function"==typeof Symbol&&Symbol.iterator,r=i&&t[i],e=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&e>=t.length?void 0:t)&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,i){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,n,s=r.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(e=s.next()).done;)o.push(e.value)}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o}function p(t,i,r){if(r||2===arguments.length)for(var e,n=0,s=i.length;n<s;n++)!e&&n in i||((e=e||Array.prototype.slice.call(i,0,n))[n]=i[n]);return t.concat(e||Array.prototype.slice.call(i))}O.prototype.equals=function(t){return this.t===t.t};var e=O;function O(t){this.iteratorType=t=void 0===t?0:t}Object.defineProperty(S.prototype,"length",{get:function(){return this.i},enumerable:!1,configurable:!0}),S.prototype.size=function(){return this.i},S.prototype.empty=function(){return 0===this.i};var n=S;function S(){this.i=0}i(T,N=n);var N,_=T;function T(){return null!==N&&N.apply(this,arguments)||this}i(s,I=n),s.prototype.clear=function(){this.i=0,this.h=[]},s.prototype.push=function(t){return this.h.push(t),this.i+=1,this.i},s.prototype.pop=function(){if(0!==this.i)return--this.i,this.h.pop()},s.prototype.top=function(){return this.h[this.i-1]};var I,q=s;function s(t){void 0===t&&(t=[]);var i=I.call(this)||this,r=(i.h=[],i);return t.forEach(function(t){r.push(t)}),i}i(L,M=_);var M,H=L;function L(){return null!==M&&M.apply(this,arguments)||this}function o(){throw new RangeError("Iterator access denied!")}i(W,z=e),Object.defineProperty(W.prototype,"pointer",{get:function(){if(this.t<0||this.t>this.u()-1)throw new RangeError;return this.o(this.t)},set:function(t){if(this.t<0||this.t>this.u()-1)throw new RangeError;this.v(this.t,t)},enumerable:!1,configurable:!0});var z,Y=W;function W(t,i,r,e,n){n=z.call(this,n)||this;return n.t=t,n.u=i,n.o=r,n.v=e,0===n.iteratorType?(n.pre=function(){return 0===this.t&&o(),--this.t,this},n.next=function(){return this.t===this.u()&&o(),this.t+=1,this}):(n.pre=function(){return this.t===this.u()-1&&o(),this.t+=1,this},n.next=function(){return-1===this.t&&o(),--this.t,this}),n}i(Z,X=Y),Z.prototype.copy=function(){return new Z(this.t,this.u,this.o,this.v,this.iteratorType)};var X,f=Z;function Z(){return null!==X&&X.apply(this,arguments)||this}i(c,C=H),c.prototype.k=function(){for(var t=[],i=Math.max(this.S>>1,1),r=0;r<i;++r)t[r]=new Array(this.O);for(r=this.l;r<this.S;++r)t[t.length]=this.L[r];for(r=0;r<this.p;++r)t[t.length]=this.L[r];t[t.length]=p([],h(this.L[this.p]),!1),this.l=i,this.p=t.length-1;for(r=0;r<i;++r)t[t.length]=new Array(this.O);this.L=t,this.S=t.length},c.prototype.g=function(t){var t=this._+t+1,i=t%this.O,r=i-1,t=this.l+(t-i)/this.O;return 0==i&&--t,t%=this.S,r<0&&(r+=this.O),{curNodeBucketIndex:t,curNodePointerIndex:r}},c.prototype.clear=function(){this.L=[[]],this.S=1,this.l=this.p=this.i=0,this._=this.I=this.O>>1},c.prototype.begin=function(){return new f(0,this.size,this.getElementByPos,this.setElementByPos)},c.prototype.end=function(){return new f(this.i,this.size,this.getElementByPos,this.setElementByPos)},c.prototype.rBegin=function(){return new f(this.i-1,this.size,this.getElementByPos,this.setElementByPos,1)},c.prototype.rEnd=function(){return new f(-1,this.size,this.getElementByPos,this.setElementByPos,1)},c.prototype.front=function(){return this.L[this.l][this._]},c.prototype.back=function(){return this.L[this.p][this.I]},c.prototype.pushBack=function(t){return this.i&&(this.I<this.O-1?this.I+=1:(this.p<this.S-1?this.p+=1:this.p=0,this.I=0),this.p===this.l)&&this.I===this._&&this.k(),this.i+=1,this.L[this.p][this.I]=t,this.i},c.prototype.popBack=function(){var t;if(0!==this.i)return t=this.L[this.p][this.I],delete this.L[this.p][this.I],1!==this.i&&(0<this.I?--this.I:(0<this.p?--this.p:this.p=this.S-1,this.I=this.O-1)),--this.i,t},c.prototype.pushFront=function(t){return this.i&&(0<this._?--this._:(0<this.l?--this.l:this.l=this.S-1,this._=this.O-1),this.l===this.p)&&this._===this.I&&this.k(),this.i+=1,this.L[this.l][this._]=t,this.i},c.prototype.popFront=function(){var t;if(0!==this.i)return t=this.L[this.l][this._],delete this.L[this.l][this._],1!==this.i&&(this._<this.O-1?this._+=1:(this.l<this.S-1?this.l+=1:this.l=0,this._=0)),--this.i,t},c.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;var t=this.g(t),i=t.curNodeBucketIndex,t=t.curNodePointerIndex;return this.L[i][t]},c.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;var t=this.g(t),r=t.curNodeBucketIndex,t=t.curNodePointerIndex;this.L[r][t]=i},c.prototype.insert=function(t,i,r){if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;if(0===t)for(;r--;)this.pushFront(i);else if(t===this.i)for(;r--;)this.pushBack(i);else{for(var e=[],n=t;n<this.i;++n)e.push(this.getElementByPos(n));this.cut(t-1);for(n=0;n<r;++n)this.pushBack(i);for(n=0;n<e.length;++n)this.pushBack(e[n])}return this.i},c.prototype.cut=function(t){var i,r;return t<0?(this.clear(),0):(i=(r=this.g(t)).curNodeBucketIndex,r=r.curNodePointerIndex,this.p=i,this.I=r,this.i=t+1,this.i)},c.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;if(0===t)this.popFront();else if(t===this.i-1)this.popBack();else{for(var i=[],r=t+1;r<this.i;++r)i.push(this.getElementByPos(r));this.cut(t),this.popBack();var e=this;i.forEach(function(t){e.pushBack(t)})}return this.i},c.prototype.eraseElementByValue=function(t){if(0===this.i)return 0;for(var i=[],r=0;r<this.i;++r){var e=this.getElementByPos(r);e!==t&&i.push(e)}for(var n=i.length,r=0;r<n;++r)this.setElementByPos(r,i[r]);return this.cut(n-1)},c.prototype.eraseElementByIterator=function(t){var i=t.t;return this.eraseElementByPos(i),t=t.next()},c.prototype.find=function(t){for(var i=0;i<this.i;++i)if(this.getElementByPos(i)===t)return new f(i,this.size,this.getElementByPos,this.setElementByPos);return this.end()},c.prototype.reverse=function(){for(var t=0,i=this.i-1;t<i;){var r=this.getElementByPos(t);this.setElementByPos(t,this.getElementByPos(i)),this.setElementByPos(i,r),t+=1,--i}},c.prototype.unique=function(){if(!(this.i<=1)){for(var t=1,i=this.getElementByPos(0),r=1;r<this.i;++r){var e=this.getElementByPos(r);e!==i&&this.setElementByPos(t++,i=e)}for(;this.i>t;)this.popBack()}return this.i},c.prototype.sort=function(t){for(var i=[],r=0;r<this.i;++r)i.push(this.getElementByPos(r));i.sort(t);for(r=0;r<this.i;++r)this.setElementByPos(r,i[r])},c.prototype.shrinkToFit=function(){if(0!==this.i){var i=[];this.forEach(function(t){i.push(t)}),this.S=Math.max(Math.ceil(this.i/this.O),1),this.i=this.l=this.p=this._=this.I=0,this.L=[];for(var t=0;t<this.S;++t)this.L.push(new Array(this.O));for(t=0;t<i.length;++t)this.pushBack(i[t])}},c.prototype.forEach=function(t){for(var i=0;i<this.i;++i)t(this.getElementByPos(i),i,this)},c.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=0,t.label=1;case 1:return i<this.i?[4,this.getElementByPos(i)]:[3,4];case 2:t.sent(),t.label=3;case 3:return++i,[3,1];case 4:return[2]}})}.bind(this)()};var C,Q=c;function c(t,i){void 0===t&&(t=[]),void 0===i&&(i=4096);var r,e=C.call(this)||this;if(e.l=0,e._=0,e.p=0,e.I=0,e.S=0,e.L=[],"size"in t)r="number"==typeof t.size?t.size:t.size();else{if(!("length"in t))throw new RangeError("Can't get container's size!");r=t.length}e.O=i,e.S=Math.max(Math.ceil(r/e.O),1);for(var n=0;n<e.S;++n)e.L.push(new Array(e.O));var i=Math.ceil(r/e.O),s=(e.l=e.p=(e.S>>1)-(i>>1),e._=e.I=e.O-r%e.O>>1,e);return t.forEach(function(t){s.pushBack(t)}),e.size=e.size.bind(e),e.getElementByPos=e.getElementByPos.bind(e),e.setElementByPos=e.setElementByPos.bind(e),e}i(a,tt=n),a.prototype.clear=function(){this.H.clear(),this.i=0},a.prototype.push=function(t){return this.H.pushBack(t),this.i+=1,this.i},a.prototype.pop=function(){if(0!==this.i)return--this.i,this.H.popFront()},a.prototype.front=function(){return this.H.front()};var tt,it=a;function a(t){void 0===t&&(t=[]);var i=tt.call(this)||this;return i.H=new Q(t),i.i=i.H.size(),i}i(l,rt=n),l.prototype.T=function(t){for(var i=this.A[t];0<t;){var r=t-1>>1,e=this.A[r];if(this.M(e,i)<=0)break;this.A[t]=e,t=r}this.A[t]=i},l.prototype.C=function(t,i){for(var r=this.A[t];t<i;){var e=t<<1|1,n=e+1,s=this.A[e];if(n<this.i&&0<this.M(s,this.A[n])&&(s=this.A[e=n]),0<=this.M(s,r))break;this.A[t]=s,t=e}this.A[t]=r},l.prototype.clear=function(){this.i=0,this.A.length=0},l.prototype.push=function(t){this.A.push(t),this.T(this.i),this.i+=1},l.prototype.pop=function(){var t,i;if(0!==this.i)return t=this.A[0],i=this.A.pop(),--this.i,this.i&&(this.A[0]=i,this.C(0,this.i>>1)),t},l.prototype.top=function(){return this.A[0]},l.prototype.find=function(t){return 0<=this.A.indexOf(t)},l.prototype.remove=function(t){t=this.A.indexOf(t);return!(t<0||(0===t?this.pop():t===this.i-1?(this.A.pop(),--this.i):(this.A.splice(t,1,this.A.pop()),--this.i,this.T(t),this.C(t,this.i>>1)),0))},l.prototype.updateItem=function(t){t=this.A.indexOf(t);return!(t<0||(this.T(t),this.C(t,this.i>>1),0))},l.prototype.toArray=function(){return p([],h(this.A),!1)};var rt,n=l;function l(t,i,r){void 0===t&&(t=[]),void 0===i&&(i=function(t,i){return i<t?-1:t<i?1:0}),void 0===r&&(r=!0);for(var e,n=rt.call(this)||this,s=(n.M=i,Array.isArray(t)?n.A=r?p([],h(t),!1):t:(n.A=[],e=n,t.forEach(function(t){e.A.push(t)})),n.i=n.A.length,n.i>>1),o=n.i-1>>1;0<=o;--o)n.C(o,s);return n}i(nt,et=Y),nt.prototype.copy=function(){return new nt(this.t,this.u,this.o,this.v,this.iteratorType)};var et,y=nt;function nt(){return null!==et&&et.apply(this,arguments)||this}i(v,st=H),v.prototype.clear=function(){this.i=0,this.q.length=0},v.prototype.begin=function(){return new y(0,this.size,this.getElementByPos,this.setElementByPos)},v.prototype.end=function(){return new y(this.i,this.size,this.getElementByPos,this.setElementByPos)},v.prototype.rBegin=function(){return new y(this.i-1,this.size,this.getElementByPos,this.setElementByPos,1)},v.prototype.rEnd=function(){return new y(-1,this.size,this.getElementByPos,this.setElementByPos,1)},v.prototype.front=function(){return this.q[0]},v.prototype.back=function(){return this.q[this.i-1]},v.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;return this.q[t]},v.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;return this.q.splice(t,1),--this.i,this.i},v.prototype.eraseElementByValue=function(t){for(var i=0,r=0;r<this.i;++r)this.q[r]!==t&&(this.q[i++]=this.q[r]);return this.i=this.q.length=i,this.i},v.prototype.eraseElementByIterator=function(t){var i=t.t;return t=t.next(),this.eraseElementByPos(i),t},v.prototype.pushBack=function(t){return this.q.push(t),this.i+=1,this.i},v.prototype.popBack=function(){if(0!==this.i)return--this.i,this.q.pop()},v.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;this.q[t]=i},v.prototype.insert=function(t,i,r){var e;if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;return(e=this.q).splice.apply(e,p([t,0],h(new Array(r).fill(i)),!1)),this.i+=r,this.i},v.prototype.find=function(t){for(var i=0;i<this.i;++i)if(this.q[i]===t)return new y(i,this.size,this.getElementByPos,this.getElementByPos);return this.end()},v.prototype.reverse=function(){this.q.reverse()},v.prototype.unique=function(){for(var t=1,i=1;i<this.i;++i)this.q[i]!==this.q[i-1]&&(this.q[t++]=this.q[i]);return this.i=this.q.length=t,this.i},v.prototype.sort=function(t){this.q.sort(t)},v.prototype.forEach=function(t){for(var i=0;i<this.i;++i)t(this.q[i],i,this)},v.prototype[Symbol.iterator]=function(){return function(){return r(this,function(t){switch(t.label){case 0:return[5,u(this.q)];case 1:return t.sent(),[2]}})}.bind(this)()};var st,Y=v;function v(t,i){void 0===t&&(t=[]),void 0===i&&(i=!0);var r,e=st.call(this)||this;return Array.isArray(t)?(e.q=i?p([],h(t),!1):t,e.i=t.length):(e.q=[],r=e,t.forEach(function(t){r.pushBack(t)})),e.size=e.size.bind(e),e.getElementByPos=e.getElementByPos.bind(e),e.setElementByPos=e.setElementByPos.bind(e),e}i(D,ot=e),Object.defineProperty(D.prototype,"pointer",{get:function(){return this.t===this.D&&o(),this.t.R},set:function(t){this.t===this.D&&o(),this.t.R=t},enumerable:!1,configurable:!0}),D.prototype.copy=function(){return new D(this.t,this.D,this.iteratorType)};var ot,d=D;function D(t,i,r){r=ot.call(this,r)||this;return r.t=t,r.D=i,0===r.iteratorType?(r.pre=function(){return this.t.m===this.D&&o(),this.t=this.t.m,this},r.next=function(){return this.t===this.D&&o(),this.t=this.t.V,this}):(r.pre=function(){return this.t.V===this.D&&o(),this.t=this.t.V,this},r.next=function(){return this.t===this.D&&o(),this.t=this.t.m,this}),r}i(w,ht=H),w.prototype.P=function(t){var i=t.m,r=t.V;(i.V=r).m=i,t===this.j&&(this.j=r),t===this.N&&(this.N=i),--this.i},w.prototype.B=function(t,i){var r=i.V,t={R:t,m:i,V:r};i.V=t,r.m=t,i===this.D&&(this.j=t),r===this.D&&(this.N=t),this.i+=1},w.prototype.clear=function(){this.i=0,this.j=this.N=this.D.m=this.D.V=this.D},w.prototype.begin=function(){return new d(this.j,this.D)},w.prototype.end=function(){return new d(this.D,this.D)},w.prototype.rBegin=function(){return new d(this.N,this.D,1)},w.prototype.rEnd=function(){return new d(this.D,this.D,1)},w.prototype.front=function(){return this.j.R},w.prototype.back=function(){return this.N.R},w.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.j;t--;)i=i.V;return i.R},w.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.j;t--;)i=i.V;return this.P(i),this.i},w.prototype.eraseElementByValue=function(t){for(var i=this.j;i!==this.D;)i.R===t&&this.P(i),i=i.V;return this.i},w.prototype.eraseElementByIterator=function(t){var i=t.t;return i===this.D&&o(),t=t.next(),this.P(i),t},w.prototype.pushBack=function(t){return this.B(t,this.N),this.i},w.prototype.popBack=function(){var t;if(0!==this.i)return t=this.N.R,this.P(this.N),t},w.prototype.pushFront=function(t){return this.B(t,this.D),this.i},w.prototype.popFront=function(){var t;if(0!==this.i)return t=this.j.R,this.P(this.j),t},w.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;for(var r=this.j;t--;)r=r.V;r.R=i},w.prototype.insert=function(t,i,r){if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;if(!(r<=0))if(0===t)for(;r--;)this.pushFront(i);else if(t===this.i)for(;r--;)this.pushBack(i);else{for(var e=this.j,n=1;n<t;++n)e=e.V;var s=e.V;for(this.i+=r;r--;)e.V={R:i,m:e},e=(e.V.m=e).V;(e.V=s).m=e}return this.i},w.prototype.find=function(t){for(var i=this.j;i!==this.D;){if(i.R===t)return new d(i,this.D);i=i.V}return this.end()},w.prototype.reverse=function(){if(!(this.i<=1))for(var t=this.j,i=this.N,r=0;r<<1<this.i;){var e=t.R;t.R=i.R,i.R=e,t=t.V,i=i.m,r+=1}},w.prototype.unique=function(){if(!(this.i<=1))for(var t=this.j;t!==this.D;){for(var i=t;i.V!==this.D&&i.R===i.V.R;)i=i.V,--this.i;t.V=i.V,t=(t.V.m=t).V}return this.i},w.prototype.sort=function(t){var i,r;this.i<=1||(i=[],this.forEach(function(t){i.push(t)}),i.sort(t),r=this.j,i.forEach(function(t){r.R=t,r=r.V}))},w.prototype.merge=function(t){var i,r=this;return 0===this.i?t.forEach(function(t){r.pushBack(t)}):(i=this.j,t.forEach(function(t){for(;i!==r.D&&i.R<=t;)i=i.V;r.B(t,i.m)})),this.i},w.prototype.forEach=function(t){for(var i=this.j,r=0;i!==this.D;)t(i.R,r++,this),i=i.V},w.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:if(0===this.i)return[2];i=this.j,t.label=1;case 1:return i===this.D?[3,3]:[4,i.R];case 2:return t.sent(),i=i.V,[3,1];case 3:return[2]}})}.bind(this)()};var ht,H=w;function w(t){void 0===t&&(t=[]);var i=ht.call(this)||this,r=(i.D={},i.j=i.N=i.D.m=i.D.V=i.D,i);return t.forEach(function(t){r.pushBack(t)}),i}m.prototype.m=function(){var t=this;if(1===t.G&&t.U.U===t)t=t.K;else if(t.J)for(t=t.J;t.K;)t=t.K;else{for(var i=t.U;i.J===t;)i=(t=i).U;t=i}return t},m.prototype.V=function(){var t=this;if(t.K){for(t=t.K;t.J;)t=t.J;return t}for(var i=t.U;i.K===t;)i=(t=i).U;return t.K!==i?i:t},m.prototype.W=function(){var t=this.U,i=this.K,r=i.J;return t.U===this?t.U=i:t.J===this?t.J=i:t.K=i,i.U=t,(i.J=this).U=i,(this.K=r)&&(r.U=this),i},m.prototype.X=function(){var t=this.U,i=this.J,r=i.K;return t.U===this?t.U=i:t.J===this?t.J=i:t.K=i,i.U=t,(i.K=this).U=i,(this.J=r)&&(r.U=this),i};var ut=m;function m(t,i){this.G=1,this.F=void 0,this.R=void 0,this.J=void 0,this.K=void 0,this.U=void 0,this.F=t,this.R=i}i(g,E=ut),g.prototype.W=function(){var t=E.prototype.W.call(this);return this.Z(),t.Z(),t},g.prototype.X=function(){var t=E.prototype.X.call(this);return this.Z(),t.Z(),t},g.prototype.Z=function(){this.Y=1,this.J&&(this.Y+=this.J.Y),this.K&&(this.Y+=this.K.Y)};var E,pt=g;function g(){var t=null!==E&&E.apply(this,arguments)||this;return t.Y=1,t}i(b,ft=_),b.prototype.st=function(t,i){for(var r=this.D;t;){var e=this.M(t.F,i);if(e<0)t=t.K;else{if(!(0<e))return t;t=(r=t).J}}return r},b.prototype.ht=function(t,i){for(var r=this.D;t;)t=this.M(t.F,i)<=0?t.K:(r=t).J;return r},b.prototype.ut=function(t,i){for(var r=this.D;t;){var e=this.M(t.F,i);if(e<0)t=(r=t).K;else{if(!(0<e))return t;t=t.J}}return r},b.prototype.ot=function(t,i){for(var r=this.D;t;)t=this.M(t.F,i)<0?(r=t).K:t.J;return r},b.prototype.ft=function(t){for(;;){var i,r=t.U;if(r===this.D)return;if(1===t.G)return void(t.G=0);if(t===r.J)if(1===(i=r.K).G)i.G=0,r.G=1,r===this.$?this.$=r.W():r.W();else{if(i.K&&1===i.K.G)return i.G=r.G,r.G=0,i.K.G=0,void(r===this.$?this.$=r.W():r.W());i.J&&1===i.J.G?(i.G=1,i.J.G=0,i.X()):(i.G=1,t=r)}else if(1===(i=r.J).G)i.G=0,r.G=1,r===this.$?this.$=r.X():r.X();else{if(i.J&&1===i.J.G)return i.G=r.G,r.G=0,i.J.G=0,void(r===this.$?this.$=r.X():r.X());i.K&&1===i.K.G?(i.G=1,i.K.G=0,i.W()):(i.G=1,t=r)}}},b.prototype.nt=function(t){var i;if(1===this.i)return this.clear(),this.D;for(var r=t;r.J||r.K;){if(r.K)for(r=r.K;r.J;)r=r.J;else r=r.J;i=h([r.F,t.F],2),t.F=i[0],r.F=i[1],i=h([r.R,t.R],2),t.R=i[0],r.R=i[1],t=r}this.D.J===r?this.D.J=r.U:this.D.K===r&&(this.D.K=r.U),this.ft(r);var e=r.U;return r===e.J?e.J=void 0:e.K=void 0,--this.i,this.$.G=0,e},b.prototype.ct=function(t,i){return void 0!==t&&(!!this.ct(t.J,i)||!!i(t)||this.ct(t.K,i))},b.prototype.et=function(t){for(;;){var i=t.U;if(0===i.G)return;var r,e,n=i.U;if(i===n.J){if((r=n.K)&&1===r.G){if(r.G=i.G=0,n===this.$)return;n.G=1,t=n;continue}if(t===i.K)return t.G=0,t.J&&(t.J.U=i),t.K&&(t.K.U=n),i.K=t.J,n.J=t.K,t.J=i,(t.K=n)===this.$?(this.$=t,this.D.U=t):(e=n.U).J===n?e.J=t:e.K=t,t.U=n.U,i.U=t,n.U=t,n.G=1,{parentNode:i,grandParent:n,curNode:t};i.G=0,n===this.$?this.$=n.X():n.X()}else{if((r=n.J)&&1===r.G){if(r.G=i.G=0,n===this.$)return;n.G=1,t=n;continue}if(t===i.J)return t.G=0,t.J&&(t.J.U=n),t.K&&(t.K.U=i),n.K=t.J,i.J=t.K,t.J=n,t.K=i,n===this.$?(this.$=t,this.D.U=t):(e=n.U).J===n?e.J=t:e.K=t,t.U=n.U,i.U=t,n.U=t,n.G=1,{parentNode:i,grandParent:n,curNode:t};i.G=0,n===this.$?this.$=n.W():n.W()}return void(n.G=1)}},b.prototype.rt=function(t,i,r){if(void 0===this.$)this.i+=1,this.$=new this.tt(t,i),this.$.G=0,this.$.U=this.D,this.D.U=this.$,this.D.J=this.$,this.D.K=this.$;else{var e,n=this.D.J,s=this.M(n.F,t);if(0!==s){if(0<s)n.J=new this.tt(t,i),e=(n.J.U=n).J,this.D.J=e;else{var s=this.D.K,o=this.M(s.F,t);if(0===o)return void(s.R=i);if(o<0)s.K=new this.tt(t,i),e=(s.K.U=s).K,this.D.K=e;else{if(void 0!==r){o=r.t;if(o!==this.D){s=this.M(o.F,t);if(0===s)return void(o.R=i);if(0<s){r=o.m(),s=this.M(r.F,t);if(0===s)return void(r.R=i);s<0&&(e=new this.tt(t,i),void 0===r.K?(r.K=e).U=r:(o.J=e).U=o)}}}if(void 0===e)for(e=this.$;;){var h=this.M(e.F,t);if(0<h){if(void 0===e.J){e.J=new this.tt(t,i),e=(e.J.U=e).J;break}e=e.J}else{if(!(h<0))return void(e.R=i);if(void 0===e.K){e.K=new this.tt(t,i),e=(e.K.U=e).K;break}e=e.K}}}}return this.i+=1,e}n.R=i}},b.prototype.vt=function(t,i){for(;t;){var r=this.M(t.F,i);if(r<0)t=t.K;else{if(!(0<r))return t;t=t.J}}return t||this.D},b.prototype.clear=function(){this.i=0,this.$=void 0,this.D.U=void 0,this.D.J=this.D.K=void 0},b.prototype.updateKeyByIterator=function(t,i){t=t.t;if(t===this.D&&o(),1!==this.i){if(t===this.D.J)return 0<this.M(t.V().F,i)&&(t.F=i,!0);if(t===this.D.K)return this.M(t.m().F,i)<0&&(t.F=i,!0);var r=t.m().F;if(0<=this.M(r,i))return!1;if(r=t.V().F,this.M(r,i)<=0)return!1}return t.F=i,!0},b.prototype.eraseElementByPos=function(i){if(i<0||i>this.i-1)throw new RangeError;var r=0,e=this;return this.ct(this.$,function(t){return i===r?(e.P(t),!0):(r+=1,!1)}),this.i},b.prototype.eraseElementByKey=function(t){return 0!==this.i&&(t=this.vt(this.$,t))!==this.D&&(this.P(t),!0)},b.prototype.eraseElementByIterator=function(t){var i=t.t,r=(i===this.D&&o(),void 0===i.K);return 0===t.iteratorType?r&&t.next():r&&void 0!==i.J||t.next(),this.P(i),t},b.prototype.forEach=function(t){var i,r,e=0;try{for(var n=u(this),s=n.next();!s.done;s=n.next())t(s.value,e++,this)}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}},b.prototype.getElementByPos=function(t){var i,r,e;if(t<0||t>this.i-1)throw new RangeError;var n=0;try{for(var s=u(this),o=s.next();!o.done;o=s.next()){var h=o.value;if(n===t){e=h;break}n+=1}}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return e},b.prototype.getHeight=function(){var i;return 0===this.i?0:(i=function(t){return t?Math.max(i(t.J),i(t.K))+1:0})(this.$)};var ft,B=b;function b(t,i){void 0===t&&(t=function(t,i){return t<i?-1:i<t?1:0}),void 0===i&&(i=!1);var r=ft.call(this)||this;return r.$=void 0,r.M=t,i?(r.tt=pt,r.it=function(t,i,r){t=this.rt(t,i,r);if(t){for(var e=t.U;e!==this.D;)e.Y+=1,e=e.U;var i=this.et(t);i&&(r=i.parentNode,t=i.grandParent,i=i.curNode,r.Z(),t.Z(),i.Z())}return this.i},r.P=function(t){for(var i=this.nt(t);i!==this.D;)--i.Y,i=i.U}):(r.tt=ut,r.it=function(t,i,r){t=this.rt(t,i,r);return t&&this.et(t),this.i},r.P=r.nt),r.D=new r.tt,r}i(lt,ct=e),Object.defineProperty(lt.prototype,"index",{get:function(){var t=this.t,i=this.D.U;if(t===this.D)return i?i.Y-1:0;var r=0;for(t.J&&(r+=t.J.Y);t!==i;){var e=t.U;t===e.K&&(r+=1,e.J)&&(r+=e.J.Y),t=e}return r},enumerable:!1,configurable:!0});var ct,at=lt;function lt(t,i,r){r=ct.call(this,r)||this;return r.t=t,r.D=i,0===r.iteratorType?(r.pre=function(){return this.t===this.D.J&&o(),this.t=this.t.m(),this},r.next=function(){return this.t===this.D&&o(),this.t=this.t.V(),this}):(r.pre=function(){return this.t===this.D.K&&o(),this.t=this.t.V(),this},r.next=function(){return this.t===this.D&&o(),this.t=this.t.m(),this}),r}i(J,yt=at),Object.defineProperty(J.prototype,"pointer",{get:function(){return this.t===this.D&&o(),this.t.F},enumerable:!1,configurable:!0}),J.prototype.copy=function(){return new J(this.t,this.D,this.iteratorType)};var yt,P=J;function J(){return null!==yt&&yt.apply(this,arguments)||this}i(K,vt=B),K.prototype.dt=function(i){return r(this,function(t){switch(t.label){case 0:return void 0===i?[2]:[5,u(this.dt(i.J))];case 1:return t.sent(),[4,i.F];case 2:return t.sent(),[5,u(this.dt(i.K))];case 3:return t.sent(),[2]}})},K.prototype.begin=function(){return new P(this.D.J||this.D,this.D)},K.prototype.end=function(){return new P(this.D,this.D)},K.prototype.rBegin=function(){return new P(this.D.K||this.D,this.D,1)},K.prototype.rEnd=function(){return new P(this.D,this.D,1)},K.prototype.front=function(){return this.D.J?this.D.J.F:void 0},K.prototype.back=function(){return this.D.K?this.D.K.F:void 0},K.prototype.insert=function(t,i){return this.it(t,void 0,i)},K.prototype.find=function(t){t=this.vt(this.$,t);return new P(t,this.D)},K.prototype.lowerBound=function(t){t=this.st(this.$,t);return new P(t,this.D)},K.prototype.upperBound=function(t){t=this.ht(this.$,t);return new P(t,this.D)},K.prototype.reverseLowerBound=function(t){t=this.ut(this.$,t);return new P(t,this.D)},K.prototype.reverseUpperBound=function(t){t=this.ot(this.$,t);return new P(t,this.D)},K.prototype.union=function(t){var i=this;return t.forEach(function(t){i.insert(t)}),this.i},K.prototype[Symbol.iterator]=function(){return this.dt(this.$)};var vt,dt=K;function K(t,i,r){void 0===t&&(t=[]);var i=vt.call(this,i,r)||this,e=i;return t.forEach(function(t){e.insert(t)}),i}i(V,Dt=at),Object.defineProperty(V.prototype,"pointer",{get:function(){this.t===this.D&&o();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.t.F:"1"===i?e.t.R:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.t.R=r,!0}})},enumerable:!1,configurable:!0}),V.prototype.copy=function(){return new V(this.t,this.D,this.iteratorType)};var Dt,R=V;function V(){return null!==Dt&&Dt.apply(this,arguments)||this}i(A,wt=B),A.prototype.dt=function(i){return r(this,function(t){switch(t.label){case 0:return void 0===i?[2]:[5,u(this.dt(i.J))];case 1:return t.sent(),[4,[i.F,i.R]];case 2:return t.sent(),[5,u(this.dt(i.K))];case 3:return t.sent(),[2]}})},A.prototype.begin=function(){return new R(this.D.J||this.D,this.D)},A.prototype.end=function(){return new R(this.D,this.D)},A.prototype.rBegin=function(){return new R(this.D.K||this.D,this.D,1)},A.prototype.rEnd=function(){return new R(this.D,this.D,1)},A.prototype.front=function(){var t;if(0!==this.i)return[(t=this.D.J).F,t.R]},A.prototype.back=function(){var t;if(0!==this.i)return[(t=this.D.K).F,t.R]},A.prototype.lowerBound=function(t){t=this.st(this.$,t);return new R(t,this.D)},A.prototype.upperBound=function(t){t=this.ht(this.$,t);return new R(t,this.D)},A.prototype.reverseLowerBound=function(t){t=this.ut(this.$,t);return new R(t,this.D)},A.prototype.reverseUpperBound=function(t){t=this.ot(this.$,t);return new R(t,this.D)},A.prototype.setElement=function(t,i,r){return this.it(t,i,r)},A.prototype.find=function(t){t=this.vt(this.$,t);return new R(t,this.D)},A.prototype.getElementByKey=function(t){return this.vt(this.$,t).R},A.prototype.union=function(t){var i=this;return t.forEach(function(t){i.setElement(t[0],t[1])}),this.i},A.prototype[Symbol.iterator]=function(){return this.dt(this.$)};var wt,at=A;function A(t,i,r){void 0===t&&(t=[]);var i=wt.call(this,i,r)||this,e=i;return t.forEach(function(t){e.setElement(t[0],t[1])}),i}function mt(t){var i=typeof t;return"object"==i&&null!==t||"function"==i}i(gt,Et=e);var Et,B=gt;function gt(t,i,r){r=Et.call(this,r)||this;return r.t=t,r.D=i,0===r.iteratorType?(r.pre=function(){return this.t.m===this.D&&o(),this.t=this.t.m,this},r.next=function(){return this.t===this.D&&o(),this.t=this.t.V,this}):(r.pre=function(){return this.t.V===this.D&&o(),this.t=this.t.V,this},r.next=function(){return this.t===this.D&&o(),this.t=this.t.m,this}),r}i(U,Bt=_),U.prototype.P=function(t){var i=t.m,r=t.V;(i.V=r).m=i,t===this.j&&(this.j=r),t===this.N&&(this.N=i),--this.i},U.prototype.it=function(t,i,r){var e;if(r=void 0===r?mt(t):r){r=t[this.HASH_TAG];if(void 0!==r)return this.lt[r].R=i,this.i;Object.defineProperty(t,this.HASH_TAG,{value:this.lt.length,configurable:!0}),e={F:t,R:i,m:this.N,V:this.D},this.lt.push(e)}else{r=this.wt[t];if(r)return r.R=i,this.i;e={F:t,R:i,m:this.N,V:this.D},this.wt[t]=e}return 0===this.i?(this.j=e,this.D.V=e):this.N.V=e,this.N=e,this.D.m=e,++this.i},U.prototype.vt=function(t,i){return(i=void 0===i?mt(t):i)?void 0===(i=t[this.HASH_TAG])?this.D:this.lt[i]:this.wt[t]||this.D},U.prototype.clear=function(){var i=this.HASH_TAG;this.lt.forEach(function(t){delete t.F[i]}),this.lt=[],this.wt={},Object.setPrototypeOf(this.wt,null),this.i=0,this.j=this.N=this.D.m=this.D.V=this.D},U.prototype.eraseElementByKey=function(t,i){var r;if(i=void 0===i?mt(t):i){i=t[this.HASH_TAG];if(void 0===i)return!1;delete t[this.HASH_TAG],r=this.lt[i],delete this.lt[i]}else{if(void 0===(r=this.wt[t]))return!1;delete this.wt[t]}return this.P(r),!0},U.prototype.eraseElementByIterator=function(t){var i=t.t;return i===this.D&&o(),this.P(i),t.next()},U.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.j;t--;)i=i.V;return this.P(i),this.i};var Bt,e=U;function U(){var t=Bt.call(this)||this;return t.lt=[],t.wt={},t.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(t.wt,null),t.D={},t.D.m=t.D.V=t.j=t.N=t.D,t}i(G,bt=B),Object.defineProperty(G.prototype,"pointer",{get:function(){return this.t===this.D&&o(),this.t.F},enumerable:!1,configurable:!0}),G.prototype.copy=function(){return new G(this.t,this.D,this.iteratorType)};var bt,j=G;function G(){return null!==bt&&bt.apply(this,arguments)||this}i(F,Pt=e),F.prototype.begin=function(){return new j(this.j,this.D)},F.prototype.end=function(){return new j(this.D,this.D)},F.prototype.rBegin=function(){return new j(this.N,this.D,1)},F.prototype.rEnd=function(){return new j(this.D,this.D,1)},F.prototype.front=function(){return this.j.F},F.prototype.back=function(){return this.N.F},F.prototype.insert=function(t,i){return this.it(t,void 0,i)},F.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.j;t--;)i=i.V;return i.F},F.prototype.find=function(t,i){t=this.vt(t,i);return new j(t,this.D)},F.prototype.forEach=function(t){for(var i=0,r=this.j;r!==this.D;)t(r.F,i++,this),r=r.V},F.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=this.j,t.label=1;case 1:return i===this.D?[3,3]:[4,i.F];case 2:return t.sent(),i=i.V,[3,1];case 3:return[2]}})}.bind(this)()};var Pt,_=F;function F(t){void 0===t&&(t=[]);var i=Pt.call(this)||this,r=i;return t.forEach(function(t){r.insert(t)}),i}i(Kt,Jt=B),Object.defineProperty(Kt.prototype,"pointer",{get:function(){this.t===this.D&&o();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.t.F:"1"===i?e.t.R:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.t.R=r,!0}})},enumerable:!1,configurable:!0}),Kt.prototype.copy=function(){return new Kt(this.t,this.D,this.iteratorType)};var Jt,x=Kt;function Kt(){return null!==Jt&&Jt.apply(this,arguments)||this}i($,Rt=e),$.prototype.begin=function(){return new x(this.j,this.D)},$.prototype.end=function(){return new x(this.D,this.D)},$.prototype.rBegin=function(){return new x(this.N,this.D,1)},$.prototype.rEnd=function(){return new x(this.D,this.D,1)},$.prototype.front=function(){if(0!==this.i)return[this.j.F,this.j.R]},$.prototype.back=function(){if(0!==this.i)return[this.N.F,this.N.R]},$.prototype.setElement=function(t,i,r){return this.it(t,i,r)},$.prototype.getElementByKey=function(t,i){return(i=void 0===i?mt(t):i)?void 0!==(i=t[this.HASH_TAG])?this.lt[i].R:void 0:(i=this.wt[t])?i.R:void 0},$.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.j;t--;)i=i.V;return[i.F,i.R]},$.prototype.find=function(t,i){t=this.vt(t,i);return new x(t,this.D)},$.prototype.forEach=function(t){for(var i=0,r=this.j;r!==this.D;)t([r.F,r.R],i++,this),r=r.V},$.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=this.j,t.label=1;case 1:return i===this.D?[3,3]:[4,[i.F,i.R]];case 2:return t.sent(),i=i.V,[3,1];case 3:return[2]}})}.bind(this)()};var Rt,B=$;function $(t){void 0===t&&(t=[]);var i=Rt.call(this)||this,r=i;return t.forEach(function(t){r.setElement(t[0],t[1])}),i}t.Deque=Q,t.HashMap=B,t.HashSet=_,t.LinkList=H,t.OrderedMap=at,t.OrderedSet=dt,t.PriorityQueue=n,t.Queue=it,t.Stack=q,t.Vector=Y,Object.defineProperty(t,"_t",{value:!0})}); +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).sdsl={})}(this,function(t){"use strict";var L=function(t,i){return(L=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,i){t.__proto__=i}:function(t,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}))(t,i)};function i(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=t}L(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}function r(e,n){var o,s,h,u={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(r){return function(t){var i=[r,t];if(o)throw new TypeError("Generator is already executing.");for(;u=f&&i[f=0]?0:u;)try{if(o=1,s&&(h=2&i[0]?s.return:i[0]?s.throw||((h=s.return)&&h.call(s),0):s.next)&&!(h=h.call(s,i[1])).done)return h;switch(s=0,(i=h?[2&i[0],h.value]:i)[0]){case 0:case 1:h=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,s=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(h=0<(h=u.trys).length&&h[h.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!h||i[1]>h[0]&&i[1]<h[3]))u.label=i[1];else if(6===i[0]&&u.label<h[1])u.label=h[1],h=i;else{if(!(h&&u.label<h[2])){h[2]&&u.ops.pop(),u.trys.pop();continue}u.label=h[2],u.ops.push(i)}}i=n.call(e,u)}catch(t){i=[6,t],s=0}finally{o=h=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}function u(t){var i="function"==typeof Symbol&&Symbol.iterator,r=i&&t[i],e=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&e>=t.length?void 0:t)&&t[e++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,i){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,n,o=r.call(t),s=[];try{for(;(void 0===i||0<i--)&&!(e=o.next()).done;)s.push(e.value)}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function f(t,i,r){if(r||2===arguments.length)for(var e,n=0,o=i.length;n<o;n++)!e&&n in i||((e=e||Array.prototype.slice.call(i,0,n))[n]=i[n]);return t.concat(e||Array.prototype.slice.call(i))}M.prototype.equals=function(t){return this.t===t.t};var e=M;function M(t){this.iteratorType=t=void 0===t?0:t}Object.defineProperty(V.prototype,"length",{get:function(){return this.i},enumerable:!1,configurable:!0}),V.prototype.size=function(){return this.i},V.prototype.empty=function(){return 0===this.i};var n=V;function V(){this.i=0}i(j,R=n);var R,_=j;function j(){return null!==R&&R.apply(this,arguments)||this}i(o,q=n),o.prototype.clear=function(){this.i=0,this.h=[]},o.prototype.push=function(t){return this.h.push(t),this.i+=1,this.i},o.prototype.pop=function(){if(0!==this.i)return--this.i,this.h.pop()},o.prototype.top=function(){return this.h[this.i-1]};var q,C=o;function o(t){void 0===t&&(t=[]);var i=q.call(this)||this,r=(i.h=[],i);return t.forEach(function(t){r.push(t)}),i}i(s,D=n),s.prototype.clear=function(){this.o=[],this.i=this.u=0},s.prototype.push=function(t){var i=this.o.length;if(.5<this.u/i&&this.u+this.i>=i&&4096<i){for(var r=this.i,e=0;e<r;++e)this.o[e]=this.o[this.u+e];this.u=0,this.o[this.i]=t}else this.o[this.u+this.i]=t;return++this.i},s.prototype.pop=function(){var t;if(0!==this.i)return t=this.o[this.u++],--this.i,t},s.prototype.front=function(){if(0!==this.i)return this.o[this.u]};var D,K=s;function s(t){void 0===t&&(t=[]);var i=D.call(this)||this,r=(i.u=0,i.o=[],i);return t.forEach(function(t){r.push(t)}),i}i(p,U=n),p.prototype.p=function(t){for(var i=this.l[t];0<t;){var r=t-1>>1,e=this.l[r];if(this.v(e,i)<=0)break;this.l[t]=e,t=r}this.l[t]=i},p.prototype._=function(t,i){for(var r=this.l[t];t<i;){var e=t<<1|1,n=e+1,o=this.l[e];if(n<this.i&&0<this.v(o,this.l[n])&&(o=this.l[e=n]),0<=this.v(o,r))break;this.l[t]=o,t=e}this.l[t]=r},p.prototype.clear=function(){this.i=0,this.l.length=0},p.prototype.push=function(t){this.l.push(t),this.p(this.i),this.i+=1},p.prototype.pop=function(){var t,i;if(0!==this.i)return t=this.l[0],i=this.l.pop(),--this.i,this.i&&(this.l[0]=i,this._(0,this.i>>1)),t},p.prototype.top=function(){return this.l[0]},p.prototype.find=function(t){return 0<=this.l.indexOf(t)},p.prototype.remove=function(t){t=this.l.indexOf(t);return!(t<0||(0===t?this.pop():t===this.i-1?(this.l.pop(),--this.i):(this.l.splice(t,1,this.l.pop()),--this.i,this.p(t),this._(t,this.i>>1)),0))},p.prototype.updateItem=function(t){t=this.l.indexOf(t);return!(t<0||(this.p(t),this._(t,this.i>>1),0))},p.prototype.toArray=function(){return f([],h(this.l),!1)};var U,n=p;function p(t,i,r){void 0===t&&(t=[]),void 0===i&&(i=function(t,i){return i<t?-1:t<i?1:0}),void 0===r&&(r=!0);for(var e,n=U.call(this)||this,o=(n.v=i,Array.isArray(t)?n.l=r?f([],h(t),!1):t:(n.l=[],e=n,t.forEach(function(t){e.l.push(t)})),n.i=n.l.length,n.i>>1),s=n.i-1>>1;0<=s;--s)n._(s,o);return n}i(Y,J=_);var J,c=Y;function Y(){return null!==J&&J.apply(this,arguments)||this}function a(){throw new RangeError("Iterator access denied!")}i(Z,z=e),Object.defineProperty(Z.prototype,"pointer",{get:function(){return this.container.getElementByPos(this.t)},set:function(t){this.container.setElementByPos(this.t,t)},enumerable:!1,configurable:!0});var z,W=Z;function Z(t,i){i=z.call(this,i)||this;return i.t=t,0===i.iteratorType?(i.pre=function(){return 0===this.t&&a(),--this.t,this},i.next=function(){return this.t===this.container.size()&&a(),this.t+=1,this}):(i.pre=function(){return this.t===this.container.size()-1&&a(),this.t+=1,this},i.next=function(){return-1===this.t&&a(),--this.t,this}),i}i(Q,$=W),Q.prototype.copy=function(){return new Q(this.t,this.container,this.iteratorType)};var $,y=Q;function Q(t,i,r){t=$.call(this,t,r)||this;return t.container=i,t}i(l,tt=c),l.prototype.clear=function(){this.i=0,this.I.length=0},l.prototype.begin=function(){return new y(0,this)},l.prototype.end=function(){return new y(this.i,this)},l.prototype.rBegin=function(){return new y(this.i-1,this,1)},l.prototype.rEnd=function(){return new y(-1,this,1)},l.prototype.front=function(){return this.I[0]},l.prototype.back=function(){return this.I[this.i-1]},l.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;return this.I[t]},l.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;return this.I.splice(t,1),--this.i,this.i},l.prototype.eraseElementByValue=function(t){for(var i=0,r=0;r<this.i;++r)this.I[r]!==t&&(this.I[i++]=this.I[r]);return this.i=this.I.length=i,this.i},l.prototype.eraseElementByIterator=function(t){var i=t.t;return t=t.next(),this.eraseElementByPos(i),t},l.prototype.pushBack=function(t){return this.I.push(t),this.i+=1,this.i},l.prototype.popBack=function(){if(0!==this.i)return--this.i,this.I.pop()},l.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;this.I[t]=i},l.prototype.insert=function(t,i,r){var e;if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;return(e=this.I).splice.apply(e,f([t,0],h(new Array(r).fill(i)),!1)),this.i+=r,this.i},l.prototype.find=function(t){for(var i=0;i<this.i;++i)if(this.I[i]===t)return new y(i,this);return this.end()},l.prototype.reverse=function(){this.I.reverse()},l.prototype.unique=function(){for(var t=1,i=1;i<this.i;++i)this.I[i]!==this.I[i-1]&&(this.I[t++]=this.I[i]);return this.i=this.I.length=t,this.i},l.prototype.sort=function(t){this.I.sort(t)},l.prototype.forEach=function(t){for(var i=0;i<this.i;++i)t(this.I[i],i,this)},l.prototype[Symbol.iterator]=function(){return function(){return r(this,function(t){switch(t.label){case 0:return[5,u(this.I)];case 1:return t.sent(),[2]}})}.bind(this)()};var tt,it=l;function l(t,i){void 0===t&&(t=[]),void 0===i&&(i=!0);var r,e=tt.call(this)||this;return Array.isArray(t)?(e.I=i?f([],h(t),!1):t,e.i=t.length):(e.I=[],r=e,t.forEach(function(t){r.pushBack(t)})),e}i(d,rt=e),Object.defineProperty(d.prototype,"pointer",{get:function(){return this.t===this.S&&a(),this.t.k},set:function(t){this.t===this.S&&a(),this.t.k=t},enumerable:!1,configurable:!0}),d.prototype.copy=function(){return new d(this.t,this.S,this.container,this.iteratorType)};var rt,v=d;function d(t,i,r,e){e=rt.call(this,e)||this;return e.t=t,e.S=i,e.container=r,0===e.iteratorType?(e.pre=function(){return this.t.L===this.S&&a(),this.t=this.t.L,this},e.next=function(){return this.t===this.S&&a(),this.t=this.t.O,this}):(e.pre=function(){return this.t.O===this.S&&a(),this.t=this.t.O,this},e.next=function(){return this.t===this.S&&a(),this.t=this.t.L,this}),e}i(S,et=c),S.prototype.M=function(t){var i=t.L,r=t.O;(i.O=r).L=i,t===this.H&&(this.H=r),t===this.g&&(this.g=i),--this.i},S.prototype.A=function(t,i){var r=i.O,t={k:t,L:i,O:r};i.O=t,r.L=t,i===this.S&&(this.H=t),r===this.S&&(this.g=t),this.i+=1},S.prototype.clear=function(){this.i=0,this.H=this.g=this.S.L=this.S.O=this.S},S.prototype.begin=function(){return new v(this.H,this.S,this)},S.prototype.end=function(){return new v(this.S,this.S,this)},S.prototype.rBegin=function(){return new v(this.g,this.S,this,1)},S.prototype.rEnd=function(){return new v(this.S,this.S,this,1)},S.prototype.front=function(){return this.H.k},S.prototype.back=function(){return this.g.k},S.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return i.k},S.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return this.M(i),this.i},S.prototype.eraseElementByValue=function(t){for(var i=this.H;i!==this.S;)i.k===t&&this.M(i),i=i.O;return this.i},S.prototype.eraseElementByIterator=function(t){var i=t.t;return i===this.S&&a(),t=t.next(),this.M(i),t},S.prototype.pushBack=function(t){return this.A(t,this.g),this.i},S.prototype.popBack=function(){var t;if(0!==this.i)return t=this.g.k,this.M(this.g),t},S.prototype.pushFront=function(t){return this.A(t,this.S),this.i},S.prototype.popFront=function(){var t;if(0!==this.i)return t=this.H.k,this.M(this.H),t},S.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;for(var r=this.H;t--;)r=r.O;r.k=i},S.prototype.insert=function(t,i,r){if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;if(!(r<=0))if(0===t)for(;r--;)this.pushFront(i);else if(t===this.i)for(;r--;)this.pushBack(i);else{for(var e=this.H,n=1;n<t;++n)e=e.O;var o=e.O;for(this.i+=r;r--;)e.O={k:i,L:e},e=(e.O.L=e).O;(e.O=o).L=e}return this.i},S.prototype.find=function(t){for(var i=this.H;i!==this.S;){if(i.k===t)return new v(i,this.S,this);i=i.O}return this.end()},S.prototype.reverse=function(){if(!(this.i<=1))for(var t=this.H,i=this.g,r=0;r<<1<this.i;){var e=t.k;t.k=i.k,i.k=e,t=t.O,i=i.L,r+=1}},S.prototype.unique=function(){if(!(this.i<=1))for(var t=this.H;t!==this.S;){for(var i=t;i.O!==this.S&&i.k===i.O.k;)i=i.O,--this.i;t.O=i.O,t=(t.O.L=t).O}return this.i},S.prototype.sort=function(t){var i,r;this.i<=1||(i=[],this.forEach(function(t){i.push(t)}),i.sort(t),r=this.H,i.forEach(function(t){r.k=t,r=r.O}))},S.prototype.merge=function(t){var i,r=this;return 0===this.i?t.forEach(function(t){r.pushBack(t)}):(i=this.H,t.forEach(function(t){for(;i!==r.S&&i.k<=t;)i=i.O;r.A(t,i.L)})),this.i},S.prototype.forEach=function(t){for(var i=this.H,r=0;i!==this.S;)t(i.k,r++,this),i=i.O},S.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:if(0===this.i)return[2];i=this.H,t.label=1;case 1:return i===this.S?[3,3]:[4,i.k];case 2:return t.sent(),i=i.O,[3,1];case 3:return[2]}})}.bind(this)()};var et,nt=S;function S(t){void 0===t&&(t=[]);var i=et.call(this)||this,r=(i.S={},i.H=i.g=i.S.L=i.S.O=i.S,i);return t.forEach(function(t){r.pushBack(t)}),i}i(st,ot=W),st.prototype.copy=function(){return new st(this.t,this.container,this.iteratorType)};var ot,B=st;function st(t,i,r){t=ot.call(this,t,r)||this;return t.container=i,t}i(w,ht=c),w.prototype.j=function(){for(var t=[],i=Math.max(this.D>>1,1),r=0;r<i;++r)t[r]=new Array(this.V);for(r=this.u;r<this.D;++r)t[t.length]=this.m[r];for(r=0;r<this.C;++r)t[t.length]=this.m[r];t[t.length]=f([],h(this.m[this.C]),!1),this.u=i,this.C=t.length-1;for(r=0;r<i;++r)t[t.length]=new Array(this.V);this.m=t,this.D=t.length},w.prototype.R=function(t){var t=this.T+t+1,i=t%this.V,r=i-1,t=this.u+(t-i)/this.V;return 0==i&&--t,t%=this.D,r<0&&(r+=this.V),{curNodeBucketIndex:t,curNodePointerIndex:r}},w.prototype.clear=function(){this.m=[new Array(this.V)],this.D=1,this.u=this.C=this.i=0,this.T=this.q=this.V>>1},w.prototype.begin=function(){return new B(0,this)},w.prototype.end=function(){return new B(this.i,this)},w.prototype.rBegin=function(){return new B(this.i-1,this,1)},w.prototype.rEnd=function(){return new B(-1,this,1)},w.prototype.front=function(){if(0!==this.i)return this.m[this.u][this.T]},w.prototype.back=function(){if(0!==this.i)return this.m[this.C][this.q]},w.prototype.pushBack=function(t){return this.i&&(this.q<this.V-1?this.q+=1:(this.C<this.D-1?this.C+=1:this.C=0,this.q=0),this.C===this.u)&&this.q===this.T&&this.j(),this.i+=1,this.m[this.C][this.q]=t,this.i},w.prototype.popBack=function(){var t;if(0!==this.i)return t=this.m[this.C][this.q],1!==this.i&&(0<this.q?--this.q:(0<this.C?--this.C:this.C=this.D-1,this.q=this.V-1)),--this.i,t},w.prototype.pushFront=function(t){return this.i&&(0<this.T?--this.T:(0<this.u?--this.u:this.u=this.D-1,this.T=this.V-1),this.u===this.C)&&this.T===this.q&&this.j(),this.i+=1,this.m[this.u][this.T]=t,this.i},w.prototype.popFront=function(){var t;if(0!==this.i)return t=this.m[this.u][this.T],1!==this.i&&(this.T<this.V-1?this.T+=1:(this.u<this.D-1?this.u+=1:this.u=0,this.T=0)),--this.i,t},w.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;var t=this.R(t),i=t.curNodeBucketIndex,t=t.curNodePointerIndex;return this.m[i][t]},w.prototype.setElementByPos=function(t,i){if(t<0||t>this.i-1)throw new RangeError;var t=this.R(t),r=t.curNodeBucketIndex,t=t.curNodePointerIndex;this.m[r][t]=i},w.prototype.insert=function(t,i,r){if(void 0===r&&(r=1),t<0||t>this.i)throw new RangeError;if(0===t)for(;r--;)this.pushFront(i);else if(t===this.i)for(;r--;)this.pushBack(i);else{for(var e=[],n=t;n<this.i;++n)e.push(this.getElementByPos(n));this.cut(t-1);for(n=0;n<r;++n)this.pushBack(i);for(n=0;n<e.length;++n)this.pushBack(e[n])}return this.i},w.prototype.cut=function(t){var i,r;return t<0?(this.clear(),0):(i=(r=this.R(t)).curNodeBucketIndex,r=r.curNodePointerIndex,this.C=i,this.q=r,this.i=t+1,this.i)},w.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;if(0===t)this.popFront();else if(t===this.i-1)this.popBack();else{for(var i=[],r=t+1;r<this.i;++r)i.push(this.getElementByPos(r));this.cut(t),this.popBack();var e=this;i.forEach(function(t){e.pushBack(t)})}return this.i},w.prototype.eraseElementByValue=function(t){if(0===this.i)return 0;for(var i=[],r=0;r<this.i;++r){var e=this.getElementByPos(r);e!==t&&i.push(e)}for(var n=i.length,r=0;r<n;++r)this.setElementByPos(r,i[r]);return this.cut(n-1)},w.prototype.eraseElementByIterator=function(t){var i=t.t;return this.eraseElementByPos(i),t=t.next()},w.prototype.find=function(t){for(var i=0;i<this.i;++i)if(this.getElementByPos(i)===t)return new B(i,this);return this.end()},w.prototype.reverse=function(){for(var t=0,i=this.i-1;t<i;){var r=this.getElementByPos(t);this.setElementByPos(t,this.getElementByPos(i)),this.setElementByPos(i,r),t+=1,--i}},w.prototype.unique=function(){if(!(this.i<=1)){for(var t=1,i=this.getElementByPos(0),r=1;r<this.i;++r){var e=this.getElementByPos(r);e!==i&&this.setElementByPos(t++,i=e)}for(;this.i>t;)this.popBack()}return this.i},w.prototype.sort=function(t){for(var i=[],r=0;r<this.i;++r)i.push(this.getElementByPos(r));i.sort(t);for(r=0;r<this.i;++r)this.setElementByPos(r,i[r])},w.prototype.shrinkToFit=function(){if(0!==this.i){var i=[];this.forEach(function(t){i.push(t)}),this.D=Math.max(Math.ceil(this.i/this.V),1),this.i=this.u=this.C=this.T=this.q=0,this.m=[];for(var t=0;t<this.D;++t)this.m.push(new Array(this.V));for(t=0;t<i.length;++t)this.pushBack(i[t])}},w.prototype.forEach=function(t){for(var i=0;i<this.i;++i)t(this.getElementByPos(i),i,this)},w.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=0,t.label=1;case 1:return i<this.i?[4,this.getElementByPos(i)]:[3,4];case 2:t.sent(),t.label=3;case 3:return++i,[3,1];case 4:return[2]}})}.bind(this)()};var ht,W=w;function w(t,i){void 0===t&&(t=[]),void 0===i&&(i=4096);var r=ht.call(this)||this,e=(r.u=0,r.T=0,r.C=0,r.q=0,r.D=0,r.m=[],function(){if("number"==typeof t.length)return t.length;if("number"==typeof t.size)return t.size;if("function"==typeof t.size)return t.size();throw new TypeError("Cannot get the length or size of the container")}());r.V=i,r.D=Math.max(Math.ceil(e/r.V),1);for(var n=0;n<r.D;++n)r.m.push(new Array(r.V));var i=Math.ceil(e/r.V),o=(r.u=r.C=(r.D>>1)-(i>>1),r.T=r.q=r.V-e%r.V>>1,r);return t.forEach(function(t){o.pushBack(t)}),r}g.prototype.L=function(){var t=this;if(1===t.N&&t.F.F===t)t=t.G;else if(t.B)for(t=t.B;t.G;)t=t.G;else{for(var i=t.F;i.B===t;)i=(t=i).F;t=i}return t},g.prototype.O=function(){var t=this;if(t.G){for(t=t.G;t.B;)t=t.B;return t}for(var i=t.F;i.G===t;)i=(t=i).F;return t.G!==i?i:t},g.prototype.J=function(){var t=this.F,i=this.G,r=i.B;return t.F===this?t.F=i:t.B===this?t.B=i:t.G=i,i.F=t,(i.B=this).F=i,(this.G=r)&&(r.F=this),i},g.prototype.K=function(){var t=this.F,i=this.B,r=i.G;return t.F===this?t.F=i:t.B===this?t.B=i:t.G=i,i.F=t,(i.G=this).F=i,(this.B=r)&&(r.F=this),i};var ut=g;function g(t,i){this.N=1,this.P=void 0,this.k=void 0,this.B=void 0,this.G=void 0,this.F=void 0,this.P=t,this.k=i}i(m,E=ut),m.prototype.J=function(){var t=E.prototype.J.call(this);return this.W(),t.W(),t},m.prototype.K=function(){var t=E.prototype.K.call(this);return this.W(),t.W(),t},m.prototype.W=function(){this.U=1,this.B&&(this.U+=this.B.U),this.G&&(this.U+=this.G.U)};var E,ft=m;function m(){var t=null!==E&&E.apply(this,arguments)||this;return t.U=1,t}i(P,pt=_),P.prototype.rt=function(t,i){for(var r=this.S;t;){var e=this.v(t.P,i);if(e<0)t=t.G;else{if(!(0<e))return t;t=(r=t).B}}return r},P.prototype.et=function(t,i){for(var r=this.S;t;)t=this.v(t.P,i)<=0?t.G:(r=t).B;return r},P.prototype.nt=function(t,i){for(var r=this.S;t;){var e=this.v(t.P,i);if(e<0)t=(r=t).G;else{if(!(0<e))return t;t=t.B}}return r},P.prototype.st=function(t,i){for(var r=this.S;t;)t=this.v(t.P,i)<0?(r=t).G:t.B;return r},P.prototype.ht=function(t){for(;;){var i,r=t.F;if(r===this.S)return;if(1===t.N)return void(t.N=0);if(t===r.B)if(1===(i=r.G).N)i.N=0,r.N=1,r===this.X?this.X=r.J():r.J();else{if(i.G&&1===i.G.N)return i.N=r.N,r.N=0,i.G.N=0,void(r===this.X?this.X=r.J():r.J());i.B&&1===i.B.N?(i.N=1,i.B.N=0,i.K()):(i.N=1,t=r)}else if(1===(i=r.B).N)i.N=0,r.N=1,r===this.X?this.X=r.K():r.K();else{if(i.B&&1===i.B.N)return i.N=r.N,r.N=0,i.B.N=0,void(r===this.X?this.X=r.K():r.K());i.G&&1===i.G.N?(i.N=1,i.G.N=0,i.J()):(i.N=1,t=r)}}},P.prototype.it=function(t){var i;if(1===this.i)return this.clear(),this.S;for(var r=t;r.B||r.G;){if(r.G)for(r=r.G;r.B;)r=r.B;else r=r.B;i=h([r.P,t.P],2),t.P=i[0],r.P=i[1],i=h([r.k,t.k],2),t.k=i[0],r.k=i[1],t=r}this.S.B===r?this.S.B=r.F:this.S.G===r&&(this.S.G=r.F),this.ht(r);var e=r.F;return r===e.B?e.B=void 0:e.G=void 0,--this.i,this.X.N=0,e},P.prototype.ut=function(t,i){return void 0!==t&&(!!this.ut(t.B,i)||!!i(t)||this.ut(t.G,i))},P.prototype.tt=function(t){for(;;){var i=t.F;if(0===i.N)return;var r,e,n=i.F;if(i===n.B){if((r=n.G)&&1===r.N){if(r.N=i.N=0,n===this.X)return;n.N=1,t=n;continue}if(t===i.G)return t.N=0,t.B&&(t.B.F=i),t.G&&(t.G.F=n),i.G=t.B,n.B=t.G,t.B=i,(t.G=n)===this.X?(this.X=t,this.S.F=t):(e=n.F).B===n?e.B=t:e.G=t,t.F=n.F,i.F=t,n.F=t,n.N=1,{parentNode:i,grandParent:n,curNode:t};i.N=0,n===this.X?this.X=n.K():n.K()}else{if((r=n.B)&&1===r.N){if(r.N=i.N=0,n===this.X)return;n.N=1,t=n;continue}if(t===i.B)return t.N=0,t.B&&(t.B.F=n),t.G&&(t.G.F=i),n.G=t.B,i.B=t.G,t.B=n,t.G=i,n===this.X?(this.X=t,this.S.F=t):(e=n.F).B===n?e.B=t:e.G=t,t.F=n.F,i.F=t,n.F=t,n.N=1,{parentNode:i,grandParent:n,curNode:t};i.N=0,n===this.X?this.X=n.J():n.J()}return void(n.N=1)}},P.prototype.$=function(t,i,r){if(void 0===this.X)this.i+=1,this.X=new this.Y(t,i),this.X.N=0,this.X.F=this.S,this.S.F=this.X,this.S.B=this.X,this.S.G=this.X;else{var e,n=this.S.B,o=this.v(n.P,t);if(0!==o){if(0<o)n.B=new this.Y(t,i),e=(n.B.F=n).B,this.S.B=e;else{var o=this.S.G,s=this.v(o.P,t);if(0===s)return void(o.k=i);if(s<0)o.G=new this.Y(t,i),e=(o.G.F=o).G,this.S.G=e;else{if(void 0!==r){s=r.t;if(s!==this.S){o=this.v(s.P,t);if(0===o)return void(s.k=i);if(0<o){r=s.L(),o=this.v(r.P,t);if(0===o)return void(r.k=i);o<0&&(e=new this.Y(t,i),void 0===r.G?(r.G=e).F=r:(s.B=e).F=s)}}}if(void 0===e)for(e=this.X;;){var h=this.v(e.P,t);if(0<h){if(void 0===e.B){e.B=new this.Y(t,i),e=(e.B.F=e).B;break}e=e.B}else{if(!(h<0))return void(e.k=i);if(void 0===e.G){e.G=new this.Y(t,i),e=(e.G.F=e).G;break}e=e.G}}}}return this.i+=1,e}n.k=i}},P.prototype.ot=function(t,i){for(;t;){var r=this.v(t.P,i);if(r<0)t=t.G;else{if(!(0<r))return t;t=t.B}}return t||this.S},P.prototype.clear=function(){this.i=0,this.X=void 0,this.S.F=void 0,this.S.B=this.S.G=void 0},P.prototype.updateKeyByIterator=function(t,i){t=t.t;if(t===this.S&&a(),1!==this.i){if(t===this.S.B)return 0<this.v(t.O().P,i)&&(t.P=i,!0);if(t===this.S.G)return this.v(t.L().P,i)<0&&(t.P=i,!0);var r=t.L().P;if(0<=this.v(r,i))return!1;if(r=t.O().P,this.v(r,i)<=0)return!1}return t.P=i,!0},P.prototype.eraseElementByPos=function(i){if(i<0||i>this.i-1)throw new RangeError;var r=0,e=this;return this.ut(this.X,function(t){return i===r?(e.M(t),!0):(r+=1,!1)}),this.i},P.prototype.eraseElementByKey=function(t){return 0!==this.i&&(t=this.ot(this.X,t))!==this.S&&(this.M(t),!0)},P.prototype.eraseElementByIterator=function(t){var i=t.t,r=(i===this.S&&a(),void 0===i.G);return 0===t.iteratorType?r&&t.next():r&&void 0!==i.B||t.next(),this.M(i),t},P.prototype.forEach=function(t){var i,r,e=0;try{for(var n=u(this),o=n.next();!o.done;o=n.next())t(o.value,e++,this)}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}},P.prototype.getElementByPos=function(t){var i,r,e;if(t<0||t>this.i-1)throw new RangeError;var n=0;try{for(var o=u(this),s=o.next();!s.done;s=o.next()){var h=s.value;if(n===t){e=h;break}n+=1}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return e},P.prototype.getHeight=function(){var i;return 0===this.i?0:(i=function(t){return t?Math.max(i(t.B),i(t.G))+1:0})(this.X)};var pt,c=P;function P(t,i){void 0===t&&(t=function(t,i){return t<i?-1:i<t?1:0}),void 0===i&&(i=!1);var r=pt.call(this)||this;return r.X=void 0,r.v=t,i?(r.Y=ft,r.Z=function(t,i,r){t=this.$(t,i,r);if(t){for(var e=t.F;e!==this.S;)e.U+=1,e=e.F;var i=this.tt(t);i&&(r=i.parentNode,t=i.grandParent,i=i.curNode,r.W(),t.W(),i.W())}return this.i},r.M=function(t){for(var i=this.it(t);i!==this.S;)--i.U,i=i.F}):(r.Y=ut,r.Z=function(t,i,r){t=this.$(t,i,r);return t&&this.tt(t),this.i},r.M=r.it),r.S=new r.Y,r}i(yt,ct=e),Object.defineProperty(yt.prototype,"index",{get:function(){var t=this.t,i=this.S.F;if(t===this.S)return i?i.U-1:0;var r=0;for(t.B&&(r+=t.B.U);t!==i;){var e=t.F;t===e.G&&(r+=1,e.B)&&(r+=e.B.U),t=e}return r},enumerable:!1,configurable:!0});var ct,at=yt;function yt(t,i,r){r=ct.call(this,r)||this;return r.t=t,r.S=i,0===r.iteratorType?(r.pre=function(){return this.t===this.S.B&&a(),this.t=this.t.L(),this},r.next=function(){return this.t===this.S&&a(),this.t=this.t.O(),this}):(r.pre=function(){return this.t===this.S.G&&a(),this.t=this.t.O(),this},r.next=function(){return this.t===this.S&&a(),this.t=this.t.L(),this}),r}i(k,lt=at),Object.defineProperty(k.prototype,"pointer",{get:function(){return this.t===this.S&&a(),this.t.P},enumerable:!1,configurable:!0}),k.prototype.copy=function(){return new k(this.t,this.S,this.container,this.iteratorType)};var lt,b=k;function k(t,i,r,e){t=lt.call(this,t,i,e)||this;return t.container=r,t}i(G,vt=c),G.prototype.ft=function(i){return r(this,function(t){switch(t.label){case 0:return void 0===i?[2]:[5,u(this.ft(i.B))];case 1:return t.sent(),[4,i.P];case 2:return t.sent(),[5,u(this.ft(i.G))];case 3:return t.sent(),[2]}})},G.prototype.begin=function(){return new b(this.S.B||this.S,this.S,this)},G.prototype.end=function(){return new b(this.S,this.S,this)},G.prototype.rBegin=function(){return new b(this.S.G||this.S,this.S,this,1)},G.prototype.rEnd=function(){return new b(this.S,this.S,this,1)},G.prototype.front=function(){return this.S.B?this.S.B.P:void 0},G.prototype.back=function(){return this.S.G?this.S.G.P:void 0},G.prototype.insert=function(t,i){return this.Z(t,void 0,i)},G.prototype.find=function(t){t=this.ot(this.X,t);return new b(t,this.S,this)},G.prototype.lowerBound=function(t){t=this.rt(this.X,t);return new b(t,this.S,this)},G.prototype.upperBound=function(t){t=this.et(this.X,t);return new b(t,this.S,this)},G.prototype.reverseLowerBound=function(t){t=this.nt(this.X,t);return new b(t,this.S,this)},G.prototype.reverseUpperBound=function(t){t=this.st(this.X,t);return new b(t,this.S,this)},G.prototype.union=function(t){var i=this;return t.forEach(function(t){i.insert(t)}),this.i},G.prototype[Symbol.iterator]=function(){return this.ft(this.X)};var vt,dt=G;function G(t,i,r){void 0===t&&(t=[]);var i=vt.call(this,i,r)||this,e=i;return t.forEach(function(t){e.insert(t)}),i}i(F,St=at),Object.defineProperty(F.prototype,"pointer",{get:function(){this.t===this.S&&a();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.t.P:"1"===i?e.t.k:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.t.k=r,!0}})},enumerable:!1,configurable:!0}),F.prototype.copy=function(){return new F(this.t,this.S,this.container,this.iteratorType)};var St,O=F;function F(t,i,r,e){t=St.call(this,t,i,e)||this;return t.container=r,t}i(N,Bt=c),N.prototype.ft=function(i){return r(this,function(t){switch(t.label){case 0:return void 0===i?[2]:[5,u(this.ft(i.B))];case 1:return t.sent(),[4,[i.P,i.k]];case 2:return t.sent(),[5,u(this.ft(i.G))];case 3:return t.sent(),[2]}})},N.prototype.begin=function(){return new O(this.S.B||this.S,this.S,this)},N.prototype.end=function(){return new O(this.S,this.S,this)},N.prototype.rBegin=function(){return new O(this.S.G||this.S,this.S,this,1)},N.prototype.rEnd=function(){return new O(this.S,this.S,this,1)},N.prototype.front=function(){var t;if(0!==this.i)return[(t=this.S.B).P,t.k]},N.prototype.back=function(){var t;if(0!==this.i)return[(t=this.S.G).P,t.k]},N.prototype.lowerBound=function(t){t=this.rt(this.X,t);return new O(t,this.S,this)},N.prototype.upperBound=function(t){t=this.et(this.X,t);return new O(t,this.S,this)},N.prototype.reverseLowerBound=function(t){t=this.nt(this.X,t);return new O(t,this.S,this)},N.prototype.reverseUpperBound=function(t){t=this.st(this.X,t);return new O(t,this.S,this)},N.prototype.setElement=function(t,i,r){return this.Z(t,i,r)},N.prototype.find=function(t){t=this.ot(this.X,t);return new O(t,this.S,this)},N.prototype.getElementByKey=function(t){return this.ot(this.X,t).k},N.prototype.union=function(t){var i=this;return t.forEach(function(t){i.setElement(t[0],t[1])}),this.i},N.prototype[Symbol.iterator]=function(){return this.ft(this.X)};var Bt,at=N;function N(t,i,r){void 0===t&&(t=[]);var i=Bt.call(this,i,r)||this,e=i;return t.forEach(function(t){e.setElement(t[0],t[1])}),i}function wt(t){var i=typeof t;return"object"==i&&null!==t||"function"==i}i(Et,gt=e);var gt,c=Et;function Et(t,i,r){r=gt.call(this,r)||this;return r.t=t,r.S=i,0===r.iteratorType?(r.pre=function(){return this.t.L===this.S&&a(),this.t=this.t.L,this},r.next=function(){return this.t===this.S&&a(),this.t=this.t.O,this}):(r.pre=function(){return this.t.O===this.S&&a(),this.t=this.t.O,this},r.next=function(){return this.t===this.S&&a(),this.t=this.t.L,this}),r}i(H,mt=_),H.prototype.M=function(t){var i=t.L,r=t.O;(i.O=r).L=i,t===this.H&&(this.H=r),t===this.g&&(this.g=i),--this.i},H.prototype.Z=function(t,i,r){var e;if(r=void 0===r?wt(t):r){r=t[this.HASH_TAG];if(void 0!==r)return this.ct[r].k=i,this.i;Object.defineProperty(t,this.HASH_TAG,{value:this.ct.length,configurable:!0}),e={P:t,k:i,L:this.g,O:this.S},this.ct.push(e)}else{r=this.vt[t];if(r)return r.k=i,this.i;e={P:t,k:i,L:this.g,O:this.S},this.vt[t]=e}return 0===this.i?(this.H=e,this.S.O=e):this.g.O=e,this.g=e,this.S.L=e,++this.i},H.prototype.ot=function(t,i){return(i=void 0===i?wt(t):i)?void 0===(i=t[this.HASH_TAG])?this.S:this.ct[i]:this.vt[t]||this.S},H.prototype.clear=function(){var i=this.HASH_TAG;this.ct.forEach(function(t){delete t.P[i]}),this.ct=[],this.vt={},Object.setPrototypeOf(this.vt,null),this.i=0,this.H=this.g=this.S.L=this.S.O=this.S},H.prototype.eraseElementByKey=function(t,i){var r;if(i=void 0===i?wt(t):i){i=t[this.HASH_TAG];if(void 0===i)return!1;delete t[this.HASH_TAG],r=this.ct[i],delete this.ct[i]}else{if(void 0===(r=this.vt[t]))return!1;delete this.vt[t]}return this.M(r),!0},H.prototype.eraseElementByIterator=function(t){var i=t.t;return i===this.S&&a(),this.M(i),t.next()},H.prototype.eraseElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return this.M(i),this.i};var mt,e=H;function H(){var t=mt.call(this)||this;return t.ct=[],t.vt={},t.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(t.vt,null),t.S={},t.S.L=t.S.O=t.H=t.g=t.S,t}i(x,Pt=c),Object.defineProperty(x.prototype,"pointer",{get:function(){return this.t===this.S&&a(),this.t.P},enumerable:!1,configurable:!0}),x.prototype.copy=function(){return new x(this.t,this.S,this.container,this.iteratorType)};var Pt,T=x;function x(t,i,r,e){t=Pt.call(this,t,i,e)||this;return t.container=r,t}i(X,bt=e),X.prototype.begin=function(){return new T(this.H,this.S,this)},X.prototype.end=function(){return new T(this.S,this.S,this)},X.prototype.rBegin=function(){return new T(this.g,this.S,this,1)},X.prototype.rEnd=function(){return new T(this.S,this.S,this,1)},X.prototype.front=function(){return this.H.P},X.prototype.back=function(){return this.g.P},X.prototype.insert=function(t,i){return this.Z(t,void 0,i)},X.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return i.P},X.prototype.find=function(t,i){t=this.ot(t,i);return new T(t,this.S,this)},X.prototype.forEach=function(t){for(var i=0,r=this.H;r!==this.S;)t(r.P,i++,this),r=r.O},X.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=this.H,t.label=1;case 1:return i===this.S?[3,3]:[4,i.P];case 2:return t.sent(),i=i.O,[3,1];case 3:return[2]}})}.bind(this)()};var bt,_=X;function X(t){void 0===t&&(t=[]);var i=bt.call(this)||this,r=i;return t.forEach(function(t){r.insert(t)}),i}i(Gt,kt=c),Object.defineProperty(Gt.prototype,"pointer",{get:function(){this.t===this.S&&a();var e=this;return new Proxy([],{get:function(t,i){return"0"===i?e.t.P:"1"===i?e.t.k:void 0},set:function(t,i,r){if("1"!==i)throw new TypeError("props must be 1");return e.t.k=r,!0}})},enumerable:!1,configurable:!0}),Gt.prototype.copy=function(){return new Gt(this.t,this.S,this.container,this.iteratorType)};var kt,I=Gt;function Gt(t,i,r,e){t=kt.call(this,t,i,e)||this;return t.container=r,t}i(A,Ot=e),A.prototype.begin=function(){return new I(this.H,this.S,this)},A.prototype.end=function(){return new I(this.S,this.S,this)},A.prototype.rBegin=function(){return new I(this.g,this.S,this,1)},A.prototype.rEnd=function(){return new I(this.S,this.S,this,1)},A.prototype.front=function(){if(0!==this.i)return[this.H.P,this.H.k]},A.prototype.back=function(){if(0!==this.i)return[this.g.P,this.g.k]},A.prototype.setElement=function(t,i,r){return this.Z(t,i,r)},A.prototype.getElementByKey=function(t,i){return(i=void 0===i?wt(t):i)?void 0!==(i=t[this.HASH_TAG])?this.ct[i].k:void 0:(i=this.vt[t])?i.k:void 0},A.prototype.getElementByPos=function(t){if(t<0||t>this.i-1)throw new RangeError;for(var i=this.H;t--;)i=i.O;return[i.P,i.k]},A.prototype.find=function(t,i){t=this.ot(t,i);return new I(t,this.S,this)},A.prototype.forEach=function(t){for(var i=0,r=this.H;r!==this.S;)t([r.P,r.k],i++,this),r=r.O},A.prototype[Symbol.iterator]=function(){return function(){var i;return r(this,function(t){switch(t.label){case 0:i=this.H,t.label=1;case 1:return i===this.S?[3,3]:[4,[i.P,i.k]];case 2:return t.sent(),i=i.O,[3,1];case 3:return[2]}})}.bind(this)()};var Ot,c=A;function A(t){void 0===t&&(t=[]);var i=Ot.call(this)||this,r=i;return t.forEach(function(t){r.setElement(t[0],t[1])}),i}t.Deque=W,t.HashMap=c,t.HashSet=_,t.LinkList=nt,t.OrderedMap=at,t.OrderedSet=dt,t.PriorityQueue=n,t.Queue=K,t.Stack=C,t.Vector=it,Object.defineProperty(t,"dt",{value:!0})}); //# sourceMappingURL=js-sdsl.min.js.map diff --git a/tools/node_modules/eslint/node_modules/js-sdsl/package.json b/tools/node_modules/eslint/node_modules/js-sdsl/package.json index c07377c41f..1c35cd2152 100644 --- a/tools/node_modules/eslint/node_modules/js-sdsl/package.json +++ b/tools/node_modules/eslint/node_modules/js-sdsl/package.json @@ -1,6 +1,6 @@ { "name": "js-sdsl", - "version": "4.2.0", + "version": "4.3.0", "description": "javascript standard data structure library which benchmark against C++ STL", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", |