fix(es/minifier): Consider function body cost while inlining function (#5342)

This commit is contained in:
Austaras 2022-10-15 13:47:56 +08:00 committed by GitHub
parent 3352c4543b
commit b40d486253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
66 changed files with 1271 additions and 1557 deletions

View File

@ -1,10 +1,5 @@
//// [ES5For-of10.ts] //// [ES5For-of10.ts]
function foo() {
return {
x: 0
};
}
for(var _i = 0, _iter = []; _i < _iter.length; _i++){ for(var _i = 0, _iter = []; _i < _iter.length; _i++){
foo().x = _iter[_i]; _iter[_i];
for(var _i1 = 0, _iter1 = []; _i1 < _iter1.length; _i1++)foo().x = _iter1[_i1], foo().x; for(var _i1 = 0, _iter1 = []; _i1 < _iter1.length; _i1++)_iter1[_i1];
} }

View File

@ -1,11 +1,6 @@
//// [ES5For-of34.ts] //// [ES5For-of34.ts]
function foo() {
return {
x: 0
};
}
for(var _i = 0, _iter = [ for(var _i = 0, _iter = [
"a", "a",
"b", "b",
"c" "c"
]; _i < _iter.length; _i++)foo().x = _iter[_i], foo().x; ]; _i < _iter.length; _i++)_iter[_i];

View File

@ -1,11 +1,6 @@
//// [ES5For-of8.ts] //// [ES5For-of8.ts]
function foo() {
return {
x: 0
};
}
for(var _i = 0, _iter = [ for(var _i = 0, _iter = [
"a", "a",
"b", "b",
"c" "c"
]; _i < _iter.length; _i++)foo().x = _iter[_i], foo().x; ]; _i < _iter.length; _i++)_iter[_i];

View File

@ -1,10 +1,5 @@
//// [ES5For-of9.ts] //// [ES5For-of9.ts]
function foo() {
return {
x: 0
};
}
for(var _i = 0, _iter = []; _i < _iter.length; _i++){ for(var _i = 0, _iter = []; _i < _iter.length; _i++){
foo().x = _iter[_i]; _iter[_i];
for(var _i1 = 0, _iter1 = []; _i1 < _iter1.length; _i1++)foo().x = _iter1[_i1], foo().x; for(var _i1 = 0, _iter1 = []; _i1 < _iter1.length; _i1++)_iter1[_i1];
} }

View File

@ -1,8 +1,5 @@
//// [bitwiseNotOperatorWithStringType.ts] //// [bitwiseNotOperatorWithStringType.ts]
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
function foo() {
return "abc";
}
var STRING, M, A = function() { var STRING, M, A = function() {
"use strict"; "use strict";
function A() { function A() {
@ -17,4 +14,4 @@ var STRING, M, A = function() {
M.n = n; M.n = n;
}(M || (M = {})); }(M || (M = {}));
var objA = new A(); var objA = new A();
objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; objA.a, M.n, A.foo(), STRING.charAt(0), objA.a, M.n;

View File

@ -14,10 +14,4 @@ var A = function A() {
} }
return B; return B;
}(A); }(A);
function NewA(Factory) { new A, new A, new B, new B;
return new A;
}
function NewB(Factory) {
return new B;
}
NewA(A), NewA(B), NewB(A), NewB(B);

View File

@ -5,16 +5,17 @@ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
var _undefined = _sliced_to_array(void 0, 2); var _undefined = _sliced_to_array(void 0, 2);
_undefined[0], _undefined[1]; _undefined[0], _undefined[1];
var _undefined1 = _sliced_to_array(void 0, 2); var _undefined1 = _sliced_to_array(void 0, 2);
function foo() {
return [
1,
2,
3
];
}
_undefined1[0], _undefined1[1]; _undefined1[0], _undefined1[1];
var ref = _sliced_to_array(foo(), 2); var ref = _sliced_to_array([
ref[0], ref[1], _to_array(foo()).slice(0); 1,
2,
3
], 2);
ref[0], ref[1], _to_array([
1,
2,
3
]).slice(0);
var ref1 = _sliced_to_array(_to_consumable_array([ var ref1 = _sliced_to_array(_to_consumable_array([
1, 1,
2, 2,

View File

@ -5,16 +5,17 @@ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
var _undefined = _sliced_to_array(void 0, 2); var _undefined = _sliced_to_array(void 0, 2);
_undefined[0], _undefined[1]; _undefined[0], _undefined[1];
var _undefined1 = _sliced_to_array(void 0, 2); var _undefined1 = _sliced_to_array(void 0, 2);
function foo() {
return [
1,
2,
3
];
}
_undefined1[0], _undefined1[1]; _undefined1[0], _undefined1[1];
var ref = _sliced_to_array(foo(), 2); var ref = _sliced_to_array([
ref[0], ref[1], _to_array(foo()).slice(0); 1,
2,
3
], 2);
ref[0], ref[1], _to_array([
1,
2,
3
]).slice(0);
var ref1 = _sliced_to_array(_to_consumable_array([ var ref1 = _sliced_to_array(_to_consumable_array([
1, 1,
2, 2,

View File

@ -7,15 +7,15 @@ var [a0, a1] = void 0, [a2 = !1, a3 = 1] = void 0, [b0, b1, b2] = [
1, 1,
2, 2,
"string" "string"
]; ], [b6, b7] = [
function foo() { 1,
return [ 2,
1, 3
2, ], [...b8] = [
3 1,
]; 2,
} 3
var [b6, b7] = foo(), [...b8] = foo(), [c0, c1] = [ ], [c0, c1] = [
1, 1,
2, 2,
3 3

View File

@ -1,11 +1,5 @@
//// [destructuringWithLiteralInitializers.ts] //// [destructuringWithLiteralInitializers.ts]
import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs"; import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
function f2(param) {
param.x, param.y;
}
function f3(param) {
param.x, param.y;
}
function f4() { function f4() {
var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { var ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {
x: 0, x: 0,
@ -51,16 +45,28 @@ function g5() {
}({ }({
x: 1, x: 1,
y: 1 y: 1
}), f2({ }), function(param) {
param.x, param.y;
}({
x: 1 x: 1
}), f2({ }), function(param) {
param.x, param.y;
}({
x: 1, x: 1,
y: 1 y: 1
}), f3({}), f3({ }), function(param) {
param.x, param.y;
}({}), function(param) {
param.x, param.y;
}({
x: 1 x: 1
}), f3({ }), function(param) {
param.x, param.y;
}({
y: 1 y: 1
}), f3({ }), function(param) {
param.x, param.y;
}({
x: 1, x: 1,
y: 1 y: 1
}), f4(), f4({ }), f4(), f4({

View File

@ -2,19 +2,13 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs";
function rec1() { function rec2() {
return rec2(); return rec2();
} }
function rec2() { function rec4() {
return rec1();
}
function rec3() {
return rec4(); return rec4();
} }
function rec4() { rec2(), rec2(), rec4(), rec4();
return rec3();
}
rec1(), rec2(), rec3(), rec4();
var Base = function Base() { var Base = function Base() {
"use strict"; "use strict";
_class_call_check(this, Base); _class_call_check(this, Base);

View File

@ -1,11 +1 @@
//// [genericCallWithFunctionTypedArguments.ts] //// [genericCallWithFunctionTypedArguments.ts]
function foo(x) {
return x(null);
}
foo(function(x) {
return "";
}), foo(function(x) {
return "";
}), foo(function(x) {
return "";
});

View File

@ -3,7 +3,4 @@ var i, i2, a;
function foo(x) { function foo(x) {
return new x(null); return new x(null);
} }
function foo2(x, cb) { foo(i), foo(i), foo(i2), foo(a), new i2(1), new a(1), new i(1), new i2(""), new i(null), new a(null), new i2(1), new i2("");
return new cb(x);
}
foo(i), foo(i), foo(i2), foo(a), foo2(1, i2), foo2(1, a), foo2(1, i), foo2("", i2), new i(null), new a(null), new i2(1), new i2("");

View File

@ -22,21 +22,19 @@ var i, Base = function Base() {
} }
return Derived2; return Derived2;
}(Base); }(Base);
function f(a) {
return [
a.x,
a.y
];
}
function f2(a) { function f2(a) {
return function(x) { return function(x) {
return a.y; return a.y;
}; };
} }
f({ !function(a) {
a.x, a.y;
}({
x: new Derived(), x: new Derived(),
y: new Derived2() y: new Derived2()
}), f({ }), function(a) {
a.x, a.y;
}({
x: new Base(), x: new Base(),
y: new Derived2() y: new Derived2()
}), f2({ }), f2({

View File

@ -14,13 +14,4 @@ var Base = function Base() {
} }
return Derived; return Derived;
}(Base); }(Base);
function f3(x, y) { new Base(), new Derived(), new Derived(), new Derived(), new Base(), new Derived(), (null)(null);
return y(null);
}
new Base(), new Derived(), new Derived(), new Derived(), f3(new Base(), function(x) {
return x;
}), f3(new Derived(), function(x) {
return x;
}), f3(null, null), f3(null, function(x) {
return x;
});

View File

@ -2,7 +2,7 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs";
var Base = function Base() { var y, y1, Base = function Base() {
"use strict"; "use strict";
_class_call_check(this, Base); _class_call_check(this, Base);
}, Derived = function(Base) { }, Derived = function(Base) {
@ -22,13 +22,8 @@ var Base = function Base() {
} }
return Derived2; return Derived2;
}(Base); }(Base);
function f3(y, x) { new Derived(), new Derived2(), new Derived(), new Derived2(), new Derived(), new Derived2(), y = function(x) {
return y(null);
}
new Derived(), new Derived2(), new Derived(), new Derived2(), new Derived(), new Derived2(), f3(function(x) {
return x; return x;
}, new Base()), f3(function(x) { }, new Base(), y(null), y1 = function(x) {
return x; return x;
}, new Derived()), f3(function(x) { }, new Derived(), y1(null);
return x;
}, null);

View File

@ -1,7 +1,4 @@
//// [iteratorSpreadInCall11.ts] //// [iteratorSpreadInCall11.ts]
function foo(...s) {
return s[0];
}
class SymbolIterator { class SymbolIterator {
next() { next() {
return { return {
@ -13,4 +10,6 @@ class SymbolIterator {
return this; return this;
} }
} }
foo(...new SymbolIterator); !function(...s) {
s[0];
}(...new SymbolIterator);

View File

@ -1,7 +1,4 @@
//// [iteratorSpreadInCall7.ts] //// [iteratorSpreadInCall7.ts]
function foo(...s) {
return s[0];
}
class SymbolIterator { class SymbolIterator {
next() { next() {
return { return {
@ -24,4 +21,6 @@ class _StringIterator {
return this; return this;
} }
} }
foo(...new SymbolIterator, ...new _StringIterator); !function(...s) {
s[0];
}(...new SymbolIterator, ...new _StringIterator);

View File

@ -1,8 +1,5 @@
//// [logicalAssignment10.ts] //// [logicalAssignment10.ts]
var _obj, _ref, _ref1, _ref2, ref, ref1, count = 0, obj = {}; var _obj, _ref, _ref1, _ref2, ref, ref1, count = 0, obj = {};
function incr() { null !== (ref = (_obj = obj)[_ref = ++count]) && void 0 !== ref || (_obj[_ref] = ++count), null !== (ref1 = (_ref1 = ({
return ++count;
}
null !== (ref = (_obj = obj)[_ref = incr()]) && void 0 !== ref || (_obj[_ref] = incr()), null !== (ref1 = (_ref1 = ({
obj obj
}).obj)[_ref2 = incr()]) && void 0 !== ref1 || (_ref1[_ref2] = incr()); }).obj)[_ref2 = ++count]) && void 0 !== ref1 || (_ref1[_ref2] = ++count);

View File

@ -1,8 +1,5 @@
//// [logicalAssignment10.ts] //// [logicalAssignment10.ts]
var _obj, _ref, _ref1, _ref2, count = 0, obj = {}; var _obj, _ref, _ref1, _ref2, count = 0, obj = {};
function incr() { (_obj = obj)[_ref = ++count], _obj[_ref] = ++count, (_ref1 = ({
return ++count;
}
(_obj = obj)[_ref = incr()], _obj[_ref] = incr(), (_ref1 = ({
obj obj
}).obj)[_ref2 = incr()], _ref1[_ref2] = incr(); }).obj)[_ref2 = ++count], _ref1[_ref2] = ++count;

View File

@ -1,9 +1,6 @@
//// [logicalAssignment10.ts] //// [logicalAssignment10.ts]
var count = 0, obj = {}; var count = 0, obj = {};
function incr() {
return ++count;
}
const oobj = { const oobj = {
obj obj
}; };
obj[incr()] ??= incr(), oobj.obj[incr()] ??= incr(); obj[++count] ??= ++count, oobj.obj[++count] ??= ++count;

View File

@ -1,9 +1,6 @@
//// [logicalAssignment10.ts] //// [logicalAssignment10.ts]
var count = 0, obj = {}; var count = 0, obj = {};
function incr() {
return ++count;
}
const oobj = { const oobj = {
obj obj
}; };
obj[incr()] ??= incr(), oobj.obj[incr()] ??= incr(); obj[++count] ??= ++count, oobj.obj[++count] ??= ++count;

View File

@ -1,8 +1,5 @@
//// [logicalNotOperatorWithStringType.ts] //// [logicalNotOperatorWithStringType.ts]
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
function foo() {
return "abc";
}
var STRING, M, A = function() { var STRING, M, A = function() {
"use strict"; "use strict";
function A() { function A() {
@ -17,4 +14,4 @@ var STRING, M, A = function() {
M.n = n; M.n = n;
}(M || (M = {})); }(M || (M = {}));
var objA = new A(); var objA = new A();
objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; objA.a, M.n, A.foo(), STRING.charAt(0), objA.a, M.n;

View File

@ -1,8 +1,5 @@
//// [negateOperatorWithStringType.ts] //// [negateOperatorWithStringType.ts]
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
function foo() {
return "abc";
}
var STRING, M, A = function() { var STRING, M, A = function() {
"use strict"; "use strict";
function A() { function A() {
@ -17,4 +14,4 @@ var STRING, M, A = function() {
M.n = n; M.n = n;
}(M || (M = {})); }(M || (M = {}));
var objA = new A(); var objA = new A();
objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; objA.a, M.n, A.foo(), STRING.charAt(0), objA.a, M.n;

View File

@ -1,8 +1 @@
//// [objectLiteralShorthandPropertiesAssignmentES6.ts] //// [objectLiteralShorthandPropertiesAssignmentES6.ts]
function bar(name, id) {
return {
name,
id
};
}
bar("Hello", 5), bar("Hello", 5), bar("Hello", 5);

View File

@ -1,12 +1,13 @@
//// [optionalBindingParameters2.ts] //// [optionalBindingParameters2.ts]
function foo(param) { !function(param) {
param.x, param.y, param.z; param.x, param.y, param.z;
} }({
foo({
x: "", x: "",
y: 0, y: 0,
z: !1 z: !1
}), foo({ }), function(param) {
param.x, param.y, param.z;
}({
x: !1, x: !1,
y: 0, y: 0,
z: "" z: ""

View File

@ -2,10 +2,3 @@
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
import _inherits from "@swc/helpers/src/_inherits.mjs"; import _inherits from "@swc/helpers/src/_inherits.mjs";
import _create_super from "@swc/helpers/src/_create_super.mjs"; import _create_super from "@swc/helpers/src/_create_super.mjs";
function fn1() {
return null;
}
function fn3() {
return null;
}
fn1(void 0), fn1({}), fn3(3), fn3("", 3, ""), fn3(5, 5, 5), fn3(4), fn3("", "", ""), fn3("", "", 3), fn3();

View File

@ -1,12 +1 @@
//// [parser536727.ts] //// [parser536727.ts]
function foo(f) {
return f("");
}
var g = function(x) {
return x + "blah";
}, x = function() {
return g;
};
foo(g), foo(function() {
return g;
}), foo(x);

View File

@ -1,8 +1,5 @@
//// [plusOperatorWithStringType.ts] //// [plusOperatorWithStringType.ts]
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
function foo() {
return "abc";
}
var STRING, M, A = function() { var STRING, M, A = function() {
"use strict"; "use strict";
function A() { function A() {
@ -17,4 +14,4 @@ var STRING, M, A = function() {
M.n = n; M.n = n;
}(M || (M = {})); }(M || (M = {}));
var objA = new A(); var objA = new A();
objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; objA.a, M.n, A.foo(), STRING.charAt(0), objA.a, M.n;

View File

@ -1,9 +1,6 @@
//// [stringLiteralTypesAsTags01.ts] //// [stringLiteralTypesAsTags01.ts]
function hasKind(entity, kind) {
return entity.kind === kind;
}
var x = { var x = {
kind: "A", kind: "A",
a: 100 a: 100
}; };
hasKind(x, "A"), hasKind(x, "B"); x.kind, x.kind;

View File

@ -1,9 +1,6 @@
//// [stringLiteralTypesAsTags02.ts] //// [stringLiteralTypesAsTags02.ts]
function hasKind(entity, kind) {
return entity.kind === kind;
}
var x = { var x = {
kind: "A", kind: "A",
a: 100 a: 100
}; };
hasKind(x, "A"), hasKind(x, "B"); x.kind, x.kind;

View File

@ -1,9 +1,6 @@
//// [stringLiteralTypesAsTags03.ts] //// [stringLiteralTypesAsTags03.ts]
function hasKind(entity, kind) {
return entity.kind === kind;
}
var x = { var x = {
kind: "A", kind: "A",
a: 100 a: 100
}; };
hasKind(x, "A"), hasKind(x, "B"); x.kind, x.kind;

View File

@ -216,13 +216,7 @@ function _templateObject21() {
return data; return data;
}, data; }, data;
} }
function fn1() {
return null;
}
function fn2() {} function fn2() {}
fn1(_templateObject(), void 0), fn1(_templateObject1(), {}); _templateObject(), _templateObject1();
var d1 = fn2(_templateObject2(), 0, void 0), d2 = fn2(_templateObject3(), 0, void 0); var d1 = fn2(_templateObject2(), 0, void 0), d2 = fn2(_templateObject3(), 0, void 0);
function fn3() { d1.foo(), d2(), _templateObject4(), _templateObject5(), _templateObject6(), _templateObject7(), _templateObject8(), _templateObject9(), _templateObject10(), _templateObject11(), _templateObject12(), _templateObject13(), _templateObject14(), _templateObject15(), _templateObject16(), _templateObject17(), _templateObject18(), _templateObject19(), _templateObject20(), _templateObject21();
return null;
}
d1.foo(), d2(), _templateObject4(), _templateObject5(), fn3(_templateObject6(), 3), fn3(_templateObject7(), "", 3, ""), fn3(_templateObject8(), 5, 5, 5), fn3(_templateObject9(), 4), fn3(_templateObject10(), "", "", ""), fn3(_templateObject11(), "", "", 3), fn3(_templateObject12()), _templateObject13(), _templateObject14(), _templateObject15(), _templateObject16(), _templateObject17(), _templateObject18(), _templateObject19(), _templateObject20(), _templateObject21();

View File

@ -1,22 +1,16 @@
//// [typeArgumentsWithStringLiteralTypes01.ts] //// [typeArgumentsWithStringLiteralTypes01.ts]
var n1, n2, n3; var n1, n2, n3;
function fun1(x, y) {
return randBool() ? x : y;
}
function fun2(x, y) {
return randBool() ? x : y;
}
function fun3() { function fun3() {
for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key]; for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key];
return args[+randBool()]; return args[+randBool()];
} }
!function(n1) { !function(n1) {
var a = n1.a = fun1("Hello", "World"), b = n1.b = fun1("Hello", "Hello"), c = n1.c = fun2("Hello", "World"), d = n1.d = fun2("Hello", "Hello"), e = n1.e = fun3("Hello", "Hello", "World", "Foo"); var a = n1.a = randBool() ? "Hello" : "World", b = n1.b = (randBool(), "Hello"), c = n1.c = randBool() ? "Hello" : "World", d = n1.d = (randBool(), "Hello"), e = n1.e = fun3("Hello", "Hello", "World", "Foo");
a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e);
}(n1 || (n1 = {})), function(n2) { }(n1 || (n1 = {})), function(n2) {
var a = n2.a = fun1("Hello", "Hello"), b = n2.b = fun1("Hello", "World"), c = n2.c = fun2("Hello", "Hello"), d = n2.d = fun2("Hello", "World"), e = n2.e = fun3("Hello", "World"); var a = n2.a = (randBool(), "Hello"), b = n2.b = randBool() ? "Hello" : "World", c = n2.c = (randBool(), "Hello"), d = n2.d = randBool() ? "Hello" : "World", e = n2.e = fun3("Hello", "World");
a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e);
}(n2 || (n2 = {})), function(n3) { }(n2 || (n2 = {})), function(n3) {
var a = n3.a = fun2("Hello", "World"), b = n3.b = fun2("World", "Hello"), c = n3.c = fun2("Hello", "Hello"), d = n3.d = fun2("World", "World"), e = n3.e = fun3("Hello", "World"); var a = n3.a = randBool() ? "Hello" : "World", b = n3.b = randBool() ? "World" : "Hello", c = n3.c = (randBool(), "Hello"), d = n3.d = (randBool(), "World"), e = n3.e = fun3("Hello", "World");
a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e); a = takeReturnString(a), b = takeReturnString(b), c = takeReturnString(c), d = takeReturnString(d), e = takeReturnString(e), a = takeReturnHello(a), b = takeReturnHello(b), c = takeReturnHello(c), d = takeReturnHello(d), e = takeReturnHello(e), a = takeReturnHelloWorld(a), b = takeReturnHelloWorld(b), c = takeReturnHelloWorld(c), d = takeReturnHelloWorld(d), e = takeReturnHelloWorld(e);
}(n3 || (n3 = {})); }(n3 || (n3 = {}));

View File

@ -1,8 +1,5 @@
//// [voidOperatorWithStringType.ts] //// [voidOperatorWithStringType.ts]
import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs";
function foo() {
return "abc";
}
var STRING, M, A = function() { var STRING, M, A = function() {
"use strict"; "use strict";
function A() { function A() {
@ -17,4 +14,4 @@ var STRING, M, A = function() {
M.n = n; M.n = n;
}(M || (M = {})); }(M || (M = {}));
var objA = new A(); var objA = new A();
objA.a, M.n, foo(), A.foo(), STRING.charAt(0), foo(), objA.a, M.n; objA.a, M.n, A.foo(), STRING.charAt(0), objA.a, M.n;

View File

@ -124,7 +124,7 @@ pub(crate) struct VarUsageInfo {
pub no_side_effect_for_member_access: bool, pub no_side_effect_for_member_access: bool,
pub used_as_callee: bool, pub callee_count: u32,
pub used_as_arg: bool, pub used_as_arg: bool,
@ -171,7 +171,7 @@ impl Default for VarUsageInfo {
var_initialized: Default::default(), var_initialized: Default::default(),
declared_as_catch_param: Default::default(), declared_as_catch_param: Default::default(),
no_side_effect_for_member_access: Default::default(), no_side_effect_for_member_access: Default::default(),
used_as_callee: Default::default(), callee_count: Default::default(),
used_as_arg: Default::default(), used_as_arg: Default::default(),
indexed_with_dynamic_key: Default::default(), indexed_with_dynamic_key: Default::default(),
pure_fn: Default::default(), pure_fn: Default::default(),

View File

@ -93,7 +93,7 @@ impl Storage for ProgramData {
e.get_mut().no_side_effect_for_member_access e.get_mut().no_side_effect_for_member_access
&& var_info.no_side_effect_for_member_access; && var_info.no_side_effect_for_member_access;
e.get_mut().used_as_callee |= var_info.used_as_callee; e.get_mut().callee_count += var_info.callee_count;
e.get_mut().used_as_arg |= var_info.used_as_arg; e.get_mut().used_as_arg |= var_info.used_as_arg;
e.get_mut().indexed_with_dynamic_key |= var_info.indexed_with_dynamic_key; e.get_mut().indexed_with_dynamic_key |= var_info.indexed_with_dynamic_key;
@ -315,7 +315,7 @@ impl VarDataLike for VarUsageInfo {
} }
fn mark_used_as_callee(&mut self) { fn mark_used_as_callee(&mut self) {
self.used_as_callee = true; self.callee_count += 1;
} }
fn mark_used_as_arg(&mut self) { fn mark_used_as_arg(&mut self) {

View File

@ -812,7 +812,7 @@ where
self.data self.data
.vars .vars
.get(id) .get(id)
.map(|usage| usage.ref_count == 1 && usage.used_as_callee) .map(|usage| usage.ref_count == 1 && usage.callee_count > 0)
.unwrap_or(false) .unwrap_or(false)
}) { }) {
return true; return true;

View File

@ -6,6 +6,7 @@ use swc_ecma_utils::{class_has_side_effect, find_pat_ids, ExprExt};
use super::Optimizer; use super::Optimizer;
use crate::{ use crate::{
alias::{collect_infects_from, AliasConfig}, alias::{collect_infects_from, AliasConfig},
analyzer::VarUsageInfo,
compress::optimize::util::is_valid_for_lhs, compress::optimize::util::is_valid_for_lhs,
mode::Mode, mode::Mode,
util::{ util::{
@ -352,7 +353,7 @@ where
} }
} }
if !usage.used_as_callee { if usage.callee_count == 0 {
if let Expr::Fn(..) | Expr::Arrow(..) = init { if let Expr::Fn(..) | Expr::Arrow(..) = init {
return; return;
} }
@ -408,8 +409,21 @@ where
} }
/// Check if the body of a function is simple enough to inline. /// Check if the body of a function is simple enough to inline.
fn is_fn_body_simple_enough_to_inline(&self, body: &BlockStmt, param_count: usize) -> bool { fn is_fn_body_simple_enough_to_inline(
let cost_limit = 3 + param_count * 2; &self,
body: &BlockStmt,
param_count: usize,
usage: &VarUsageInfo,
) -> bool {
let param_cost = param_count * 2;
// if it's passed as value but not called, the function expr cannot be removed
let func_body_cost = if usage.ref_count == usage.callee_count {
// length of "function c(){}"
14 / usage.usage_count
} else {
0
} as usize;
let cost_limit = 3 + param_cost + func_body_cost;
if body.stmts.len() == 1 { if body.stmts.len() == 1 {
match &body.stmts[0] { match &body.stmts[0] {
@ -541,13 +555,21 @@ where
match &f.function.body { match &f.function.body {
Some(body) => { Some(body) => {
if !usage.used_recursively if !usage.used_recursively
// only callees can be inlined multiple times // only callees can be inlined multiple times
&& usage.used_as_callee && usage.callee_count > 0
// prefer single inline
&& usage.ref_count > 1
&& self.is_fn_body_simple_enough_to_inline( && self.is_fn_body_simple_enough_to_inline(
body, body,
f.function.params.len(), f.function.params.len(),
usage,
) )
{ {
if f.function.params.iter().any(|param| {
matches!(param.pat, Pat::Rest(..) | Pat::Assign(..))
}) {
return;
}
trace_op!( trace_op!(
"inline: Decided to inline function '{}{:?}' as it's very \ "inline: Decided to inline function '{}{:?}' as it's very \
simple", simple",
@ -555,12 +577,6 @@ where
f.ident.span.ctxt f.ident.span.ctxt
); );
if f.function.params.iter().any(|param| {
matches!(param.pat, Pat::Rest(..) | Pat::Assign(..))
}) {
return;
}
for i in collect_infects_from( for i in collect_infects_from(
&f.function, &f.function,
AliasConfig { AliasConfig {
@ -576,15 +592,10 @@ where
self.vars.simple_functions.insert( self.vars.simple_functions.insert(
i.to_id(), i.to_id(),
match decl { Box::new(Expr::Fn(FnExpr {
Decl::Fn(f) => Box::new(Expr::Fn(FnExpr { ident: None,
ident: None, function: f.function.clone(),
function: f.function.clone(), })),
})),
_ => {
unreachable!()
}
},
); );
return; return;
@ -607,7 +618,7 @@ where
// //
if (self.options.reduce_vars || self.options.collapse_vars || self.options.inline != 0) if (self.options.reduce_vars || self.options.collapse_vars || self.options.inline != 0)
&& usage.ref_count == 1 && usage.ref_count == 1
&& (usage.used_as_callee && (usage.callee_count > 0
|| !usage.executed_multiple_time || !usage.executed_multiple_time
&& (usage.is_fn_local || !usage.used_in_non_child_fn)) && (usage.is_fn_local || !usage.used_in_non_child_fn))
&& !usage.inline_prevented && !usage.inline_prevented

View File

@ -2017,9 +2017,6 @@
function transition(name) { function transition(name) {
return selection().transition(name); return selection().transition(name);
} }
function newId() {
return ++id;
}
var selection_prototype = selection.prototype; var selection_prototype = selection.prototype;
function quadInOut(t) { function quadInOut(t) {
return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
@ -2059,7 +2056,7 @@
return new Selection$1(this._groups, this._parents); return new Selection$1(this._groups, this._parents);
}, },
transition: function() { transition: function() {
for(var name = this._name, id0 = this._id, id1 = newId(), groups = this._groups, m = groups.length, j = 0; j < m; ++j)for(var node, group = groups[j], n = group.length, i = 0; i < n; ++i)if (node = group[i]) { for(var name = this._name, id0 = this._id, id1 = ++id, groups = this._groups, m = groups.length, j = 0; j < m; ++j)for(var node, group = groups[j], n = group.length, i = 0; i < n; ++i)if (node = group[i]) {
var inherit = get$1(node, id0); var inherit = get$1(node, id0);
schedule(node, name, id1, i, group, { schedule(node, name, id1, i, group, {
time: inherit.time + inherit.delay + inherit.duration, time: inherit.time + inherit.delay + inherit.duration,
@ -2303,13 +2300,13 @@
interrupt(this, name); interrupt(this, name);
}); });
}, selection.prototype.transition = function(name) { }, selection.prototype.transition = function(name) {
var id, timing; var id1, timing;
name instanceof Transition ? (id = name._id, name = name._name) : (id = newId(), (timing = defaultTiming).time = now(), name = null == name ? null : name + ""); name instanceof Transition ? (id1 = name._id, name = name._name) : (id1 = ++id, (timing = defaultTiming).time = now(), name = null == name ? null : name + "");
for(var groups = this._groups, m = groups.length, j = 0; j < m; ++j)for(var node, group = groups[j], n = group.length, i = 0; i < n; ++i)(node = group[i]) && schedule(node, name, id, i, group, timing || function(node, id) { for(var groups = this._groups, m = groups.length, j = 0; j < m; ++j)for(var node, group = groups[j], n = group.length, i = 0; i < n; ++i)(node = group[i]) && schedule(node, name, id1, i, group, timing || function(node, id) {
for(var timing; !(timing = node.__transition) || !(timing = timing[id]);)if (!(node = node.parentNode)) throw Error(`transition ${id} not found`); for(var timing; !(timing = node.__transition) || !(timing = timing[id]);)if (!(node = node.parentNode)) throw Error(`transition ${id} not found`);
return timing; return timing;
}(node, id)); }(node, id1));
return new Transition(groups, this._parents, name, id); return new Transition(groups, this._parents, name, id1);
}; };
var root$1 = [ var root$1 = [
null null
@ -4429,9 +4426,6 @@
function asin(x) { function asin(x) {
return x > 1 ? halfPi$2 : x < -1 ? -halfPi$2 : Math.asin(x); return x > 1 ? halfPi$2 : x < -1 ? -halfPi$2 : Math.asin(x);
} }
function haversin(x) {
return (x = sin$1(x / 2)) * x;
}
function noop$2() {} function noop$2() {}
function streamGeometry(geometry, stream) { function streamGeometry(geometry, stream) {
geometry && streamGeometryType.hasOwnProperty(geometry.type) && streamGeometryType[geometry.type](geometry, stream); geometry && streamGeometryType.hasOwnProperty(geometry.type) && streamGeometryType[geometry.type](geometry, stream);
@ -5146,10 +5140,10 @@
return !0; return !0;
}, },
Point: function(object, point) { Point: function(object, point) {
return containsPoint(object.coordinates, point); return 0 === distance(object.coordinates, point);
}, },
MultiPoint: function(object, point) { MultiPoint: function(object, point) {
for(var coordinates = object.coordinates, i = -1, n = coordinates.length; ++i < n;)if (containsPoint(coordinates[i], point)) return !0; for(var coordinates = object.coordinates, i = -1, n = coordinates.length; ++i < n;)if (0 === distance(coordinates[i], point)) return !0;
return !1; return !1;
}, },
LineString: function(object, point) { LineString: function(object, point) {
@ -5174,9 +5168,6 @@
function containsGeometry(geometry, point) { function containsGeometry(geometry, point) {
return !!(geometry && containsGeometryType.hasOwnProperty(geometry.type)) && containsGeometryType[geometry.type](geometry, point); return !!(geometry && containsGeometryType.hasOwnProperty(geometry.type)) && containsGeometryType[geometry.type](geometry, point);
} }
function containsPoint(coordinates, point) {
return 0 === distance(coordinates, point);
}
function containsLine(coordinates, point) { function containsLine(coordinates, point) {
for(var ao, bo, ab, i = 0, n = coordinates.length; i < n; i++){ for(var ao, bo, ab, i = 0, n = coordinates.length; i < n; i++){
if (0 === (bo = distance(coordinates[i], point)) || i > 0 && (ab = distance(coordinates[i], coordinates[i - 1])) > 0 && ao <= ab && bo <= ab && (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < 1e-12 * ab) return !0; if (0 === (bo = distance(coordinates[i], point)) || i > 0 && (ab = distance(coordinates[i], coordinates[i - 1])) > 0 && ao <= ab && bo <= ab && (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < 1e-12 * ab) return !0;
@ -8607,12 +8598,9 @@
function LinearClosed(context) { function LinearClosed(context) {
this._context = context; this._context = context;
} }
function sign$1(x) {
return x < 0 ? -1 : 1;
}
function slope3(that, x2, y2) { function slope3(that, x2, y2) {
var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0); var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0);
return (sign$1(s0) + sign$1(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs((s0 * h1 + s1 * h0) / (h0 + h1))) || 0; return ((s0 < 0 ? -1 : 1) + (s1 < 0 ? -1 : 1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs((s0 * h1 + s1 * h0) / (h0 + h1))) || 0;
} }
function slope2(that, t) { function slope2(that, t) {
var h = that._x1 - that._x0; var h = that._x1 - that._x0;
@ -9924,7 +9912,7 @@
return fitHeight(projection, height, object); return fitHeight(projection, height, object);
}, projection; }, projection;
}, exports1.geoInterpolate = function(a, b) { }, exports1.geoInterpolate = function(a, b) {
var x0 = a[0] * radians$1, y0 = a[1] * radians$1, x1 = b[0] * radians$1, y1 = b[1] * radians$1, cy0 = cos$1(y0), sy0 = sin$1(y0), cy1 = cos$1(y1), sy1 = sin$1(y1), kx0 = cy0 * cos$1(x0), ky0 = cy0 * sin$1(x0), kx1 = cy1 * cos$1(x1), ky1 = cy1 * sin$1(x1), d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))), k = sin$1(d), interpolate = d ? function(t) { var x, x1, x0 = a[0] * radians$1, y0 = a[1] * radians$1, x11 = b[0] * radians$1, y1 = b[1] * radians$1, cy0 = cos$1(y0), sy0 = sin$1(y0), cy1 = cos$1(y1), sy1 = sin$1(y1), kx0 = cy0 * cos$1(x0), ky0 = cy0 * sin$1(x0), kx1 = cy1 * cos$1(x11), ky1 = cy1 * sin$1(x11), d = 2 * asin(sqrt((x = sin$1((x = y1 - y0) / 2)) * x + cy0 * cy1 * ((x1 = sin$1((x1 = x11 - x0) / 2)) * x1))), k = sin$1(d), interpolate = d ? function(t) {
var B = sin$1(t *= d) / k, A = sin$1(d - t) / k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1; var B = sin$1(t *= d) / k, A = sin$1(d - t) / k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1;
return [ return [
atan2(y, x) * degrees$2, atan2(y, x) * degrees$2,

View File

@ -4167,11 +4167,12 @@
existings = existings || [], newCmptOptions = (newCmptOptions || []).slice(); existings = existings || [], newCmptOptions = (newCmptOptions || []).slice();
var existingIdIdxMap = createHashMap(); var existingIdIdxMap = createHashMap();
each(newCmptOptions, function(cmptOption, index) { each(newCmptOptions, function(cmptOption, index) {
var idOrName, idOrName1;
if (!isObject(cmptOption)) { if (!isObject(cmptOption)) {
newCmptOptions[index] = null; newCmptOptions[index] = null;
return; return;
} }
null == cmptOption.id || isValidIdOrName(cmptOption.id) || warnInvalidateIdOrName(cmptOption.id), null == cmptOption.name || isValidIdOrName(cmptOption.name) || warnInvalidateIdOrName(cmptOption.name); null == cmptOption.id || isStringSafe(idOrName = cmptOption.id) || isNumeric(idOrName) || warnInvalidateIdOrName(cmptOption.id), null == cmptOption.name || isStringSafe(idOrName1 = cmptOption.name) || isNumeric(idOrName1) || warnInvalidateIdOrName(cmptOption.name);
}); });
var result1 = function(existings, existingIdIdxMap, mode) { var result1 = function(existings, existingIdIdxMap, mode) {
var result = []; var result = [];
@ -4256,9 +4257,6 @@
function warnInvalidateIdOrName(idOrName) { function warnInvalidateIdOrName(idOrName) {
warn('`' + idOrName + '` is invalid id or name. Must be a string or number.'); warn('`' + idOrName + '` is invalid id or name. Must be a string or number.');
} }
function isValidIdOrName(idOrName) {
return isStringSafe(idOrName) || isNumeric(idOrName);
}
function isNameSpecified(componentModel) { function isNameSpecified(componentModel) {
var name = componentModel.name; var name = componentModel.name;
return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));
@ -6005,18 +6003,6 @@
function leaveEmphasis(el, highlightDigit) { function leaveEmphasis(el, highlightDigit) {
(el.__highByOuter &= ~(1 << (highlightDigit || 0))) || traverseUpdateState(el, singleLeaveEmphasis); (el.__highByOuter &= ~(1 << (highlightDigit || 0))) || traverseUpdateState(el, singleLeaveEmphasis);
} }
function enterBlur(el) {
traverseUpdateState(el, singleEnterBlur);
}
function leaveBlur(el) {
traverseUpdateState(el, singleLeaveBlur);
}
function enterSelect(el) {
traverseUpdateState(el, singleEnterSelect);
}
function leaveSelect(el) {
traverseUpdateState(el, singleLeaveSelect);
}
function shouldSilent(el, e) { function shouldSilent(el, e) {
return el.__highDownSilentOnTouch && e.zrByTouch; return el.__highDownSilentOnTouch && e.zrByTouch;
} }
@ -6032,7 +6018,7 @@
function leaveBlurOfIndices(data, dataIndices) { function leaveBlurOfIndices(data, dataIndices) {
for(var i = 0; i < dataIndices.length; i++){ for(var i = 0; i < dataIndices.length; i++){
var itemEl = data.getItemGraphicEl(dataIndices[i]); var itemEl = data.getItemGraphicEl(dataIndices[i]);
itemEl && leaveBlur(itemEl); itemEl && traverseUpdateState(itemEl, singleLeaveBlur);
} }
} }
if (blurScope = blurScope || 'coordinateSystem', null != targetSeriesIndex && focus && 'none' !== focus) { if (blurScope = blurScope || 'coordinateSystem', null != targetSeriesIndex && focus && 'none' !== focus) {
@ -6092,7 +6078,7 @@
each(seriesModel.getAllData(), function(_a) { each(seriesModel.getAllData(), function(_a) {
var data = _a.data, type = _a.type; var data = _a.data, type = _a.type;
data.eachItemGraphicEl(function(el, idx) { data.eachItemGraphicEl(function(el, idx) {
seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el); seriesModel.isSelected(idx, type) ? traverseUpdateState(el, singleEnterSelect) : traverseUpdateState(el, singleLeaveSelect);
}); });
}); });
} }
@ -6292,9 +6278,6 @@
})(pathProxy, m), this.dirtyShape(); })(pathProxy, m), this.dirtyShape();
}, innerOpts; }, innerOpts;
} }
function createFromString(str, opts) {
return new SVGPath(createPathOptions(str, opts));
}
var CircleShape = function() { var CircleShape = function() {
this.cx = 0, this.cy = 0, this.r = 0; this.cx = 0, this.cy = 0, this.r = 0;
}, Circle = function(_super) { }, Circle = function(_super) {
@ -6755,7 +6738,7 @@
if (_customShapeMap.hasOwnProperty(name)) return _customShapeMap[name]; if (_customShapeMap.hasOwnProperty(name)) return _customShapeMap[name];
} }
function makePath(pathData, opts, rect, layout) { function makePath(pathData, opts, rect, layout) {
var path = createFromString(pathData, opts); var path = new SVGPath(createPathOptions(pathData, opts));
return rect && ('center' === layout && (rect = centerGraphic(rect, path.getBoundingRect())), resizePath(path, rect)), path; return rect && ('center' === layout && (rect = centerGraphic(rect, path.getBoundingRect())), resizePath(path, rect)), path;
} }
function makeImage(imageUrl, rect, layout) { function makeImage(imageUrl, rect, layout) {
@ -6882,16 +6865,13 @@
]; ];
return Math.abs((vertex = applyTransform$1(vertex, transform, invert))[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top'; return Math.abs((vertex = applyTransform$1(vertex, transform, invert))[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top';
} }
function isNotGroup(el) {
return !el.isGroup;
}
function groupTransition(g1, g2, animatableModel) { function groupTransition(g1, g2, animatableModel) {
if (g1 && g2) { if (g1 && g2) {
var elMap, elMap1 = (elMap = {}, g1.traverse(function(el) { var elMap, elMap1 = (elMap = {}, g1.traverse(function(el) {
isNotGroup(el) && el.anid && (elMap[el.anid] = el); !el.isGroup && el.anid && (elMap[el.anid] = el);
}), elMap); }), elMap);
g2.traverse(function(el) { g2.traverse(function(el) {
if (isNotGroup(el) && el.anid) { if (!el.isGroup && el.anid) {
var oldEl = elMap1[el.anid]; var oldEl = elMap1[el.anid];
if (oldEl) { if (oldEl) {
var newProp = getAnimatableProps(el); var newProp = getAnimatableProps(el);
@ -9157,7 +9137,7 @@
dimensionsDefine: determined.dimensionsDefine, dimensionsDefine: determined.dimensionsDefine,
startIndex: determined.startIndex, startIndex: determined.startIndex,
dimensionsDetectedCount: determined.dimensionsDetectedCount, dimensionsDetectedCount: determined.dimensionsDetectedCount,
encodeDefine: makeEncodeDefine(encodeDefine), encodeDefine: encodeDefine ? createHashMap(encodeDefine) : null,
metaRawOption: clone(thisMetaRawOption) metaRawOption: clone(thisMetaRawOption)
}); });
} }
@ -9167,9 +9147,6 @@
sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL
}); });
} }
function makeEncodeDefine(encodeDefine) {
return encodeDefine ? createHashMap(encodeDefine) : null;
}
function detectSourceFormat(data) { function detectSourceFormat(data) {
var sourceFormat = SOURCE_FORMAT_UNKNOWN; var sourceFormat = SOURCE_FORMAT_UNKNOWN;
if (isTypedArray(data)) sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; if (isTypedArray(data)) sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;
@ -9426,16 +9403,13 @@
define1 = define1 || {}, this._reset = define1.reset, this._plan = define1.plan, this._count = define1.count, this._onDirty = define1.onDirty, this._dirty = !0; define1 = define1 || {}, this._reset = define1.reset, this._plan = define1.plan, this._count = define1.count, this._onDirty = define1.onDirty, this._dirty = !0;
} }
return Task.prototype.perform = function(performArgs) { return Task.prototype.perform = function(performArgs) {
var planResult, forceFirstProgress, upTask = this._upstream, skip = performArgs && performArgs.skip; var val, val1, planResult, forceFirstProgress, upTask = this._upstream, skip = performArgs && performArgs.skip;
if (this._dirty && upTask) { if (this._dirty && upTask) {
var context = this.context; var context = this.context;
context.data = context.outputData = upTask.context.outputData; context.data = context.outputData = upTask.context.outputData;
} }
this.__pipeline && (this.__pipeline.currentTask = this), this._plan && !skip && (planResult = this._plan(this.context)); this.__pipeline && (this.__pipeline.currentTask = this), this._plan && !skip && (planResult = this._plan(this.context));
var lastModBy = normalizeModBy(this._modBy), lastModDataCount = this._modDataCount || 0, modBy = normalizeModBy(performArgs && performArgs.modBy), modDataCount = performArgs && performArgs.modDataCount || 0; var lastModBy = ((val = this._modBy) >= 1 || (val = 1), val), lastModDataCount = this._modDataCount || 0, modBy = ((val1 = performArgs && performArgs.modBy) >= 1 || (val1 = 1), val1), modDataCount = performArgs && performArgs.modDataCount || 0;
function normalizeModBy(val) {
return val >= 1 || (val = 1), val;
}
(lastModBy !== modBy || lastModDataCount !== modDataCount) && (planResult = 'reset'), (this._dirty || 'reset' === planResult) && (this._dirty = !1, forceFirstProgress = this._doReset(skip)), this._modBy = modBy, this._modDataCount = modDataCount; (lastModBy !== modBy || lastModDataCount !== modDataCount) && (planResult = 'reset'), (this._dirty || 'reset' === planResult) && (this._dirty = !1, forceFirstProgress = this._doReset(skip)), this._modBy = modBy, this._modDataCount = modDataCount;
var step = performArgs && performArgs.step; var step = performArgs && performArgs.step;
if (upTask ? (assert(null != upTask._outputDueEnd), this._dueEnd = upTask._outputDueEnd) : (assert(!this._progress || this._count), this._dueEnd = this._count ? this._count(this.context) : 1 / 0), this._progress) { if (upTask ? (assert(null != upTask._outputDueEnd), this._dueEnd = upTask._outputDueEnd) : (assert(!this._progress || this._count), this._dueEnd = this._count ? this._count(this.context) : 1 / 0), this._progress) {
@ -9509,11 +9483,7 @@
trim: function(val) { trim: function(val) {
return 'string' == typeof val ? trim(val) : val; return 'string' == typeof val ? trim(val) : val;
} }
}); }), ORDER_COMPARISON_OP_MAP = {
function getRawValueParser(type) {
return valueParserMap.get(type);
}
var ORDER_COMPARISON_OP_MAP = {
lt: function(lval, rval) { lt: function(lval, rval) {
return lval < rval; return lval < rval;
}, },
@ -9632,7 +9602,7 @@
], upstreamSignList = []; ], upstreamSignList = [];
assert(resultSourceList && upstreamSignList), this._setLocalSource(resultSourceList, upstreamSignList); assert(resultSourceList && upstreamSignList), this._setLocalSource(resultSourceList, upstreamSignList);
}, SourceManager.prototype._applyTransform = function(upMgrList) { }, SourceManager.prototype._applyTransform = function(upMgrList) {
var source, sourceList, datasetModel = this._sourceHost, transformOption = datasetModel.get('transform', !0), fromTransformResult = datasetModel.get('fromTransformResult', !0); var encodeDefine, source, sourceList, datasetModel = this._sourceHost, transformOption = datasetModel.get('transform', !0), fromTransformResult = datasetModel.get('fromTransformResult', !0);
assert(null != fromTransformResult || null != transformOption), null != fromTransformResult && 1 !== upMgrList.length && doThrow('When using `fromTransformResult`, there should be only one upstream dataset'); assert(null != fromTransformResult || null != transformOption), null != fromTransformResult && 1 !== upMgrList.length && doThrow('When using `fromTransformResult`, there should be only one upstream dataset');
var upSourceList = [], upstreamSignList = []; var upSourceList = [], upstreamSignList = [];
return (each(upMgrList, function(upMgr) { return (each(upMgrList, function(upMgr) {
@ -9725,7 +9695,7 @@
dimensionsDefine: clone(source.dimensionsDefine), dimensionsDefine: clone(source.dimensionsDefine),
startIndex: source.startIndex, startIndex: source.startIndex,
dimensionsDetectedCount: source.dimensionsDetectedCount, dimensionsDetectedCount: source.dimensionsDetectedCount,
encodeDefine: makeEncodeDefine(source.encodeDefine) encodeDefine: (encodeDefine = source.encodeDefine) ? createHashMap(encodeDefine) : null
})) }))
]), { ]), {
sourceList: sourceList, sourceList: sourceList,
@ -12054,7 +12024,7 @@
return inheritStyle(parentGroup, g), parseAttributes(xmlNode, g, this._defsUsePending, !1, !0), this._textX += parseFloat(dx), this._textY += parseFloat(dy), g; return inheritStyle(parentGroup, g), parseAttributes(xmlNode, g, this._defsUsePending, !1, !0), this._textX += parseFloat(dx), this._textY += parseFloat(dy), g;
}, },
path: function(xmlNode, parentGroup) { path: function(xmlNode, parentGroup) {
var path = createFromString(xmlNode.getAttribute('d') || ''); var str, path = (str = xmlNode.getAttribute('d') || '', new SVGPath(createPathOptions(str, void 0)));
return inheritStyle(parentGroup, path), parseAttributes(xmlNode, path, this._defsUsePending, !1, !1), path.silent = !0, path; return inheritStyle(parentGroup, path), parseAttributes(xmlNode, path, this._defsUsePending, !1, !1), path.silent = !0, path;
} }
}), SVGParser; }), SVGParser;
@ -13625,13 +13595,13 @@
}, class_1.prototype.leaveEmphasis = function(el, highlightDigit) { }, class_1.prototype.leaveEmphasis = function(el, highlightDigit) {
leaveEmphasis(el, highlightDigit), markStatusToUpdate(ecIns); leaveEmphasis(el, highlightDigit), markStatusToUpdate(ecIns);
}, class_1.prototype.enterBlur = function(el) { }, class_1.prototype.enterBlur = function(el) {
enterBlur(el), markStatusToUpdate(ecIns); traverseUpdateState(el, singleEnterBlur), markStatusToUpdate(ecIns);
}, class_1.prototype.leaveBlur = function(el) { }, class_1.prototype.leaveBlur = function(el) {
leaveBlur(el), markStatusToUpdate(ecIns); traverseUpdateState(el, singleLeaveBlur), markStatusToUpdate(ecIns);
}, class_1.prototype.enterSelect = function(el) { }, class_1.prototype.enterSelect = function(el) {
enterSelect(el), markStatusToUpdate(ecIns); traverseUpdateState(el, singleEnterSelect), markStatusToUpdate(ecIns);
}, class_1.prototype.leaveSelect = function(el) { }, class_1.prototype.leaveSelect = function(el) {
leaveSelect(el), markStatusToUpdate(ecIns); traverseUpdateState(el, singleLeaveSelect), markStatusToUpdate(ecIns);
}, class_1.prototype.getModel = function() { }, class_1.prototype.getModel = function() {
return ecIns.getModel(); return ecIns.getModel();
}, class_1.prototype.getViewOfComponentModel = function(componentModel) { }, class_1.prototype.getViewOfComponentModel = function(componentModel) {
@ -14971,9 +14941,6 @@
function getName(obj) { function getName(obj) {
return isObject(obj) && null != obj.value ? obj.value : obj + ''; return isObject(obj) && null != obj.value ? obj.value : obj + '';
} }
function getIntervalPrecision(interval) {
return getPrecisionSafe(interval) + 2;
}
function clamp(niceTickExtent, idx, extent) { function clamp(niceTickExtent, idx, extent) {
niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]); niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);
} }
@ -15070,7 +15037,7 @@
}, IntervalScale.prototype.getInterval = function() { }, IntervalScale.prototype.getInterval = function() {
return this._interval; return this._interval;
}, IntervalScale.prototype.setInterval = function(interval) { }, IntervalScale.prototype.setInterval = function(interval) {
this._interval = interval, this._niceExtent = this._extent.slice(), this._intervalPrecision = getIntervalPrecision(interval); this._interval = interval, this._niceExtent = this._extent.slice(), this._intervalPrecision = getPrecisionSafe(interval) + 2;
}, IntervalScale.prototype.getTicks = function(expandToNicedExtent) { }, IntervalScale.prototype.getTicks = function(expandToNicedExtent) {
var interval = this._interval, extent = this._extent, niceTickExtent = this._niceExtent, intervalPrecision = this._intervalPrecision, ticks = []; var interval = this._interval, extent = this._extent, niceTickExtent = this._niceExtent, intervalPrecision = this._intervalPrecision, ticks = [];
if (!interval) return ticks; if (!interval) return ticks;
@ -15106,7 +15073,7 @@
var splitNumber1, result, span, interval, precision, extent = this._extent, span1 = extent[1] - extent[0]; var splitNumber1, result, span, interval, precision, extent = this._extent, span1 = extent[1] - extent[0];
if (isFinite(span1)) { if (isFinite(span1)) {
span1 < 0 && (span1 = -span1, extent.reverse()); span1 < 0 && (span1 = -span1, extent.reverse());
var niceTickExtent, result1 = (splitNumber1 = splitNumber, result = {}, span = extent[1] - extent[0], interval = result.interval = nice(span / splitNumber1, !0), null != minInterval && interval < minInterval && (interval = result.interval = minInterval), null != maxInterval && interval > maxInterval && (interval = result.interval = maxInterval), precision = result.intervalPrecision = getIntervalPrecision(interval), isFinite((niceTickExtent = result.niceTickExtent = [ var interval1, niceTickExtent, result1 = (splitNumber1 = splitNumber, result = {}, span = extent[1] - extent[0], interval = result.interval = nice(span / splitNumber1, !0), null != minInterval && interval < minInterval && (interval = result.interval = minInterval), null != maxInterval && interval > maxInterval && (interval = result.interval = maxInterval), precision = result.intervalPrecision = getPrecisionSafe(interval) + 2, isFinite((niceTickExtent = result.niceTickExtent = [
round(Math.ceil(extent[0] / interval) * interval, precision), round(Math.ceil(extent[0] / interval) * interval, precision),
round(Math.floor(extent[1] / interval) * interval, precision) round(Math.floor(extent[1] / interval) * interval, precision)
])[0]) || (niceTickExtent[0] = extent[0]), isFinite(niceTickExtent[1]) || (niceTickExtent[1] = extent[1]), clamp(niceTickExtent, 0, extent), clamp(niceTickExtent, 1, extent), niceTickExtent[0] > niceTickExtent[1] && (niceTickExtent[0] = niceTickExtent[1]), result); ])[0]) || (niceTickExtent[0] = extent[0]), isFinite(niceTickExtent[1]) || (niceTickExtent[1] = extent[1]), clamp(niceTickExtent, 0, extent), clamp(niceTickExtent, 1, extent), niceTickExtent[0] > niceTickExtent[1] && (niceTickExtent[0] = niceTickExtent[1]), result);
@ -15613,19 +15580,19 @@
return __extends(LogScale, _super), LogScale.prototype.getTicks = function(expandToNicedExtent) { return __extends(LogScale, _super), LogScale.prototype.getTicks = function(expandToNicedExtent) {
var originalScale = this._originalScale, extent = this._extent, originalExtent = originalScale.getExtent(); var originalScale = this._originalScale, extent = this._extent, originalExtent = originalScale.getExtent();
return map(intervalScaleProto.getTicks.call(this, expandToNicedExtent), function(tick) { return map(intervalScaleProto.getTicks.call(this, expandToNicedExtent), function(tick) {
var val = tick.value, powVal = round(mathPow$1(this.base, val)); var originalVal, originalVal1, val = tick.value, powVal = round(mathPow$1(this.base, val));
return powVal = val === extent[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal, { return powVal = val === extent[0] && this._fixMin ? round(powVal, getPrecisionSafe(originalExtent[0])) : powVal, {
value: powVal = val === extent[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal value: powVal = val === extent[1] && this._fixMax ? round(powVal, getPrecisionSafe(originalExtent[1])) : powVal
}; };
}, this); }, this);
}, LogScale.prototype.setExtent = function(start, end) { }, LogScale.prototype.setExtent = function(start, end) {
var base = this.base; var base = this.base;
start = mathLog(start) / mathLog(base), end = mathLog(end) / mathLog(base), intervalScaleProto.setExtent.call(this, start, end); start = mathLog(start) / mathLog(base), end = mathLog(end) / mathLog(base), intervalScaleProto.setExtent.call(this, start, end);
}, LogScale.prototype.getExtent = function() { }, LogScale.prototype.getExtent = function() {
var base = this.base, extent = scaleProto.getExtent.call(this); var originalVal, originalVal1, base = this.base, extent = scaleProto.getExtent.call(this);
extent[0] = mathPow$1(base, extent[0]), extent[1] = mathPow$1(base, extent[1]); extent[0] = mathPow$1(base, extent[0]), extent[1] = mathPow$1(base, extent[1]);
var originalExtent = this._originalScale.getExtent(); var originalExtent = this._originalScale.getExtent();
return this._fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0])), this._fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1])), extent; return this._fixMin && (extent[0] = round(extent[0], getPrecisionSafe(originalExtent[0]))), this._fixMax && (extent[1] = round(extent[1], getPrecisionSafe(originalExtent[1]))), extent;
}, LogScale.prototype.unionExtent = function(extent) { }, LogScale.prototype.unionExtent = function(extent) {
this._originalScale.unionExtent(extent); this._originalScale.unionExtent(extent);
var base = this.base; var base = this.base;
@ -15656,9 +15623,6 @@
return val = scale$2(val, this._extent), mathPow$1(this.base, val); return val = scale$2(val, this._extent), mathPow$1(this.base, val);
}, LogScale.type = 'log', LogScale; }, LogScale.type = 'log', LogScale;
}(Scale), proto = LogScale.prototype; }(Scale), proto = LogScale.prototype;
function fixRoundingError(val, originalVal) {
return round(val, getPrecisionSafe(originalVal));
}
proto.getMinorTicks = intervalScaleProto.getMinorTicks, proto.getLabel = intervalScaleProto.getLabel, Scale.registerClass(LogScale); proto.getMinorTicks = intervalScaleProto.getMinorTicks, proto.getLabel = intervalScaleProto.getLabel, Scale.registerClass(LogScale);
var ScaleRawExtentInfo = function() { var ScaleRawExtentInfo = function() {
function ScaleRawExtentInfo(scale, model, originalExtent) { function ScaleRawExtentInfo(scale, model, originalExtent) {
@ -20531,12 +20495,18 @@
data.each(data.mapDimension(axes[axisIndex].dim), function(val, dataIndex) { data.each(data.mapDimension(axes[axisIndex].dim), function(val, dataIndex) {
points[dataIndex] = points[dataIndex] || []; points[dataIndex] = points[dataIndex] || [];
var point = coordSys.dataToPoint(val, axisIndex); var point = coordSys.dataToPoint(val, axisIndex);
points[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys); points[dataIndex][axisIndex] = isValidPoint(point) ? point : [
coordSys.cx,
coordSys.cy
];
}); });
}), data.each(function(idx) { }), data.each(function(idx) {
var firstPoint = find(points[idx], function(point) { var firstPoint = find(points[idx], function(point) {
return isValidPoint(point); return isValidPoint(point);
}) || getValueMissingPoint(coordSys); }) || [
coordSys.cx,
coordSys.cy
];
points[idx].push(firstPoint.slice()), data.setItemLayout(idx, points[idx]); points[idx].push(firstPoint.slice()), data.setItemLayout(idx, points[idx]);
}); });
} }
@ -20545,12 +20515,6 @@
function isValidPoint(point) { function isValidPoint(point) {
return !isNaN(point[0]) && !isNaN(point[1]); return !isNaN(point[0]) && !isNaN(point[1]);
} }
function getValueMissingPoint(coordSys) {
return [
coordSys.cx,
coordSys.cy
];
}
function radarBackwardCompat(option) { function radarBackwardCompat(option) {
var polarOptArr = option.polar; var polarOptArr = option.polar;
if (polarOptArr) { if (polarOptArr) {
@ -21030,9 +20994,6 @@
}); });
} }
var ATTR = '\0_ec_interaction_mutex'; var ATTR = '\0_ec_interaction_mutex';
function isTaken(zr, resourceKey) {
return !!getStore(zr)[resourceKey];
}
function getStore(zr) { function getStore(zr) {
return zr[ATTR] || (zr[ATTR] = {}); return zr[ATTR] || (zr[ATTR] = {});
} }
@ -21071,7 +21032,7 @@
this.pointerChecker && this.pointerChecker(e, x, y) && (this._x = x, this._y = y, this._dragging = !0); this.pointerChecker && this.pointerChecker(e, x, y) && (this._x = x, this._y = y, this._dragging = !0);
} }
}, RoamController.prototype._mousemoveHandler = function(e) { }, RoamController.prototype._mousemoveHandler = function(e) {
if (!(!this._dragging || !isAvailableBehavior('moveOnMouseMove', e, this._opt) || 'pinch' === e.gestureEvent || isTaken(this._zr, 'globalPan'))) { if (this._dragging && isAvailableBehavior('moveOnMouseMove', e, this._opt) && 'pinch' !== e.gestureEvent && !getStore(this._zr).globalPan) {
var x = e.offsetX, y = e.offsetY, oldX = this._x, oldY = this._y; var x = e.offsetX, y = e.offsetY, oldX = this._x, oldY = this._y;
this._x = x, this._y = y, this._opt.preventDefaultMouseMove && stop(e.event), trigger(this, 'pan', 'moveOnMouseMove', e, { this._x = x, this._y = y, this._opt.preventDefaultMouseMove && stop(e.event), trigger(this, 'pan', 'moveOnMouseMove', e, {
dx: x - oldX, dx: x - oldX,
@ -21108,7 +21069,7 @@
} }
} }
}, RoamController.prototype._pinchHandler = function(e) { }, RoamController.prototype._pinchHandler = function(e) {
if (!isTaken(this._zr, 'globalPan')) { if (!getStore(this._zr).globalPan) {
var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1; var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
checkPointerAndTrigger(this, 'zoom', null, e, { checkPointerAndTrigger(this, 'zoom', null, e, {
scale: scale, scale: scale,
@ -23206,8 +23167,8 @@
} }
} }
function giveGraphic(storageName, Ctor, depth, z) { function giveGraphic(storageName, Ctor, depth, z) {
var depth1, lasts, element, lastCfg, element1 = null != oldRawIndex && oldStorage[storageName][oldRawIndex], lasts1 = lastsForAnimation[storageName]; var lasts, element, lastCfg, element1 = null != oldRawIndex && oldStorage[storageName][oldRawIndex], lasts1 = lastsForAnimation[storageName];
return element1 ? (oldStorage[storageName][oldRawIndex] = null, lasts = lasts1, element = element1, lastCfg = lasts[thisRawIndex] = {}, element instanceof Group ? (lastCfg.oldX = element.x, lastCfg.oldY = element.y) : lastCfg.oldShape = extend({}, element.shape)) : thisInvisible || ((element1 = new Ctor()) instanceof Displayable && (element1.z2 = (depth1 = depth, 100 * depth1 + z)), function(lasts, element) { return element1 ? (oldStorage[storageName][oldRawIndex] = null, lasts = lasts1, element = element1, lastCfg = lasts[thisRawIndex] = {}, element instanceof Group ? (lastCfg.oldX = element.x, lastCfg.oldY = element.y) : lastCfg.oldShape = extend({}, element.shape)) : thisInvisible || ((element1 = new Ctor()) instanceof Displayable && (element1.z2 = 100 * depth + z), function(lasts, element) {
var lastCfg = lasts[thisRawIndex] = {}, parentNode = thisNode.parentNode, isGroup = element instanceof Group; var lastCfg = lasts[thisRawIndex] = {}, parentNode = thisNode.parentNode, isGroup = element instanceof Group;
if (parentNode && (!reRoot || 'drillDown' === reRoot.direction)) { if (parentNode && (!reRoot || 'drillDown' === reRoot.direction)) {
var parentOldX = 0, parentOldY = 0, parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; var parentOldX = 0, parentOldY = 0, parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];
@ -23510,13 +23471,13 @@
} }
} }
for(var i = 0, len = pieceList.length; i < len; i++){ for(var i = 0, len = pieceList.length; i < len; i++){
var piece = pieceList[i], interval = piece.interval, close_1 = piece.close; var close, b, close1, a, close2, a1, close3, b1, piece = pieceList[i], interval = piece.interval, close_1 = piece.close;
if (interval) { if (interval) {
if (interval[0] === -1 / 0) { if (interval[0] === -1 / 0) {
if (littleThan(close_1[1], value, interval[1])) return i; if (close = close_1[1], b = interval[1], close ? value <= b : value < b) return i;
} else if (interval[1] === 1 / 0) { } else if (interval[1] === 1 / 0) {
if (littleThan(close_1[0], interval[0], value)) return i; if (close1 = close_1[0], a = interval[0], close1 ? a <= value : a < value) return i;
} else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) return i; } else if (close2 = close_1[0], a1 = interval[0], (close2 ? a1 <= value : a1 < value) && (close3 = close_1[1], b1 = interval[1], close3 ? value <= b1 : value < b1)) return i;
findClosestWhenOutside && updatePossible(interval[0], i), findClosestWhenOutside && updatePossible(interval[1], i); findClosestWhenOutside && updatePossible(interval[0], i), findClosestWhenOutside && updatePossible(interval[1], i);
} }
} }
@ -23699,11 +23660,7 @@
return null == index ? -1 : index; return null == index ? -1 : index;
}, },
fixed: noop fixed: noop
}; }, inner$8 = makeInner(), treemapVisual = {
function littleThan(close, a, b) {
return close ? a <= b : a < b;
}
var inner$8 = makeInner(), treemapVisual = {
seriesType: 'treemap', seriesType: 'treemap',
reset: function(seriesModel) { reset: function(seriesModel) {
var root = seriesModel.getData().tree.root; var root = seriesModel.getData().tree.root;
@ -37383,7 +37340,7 @@
each(seriesModelList, function(seriesModel) { each(seriesModelList, function(seriesModel) {
var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type); var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);
markerModel && markerModel.getData().eachItemGraphicEl(function(el) { markerModel && markerModel.getData().eachItemGraphicEl(function(el) {
el && enterBlur(el); el && traverseUpdateState(el, singleEnterBlur);
}); });
}); });
}, MarkerView.type = 'marker', MarkerView; }, MarkerView.type = 'marker', MarkerView;
@ -40891,12 +40848,17 @@
}(); }();
function parseOption(exprOption, getters) { function parseOption(exprOption, getters) {
if (!0 === exprOption || !1 === exprOption) { if (!0 === exprOption || !1 === exprOption) {
var subOption, errMsg, cond, cond1 = new ConstConditionInternal(); var val, subOption, errMsg, cond, cond1 = new ConstConditionInternal();
return cond1.value = exprOption, cond1; return cond1.value = exprOption, cond1;
} }
return (isObjectNotArray(exprOption) || throwError(makePrintable('Illegal config. Expect a plain object but actually', exprOption)), exprOption.and) ? parseAndOrOption('and', exprOption, getters) : exprOption.or ? parseAndOrOption('or', exprOption, getters) : exprOption.not ? (subOption = exprOption.not, errMsg = '', errMsg = makePrintable('"not" condition should only be `not: {}`.', 'Illegal condition:', exprOption), isObjectNotArray(subOption) || throwError(errMsg), (cond = new NotConditionInternal()).child = parseOption(subOption, getters), cond.child || throwError(errMsg), cond) : function(exprOption, getters) { if (isObject(exprOption) && !isArrayLike(exprOption) || throwError(makePrintable('Illegal config. Expect a plain object but actually', exprOption)), exprOption.and) return parseAndOrOption('and', exprOption, getters);
for(var valueGetterParam = getters.prepareGetValue(exprOption), subCondList = [], exprKeys = keys(exprOption), parserName = exprOption.parser, valueParser = parserName ? getRawValueParser(parserName) : null, i = 0; i < exprKeys.length; i++){ if (exprOption.or) return parseAndOrOption('or', exprOption, getters);
var keyRaw = exprKeys[i]; if (exprOption.not) {
return subOption = exprOption.not, errMsg = '', errMsg = makePrintable('"not" condition should only be `not: {}`.', 'Illegal condition:', exprOption), isObject(val = subOption) && !isArrayLike(val) || throwError(errMsg), (cond = new NotConditionInternal()).child = parseOption(subOption, getters), cond.child || throwError(errMsg), cond;
}
return function(exprOption, getters) {
for(var valueGetterParam = getters.prepareGetValue(exprOption), subCondList = [], exprKeys = keys(exprOption), parserName = exprOption.parser, valueParser = parserName ? (type = parserName, valueParserMap.get(type)) : null, i = 0; i < exprKeys.length; i++){
var type, keyRaw = exprKeys[i];
if (!('parser' === keyRaw || getters.valueGetterAttrMap.get(keyRaw))) { if (!('parser' === keyRaw || getters.valueGetterAttrMap.get(keyRaw))) {
var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw, condValueRaw = exprOption[keyRaw], condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw, evaluator = ('eq' === op || 'ne' === op ? new FilterEqualityComparator('eq' === op, condValueParsed) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, condValueParsed) : null) || 'reg' === op && new RegExpEvaluator(condValueParsed); var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw, condValueRaw = exprOption[keyRaw], condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw, evaluator = ('eq' === op || 'ne' === op ? new FilterEqualityComparator('eq' === op, condValueParsed) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, condValueParsed) : null) || 'reg' === op && new RegExpEvaluator(condValueParsed);
evaluator || throwError(makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption)), subCondList.push(evaluator); evaluator || throwError(makePrintable('Illegal relational operation: "' + keyRaw + '" in condition:', exprOption)), subCondList.push(evaluator);
@ -40915,9 +40877,6 @@
return parseOption(subOption, getters); return parseOption(subOption, getters);
}), cond.children.length || throwError(errMsg), cond; }), cond.children.length || throwError(errMsg), cond;
} }
function isObjectNotArray(val) {
return isObject(val) && !isArrayLike(val);
}
var ConditionalExpressionParsed = function() { var ConditionalExpressionParsed = function() {
function ConditionalExpressionParsed(exprOption, getters) { function ConditionalExpressionParsed(exprOption, getters) {
this._cond = parseOption(exprOption, getters); this._cond = parseOption(exprOption, getters);
@ -40961,7 +40920,7 @@
null == dimLoose && throwError('Sort transform config must has "dimension" specified.' + sampleLog), 'asc' !== order && 'desc' !== order && throwError('Sort transform config must has "order" specified.' + sampleLog), incomparable && 'min' !== incomparable && 'max' !== incomparable && throwError('incomparable must be "min" or "max" rather than "' + incomparable + '".'), 'asc' !== order && 'desc' !== order && throwError('order must be "asc" or "desc" rather than "' + order + '".'); null == dimLoose && throwError('Sort transform config must has "dimension" specified.' + sampleLog), 'asc' !== order && 'desc' !== order && throwError('Sort transform config must has "order" specified.' + sampleLog), incomparable && 'min' !== incomparable && 'max' !== incomparable && throwError('incomparable must be "min" or "max" rather than "' + incomparable + '".'), 'asc' !== order && 'desc' !== order && throwError('order must be "asc" or "desc" rather than "' + order + '".');
var dimInfo = upstream.getDimensionInfo(dimLoose); var dimInfo = upstream.getDimensionInfo(dimLoose);
dimInfo || throwError(makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal config:', orderExpr, '.\n')); dimInfo || throwError(makePrintable('Can not find dimension info via: ' + dimLoose + '.\n', 'Existing dimensions: ', upstream.cloneAllDimensionInfo(), '.\n', 'Illegal config:', orderExpr, '.\n'));
var parser = parserName ? getRawValueParser(parserName) : null; var parser = parserName ? valueParserMap.get(parserName) : null;
parserName && !parser && throwError(makePrintable('Invalid parser name ' + parserName + '.\n', 'Illegal config:', orderExpr, '.\n')), orderDefList.push({ parserName && !parser && throwError(makePrintable('Invalid parser name ' + parserName + '.\n', 'Illegal config:', orderExpr, '.\n')), orderDefList.push({
dimIdx: dimInfo.index, dimIdx: dimInfo.index,
parser: parser, parser: parser,

View File

@ -1013,7 +1013,7 @@
}; };
} }
function baseMatchesProperty(path, srcValue) { function baseMatchesProperty(path, srcValue) {
return isKey(path) && isStrictComparable(srcValue) ? matchesStrictComparable(toKey(path), srcValue) : function(object) { return isKey(path) && srcValue == srcValue && !isObject(srcValue) ? matchesStrictComparable(toKey(path), srcValue) : function(object) {
var objValue = get(object, path); var objValue = get(object, path);
return undefined === objValue && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, 3); return undefined === objValue && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, 3);
}; };
@ -1645,7 +1645,7 @@
result[length] = [ result[length] = [
key, key,
value, value,
isStrictComparable(value) value == value && !isObject(value)
]; ];
} }
return result; return result;
@ -1719,9 +1719,6 @@
var Ctor = value && value.constructor, proto = 'function' == typeof Ctor && Ctor.prototype || objectProto; var Ctor = value && value.constructor, proto = 'function' == typeof Ctor && Ctor.prototype || objectProto;
return value === proto; return value === proto;
} }
function isStrictComparable(value) {
return value == value && !isObject(value);
}
function matchesStrictComparable(key, srcValue) { function matchesStrictComparable(key, srcValue) {
return function(object) { return function(object) {
return null != object && object[key] === srcValue && (undefined !== srcValue || key in Object1(object)); return null != object && object[key] === srcValue && (undefined !== srcValue || key in Object1(object));

View File

@ -981,9 +981,6 @@
function localeData() { function localeData() {
return this._locale; return this._locale;
} }
function mod$1(dividend, divisor) {
return (dividend % divisor + divisor) % divisor;
}
function localStartOfDate(y, m, d) { function localStartOfDate(y, m, d) {
return y < 100 && y >= 0 ? new Date(y + 400, m, d) - 12622780800000 : new Date(y, m, d).valueOf(); return y < 100 && y >= 0 ? new Date(y + 400, m, d) - 12622780800000 : new Date(y, m, d).valueOf();
} }
@ -1268,13 +1265,13 @@
time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
break; break;
case 'hour': case 'hour':
time = this._d.valueOf(), time += 3600000 - mod$1(time + (this._isUTC ? 0 : 60000 * this.utcOffset()), 3600000) - 1; time = this._d.valueOf(), time += 3600000 - ((time + (this._isUTC ? 0 : 60000 * this.utcOffset())) % 3600000 + 3600000) % 3600000 - 1;
break; break;
case 'minute': case 'minute':
time = this._d.valueOf(), time += 60000 - mod$1(time, 60000) - 1; time = this._d.valueOf(), time += 60000 - (time % 60000 + 60000) % 60000 - 1;
break; break;
case 'second': case 'second':
time = this._d.valueOf(), time += 1000 - mod$1(time, 1000) - 1; time = this._d.valueOf(), time += 1000 - (time % 1000 + 1000) % 1000 - 1;
} }
return this._d.setTime(time), hooks.updateOffset(this, !0), this; return this._d.setTime(time), hooks.updateOffset(this, !0), this;
}, proto.format = function(inputString) { }, proto.format = function(inputString) {
@ -1358,13 +1355,13 @@
time = startOfDate(this.year(), this.month(), this.date()); time = startOfDate(this.year(), this.month(), this.date());
break; break;
case 'hour': case 'hour':
time = this._d.valueOf(), time -= mod$1(time + (this._isUTC ? 0 : 60000 * this.utcOffset()), 3600000); time = this._d.valueOf(), time -= ((time + (this._isUTC ? 0 : 60000 * this.utcOffset())) % 3600000 + 3600000) % 3600000;
break; break;
case 'minute': case 'minute':
time = this._d.valueOf(), time -= mod$1(time, 60000); time = this._d.valueOf(), time -= (time % 60000 + 60000) % 60000;
break; break;
case 'second': case 'second':
time = this._d.valueOf(), time -= mod$1(time, 1000); time = this._d.valueOf(), time -= (time % 1000 + 1000) % 1000;
} }
return this._d.setTime(time), hooks.updateOffset(this, !0), this; return this._d.setTime(time), hooks.updateOffset(this, !0), this;
}, proto.subtract = subtract, proto.toArray = function() { }, proto.subtract = subtract, proto.toArray = function() {

View File

@ -3986,12 +3986,9 @@
}, },
"../../../node_modules/d3-shape/src/curve/monotone.js": function(module1, __webpack_exports__, __webpack_require__) { "../../../node_modules/d3-shape/src/curve/monotone.js": function(module1, __webpack_exports__, __webpack_require__) {
"use strict"; "use strict";
function sign(x) {
return x < 0 ? -1 : 1;
}
function slope3(that, x2, y2) { function slope3(that, x2, y2) {
var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0); var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0);
return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs((s0 * h1 + s1 * h0) / (h0 + h1))) || 0; return ((s0 < 0 ? -1 : 1) + (s1 < 0 ? -1 : 1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs((s0 * h1 + s1 * h0) / (h0 + h1))) || 0;
} }
function slope2(that, t) { function slope2(that, t) {
var h = that._x1 - that._x0; var h = that._x1 - that._x0;

View File

@ -571,12 +571,9 @@
var match = fn && fn.toString().match(/^\s*function (\w+)/); var match = fn && fn.toString().match(/^\s*function (\w+)/);
return match ? match[1] : ''; return match ? match[1] : '';
} }
function isSameType(a, b) {
return getType(a) === getType(b);
}
function getTypeIndex(type, expectedTypes) { function getTypeIndex(type, expectedTypes) {
if (!Array.isArray(expectedTypes)) return isSameType(expectedTypes, type) ? 0 : -1; if (!Array.isArray(expectedTypes)) return getType(expectedTypes) === getType(type) ? 0 : -1;
for(var i = 0, len = expectedTypes.length; i < len; i++)if (isSameType(expectedTypes[i], type)) return i; for(var i = 0, len = expectedTypes.length; i < len; i++)if (getType(expectedTypes[i]) === getType(type)) return i;
return -1; return -1;
} }
function styleValue(value, type) { function styleValue(value, type) {
@ -1919,9 +1916,9 @@
exp: val, exp: val,
key: null key: null
}; };
for(str = val, index$1 = expressionPos = expressionEndPos = 0; !eof();)isStringStart(chr = next()) ? parseString(chr) : 0x5B === chr && function(chr) { for(str = val, index$1 = expressionPos = expressionEndPos = 0; !(index$1 >= len);)isStringStart(chr = next()) ? parseString(chr) : 0x5B === chr && function(chr) {
var inBracket = 1; var inBracket = 1;
for(expressionPos = index$1; !eof();){ for(expressionPos = index$1; !(index$1 >= len);){
if (isStringStart(chr = next())) { if (isStringStart(chr = next())) {
parseString(chr); parseString(chr);
continue; continue;
@ -1942,14 +1939,11 @@
function next() { function next() {
return str.charCodeAt(++index$1); return str.charCodeAt(++index$1);
} }
function eof() {
return index$1 >= len;
}
function isStringStart(chr) { function isStringStart(chr) {
return 0x22 === chr || 0x27 === chr; return 0x22 === chr || 0x27 === chr;
} }
function parseString(chr) { function parseString(chr) {
for(var stringQuote = chr; !eof() && (chr = next()) !== stringQuote;); for(var stringQuote = chr; !(index$1 >= len) && (chr = next()) !== stringQuote;);
} }
function createOnceHandler$1(event, handler, capture) { function createOnceHandler$1(event, handler, capture) {
var _target = target$1; var _target = target$1;

View File

@ -10000,10 +10000,10 @@
asterisk: !1, asterisk: !1,
pattern: null pattern: null
}); });
return attachKeys(path, keys); return path.keys = keys, path;
}(path, keys) : isarray(path) ? function(path, keys, options) { }(path, keys) : isarray(path) ? function(path, keys, options) {
for(var parts = [], i = 0; i < path.length; i++)parts.push(pathToRegexp(path[i], keys, options).source); for(var re, parts = [], i = 0; i < path.length; i++)parts.push(pathToRegexp(path[i], keys, options).source);
return attachKeys(RegExp("(?:" + parts.join("|") + ")", flags(options)), keys); return (re = RegExp("(?:" + parts.join("|") + ")", flags(options))).keys = keys, re;
}(path, keys, options) : (keys1 = keys, tokensToRegExp(parse(path, options1 = options), keys1, options1)); }(path, keys, options) : (keys1 = keys, tokensToRegExp(parse(path, options1 = options), keys1, options1));
}, module.exports.parse = parse, module.exports.compile = function(str, options) { }, module.exports.parse = parse, module.exports.compile = function(str, options) {
return tokensToFunction(parse(str, options), options); return tokensToFunction(parse(str, options), options);
@ -10077,15 +10077,12 @@
function escapeString(str) { function escapeString(str) {
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1"); return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, "\\$1");
} }
function attachKeys(re, keys) {
return re.keys = keys, re;
}
function flags(options) { function flags(options) {
return options && options.sensitive ? "" : "i"; return options && options.sensitive ? "" : "i";
} }
function tokensToRegExp(tokens, keys, options) { function tokensToRegExp(tokens, keys, options) {
isarray(keys) || (options = keys || options, keys = []); isarray(keys) || (options = keys || options, keys = []);
for(var strict = (options = options || {}).strict, end = !1 !== options.end, route = "", i = 0; i < tokens.length; i++){ for(var re, keys1, strict = (options = options || {}).strict, end = !1 !== options.end, route = "", i = 0; i < tokens.length; i++){
var token = tokens[i]; var token = tokens[i];
if ("string" == typeof token) route += escapeString(token); if ("string" == typeof token) route += escapeString(token);
else { else {
@ -10094,7 +10091,7 @@
} }
} }
var delimiter = escapeString(options.delimiter || "/"), endsWithDelimiter = route.slice(-delimiter.length) === delimiter; var delimiter = escapeString(options.delimiter || "/"), endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
return strict || (route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + "(?:" + delimiter + "(?=$))?"), end ? route += "$" : route += strict && endsWithDelimiter ? "" : "(?=" + delimiter + "|$)", attachKeys(RegExp("^" + route, flags(options)), keys); return strict || (route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + "(?:" + delimiter + "(?=$))?"), end ? route += "$" : route += strict && endsWithDelimiter ? "" : "(?=" + delimiter + "|$)", re = RegExp("^" + route, flags(options)), keys1 = keys, re.keys = keys1, re;
} }
}, },
97671: function(module) { 97671: function(module) {

View File

@ -43,15 +43,9 @@
}), this.tags = [], this.ctr = 0; }), this.tags = [], this.ctr = 0;
}, StyleSheet; }, StyleSheet;
}(), abs = Math.abs, Utility_from = String.fromCharCode; }(), abs = Math.abs, Utility_from = String.fromCharCode;
function trim(value) {
return value.trim();
}
function replace(value, pattern, replacement) { function replace(value, pattern, replacement) {
return value.replace(pattern, replacement); return value.replace(pattern, replacement);
} }
function indexof(value, search) {
return value.indexOf(search);
}
function Utility_charat(value, index) { function Utility_charat(value, index) {
return 0 | value.charCodeAt(index); return 0 | value.charCodeAt(index);
} }
@ -61,9 +55,6 @@
function Utility_strlen(value) { function Utility_strlen(value) {
return value.length; return value.length;
} }
function Utility_sizeof(value) {
return value.length;
}
function Utility_append(value, array) { function Utility_append(value, array) {
return array.push(value), value; return array.push(value), value;
} }
@ -91,9 +82,6 @@
function peek() { function peek() {
return Utility_charat(characters, position); return Utility_charat(characters, position);
} }
function slice(begin, end) {
return Utility_substr(characters, begin, end);
}
function token(type) { function token(type) {
switch(type){ switch(type){
case 0: case 0:
@ -129,11 +117,9 @@
function alloc(value) { function alloc(value) {
return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, []; return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), position = 0, [];
} }
function dealloc(value) {
return characters = "", value;
}
function delimit(type) { function delimit(type) {
return trim(slice(position - 1, function delimiter(type) { var begin, end;
return (begin = position - 1, end = function delimiter(type) {
for(; next();)switch(character){ for(; next();)switch(character){
case type: case type:
return position; return position;
@ -147,11 +133,11 @@
next(); next();
} }
return position; return position;
}(91 === type ? type + 2 : 40 === type ? type + 1 : type))); }(91 === type ? type + 2 : 40 === type ? type + 1 : type), Utility_substr(characters, begin, end)).trim();
} }
var MS = "-ms-", MOZ = "-moz-", WEBKIT = "-webkit-", COMMENT = "comm", Enum_RULESET = "rule", DECLARATION = "decl"; var MS = "-ms-", MOZ = "-moz-", WEBKIT = "-webkit-", COMMENT = "comm", Enum_RULESET = "rule", DECLARATION = "decl";
function serialize(children, callback) { function serialize(children, callback) {
for(var output = "", length = Utility_sizeof(children), i = 0; i < length; i++)output += callback(children[i], i, children, callback) || ""; for(var output = "", length = children.length, i = 0; i < length; i++)output += callback(children[i], i, children, callback) || "";
return output; return output;
} }
function stringify(element, index, children, callback) { function stringify(element, index, children, callback) {
@ -169,7 +155,7 @@
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) { function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length) {
for(var post = offset - 1, rule = 0 === offset ? rules : [ for(var post = offset - 1, rule = 0 === offset ? rules : [
"" ""
], size = Utility_sizeof(rule), i = 0, j = 0, k = 0; i < index; ++i)for(var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)(z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x]))) && (props[k++] = z); ], size = rule.length, i = 0, j = 0, k = 0; i < index; ++i)for(var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)(z = (j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])).trim()) && (props[k++] = z);
return node(value, root, parent, 0 === offset ? Enum_RULESET : type, props, children, length); return node(value, root, parent, 0 === offset ? Enum_RULESET : type, props, children, length);
} }
function declaration(value, root, parent, length) { function declaration(value, root, parent, length) {
@ -177,7 +163,7 @@
} }
var identifierWithPointTracking = function(begin, points, index) { var identifierWithPointTracking = function(begin, points, index) {
for(var previous = 0, character = 0; previous = character, character = peek(), 38 === previous && 12 === character && (points[index] = 1), !token(character);)next(); for(var previous = 0, character = 0; previous = character, character = peek(), 38 === previous && 12 === character && (points[index] = 1), !token(character);)next();
return slice(begin, position); return Utility_substr(characters, begin, position);
}, toRules = function(parsed, points) { }, toRules = function(parsed, points) {
var index = -1, character = 44; var index = -1, character = 44;
do switch(token(character)){ do switch(token(character)){
@ -197,12 +183,15 @@
} }
while (character = next()) while (character = next())
return parsed; return parsed;
}, getRules = function(value, points) {
var value1;
return value1 = toRules(alloc(value), points), characters = "", value1;
}, fixedElements = new WeakMap(), compat = function(element) { }, fixedElements = new WeakMap(), compat = function(element) {
if ("rule" === element.type && element.parent && element.length) { if ("rule" === element.type && element.parent && element.length) {
for(var value = element.value, parent = element.parent, isImplicitRule = element.column === parent.column && element.line === parent.line; "rule" !== parent.type;)if (!(parent = parent.parent)) return; for(var value = element.value, parent = element.parent, isImplicitRule = element.column === parent.column && element.line === parent.line; "rule" !== parent.type;)if (!(parent = parent.parent)) return;
if ((1 !== element.props.length || 58 === value.charCodeAt(0) || fixedElements.get(parent)) && !isImplicitRule) { if ((1 !== element.props.length || 58 === value.charCodeAt(0) || fixedElements.get(parent)) && !isImplicitRule) {
fixedElements.set(element, !0); fixedElements.set(element, !0);
for(var points = [], rules = dealloc(toRules(alloc(value), points)), parentRules = parent.props, i = 0, k = 0; i < rules.length; i++)for(var j = 0; j < parentRules.length; j++, k++)element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; for(var points = [], rules = getRules(value, points), parentRules = parent.props, i = 0, k = 0; i < rules.length; i++)for(var j = 0; j < parentRules.length; j++, k++)element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
} }
} }
}, removeLabel = function(element) { }, removeLabel = function(element) {
@ -299,13 +288,13 @@
case 102: case 102:
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (108 == Utility_charat(value, length + 3) ? "$3" : "$2-$3")) + value; return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (108 == Utility_charat(value, length + 3) ? "$3" : "$2-$3")) + value;
case 115: case 115:
return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length) + value : value; return ~value.indexOf("stretch") ? prefix(replace(value, "stretch", "fill-available"), length) + value : value;
} }
break; break;
case 4949: case 4949:
if (115 !== Utility_charat(value, length + 1)) break; if (115 !== Utility_charat(value, length + 1)) break;
case 6444: case 6444:
switch(Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, "!important") && 10))){ switch(Utility_charat(value, Utility_strlen(value) - 3 - (~value.indexOf("!important") && 10))){
case 107: case 107:
return replace(value, ":", ":" + WEBKIT) + value; return replace(value, ":", ":" + WEBKIT) + value;
case 101: case 101:
@ -501,7 +490,7 @@
}; };
Object.prototype.hasOwnProperty; Object.prototype.hasOwnProperty;
var EmotionCacheContext = (0, react.createContext)("undefined" != typeof HTMLElement ? function(options) { var EmotionCacheContext = (0, react.createContext)("undefined" != typeof HTMLElement ? function(options) {
var callback, container, _insert, currentSheet, collection, length, key = options.key; var collection, length, callback, container, _insert, currentSheet, key = options.key;
if ("css" === key) { if ("css" === key) {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
Array.prototype.forEach.call(ssrStyles, function(node) { Array.prototype.forEach.call(ssrStyles, function(node) {
@ -513,7 +502,7 @@
for(var attrib = node.getAttribute("data-emotion").split(" "), i = 1; i < attrib.length; i++)inserted[attrib[i]] = !0; for(var attrib = node.getAttribute("data-emotion").split(" "), i = 1; i < attrib.length; i++)inserted[attrib[i]] = !0;
nodesToHydrate.push(node); nodesToHydrate.push(node);
}); });
var serializer = (length = Utility_sizeof(collection = [ var serializer = (length = (collection = [
compat, compat,
removeLabel removeLabel
].concat(stylisPlugins, [ ].concat(stylisPlugins, [
@ -523,12 +512,12 @@
}, function(element) { }, function(element) {
!element.root && (element = element.return) && callback(element); !element.root && (element = element.return) && callback(element);
}) })
])), function(element, index, children, callback) { ])).length, function(element, index, children, callback) {
for(var output = "", i = 0; i < length; i++)output += collection[i](element, index, children, callback) || ""; for(var output = "", i = 0; i < length; i++)output += collection[i](element, index, children, callback) || "";
return output; return output;
}), stylis = function(styles) { }), stylis = function(styles) {
var value; var value, value1;
return serialize(dealloc(function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { return serialize((value1 = function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
for(var value1, index = 0, offset = 0, length = pseudo, atrule = 0, property = 0, previous = 0, variable = 1, scanning = 1, ampersand = 1, character1 = 0, type = "", props = rules, children = rulesets, reference = rule, characters1 = type; scanning;)switch(previous = character1, character1 = next()){ for(var value1, index = 0, offset = 0, length = pseudo, atrule = 0, property = 0, previous = 0, variable = 1, scanning = 1, ampersand = 1, character1 = 0, type = "", props = rules, children = rulesets, reference = rule, characters1 = type; scanning;)switch(previous = character1, character1 = next()){
case 34: case 34:
case 39: case 39:
@ -548,8 +537,8 @@
break; break;
case 92: case 92:
characters1 += function(index, count) { characters1 += function(index, count) {
for(; --count && next() && !(character < 48) && !(character > 102) && (!(character > 57) || !(character < 65)) && (!(character > 70) || !(character < 97));); for(var end; --count && next() && !(character < 48) && !(character > 102) && (!(character > 57) || !(character < 65)) && (!(character > 70) || !(character < 97)););
return slice(index, position + (count < 6 && 32 == peek() && 32 == next())); return end = position + (count < 6 && 32 == peek() && 32 == next()), Utility_substr(characters, index, end);
}(position - 1, 7); }(position - 1, 7);
continue; continue;
case 47: case 47:
@ -559,7 +548,7 @@
Utility_append(node(value1 = function(type, index) { Utility_append(node(value1 = function(type, index) {
for(; next();)if (type + character === 57) break; for(; next();)if (type + character === 57) break;
else if (type + character === 84 && 47 === peek()) break; else if (type + character === 84 && 47 === peek()) break;
return "/*" + slice(index, position - 1) + "*" + Utility_from(47 === type ? type : next()); return "/*" + Utility_substr(characters, index, position - 1) + "*" + Utility_from(47 === type ? type : next());
}(next(), position), root, parent, COMMENT, Utility_from(character), Utility_substr(value1, 2, -2), 0), declarations); }(next(), position), root, parent, COMMENT, Utility_from(character), Utility_substr(value1, 2, -2), 0), declarations);
break; break;
default: default:
@ -615,7 +604,7 @@
case 64: case 64:
45 === peek() && (characters1 += delimit(next())), atrule = peek(), offset = Utility_strlen(type = characters1 += function(index) { 45 === peek() && (characters1 += delimit(next())), atrule = peek(), offset = Utility_strlen(type = characters1 += function(index) {
for(; !token(peek());)next(); for(; !token(peek());)next();
return slice(index, position); return Utility_substr(characters, index, position);
}(position)), character1++; }(position)), character1++;
break; break;
case 45: case 45:
@ -627,7 +616,7 @@
"" ""
], value = alloc(value = styles), 0, [ ], value = alloc(value = styles), 0, [
0 0
], value)), serializer); ], value), characters = "", value1), serializer);
}; };
_insert = function(selector, serialized, sheet, shouldCache) { _insert = function(selector, serialized, sheet, shouldCache) {
currentSheet = sheet, stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles), shouldCache && (cache.inserted[serialized.name] = !0); currentSheet = sheet, stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles), shouldCache && (cache.inserted[serialized.name] = !0);

View File

@ -997,9 +997,6 @@
this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, this.limit = i, this.limitType = r, this.startAt = o, this.endAt = c, this.V = null, this.S = null, this.startAt, this.endAt; this.path = t, this.collectionGroup = e, this.explicitOrderBy = n, this.filters = s, this.limit = i, this.limitType = r, this.startAt = o, this.endAt = c, this.V = null, this.S = null, this.startAt, this.endAt;
} }
} }
function we(t) {
return new fe(t);
}
function _e(t) { function _e(t) {
return !At(t.limit) && "F" === t.limitType; return !At(t.limit) && "F" === t.limitType;
} }
@ -1916,7 +1913,7 @@
} }
function Es(t) { function Es(t) {
let e = ""; let e = "";
for(let n = 0; n < t.length; n++)e.length > 0 && (e = As(e)), e = function(t, e) { for(let n = 0; n < t.length; n++)e.length > 0 && (e += ""), e = function(t, e) {
let n = e; let n = e;
const s = t.length; const s = t.length;
for(let e1 = 0; e1 < s; e1++){ for(let e1 = 0; e1 < s; e1++){
@ -1934,10 +1931,7 @@
} }
return n; return n;
}(t.get(n), e); }(t.get(n), e);
return As(e); return e + "";
}
function As(t) {
return t + "";
} }
class Ps { class Ps {
constructor(t, e, n){ constructor(t, e, n){
@ -3260,9 +3254,6 @@
function Jr() { function Jr() {
return "undefined" != typeof document ? document : null; return "undefined" != typeof document ? document : null;
} }
function Yr(t) {
return new Bn(t, !0);
}
class Xr { class Xr {
constructor(t, e, n = 1e3, s = 1.5, i = 6e4){ constructor(t, e, n = 1e3, s = 1.5, i = 6e4){
this.Oe = t, this.timerId = e, this.Qi = n, this.Wi = s, this.Gi = i, this.zi = 0, this.Hi = null, this.Ji = Date.now(), this.reset(); this.Oe = t, this.timerId = e, this.Qi = n, this.Wi = s, this.Gi = i, this.zi = 0, this.Hi = null, this.Ji = Date.now(), this.reset();
@ -3624,16 +3615,13 @@
function wo(t) { function wo(t) {
return 0 === t.Wr.size; return 0 === t.Wr.size;
} }
function _o(t) {
t.Jr = void 0;
}
async function mo(t) { async function mo(t) {
t.Qr.forEach((e, n)=>{ t.Qr.forEach((e, n)=>{
uo(t, e); uo(t, e);
}); });
} }
async function go(t, e) { async function go(t, e) {
_o(t), fo(t) ? (t.Hr.qr(e), lo(t)) : t.Hr.set("Unknown"); t.Jr = void 0, fo(t) ? (t.Hr.qr(e), lo(t)) : t.Hr.set("Unknown");
} }
async function yo(t, e, n) { async function yo(t, e, n) {
if (t.Hr.set("Online"), e instanceof xn && 2 === e.state && e.cause) try { if (t.Hr.set("Online"), e instanceof xn && 2 === e.state && e.cause) try {
@ -3681,7 +3669,7 @@
Ci: go.bind(null, t), Ci: go.bind(null, t),
Rr: yo.bind(null, t) Rr: yo.bind(null, t)
}, t1.$r(), new to(e, t1.sr, t1.credentials, t1.N, n)), t.Gr.push(async (e)=>{ }, t1.$r(), new to(e, t1.sr, t1.credentials, t1.N, n)), t.Gr.push(async (e)=>{
e ? (t.Yr.dr(), fo(t) ? lo(t) : t.Hr.set("Unknown")) : (await t.Yr.stop(), _o(t)); e ? (t.Yr.dr(), fo(t) ? lo(t) : t.Hr.set("Unknown")) : (await t.Yr.stop(), t.Jr = void 0);
})), t.Yr; })), t.Yr;
} }
class xo { class xo {
@ -4188,10 +4176,11 @@
} }
function yc(t) { function yc(t) {
for(; t.Mo.size > 0 && t.Lo.size < t.maxConcurrentLimboResolutions;){ for(; t.Mo.size > 0 && t.Lo.size < t.maxConcurrentLimboResolutions;){
var t1;
const e = t.Mo.values().next().value; const e = t.Mo.values().next().value;
t.Mo.delete(e); t.Mo.delete(e);
const n = new Pt(ht.fromString(e)), s = t.jo.next(); const n = new Pt(ht.fromString(e)), s = t.jo.next();
t.Bo.set(s, new tc(n)), t.Lo = t.Lo.insert(n, s), co(t.remoteStore, new ii(Ee(we(n.path)), s, 2, X.T)); t.Bo.set(s, new tc(n)), t.Lo = t.Lo.insert(n, s), co(t.remoteStore, new ii(Ee((t1 = n.path, new fe(t1))), s, 2, X.T));
} }
} }
async function pc(t, e, n) { async function pc(t, e, n) {
@ -4252,7 +4241,8 @@
this.synchronizeTabs = !1; this.synchronizeTabs = !1;
} }
async initialize(t) { async initialize(t) {
this.N = Yr(t.databaseInfo.databaseId), this.sharedClientState = this.Ho(t), this.persistence = this.Jo(t), await this.persistence.start(), this.gcScheduler = this.Yo(t), this.localStore = this.Xo(t); var t1;
this.N = (t1 = t.databaseInfo.databaseId, new Bn(t1, !0)), this.sharedClientState = this.Ho(t), this.persistence = this.Jo(t), await this.persistence.start(), this.gcScheduler = this.Yo(t), this.localStore = this.Xo(t);
} }
Yo(t) { Yo(t) {
return null; return null;
@ -4279,9 +4269,9 @@
return new Lo(); return new Lo();
} }
createDatastore(t) { createDatastore(t) {
var s, t1; var s, t1, t2;
const e = Yr(t.databaseInfo.databaseId), n = (s = t.databaseInfo, new zr(s)); const e = (t1 = t.databaseInfo.databaseId, new Bn(t1, !0)), n = (s = t.databaseInfo, new zr(s));
return t1 = t.credentials, new no(t1, n, e); return t2 = t.credentials, new no(t2, n, e);
} }
createRemoteStore(t) { createRemoteStore(t) {
var e, n, s, i, r; var e, n, s, i, r;
@ -4534,7 +4524,7 @@
} }
class Ra extends Aa { class Ra extends Aa {
constructor(t, e, n){ constructor(t, e, n){
super(t, e, we(n)), this._path = n, this.type = "collection"; super(t, e, new fe(n)), this._path = n, this.type = "collection";
} }
get id() { get id() {
return this._query.path.lastSegment(); return this._query.path.lastSegment();

View File

@ -981,9 +981,6 @@
function localeData() { function localeData() {
return this._locale; return this._locale;
} }
function mod$1(dividend, divisor) {
return (dividend % divisor + divisor) % divisor;
}
function localStartOfDate(y, m, d) { function localStartOfDate(y, m, d) {
return y < 100 && y >= 0 ? new Date(y + 400, m, d) - 12622780800000 : new Date(y, m, d).valueOf(); return y < 100 && y >= 0 ? new Date(y + 400, m, d) - 12622780800000 : new Date(y, m, d).valueOf();
} }
@ -1268,13 +1265,13 @@
time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
break; break;
case "hour": case "hour":
time = this._d.valueOf(), time += 3600000 - mod$1(time + (this._isUTC ? 0 : 60000 * this.utcOffset()), 3600000) - 1; time = this._d.valueOf(), time += 3600000 - ((time + (this._isUTC ? 0 : 60000 * this.utcOffset())) % 3600000 + 3600000) % 3600000 - 1;
break; break;
case "minute": case "minute":
time = this._d.valueOf(), time += 60000 - mod$1(time, 60000) - 1; time = this._d.valueOf(), time += 60000 - (time % 60000 + 60000) % 60000 - 1;
break; break;
case "second": case "second":
time = this._d.valueOf(), time += 1000 - mod$1(time, 1000) - 1; time = this._d.valueOf(), time += 1000 - (time % 1000 + 1000) % 1000 - 1;
} }
return this._d.setTime(time), hooks.updateOffset(this, !0), this; return this._d.setTime(time), hooks.updateOffset(this, !0), this;
}, proto.format = function(inputString) { }, proto.format = function(inputString) {
@ -1358,13 +1355,13 @@
time = startOfDate(this.year(), this.month(), this.date()); time = startOfDate(this.year(), this.month(), this.date());
break; break;
case "hour": case "hour":
time = this._d.valueOf(), time -= mod$1(time + (this._isUTC ? 0 : 60000 * this.utcOffset()), 3600000); time = this._d.valueOf(), time -= ((time + (this._isUTC ? 0 : 60000 * this.utcOffset())) % 3600000 + 3600000) % 3600000;
break; break;
case "minute": case "minute":
time = this._d.valueOf(), time -= mod$1(time, 60000); time = this._d.valueOf(), time -= (time % 60000 + 60000) % 60000;
break; break;
case "second": case "second":
time = this._d.valueOf(), time -= mod$1(time, 1000); time = this._d.valueOf(), time -= (time % 1000 + 1000) % 1000;
} }
return this._d.setTime(time), hooks.updateOffset(this, !0), this; return this._d.setTime(time), hooks.updateOffset(this, !0), this;
}, proto.subtract = subtract, proto.toArray = function() { }, proto.subtract = subtract, proto.toArray = function() {

View File

@ -405,16 +405,13 @@
}, setTextContent = function(el, content) { }, setTextContent = function(el, content) {
el.styleSheet ? el.styleSheet.cssText = content : el.textContent = content; el.styleSheet ? el.styleSheet.cssText = content : el.textContent = content;
}, _guid = 3; }, _guid = 3;
function newGUID() {
return _guid++;
}
global_window__WEBPACK_IMPORTED_MODULE_0___default().WeakMap || (FakeWeakMap = function() { global_window__WEBPACK_IMPORTED_MODULE_0___default().WeakMap || (FakeWeakMap = function() {
function FakeWeakMap() { function FakeWeakMap() {
this.vdata = "vdata" + Math.floor(global_window__WEBPACK_IMPORTED_MODULE_0___default().performance && global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now() || Date.now()), this.data = {}; this.vdata = "vdata" + Math.floor(global_window__WEBPACK_IMPORTED_MODULE_0___default().performance && global_window__WEBPACK_IMPORTED_MODULE_0___default().performance.now() || Date.now()), this.data = {};
} }
var _proto = FakeWeakMap.prototype; var _proto = FakeWeakMap.prototype;
return _proto.set = function(key, value) { return _proto.set = function(key, value) {
var access = key[this.vdata] || newGUID(); var access = key[this.vdata] || _guid++;
return key[this.vdata] || (key[this.vdata] = access), this.data[access] = value, this; return key[this.vdata] || (key[this.vdata] = access), this.data[access] = value, this;
}, _proto.get = function(key) { }, _proto.get = function(key) {
var access = key[this.vdata]; var access = key[this.vdata];
@ -485,7 +482,7 @@
if (Array.isArray(type)) return _handleMultipleEvents(on, elem, type, fn); if (Array.isArray(type)) return _handleMultipleEvents(on, elem, type, fn);
DomData.has(elem) || DomData.set(elem, {}); DomData.has(elem) || DomData.set(elem, {});
var data = DomData.get(elem); var data = DomData.get(elem);
if (data.handlers || (data.handlers = {}), data.handlers[type] || (data.handlers[type] = []), fn.guid || (fn.guid = newGUID()), data.handlers[type].push(fn), data.dispatcher || (data.disabled = !1, data.dispatcher = function(event, hash) { if (data.handlers || (data.handlers = {}), data.handlers[type] || (data.handlers[type] = []), fn.guid || (fn.guid = _guid++), data.handlers[type].push(fn), data.dispatcher || (data.disabled = !1, data.dispatcher = function(event, hash) {
if (!data.disabled) { if (!data.disabled) {
event = fixEvent(event); event = fixEvent(event);
var handlers = data.handlers[event.type]; var handlers = data.handlers[event.type];
@ -546,13 +543,13 @@
var func = function func() { var func = function func() {
off(elem, type, func), fn.apply(this, arguments); off(elem, type, func), fn.apply(this, arguments);
}; };
func.guid = fn.guid = fn.guid || newGUID(), on(elem, type, func); func.guid = fn.guid = fn.guid || _guid++, on(elem, type, func);
} }
function any(elem, type, fn) { function any(elem, type, fn) {
var func = function func() { var func = function func() {
off(elem, type, func), fn.apply(this, arguments); off(elem, type, func), fn.apply(this, arguments);
}; };
func.guid = fn.guid = fn.guid || newGUID(), on(elem, type, func); func.guid = fn.guid = fn.guid || _guid++, on(elem, type, func);
} }
var Events = Object.freeze({ var Events = Object.freeze({
__proto__: null, __proto__: null,
@ -563,7 +560,7 @@
one: one, one: one,
any: any any: any
}), bind = function(context, fn, uid) { }), bind = function(context, fn, uid) {
fn.guid || (fn.guid = newGUID()); fn.guid || (fn.guid = _guid++);
var bound = fn.bind(context); var bound = fn.bind(context);
return bound.guid = uid ? uid + "_" + fn.guid : fn.guid, bound; return bound.guid = uid ? uid + "_" + fn.guid : fn.guid, bound;
}, throttle = function(fn, wait) { }, throttle = function(fn, wait) {
@ -792,7 +789,7 @@
function Component(player, options, ready) { function Component(player, options, ready) {
if (!player && this.play ? this.player_ = player = this : this.player_ = player, this.isDisposed_ = !1, this.parentComponent_ = null, this.options_ = mergeOptions$3({}, this.options_), options = this.options_ = mergeOptions$3(this.options_, options), this.id_ = options.id || options.el && options.el.id, !this.id_) { if (!player && this.play ? this.player_ = player = this : this.player_ = player, this.isDisposed_ = !1, this.parentComponent_ = null, this.options_ = mergeOptions$3({}, this.options_), options = this.options_ = mergeOptions$3(this.options_, options), this.id_ = options.id || options.el && options.el.id, !this.id_) {
var id = player && player.id && player.id() || "no_player"; var id = player && player.id && player.id() || "no_player";
this.id_ = id + "_component_" + newGUID(); this.id_ = id + "_component_" + _guid++;
} }
this.name_ = options.name || null, options.el ? this.el_ = options.el : !1 !== options.createEl && (this.el_ = this.createEl()), !1 !== options.evented && (evented(this, { this.name_ = options.name || null, options.el ? this.el_ = options.el : !1 !== options.createEl && (this.el_ = this.createEl()), !1 !== options.evented && (evented(this, {
eventBusKey: this.el_ ? "el_" : null eventBusKey: this.el_ ? "el_" : null
@ -1502,7 +1499,7 @@
function Track(options) { function Track(options) {
void 0 === options && (options = {}), _this = _EventTarget.call(this) || this; void 0 === options && (options = {}), _this = _EventTarget.call(this) || this;
var _this, trackProps = { var _this, trackProps = {
id: options.id || "vjs_track_" + newGUID(), id: options.id || "vjs_track_" + _guid++,
kind: options.kind || "", kind: options.kind || "",
language: options.language || "" language: options.language || ""
}, label = options.label || "", _loop = function(key) { }, label = options.label || "", _loop = function(key) {
@ -5157,7 +5154,7 @@
huge: 1 / 0 huge: 1 / 0
}, Player = function(_Component) { }, Player = function(_Component) {
function Player(tag, options, ready) { function Player(tag, options, ready) {
if (tag.id = tag.id || options.id || "vjs_video_" + newGUID(), (options = assign(Player.getTagSettings(tag), options)).initChildren = !1, options.createEl = !1, options.evented = !1, options.reportTouchActivity = !1, !options.language) { if (tag.id = tag.id || options.id || "vjs_video_" + _guid++, (options = assign(Player.getTagSettings(tag), options)).initChildren = !1, options.createEl = !1, options.evented = !1, options.reportTouchActivity = !1, !options.language) {
if ("function" == typeof tag.closest) { if ("function" == typeof tag.closest) {
var _this, closest = tag.closest("[lang]"); var _this, closest = tag.closest("[lang]");
closest && closest.getAttribute && (options.language = closest.getAttribute("lang")); closest && closest.getAttribute && (options.language = closest.getAttribute("lang"));

View File

@ -5443,7 +5443,7 @@
else if (void 0 === length && "string" == typeof offset) encoding = offset, length = this.length, offset = 0; else if (void 0 === length && "string" == typeof offset) encoding = offset, length = this.length, offset = 0;
else if (isFinite(offset)) offset >>>= 0, isFinite(length) ? (length >>>= 0, void 0 === encoding && (encoding = "utf8")) : (encoding = length, length = void 0); else if (isFinite(offset)) offset >>>= 0, isFinite(length) ? (length >>>= 0, void 0 === encoding && (encoding = "utf8")) : (encoding = length, length = void 0);
else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
var offset1, length1, offset2, length2, offset3, length3, offset4, length4, remaining = this.length - offset; var offset1, length1, offset2, length2, offset3, length3, offset4, length4, offset5, length5, remaining = this.length - offset;
if ((void 0 === length || length > remaining) && (length = remaining), string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw RangeError("Attempt to write outside buffer bounds"); if ((void 0 === length || length > remaining) && (length = remaining), string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw RangeError("Attempt to write outside buffer bounds");
encoding || (encoding = "utf8"); encoding || (encoding = "utf8");
for(var loweredCase = !1;;)switch(encoding){ for(var loweredCase = !1;;)switch(encoding){
@ -5465,22 +5465,20 @@
case "utf-8": case "utf-8":
return offset2 = offset, length2 = length, blitBuffer(utf8ToBytes(string, this.length - offset2), this, offset2, length2); return offset2 = offset, length2 = length, blitBuffer(utf8ToBytes(string, this.length - offset2), this, offset2, length2);
case "ascii": case "ascii":
return offset3 = offset, length3 = length, blitBuffer(asciiToBytes(string), this, offset3, length3);
case "latin1": case "latin1":
case "binary": case "binary":
return offset1 = offset, length1 = length, blitBuffer(function(str) { return offset1 = offset, length1 = length, blitBuffer(asciiToBytes(string), this, offset1, length1);
for(var byteArray = [], i = 0; i < str.length; ++i)byteArray.push(0xff & str.charCodeAt(i));
return byteArray;
}(string), this, offset1, length1);
case "base64": case "base64":
return offset3 = offset, length3 = length, blitBuffer(base64ToBytes(string), this, offset3, length3); return offset4 = offset, length4 = length, blitBuffer(base64ToBytes(string), this, offset4, length4);
case "ucs2": case "ucs2":
case "ucs-2": case "ucs-2":
case "utf16le": case "utf16le":
case "utf-16le": case "utf-16le":
return offset4 = offset, length4 = length, blitBuffer(function(str, units) { return offset5 = offset, length5 = length, blitBuffer(function(str, units) {
for(var c, hi, byteArray = [], i = 0; i < str.length && !((units -= 2) < 0); ++i)hi = (c = str.charCodeAt(i)) >> 8, byteArray.push(c % 256), byteArray.push(hi); for(var c, hi, byteArray = [], i = 0; i < str.length && !((units -= 2) < 0); ++i)hi = (c = str.charCodeAt(i)) >> 8, byteArray.push(c % 256), byteArray.push(hi);
return byteArray; return byteArray;
}(string, this.length - offset4), this, offset4, length4); }(string, this.length - offset5), this, offset5, length5);
default: default:
if (loweredCase) throw TypeError("Unknown encoding: " + encoding); if (loweredCase) throw TypeError("Unknown encoding: " + encoding);
encoding = ("" + encoding).toLowerCase(), loweredCase = !0; encoding = ("" + encoding).toLowerCase(), loweredCase = !0;
@ -5669,6 +5667,10 @@
} }
return bytes; return bytes;
} }
function asciiToBytes(str) {
for(var byteArray = [], i = 0; i < str.length; ++i)byteArray.push(0xff & str.charCodeAt(i));
return byteArray;
}
function base64ToBytes(str) { function base64ToBytes(str) {
return base64.toByteArray(function(str) { return base64.toByteArray(function(str) {
if ((str = (str = str.split("=")[0]).trim().replace(INVALID_BASE64_RE, "")).length < 2) return ""; if ((str = (str = str.split("=")[0]).trim().replace(INVALID_BASE64_RE, "")).length < 2) return "";

View File

@ -22,17 +22,17 @@ export class Text {
eq(t) { eq(t) {
if (t == this) return !0; if (t == this) return !0;
if (t.length != this.length || t.lines != this.lines) return !1; if (t.length != this.length || t.lines != this.lines) return !1;
let e = this.scanIdentical(t, 1), n = this.length - this.scanIdentical(t, -1), i = new s(this), h = new s(t); let e = this.scanIdentical(t, 1), n = this.length - this.scanIdentical(t, -1), s = new i(this), h = new i(t);
for(let l = e, r = e;;){ for(let l = e, r = e;;){
if (i.next(l), h.next(l), l = 0, i.lineBreak != h.lineBreak || i.done != h.done || i.value != h.value) return !1; if (s.next(l), h.next(l), l = 0, s.lineBreak != h.lineBreak || s.done != h.done || s.value != h.value) return !1;
if (r += i.value.length, i.done || r >= n) return !0; if (r += s.value.length, s.done || r >= n) return !0;
} }
} }
iter(t = 1) { iter(t = 1) {
return new s(this, t); return new i(this, t);
} }
iterRange(t, e = this.length) { iterRange(t, e = this.length) {
return new h(this, t, e); return new s(this, t, e);
} }
iterLines(t, e) { iterLines(t, e) {
let n; let n;
@ -42,7 +42,7 @@ export class Text {
let i = this.line(t).from; let i = this.line(t).from;
n = this.iterRange(i, Math.max(i, e == this.lines + 1 ? this.length : e <= 1 ? 0 : this.line(e - 1).to)); n = this.iterRange(i, Math.max(i, e == this.lines + 1 ? this.length : e <= 1 ? 0 : this.line(e - 1).to));
} }
return new l(n); return new h(n);
} }
toString() { toString() {
return this.sliceString(0); return this.sliceString(0);
@ -77,21 +77,25 @@ class t extends Text {
i = l + 1, n++; i = l + 1, n++;
} }
} }
decompose(e, s, h, l) { decompose(e, i, s, h) {
let r = e <= 0 && s >= this.length ? this : new t(i(this.text, e, s), Math.min(s, this.length) - Math.max(0, e)); let l = e <= 0 && i >= this.length ? this : new t(n(this.text, [
if (1 & l) { ""
let o = h.pop(), f = n(r.text, o.text.slice(), 0, r.length); ], e, i), Math.min(i, this.length) - Math.max(0, e));
if (f.length <= 32) h.push(new t(f, o.length + r.length)); if (1 & h) {
let r = s.pop(), o = n(l.text, r.text.slice(), 0, l.length);
if (o.length <= 32) s.push(new t(o, r.length + l.length));
else { else {
let u = f.length >> 1; let f = o.length >> 1;
h.push(new t(f.slice(0, u)), new t(f.slice(u))); s.push(new t(o.slice(0, f)), new t(o.slice(f)));
} }
} else h.push(r); } else s.push(l);
} }
replace(s, h, l) { replace(i, s, h) {
if (!(l instanceof t)) return super.replace(s, h, l); if (!(h instanceof t)) return super.replace(i, s, h);
let r = n(this.text, n(l.text, i(this.text, 0, s)), h), o = this.length + l.length - (h - s); let l = n(this.text, n(h.text, n(this.text, [
return r.length <= 32 ? new t(r, o) : e.from(t.split(r, []), o); ""
], 0, i)), s), r = this.length + h.length - (s - i);
return l.length <= 32 ? new t(l, r) : e.from(t.split(l, []), r);
} }
sliceString(t, e = this.length, n = "\n") { sliceString(t, e = this.length, n = "\n") {
let i = ""; let i = "";
@ -140,8 +144,8 @@ class e extends Text {
if (t >= h && n <= r) { if (t >= h && n <= r) {
let o = l.replace(t - h, n - h, i), f = this.lines - l.lines + o.lines; let o = l.replace(t - h, n - h, i), f = this.lines - l.lines + o.lines;
if (o.lines < f >> 4 && o.lines > f >> 6) { if (o.lines < f >> 4 && o.lines > f >> 6) {
let u = this.children.slice(); let c = this.children.slice();
return u[s] = o, new e(u, this.length - (n - t) + i.length); return c[s] = o, new e(c, this.length - (n - t) + i.length);
} }
return super.replace(h, r, o); return super.replace(h, r, o);
} }
@ -188,16 +192,16 @@ class e extends Text {
for (let r of n)r.flatten(l); for (let r of n)r.flatten(l);
return new t(l, i); return new t(l, i);
} }
let o = Math.max(32, s >> 5), f = o << 1, u = o >> 1, c = [], a = 0, g = -1, p = []; let o = Math.max(32, s >> 5), f = o << 1, c = o >> 1, u = [], a = 0, g = -1, p = [];
function d() { function d() {
0 != a && (c.push(1 == p.length ? p[0] : e.from(p, g)), g = -1, a = p.length = 0); 0 != a && (u.push(1 == p.length ? p[0] : e.from(p, g)), g = -1, a = p.length = 0);
} }
for (let x of n)!function n(i) { for (let x of n)!function n(i) {
let s; let s;
if (i.lines > f && i instanceof e) for (let h of i.children)n(h); if (i.lines > f && i instanceof e) for (let h of i.children)n(h);
else i.lines > u && (a > u || !a) ? (d(), c.push(i)) : i instanceof t && a && (s = p[p.length - 1]) instanceof t && i.lines + s.lines <= 32 ? (a += i.lines, g += i.length + 1, p[p.length - 1] = new t(s.text.concat(i.text), s.length + 1 + i.length)) : (a + i.lines > o && d(), a += i.lines, g += i.length + 1, p.push(i)); else i.lines > c && (a > c || !a) ? (d(), u.push(i)) : i instanceof t && a && (s = p[p.length - 1]) instanceof t && i.lines + s.lines <= 32 ? (a += i.lines, g += i.length + 1, p[p.length - 1] = new t(s.text.concat(i.text), s.length + 1 + i.length)) : (a + i.lines > o && d(), a += i.lines, g += i.length + 1, p.push(i));
}(x); }(x);
return d(), 1 == c.length ? c[0] : new e(c, i); return d(), 1 == u.length ? u[0] : new e(u, i);
} }
} }
function n(t, e, n = 0, i = 1e9) { function n(t, e, n = 0, i = 1e9) {
@ -207,15 +211,10 @@ function n(t, e, n = 0, i = 1e9) {
} }
return e; return e;
} }
function i(t, e, i) {
return n(t, [
""
], e, i);
}
Text.empty = new t([ Text.empty = new t([
"" ""
], 0); ], 0);
class s { class i {
constructor(e, n = 1){ constructor(e, n = 1){
this.dir = n, this.done = !1, this.lineBreak = !1, this.value = "", this.nodes = [ this.dir = n, this.done = !1, this.lineBreak = !1, this.value = "", this.nodes = [
e e
@ -246,9 +245,9 @@ class s {
return t < 0 && (this.nextInner(-t, -this.dir), t = this.value.length), this.nextInner(t, this.dir); return t < 0 && (this.nextInner(-t, -this.dir), t = this.value.length), this.nextInner(t, this.dir);
} }
} }
class h { class s {
constructor(t, e, n){ constructor(t, e, n){
this.value = "", this.done = !1, this.cursor = new s(t, e > n ? -1 : 1), this.pos = e > n ? t.length : 0, this.from = Math.min(e, n), this.to = Math.max(e, n); this.value = "", this.done = !1, this.cursor = new i(t, e > n ? -1 : 1), this.pos = e > n ? t.length : 0, this.from = Math.min(e, n), this.to = Math.max(e, n);
} }
nextInner(t, e) { nextInner(t, e) {
if (e < 0 ? this.pos <= this.from : this.pos >= this.to) return this.value = "", this.done = !0, this; if (e < 0 ? this.pos <= this.from : this.pos >= this.to) return this.value = "", this.done = !0, this;
@ -265,7 +264,7 @@ class h {
return this.cursor.lineBreak && "" != this.value; return this.cursor.lineBreak && "" != this.value;
} }
} }
class l { class h {
constructor(t){ constructor(t){
this.inner = t, this.afterBreak = !0, this.value = "", this.done = !1; this.inner = t, this.afterBreak = !0, this.value = "", this.done = !1;
} }
@ -279,7 +278,7 @@ class l {
} }
"undefined" != typeof Symbol && (Text.prototype[Symbol.iterator] = function() { "undefined" != typeof Symbol && (Text.prototype[Symbol.iterator] = function() {
return this.iter(); return this.iter();
}, s.prototype[Symbol.iterator] = h.prototype[Symbol.iterator] = l.prototype[Symbol.iterator] = function() { }, i.prototype[Symbol.iterator] = s.prototype[Symbol.iterator] = h.prototype[Symbol.iterator] = function() {
return this; return this;
}); });
export class Line { export class Line {

View File

@ -371,9 +371,6 @@
]; ];
return allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) ? hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) : hex.join(""); return allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) ? hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) : hex.join("");
} }
function convertHexToDecimal(h) {
return parseIntFromHex(h) / 255;
}
function parseIntFromHex(val) { function parseIntFromHex(val) {
return parseInt(val, 16); return parseInt(val, 16);
} }
@ -597,7 +594,7 @@
r: parseIntFromHex(match[1]), r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]), g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]), b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]), a: parseIntFromHex(match[4]) / 255,
format: named ? "name" : "hex8" format: named ? "name" : "hex8"
} : (match = matchers.hex6.exec(color)) ? { } : (match = matchers.hex6.exec(color)) ? {
r: parseIntFromHex(match[1]), r: parseIntFromHex(match[1]),
@ -608,7 +605,7 @@
r: parseIntFromHex(match[1] + match[1]), r: parseIntFromHex(match[1] + match[1]),
g: parseIntFromHex(match[2] + match[2]), g: parseIntFromHex(match[2] + match[2]),
b: parseIntFromHex(match[3] + match[3]), b: parseIntFromHex(match[3] + match[3]),
a: convertHexToDecimal(match[4] + match[4]), a: parseIntFromHex(match[4] + match[4]) / 255,
format: named ? "name" : "hex8" format: named ? "name" : "hex8"
} : !!(match = matchers.hex3.exec(color)) && { } : !!(match = matchers.hex3.exec(color)) && {
r: parseIntFromHex(match[1] + match[1]), r: parseIntFromHex(match[1] + match[1]),

View File

@ -776,12 +776,6 @@
if (sps) for(var sp = void 0, i = 0; i < sps.length; ++i)(sp = sps[i]).marker.collapsed && (start ? sp.from : sp.to) == null && (!found || 0 > compareCollapsedMarkers(found, sp.marker)) && (found = sp.marker); if (sps) for(var sp = void 0, i = 0; i < sps.length; ++i)(sp = sps[i]).marker.collapsed && (start ? sp.from : sp.to) == null && (!found || 0 > compareCollapsedMarkers(found, sp.marker)) && (found = sp.marker);
return found; return found;
} }
function collapsedSpanAtStart(line) {
return collapsedSpanAtSide(line, !0);
}
function collapsedSpanAtEnd(line) {
return collapsedSpanAtSide(line, !1);
}
function conflictingCollapsedRange(doc, lineNo, from, to, marker) { function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
var line = getLine(doc, lineNo), sps = sawCollapsedSpans && line.markedSpans; var line = getLine(doc, lineNo), sps = sawCollapsedSpans && line.markedSpans;
if (sps) for(var i = 0; i < sps.length; ++i){ if (sps) for(var i = 0; i < sps.length; ++i){
@ -793,7 +787,7 @@
} }
} }
function visualLine(line) { function visualLine(line) {
for(var merged; merged = collapsedSpanAtStart(line);)line = merged.find(-1, !0).line; for(var merged; merged = collapsedSpanAtSide(line, !0);)line = merged.find(-1, !0).line;
return line; return line;
} }
function visualLineNo(doc, lineN) { function visualLineNo(doc, lineN) {
@ -804,7 +798,7 @@
if (lineN > doc.lastLine()) return lineN; if (lineN > doc.lastLine()) return lineN;
var merged, line = getLine(doc, lineN); var merged, line = getLine(doc, lineN);
if (!lineIsHidden(doc, line)) return lineN; if (!lineIsHidden(doc, line)) return lineN;
for(; merged = collapsedSpanAtEnd(line);)line = merged.find(1, !0).line; for(; merged = collapsedSpanAtSide(line, !1);)line = merged.find(1, !0).line;
return lineNo(line) + 1; return lineNo(line) + 1;
} }
function lineIsHidden(doc, line) { function lineIsHidden(doc, line) {
@ -836,11 +830,11 @@
} }
function lineLength(line) { function lineLength(line) {
if (0 == line.height) return 0; if (0 == line.height) return 0;
for(var merged, len = line.text.length, cur = line; merged = collapsedSpanAtStart(cur);){ for(var merged, len = line.text.length, cur = line; merged = collapsedSpanAtSide(cur, !0);){
var found = merged.find(0, !0); var found = merged.find(0, !0);
cur = found.from.line, len += found.from.ch - found.to.ch; cur = found.from.line, len += found.from.ch - found.to.ch;
} }
for(cur = line; merged = collapsedSpanAtEnd(cur);){ for(cur = line; merged = collapsedSpanAtSide(cur, !1);){
var found$1 = merged.find(0, !0); var found$1 = merged.find(0, !0);
len -= cur.text.length - found$1.from.ch, len += (cur = found$1.to.line).text.length - found$1.to.ch; len -= cur.text.length - found$1.from.ch, len += (cur = found$1.to.line).text.length - found$1.to.ch;
} }
@ -1009,7 +1003,7 @@
} }
function LineView(doc, line, lineN) { function LineView(doc, line, lineN) {
this.line = line, this.rest = function(line) { this.line = line, this.rest = function(line) {
for(var merged, lines; merged = collapsedSpanAtEnd(line);)line = merged.find(1, !0).line, (lines || (lines = [])).push(line); for(var merged, lines; merged = collapsedSpanAtSide(line, !1);)line = merged.find(1, !0).line, (lines || (lines = [])).push(line);
return lines; return lines;
}(line), this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1, this.node = this.text = null, this.hidden = lineIsHidden(doc, line); }(line), this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1, this.node = this.text = null, this.hidden = lineIsHidden(doc, line);
} }
@ -1160,9 +1154,6 @@
}; };
} }
} }
function measureChar(cm, line, ch, bias) {
return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);
}
function findViewForLine(cm, lineN) { function findViewForLine(cm, lineN) {
if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) return cm.display.view[findViewIndex(cm, lineN)]; if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) return cm.display.view[findViewIndex(cm, lineN)];
var ext = cm.display.externalMeasured; var ext = cm.display.externalMeasured;
@ -1324,7 +1315,8 @@
}; };
} }
function charCoords(cm, pos, context, lineObj, bias) { function charCoords(cm, pos, context, lineObj, bias) {
return lineObj || (lineObj = getLine(cm.doc, pos.line)), intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context); var line, ch;
return lineObj || (lineObj = getLine(cm.doc, pos.line)), intoCoordSystem(cm, lineObj, (line = lineObj, ch = pos.ch, measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)), context);
} }
function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
function get(ch, right) { function get(ch, right) {
@ -1934,8 +1926,8 @@
}(ops[i]); }(ops[i]);
for(var i$1 = 0; i$1 < ops.length; i$1++)(op = ops[i$1]).updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); for(var i$1 = 0; i$1 < ops.length; i$1++)(op = ops[i$1]).updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);
for(var i$2 = 0; i$2 < ops.length; i$2++)!function(op) { for(var i$2 = 0; i$2 < ops.length; i$2++)!function(op) {
var cm = op.cm, display = cm.display; var line, ch, cm = op.cm, display = cm.display;
op.updatedDisplay && updateHeightsInViewport(cm), op.barMeasure = measureForScrollbars(cm), display.maxLineChanged && !cm.options.lineWrapping && (op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3, cm.display.sizerWidth = op.adjustWidthTo, op.barMeasure.scrollWidth = Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth), op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))), (op.updatedDisplay || op.selectionChanged) && (op.preparedSelection = display.input.prepareSelection()); op.updatedDisplay && updateHeightsInViewport(cm), op.barMeasure = measureForScrollbars(cm), display.maxLineChanged && !cm.options.lineWrapping && (op.adjustWidthTo = (line = display.maxLine, ch = display.maxLine.text.length, measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, void 0)).left + 3, cm.display.sizerWidth = op.adjustWidthTo, op.barMeasure.scrollWidth = Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth), op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm))), (op.updatedDisplay || op.selectionChanged) && (op.preparedSelection = display.input.prepareSelection());
}(ops[i$2]); }(ops[i$2]);
for(var i$3 = 0; i$3 < ops.length; i$3++)!function(op) { for(var i$3 = 0; i$3 < ops.length; i$3++)!function(op) {
var cm = op.cm; var cm = op.cm;
@ -2490,9 +2482,6 @@
var ranges = doc.sel.ranges.slice(0); var ranges = doc.sel.ranges.slice(0);
ranges[i] = range, setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); ranges[i] = range, setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);
} }
function setSimpleSelection(doc, anchor, head, options) {
setSelection(doc, simpleSelection(anchor, head), options);
}
function setSelectionReplaceHistory(doc, sel, options) { function setSelectionReplaceHistory(doc, sel, options) {
var done = doc.history.done, last = lst(done); var done = doc.history.done, last = lst(done);
last && last.ranges ? (done[done.length - 1] = sel, setSelectionNoUndo(doc, sel, options)) : setSelection(doc, sel, options); last && last.ranges ? (done[done.length - 1] = sel, setSelectionNoUndo(doc, sel, options)) : setSelection(doc, sel, options);
@ -3136,10 +3125,10 @@
return this.sel.somethingSelected(); return this.sel.somethingSelected();
}, },
setCursor: docMethodOp(function(line, ch, options) { setCursor: docMethodOp(function(line, ch, options) {
setSimpleSelection(this, clipPos(this, "number" == typeof line ? Pos(line, ch || 0) : line), null, options); setSelection(this, simpleSelection(clipPos(this, "number" == typeof line ? Pos(line, ch || 0) : line), null), options);
}), }),
setSelection: docMethodOp(function(anchor, head, options) { setSelection: docMethodOp(function(anchor, head, options) {
setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); setSelection(this, simpleSelection(clipPos(this, anchor), clipPos(this, head || anchor)), options);
}), }),
extendSelection: docMethodOp(function(head, other, options) { extendSelection: docMethodOp(function(head, other, options) {
extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
@ -3871,7 +3860,7 @@
return cm.extendSelectionsBy(function(range) { return cm.extendSelectionsBy(function(range) {
var lineN, line, visual; var lineN, line, visual;
return lineN = range.head.line, (visual = function(line) { return lineN = range.head.line, (visual = function(line) {
for(var merged; merged = collapsedSpanAtEnd(line);)line = merged.find(1, !0).line; for(var merged; merged = collapsedSpanAtSide(line, !1);)line = merged.find(1, !0).line;
return line; return line;
}(line = getLine(cm.doc, lineN))) != line && (lineN = lineNo(visual)), endOfLine(!0, cm, line, lineN, -1); }(line = getLine(cm.doc, lineN))) != line && (lineN = lineNo(visual)), endOfLine(!0, cm, line, lineN, -1);
}, { }, {

View File

@ -463,7 +463,7 @@
else if (void 0 === t && "string" == typeof r) f = r, t = this.length, r = 0; else if (void 0 === t && "string" == typeof r) f = r, t = this.length, r = 0;
else if (isFinite(r)) r >>>= 0, isFinite(t) ? (t >>>= 0, void 0 === f && (f = "utf8")) : (f = t, t = void 0); else if (isFinite(r)) r >>>= 0, isFinite(t) ? (t >>>= 0, void 0 === f && (f = "utf8")) : (f = t, t = void 0);
else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
var t1, f1, t2, f2, t3, f3, t4, f4, n = this.length - r; var t1, f1, t2, f2, t3, f3, t4, f4, t5, f5, n = this.length - r;
if ((void 0 === t || t > n) && (t = n), e.length > 0 && (t < 0 || r < 0) || r > this.length) throw RangeError("Attempt to write outside buffer bounds"); if ((void 0 === t || t > n) && (t = n), e.length > 0 && (t < 0 || r < 0) || r > this.length) throw RangeError("Attempt to write outside buffer bounds");
f || (f = "utf8"); f || (f = "utf8");
for(var i = !1;;)switch(f){ for(var i = !1;;)switch(f){
@ -485,22 +485,20 @@
case "utf-8": case "utf-8":
return t2 = r, f2 = t, blitBuffer(utf8ToBytes(e, this.length - t2), this, t2, f2); return t2 = r, f2 = t, blitBuffer(utf8ToBytes(e, this.length - t2), this, t2, f2);
case "ascii": case "ascii":
return t3 = r, f3 = t, blitBuffer(asciiToBytes(e), this, t3, f3);
case "latin1": case "latin1":
case "binary": case "binary":
return t1 = r, f1 = t, blitBuffer(function(e) { return t1 = r, f1 = t, blitBuffer(asciiToBytes(e), this, t1, f1);
for(var r = [], t = 0; t < e.length; ++t)r.push(255 & e.charCodeAt(t));
return r;
}(e), this, t1, f1);
case "base64": case "base64":
return t3 = r, f3 = t, blitBuffer(base64ToBytes(e), this, t3, f3); return t4 = r, f4 = t, blitBuffer(base64ToBytes(e), this, t4, f4);
case "ucs2": case "ucs2":
case "ucs-2": case "ucs-2":
case "utf16le": case "utf16le":
case "utf-16le": case "utf-16le":
return t4 = r, f4 = t, blitBuffer(function(e, r) { return t5 = r, f5 = t, blitBuffer(function(e, r) {
for(var t, f, i = [], o = 0; o < e.length && !((r -= 2) < 0); ++o)f = (t = e.charCodeAt(o)) >> 8, i.push(t % 256), i.push(f); for(var t, f, i = [], o = 0; o < e.length && !((r -= 2) < 0); ++o)f = (t = e.charCodeAt(o)) >> 8, i.push(t % 256), i.push(f);
return i; return i;
}(e, this.length - t4), this, t4, f4); }(e, this.length - t5), this, t5, f5);
default: default:
if (i) throw TypeError("Unknown encoding: " + f); if (i) throw TypeError("Unknown encoding: " + f);
f = ("" + f).toLowerCase(), i = !0; f = ("" + f).toLowerCase(), i = !0;
@ -689,6 +687,10 @@
} }
return i; return i;
} }
function asciiToBytes(e) {
for(var r = [], t = 0; t < e.length; ++t)r.push(255 & e.charCodeAt(t));
return r;
}
function base64ToBytes(e) { function base64ToBytes(e) {
return f.toByteArray(function(e) { return f.toByteArray(function(e) {
if ((e = (e = e.split("=")[0]).trim().replace(a, "")).length < 2) return ""; if ((e = (e = e.split("=")[0]).trim().replace(a, "")).length < 2) return "";

File diff suppressed because it is too large Load Diff

View File

@ -7214,33 +7214,34 @@
} }
function calculatePosition(currentElement, positionX, positionY, parentElement, targetValues) { function calculatePosition(currentElement, positionX, positionY, parentElement, targetValues) {
return (popupRect = void 0, popupRect = targetValues, fixedParent = !!parentElement, currentElement) ? (positionX || (positionX = 'left'), positionY || (positionY = 'top'), parentDocument = currentElement.ownerDocument, element = currentElement, function(posX, posY, pos) { return (popupRect = void 0, popupRect = targetValues, fixedParent = !!parentElement, currentElement) ? (positionX || (positionX = 'left'), positionY || (positionY = 'top'), parentDocument = currentElement.ownerDocument, element = currentElement, function(posX, posY, pos) {
var value, value1, value2, value3, value4, value5, value6, value7, value8;
switch(elementRect = element.getBoundingClientRect(), posY + posX){ switch(elementRect = element.getBoundingClientRect(), posY + posX){
case 'topcenter': case 'topcenter':
setPosx(getElementHCenter(), pos), setPosy(getElementTop(), pos); setPosx(getElementHCenter(), pos), value = getElementTop(), pos.top = value;
break; break;
case 'topright': case 'topright':
setPosx(getElementRight(), pos), setPosy(getElementTop(), pos); setPosx(getElementRight(), pos), value1 = getElementTop(), pos.top = value1;
break; break;
case 'centercenter': case 'centercenter':
setPosx(getElementHCenter(), pos), setPosy(getElementVCenter(), pos); setPosx(getElementHCenter(), pos), value2 = getElementVCenter(), pos.top = value2;
break; break;
case 'centerright': case 'centerright':
setPosx(getElementRight(), pos), setPosy(getElementVCenter(), pos); setPosx(getElementRight(), pos), value3 = getElementVCenter(), pos.top = value3;
break; break;
case 'centerleft': case 'centerleft':
setPosx(getElementLeft(), pos), setPosy(getElementVCenter(), pos); setPosx(getElementLeft(), pos), value4 = getElementVCenter(), pos.top = value4;
break; break;
case 'bottomcenter': case 'bottomcenter':
setPosx(getElementHCenter(), pos), setPosy(getElementBottom(), pos); setPosx(getElementHCenter(), pos), value5 = getElementBottom(), pos.top = value5;
break; break;
case 'bottomright': case 'bottomright':
setPosx(getElementRight(), pos), setPosy(getElementBottom(), pos); setPosx(getElementRight(), pos), value6 = getElementBottom(), pos.top = value6;
break; break;
case 'bottomleft': case 'bottomleft':
setPosx(getElementLeft(), pos), setPosy(getElementBottom(), pos); setPosx(getElementLeft(), pos), value7 = getElementBottom(), pos.top = value7;
break; break;
default: default:
setPosx(getElementLeft(), pos), setPosy(getElementTop(), pos); setPosx(getElementLeft(), pos), value8 = getElementTop(), pos.top = value8;
} }
return pos; return pos;
}(positionX.toLowerCase(), positionY.toLowerCase(), { }(positionX.toLowerCase(), positionY.toLowerCase(), {
@ -7254,9 +7255,6 @@
function setPosx(value, pos) { function setPosx(value, pos) {
pos.left = value; pos.left = value;
} }
function setPosy(value, pos) {
pos.top = value;
}
function getBodyScrollTop() { function getBodyScrollTop() {
return parentDocument.documentElement.scrollTop || parentDocument.body.scrollTop; return parentDocument.documentElement.scrollTop || parentDocument.body.scrollTop;
} }
@ -16179,12 +16177,9 @@
svgMaterial.setAttribute('class', cls), svgMaterial.setAttribute('id', uniqueID), matCirclePath.setAttribute('class', CLS_SPINCIRCLE), innerContainer.insertBefore(svgMaterial, innerContainer.firstChild), svgMaterial.appendChild(matCirclePath); svgMaterial.setAttribute('class', cls), svgMaterial.setAttribute('id', uniqueID), matCirclePath.setAttribute('class', CLS_SPINCIRCLE), innerContainer.insertBefore(svgMaterial, innerContainer.firstChild), svgMaterial.appendChild(matCirclePath);
} }
function mat_calculate_attributes(radius, container, type, cls) { function mat_calculate_attributes(radius, container, type, cls) {
var radius1, offset, diameter = 2 * radius, svg = container.querySelector('svg.' + cls), path = svg.querySelector('path.e-path-circle'), strokeSize = getStrokeSize(diameter), transformOrigin = diameter / 2 + 'px'; var radius1, offset, diameter = 2 * radius, svg = container.querySelector('svg.' + cls), path = svg.querySelector('path.e-path-circle'), strokeSize = 0.1 * diameter, transformOrigin = diameter / 2 + 'px';
svg.setAttribute('viewBox', '0 0 ' + diameter + ' ' + diameter), svg.style.width = svg.style.height = diameter + 'px', svg.style.transformOrigin = transformOrigin + ' ' + transformOrigin + ' ' + transformOrigin, path.setAttribute('d', 'M' + (radius1 = diameter / 2) + ',' + (offset = strokeSize / 2) + 'A' + (radius1 - offset) + ',' + (radius1 - offset) + ' 0 1 1 ' + offset + ',' + radius1), 'Material' === type && (path.setAttribute('stroke-width', strokeSize + ''), path.setAttribute('stroke-dasharray', (diameter - strokeSize) * Math.PI * 0.75 + ''), path.setAttribute('stroke-dashoffset', getDashOffset(diameter, strokeSize, 1, 75) + '')); svg.setAttribute('viewBox', '0 0 ' + diameter + ' ' + diameter), svg.style.width = svg.style.height = diameter + 'px', svg.style.transformOrigin = transformOrigin + ' ' + transformOrigin + ' ' + transformOrigin, path.setAttribute('d', 'M' + (radius1 = diameter / 2) + ',' + (offset = strokeSize / 2) + 'A' + (radius1 - offset) + ',' + (radius1 - offset) + ' 0 1 1 ' + offset + ',' + radius1), 'Material' === type && (path.setAttribute('stroke-width', strokeSize + ''), path.setAttribute('stroke-dasharray', (diameter - strokeSize) * Math.PI * 0.75 + ''), path.setAttribute('stroke-dashoffset', getDashOffset(diameter, strokeSize, 1, 75) + ''));
} }
function getStrokeSize(diameter) {
return 0.1 * diameter;
}
function getDashOffset(diameter, strokeSize, value, max) { function getDashOffset(diameter, strokeSize, value, max) {
return (diameter - strokeSize) * Math.PI * (3 * max / 100 - value / 100); return (diameter - strokeSize) * Math.PI * (3 * max / 100 - value / 100);
} }
@ -16257,7 +16252,7 @@
previousId: 0 previousId: 0
}, function animateMaterial(spinnerInfo) { }, function animateMaterial(spinnerInfo) {
(function(start, end, easing, duration, count, max, spinnerInfo) { (function(start, end, easing, duration, count, max, spinnerInfo) {
var id = ++spinnerInfo.globalInfo[spinnerInfo.uniqueID].previousId, startTime = new Date().getTime(), change = 149 - start, diameter = parseFloat(2 * spinnerInfo.globalInfo[spinnerInfo.uniqueID].radius + ''), strokeSize = getStrokeSize(diameter), rotate = -90 * (spinnerInfo.globalInfo[spinnerInfo.uniqueID].count || 0); var id = ++spinnerInfo.globalInfo[spinnerInfo.uniqueID].previousId, startTime = new Date().getTime(), change = 149 - start, diameter = parseFloat(2 * spinnerInfo.globalInfo[spinnerInfo.uniqueID].radius + ''), strokeSize = 0.1 * diameter, rotate = -90 * (spinnerInfo.globalInfo[spinnerInfo.uniqueID].count || 0);
(function mat_animation(spinnerInfo) { (function mat_animation(spinnerInfo) {
var currentTime = Math.max(0, Math.min(new Date().getTime() - startTime, duration)); var currentTime = Math.max(0, Math.min(new Date().getTime() - startTime, duration));
(function(value, container) { (function(value, container) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1 @@
console.log("Greeting:", (function(value) { console.log("Greeting:", "Hello");
function closure() {
return value;
}
return function() {
return value;
};
})("Hello")());

View File

@ -953,12 +953,14 @@
} }
return flags; return flags;
} }
function disableTouchBindings() { $.vmouse = {
blockTouchTriggers = !0; moveDistanceThreshold: 10,
} clickDistanceThreshold: 10,
resetTimerDuration: 1500
};
function startResetTimer() { function startResetTimer() {
clearResetTimer(), resetTimerID = setTimeout(function() { clearResetTimer(), resetTimerID = setTimeout(function() {
resetTimerID = 0, lastTouchID = 0, clickBlockList.length = 0, blockMouseTriggers = !1, disableTouchBindings(); resetTimerID = 0, lastTouchID = 0, clickBlockList.length = 0, blockMouseTriggers = !1, blockTouchTriggers = !0;
}, $.vmouse.resetTimerDuration); }, $.vmouse.resetTimerDuration);
} }
function clearResetTimer() { function clearResetTimer() {
@ -998,7 +1000,7 @@
} }
function handleTouchEnd(event1) { function handleTouchEnd(event1) {
if (!blockTouchTriggers) { if (!blockTouchTriggers) {
disableTouchBindings(); blockTouchTriggers = !0;
var ve, t, flags = getVirtualBindingFlags(event1.target); var ve, t, flags = getVirtualBindingFlags(event1.target);
triggerVirtualEvent("vmouseup", event1, flags), !didScroll && (ve = triggerVirtualEvent("vclick", event1, flags)) && ve.isDefaultPrevented() && (t = getNativeEvent(event1).changedTouches[0], clickBlockList.push({ triggerVirtualEvent("vmouseup", event1, flags), !didScroll && (ve = triggerVirtualEvent("vclick", event1, flags)) && ve.isDefaultPrevented() && (t = getNativeEvent(event1).changedTouches[0], clickBlockList.push({
touchID: lastTouchID, touchID: lastTouchID,
@ -1015,11 +1017,7 @@
return !1; return !1;
} }
function dummyMouseHandler() {} function dummyMouseHandler() {}
for(i = 0, $.vmouse = { for(i = 0; i < virtualEventNames.length; i++)$.event.special[virtualEventNames[i]] = function(eventType) {
moveDistanceThreshold: 10,
clickDistanceThreshold: 10,
resetTimerDuration: 1500
}; i < virtualEventNames.length; i++)$.event.special[virtualEventNames[i]] = function(eventType) {
var realType = eventType.substr(1); var realType = eventType.substr(1);
return { return {
setup: function() { setup: function() {

View File

@ -454,6 +454,7 @@
var name = fn ? fn.displayName || fn.name : "", syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; var name = fn ? fn.displayName || fn.name : "", syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
return "function" == typeof fn && componentFrameCache.set(fn, syntheticFrame), syntheticFrame; return "function" == typeof fn && componentFrameCache.set(fn, syntheticFrame), syntheticFrame;
} }
componentFrameCache = new ("function" == typeof WeakMap ? WeakMap : Map)();
function getStackByFiberInDevAndProd(workInProgress) { function getStackByFiberInDevAndProd(workInProgress) {
try { try {
var info = "", node = workInProgress; var info = "", node = workInProgress;
@ -528,7 +529,6 @@
} }
return null; return null;
} }
componentFrameCache = new ("function" == typeof WeakMap ? WeakMap : Map)();
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame, current = null, isRendering = !1; var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame, current = null, isRendering = !1;
function getCurrentFiberOwnerNameInDevOrNull() { function getCurrentFiberOwnerNameInDevOrNull() {
if (null === current) return null; if (null === current) return null;
@ -2327,9 +2327,6 @@
function includesSomeLane(a, b) { function includesSomeLane(a, b) {
return (a & b) != 0; return (a & b) != 0;
} }
function isSubsetOfLanes(set, subset) {
return (set & subset) === subset;
}
function createLaneMap(initial) { function createLaneMap(initial) {
for(var laneMap = [], i = 0; i < 31; i++)laneMap.push(initial); for(var laneMap = [], i = 0; i < 31; i++)laneMap.push(initial);
return laneMap; return laneMap;
@ -2348,9 +2345,6 @@
var clz32 = Math.clz32 ? Math.clz32 : function(lanes) { var clz32 = Math.clz32 ? Math.clz32 : function(lanes) {
return 0 === lanes ? 32 : 31 - (log(lanes) / LN2 | 0) | 0; return 0 === lanes ? 32 : 31 - (log(lanes) / LN2 | 0) | 0;
}, log = Math.log, LN2 = Math.LN2, _enabled = !0; }, log = Math.log, LN2 = Math.LN2, _enabled = !0;
function setEnabled(enabled) {
_enabled = !!enabled;
}
function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) { function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
var timeStamp; var timeStamp;
nativeEvent.timeStamp, isInsideEventHandler || flushDiscreteUpdatesImpl(), function(fn, a, b, c, d) { nativeEvent.timeStamp, isInsideEventHandler || flushDiscreteUpdatesImpl(), function(fn, a, b, c, d) {
@ -3304,8 +3298,8 @@
}(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags), (7 & eventSystemFlags) == 0) (function(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { }(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags), (7 & eventSystemFlags) == 0) (function(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {
var win, from, to, isOverEvent = "mouseover" === domEventName || "pointerover" === domEventName, isOutEvent = "mouseout" === domEventName || "pointerout" === domEventName; var win, from, to, isOverEvent = "mouseover" === domEventName || "pointerover" === domEventName, isOutEvent = "mouseout" === domEventName || "pointerout" === domEventName;
if (isOverEvent && (16 & eventSystemFlags) == 0) { if (isOverEvent && (16 & eventSystemFlags) == 0) {
var related = nativeEvent.relatedTarget || nativeEvent.fromElement; var node, related = nativeEvent.relatedTarget || nativeEvent.fromElement;
if (related && (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related))) return; if (related && (getClosestInstanceFromNode(related) || (node = related)[internalContainerInstanceKey])) return;
} }
if (isOutEvent || isOverEvent) { if (isOutEvent || isOverEvent) {
if (nativeEventTarget.window === nativeEventTarget) win = nativeEventTarget; if (nativeEventTarget.window === nativeEventTarget) win = nativeEventTarget;
@ -3847,9 +3841,6 @@
return "textarea" === type || "option" === type || "noscript" === type || "string" == typeof props.children || "number" == typeof props.children || "object" == typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html; return "textarea" === type || "option" === type || "noscript" === type || "string" == typeof props.children || "number" == typeof props.children || "object" == typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html;
} }
var scheduleTimeout = "function" == typeof setTimeout ? setTimeout : void 0, cancelTimeout = "function" == typeof clearTimeout ? clearTimeout : void 0; var scheduleTimeout = "function" == typeof setTimeout ? setTimeout : void 0, cancelTimeout = "function" == typeof clearTimeout ? clearTimeout : void 0;
function resetTextContent(domElement) {
setTextContent(domElement, "");
}
function clearContainer(container) { function clearContainer(container) {
if (1 === container.nodeType) container.textContent = ""; if (1 === container.nodeType) container.textContent = "";
else if (9 === container.nodeType) { else if (9 === container.nodeType) {
@ -3896,12 +3887,6 @@
}; };
} }
var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey; var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey;
function unmarkContainerAsRoot(node) {
node[internalContainerInstanceKey] = null;
}
function isContainerMarkedAsRoot(node) {
return !!node[internalContainerInstanceKey];
}
function getClosestInstanceFromNode(targetNode) { function getClosestInstanceFromNode(targetNode) {
var targetInst = targetNode[internalInstanceKey]; var targetInst = targetNode[internalInstanceKey];
if (targetInst) return targetInst; if (targetInst) return targetInst;
@ -4100,9 +4085,6 @@
function scheduleCallback(reactPriorityLevel, callback, options) { function scheduleCallback(reactPriorityLevel, callback, options) {
return unstable_scheduleCallback(reactPriorityToSchedulerPriority(reactPriorityLevel), callback, options); return unstable_scheduleCallback(reactPriorityToSchedulerPriority(reactPriorityLevel), callback, options);
} }
function cancelCallback(callbackNode) {
callbackNode !== fakeCallbackNode && unstable_cancelCallback(callbackNode);
}
function flushSyncCallbackQueue() { function flushSyncCallbackQueue() {
if (null !== immediateQueueCallbackNode) { if (null !== immediateQueueCallbackNode) {
var node = immediateQueueCallbackNode; var node = immediateQueueCallbackNode;
@ -4216,12 +4198,6 @@
function resetContextDependencies() { function resetContextDependencies() {
currentlyRenderingFiber = null, lastContextDependency = null, lastContextWithAllBitsObserved = null, isDisallowedContextReadInDEV = !1; currentlyRenderingFiber = null, lastContextDependency = null, lastContextWithAllBitsObserved = null, isDisallowedContextReadInDEV = !1;
} }
function enterDisallowedContextReadInDEV() {
isDisallowedContextReadInDEV = !0;
}
function exitDisallowedContextReadInDEV() {
isDisallowedContextReadInDEV = !1;
}
function pushProvider(providerFiber, nextValue) { function pushProvider(providerFiber, nextValue) {
var context = providerFiber.type._context; var context = providerFiber.type._context;
push(valueCursor, context._currentValue, providerFiber), context._currentValue = nextValue, void 0 !== context._currentRenderer && null !== context._currentRenderer && context._currentRenderer !== rendererSigil && error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), context._currentRenderer = rendererSigil; push(valueCursor, context._currentValue, providerFiber), context._currentValue = nextValue, void 0 !== context._currentRenderer && null !== context._currentRenderer && context._currentRenderer !== rendererSigil && error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), context._currentRenderer = rendererSigil;
@ -4233,8 +4209,8 @@
function scheduleWorkOnParentPath(parent, renderLanes) { function scheduleWorkOnParentPath(parent, renderLanes) {
for(var node = parent; null !== node;){ for(var node = parent; null !== node;){
var alternate = node.alternate; var alternate = node.alternate;
if (isSubsetOfLanes(node.childLanes, renderLanes)) { if ((node.childLanes & renderLanes) === renderLanes) {
if (null === alternate || isSubsetOfLanes(alternate.childLanes, renderLanes)) break; if (null === alternate || (alternate.childLanes & renderLanes) === renderLanes) break;
alternate.childLanes = alternate.childLanes | renderLanes; alternate.childLanes = alternate.childLanes | renderLanes;
} else node.childLanes = node.childLanes | renderLanes, null !== alternate && (alternate.childLanes = alternate.childLanes | renderLanes); } else node.childLanes = node.childLanes | renderLanes, null !== alternate && (alternate.childLanes = alternate.childLanes | renderLanes);
node = node.return; node = node.return;
@ -4243,7 +4219,7 @@
function prepareToReadContext(workInProgress, renderLanes) { function prepareToReadContext(workInProgress, renderLanes) {
currentlyRenderingFiber = workInProgress, lastContextDependency = null, lastContextWithAllBitsObserved = null; currentlyRenderingFiber = workInProgress, lastContextDependency = null, lastContextWithAllBitsObserved = null;
var a, dependencies = workInProgress.dependencies; var a, dependencies = workInProgress.dependencies;
null !== dependencies && null !== dependencies.firstContext && (a = dependencies.lanes, (a & renderLanes) != 0 && markWorkInProgressReceivedUpdate(), dependencies.firstContext = null); null !== dependencies && null !== dependencies.firstContext && (a = dependencies.lanes, (a & renderLanes) != 0 && (didReceiveUpdate = !0), dependencies.firstContext = null);
} }
function readContext(context, observedBits) { function readContext(context, observedBits) {
if (isDisallowedContextReadInDEV && error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."), lastContextWithAllBitsObserved === context) ; if (isDisallowedContextReadInDEV && error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."), lastContextWithAllBitsObserved === context) ;
@ -4360,7 +4336,7 @@
if (null !== firstBaseUpdate) { if (null !== firstBaseUpdate) {
for(var newState = queue.baseState, newLanes = 0, newBaseState = null, newFirstBaseUpdate = null, newLastBaseUpdate = null, update = firstBaseUpdate;;){ for(var newState = queue.baseState, newLanes = 0, newBaseState = null, newFirstBaseUpdate = null, newLastBaseUpdate = null, update = firstBaseUpdate;;){
var updateLane = update.lane, updateEventTime = update.eventTime; var updateLane = update.lane, updateEventTime = update.eventTime;
if (isSubsetOfLanes(renderLanes, updateLane)) { if ((renderLanes & updateLane) === updateLane) {
if (null !== newLastBaseUpdate) { if (null !== newLastBaseUpdate) {
var _clone = { var _clone = {
eventTime: updateEventTime, eventTime: updateEventTime,
@ -4377,7 +4353,7 @@
case 1: case 1:
var payload = update.payload; var payload = update.payload;
if ("function" == typeof payload) { if ("function" == typeof payload) {
enterDisallowedContextReadInDEV(); isDisallowedContextReadInDEV = !0;
var nextState = payload.call(instance, prevState, nextProps); var nextState = payload.call(instance, prevState, nextProps);
if (1 & workInProgress.mode) { if (1 & workInProgress.mode) {
disableLogs(); disableLogs();
@ -4387,7 +4363,7 @@
reenableLogs(); reenableLogs();
} }
} }
return exitDisallowedContextReadInDEV(), nextState; return isDisallowedContextReadInDEV = !1, nextState;
} }
return payload; return payload;
case 3: case 3:
@ -4395,7 +4371,7 @@
case 0: case 0:
var partialState, _payload = update.payload; var partialState, _payload = update.payload;
if ("function" == typeof _payload) { if ("function" == typeof _payload) {
if (enterDisallowedContextReadInDEV(), partialState = _payload.call(instance, prevState, nextProps), 1 & workInProgress.mode) { if (isDisallowedContextReadInDEV = !0, partialState = _payload.call(instance, prevState, nextProps), 1 & workInProgress.mode) {
disableLogs(); disableLogs();
try { try {
_payload.call(instance, prevState, nextProps); _payload.call(instance, prevState, nextProps);
@ -4403,7 +4379,7 @@
reenableLogs(); reenableLogs();
} }
} }
exitDisallowedContextReadInDEV(); isDisallowedContextReadInDEV = !1;
} else partialState = _payload; } else partialState = _payload;
if (null == partialState) break; if (null == partialState) break;
return _assign({}, prevState, partialState); return _assign({}, prevState, partialState);
@ -4439,9 +4415,6 @@
} }
currentlyProcessingQueue = null; currentlyProcessingQueue = null;
} }
function resetHasForceUpdateBeforeProcessing() {
hasForceUpdate = !1;
}
didWarnUpdateInsideUpdate = !1, currentlyProcessingQueue = null; didWarnUpdateInsideUpdate = !1, currentlyProcessingQueue = null;
function commitUpdateQueue(finishedWork, finishedQueue, instance) { function commitUpdateQueue(finishedWork, finishedQueue, instance) {
var effects = finishedQueue.effects; var effects = finishedQueue.effects;
@ -4945,12 +4918,6 @@
contextFiberStackCursor.current === fiber && (pop(contextStackCursor$1, fiber), pop(contextFiberStackCursor, fiber)); contextFiberStackCursor.current === fiber && (pop(contextStackCursor$1, fiber), pop(contextFiberStackCursor, fiber));
} }
var suspenseStackCursor = createCursor(0); var suspenseStackCursor = createCursor(0);
function pushSuspenseContext(fiber, newContext) {
push(suspenseStackCursor, newContext, fiber);
}
function popSuspenseContext(fiber) {
pop(suspenseStackCursor, fiber);
}
function findFirstSuspended(row) { function findFirstSuspended(row) {
for(var node = row; null !== node;){ for(var node = row; null !== node;){
if (13 === node.tag) { if (13 === node.tag) {
@ -5217,7 +5184,7 @@
var first = baseQueue.next, newState = current.baseState, newBaseState = null, newBaseQueueFirst = null, newBaseQueueLast = null, update = first; var first = baseQueue.next, newState = current.baseState, newBaseState = null, newBaseQueueFirst = null, newBaseQueueLast = null, update = first;
do { do {
var updateLane = update.lane; var updateLane = update.lane;
if (isSubsetOfLanes(renderLanes, updateLane)) { if ((renderLanes & updateLane) === updateLane) {
if (null !== newBaseQueueLast) { if (null !== newBaseQueueLast) {
var _clone = { var _clone = {
lane: 0, lane: 0,
@ -5241,7 +5208,7 @@
} }
update = update.next; update = update.next;
}while (null !== update && update !== first) }while (null !== update && update !== first)
null === newBaseQueueLast ? newBaseState = newState : newBaseQueueLast.next = newBaseQueueFirst, objectIs(newState, hook.memoizedState) || markWorkInProgressReceivedUpdate(), hook.memoizedState = newState, hook.baseState = newBaseState, hook.baseQueue = newBaseQueueLast, queue.lastRenderedState = newState; null === newBaseQueueLast ? newBaseState = newState : newBaseQueueLast.next = newBaseQueueFirst, objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0), hook.memoizedState = newState, hook.baseState = newBaseState, hook.baseQueue = newBaseQueueLast, queue.lastRenderedState = newState;
} }
var dispatch = queue.dispatch; var dispatch = queue.dispatch;
return [ return [
@ -5259,7 +5226,7 @@
var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next, update = firstRenderPhaseUpdate; var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next, update = firstRenderPhaseUpdate;
do newState = reducer(newState, update.action), update = update.next; do newState = reducer(newState, update.action), update = update.next;
while (update !== firstRenderPhaseUpdate) while (update !== firstRenderPhaseUpdate)
objectIs(newState, hook.memoizedState) || markWorkInProgressReceivedUpdate(), hook.memoizedState = newState, null === hook.baseQueue && (hook.baseState = newState), queue.lastRenderedState = newState; objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0), hook.memoizedState = newState, null === hook.baseQueue && (hook.baseState = newState), queue.lastRenderedState = newState;
} }
return [ return [
newState, newState,
@ -5268,8 +5235,8 @@
} }
function readFromUnsubcribedMutableSource(root, source, getSnapshot) { function readFromUnsubcribedMutableSource(root, source, getSnapshot) {
null == (mutableSource = source)._currentPrimaryRenderer ? mutableSource._currentPrimaryRenderer = rendererSigil$1 : mutableSource._currentPrimaryRenderer !== rendererSigil$1 && error("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported."); null == (mutableSource = source)._currentPrimaryRenderer ? mutableSource._currentPrimaryRenderer = rendererSigil$1 : mutableSource._currentPrimaryRenderer !== rendererSigil$1 && error("Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported.");
var mutableSource, version = (0, source._getVersion)(source._source), isSafeToReadFromSource = !1, currentRenderVersion = source._workInProgressVersionPrimary; var mutableSource, subset, version = (0, source._getVersion)(source._source), isSafeToReadFromSource = !1, currentRenderVersion = source._workInProgressVersionPrimary;
if (null !== currentRenderVersion ? isSafeToReadFromSource = currentRenderVersion === version : (isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root.mutableReadLanes)) && setWorkInProgressVersion(source, version), isSafeToReadFromSource) { if (null !== currentRenderVersion ? isSafeToReadFromSource = currentRenderVersion === version : (isSafeToReadFromSource = (renderLanes & (subset = root.mutableReadLanes)) === subset) && setWorkInProgressVersion(source, version), isSafeToReadFromSource) {
var snapshot = getSnapshot(source._source); var snapshot = getSnapshot(source._source);
return "function" == typeof snapshot && error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."), snapshot; return "function" == typeof snapshot && error("Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing."), snapshot;
} }
@ -5826,7 +5793,7 @@
return currentHookNameInDev = "useMutableSource", updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe); return currentHookNameInDev = "useMutableSource", updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe);
}, },
useOpaqueIdentifier: function() { useOpaqueIdentifier: function() {
return currentHookNameInDev = "useOpaqueIdentifier", updateHookTypesDev(), updateOpaqueIdentifier(); return currentHookNameInDev = "useOpaqueIdentifier", updateHookTypesDev(), updateReducer(basicStateReducer)[0];
}, },
unstable_isNewReconciler: !1 unstable_isNewReconciler: !1
}, HooksDispatcherOnRerenderInDEV = { }, HooksDispatcherOnRerenderInDEV = {
@ -5894,7 +5861,7 @@
return currentHookNameInDev = "useMutableSource", updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe); return currentHookNameInDev = "useMutableSource", updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe);
}, },
useOpaqueIdentifier: function() { useOpaqueIdentifier: function() {
return currentHookNameInDev = "useOpaqueIdentifier", updateHookTypesDev(), rerenderOpaqueIdentifier(); return currentHookNameInDev = "useOpaqueIdentifier", updateHookTypesDev(), rerenderReducer(basicStateReducer)[0];
}, },
unstable_isNewReconciler: !1 unstable_isNewReconciler: !1
}, InvalidNestedHooksDispatcherOnMountInDEV = { }, InvalidNestedHooksDispatcherOnMountInDEV = {
@ -6030,7 +5997,7 @@
return currentHookNameInDev = "useMutableSource", warnInvalidHookAccess(), updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe); return currentHookNameInDev = "useMutableSource", warnInvalidHookAccess(), updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe);
}, },
useOpaqueIdentifier: function() { useOpaqueIdentifier: function() {
return currentHookNameInDev = "useOpaqueIdentifier", warnInvalidHookAccess(), updateHookTypesDev(), updateOpaqueIdentifier(); return currentHookNameInDev = "useOpaqueIdentifier", warnInvalidHookAccess(), updateHookTypesDev(), updateReducer(basicStateReducer)[0];
}, },
unstable_isNewReconciler: !1 unstable_isNewReconciler: !1
}, InvalidNestedHooksDispatcherOnRerenderInDEV = { }, InvalidNestedHooksDispatcherOnRerenderInDEV = {
@ -6098,14 +6065,11 @@
return currentHookNameInDev = "useMutableSource", warnInvalidHookAccess(), updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe); return currentHookNameInDev = "useMutableSource", warnInvalidHookAccess(), updateHookTypesDev(), updateMutableSource(source, getSnapshot, subscribe);
}, },
useOpaqueIdentifier: function() { useOpaqueIdentifier: function() {
return currentHookNameInDev = "useOpaqueIdentifier", warnInvalidHookAccess(), updateHookTypesDev(), rerenderOpaqueIdentifier(); return currentHookNameInDev = "useOpaqueIdentifier", warnInvalidHookAccess(), updateHookTypesDev(), rerenderReducer(basicStateReducer)[0];
}, },
unstable_isNewReconciler: !1 unstable_isNewReconciler: !1
}; };
var commitTime = 0, profilerStartTime = -1; var commitTime = 0, profilerStartTime = -1;
function recordCommitTime() {
commitTime = unstable_now();
}
function startProfilerTimer(fiber) { function startProfilerTimer(fiber) {
profilerStartTime = unstable_now(), fiber.actualStartTime < 0 && (fiber.actualStartTime = unstable_now()); profilerStartTime = unstable_now(), fiber.actualStartTime < 0 && (fiber.actualStartTime = unstable_now());
} }
@ -6235,7 +6199,7 @@
nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
} }
var getDerivedStateFromProps = ctor.getDerivedStateFromProps, hasNewLifecycles = "function" == typeof getDerivedStateFromProps || "function" == typeof instance.getSnapshotBeforeUpdate; var getDerivedStateFromProps = ctor.getDerivedStateFromProps, hasNewLifecycles = "function" == typeof getDerivedStateFromProps || "function" == typeof instance.getSnapshotBeforeUpdate;
hasNewLifecycles || "function" != typeof instance.UNSAFE_componentWillReceiveProps && "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === nextContext || callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext), resetHasForceUpdateBeforeProcessing(); hasNewLifecycles || "function" != typeof instance.UNSAFE_componentWillReceiveProps && "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === nextContext || callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext), hasForceUpdate = !1;
var oldState = workInProgress.memoizedState, newState = instance.state = oldState; var oldState = workInProgress.memoizedState, newState = instance.state = oldState;
if (processUpdateQueue(workInProgress, newProps, instance, renderLanes), newState = workInProgress.memoizedState, oldProps === newProps && oldState === newState && !hasContextChanged() && !hasForceUpdate) return "function" == typeof instance.componentDidMount && (workInProgress.flags |= 4), !1; if (processUpdateQueue(workInProgress, newProps, instance, renderLanes), newState = workInProgress.memoizedState, oldProps === newProps && oldState === newState && !hasContextChanged() && !hasForceUpdate) return "function" == typeof instance.componentDidMount && (workInProgress.flags |= 4), !1;
"function" == typeof getDerivedStateFromProps && (applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps), newState = workInProgress.memoizedState); "function" == typeof getDerivedStateFromProps && (applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps), newState = workInProgress.memoizedState);
@ -6253,7 +6217,7 @@
nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
} }
var getDerivedStateFromProps = ctor.getDerivedStateFromProps, hasNewLifecycles = "function" == typeof getDerivedStateFromProps || "function" == typeof instance.getSnapshotBeforeUpdate; var getDerivedStateFromProps = ctor.getDerivedStateFromProps, hasNewLifecycles = "function" == typeof getDerivedStateFromProps || "function" == typeof instance.getSnapshotBeforeUpdate;
hasNewLifecycles || "function" != typeof instance.UNSAFE_componentWillReceiveProps && "function" != typeof instance.componentWillReceiveProps || unresolvedOldProps === unresolvedNewProps && oldContext === nextContext || callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext), resetHasForceUpdateBeforeProcessing(); hasNewLifecycles || "function" != typeof instance.UNSAFE_componentWillReceiveProps && "function" != typeof instance.componentWillReceiveProps || unresolvedOldProps === unresolvedNewProps && oldContext === nextContext || callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext), hasForceUpdate = !1;
var oldState = workInProgress.memoizedState, newState = instance.state = oldState; var oldState = workInProgress.memoizedState, newState = instance.state = oldState;
if (processUpdateQueue(workInProgress, newProps, instance, renderLanes), newState = workInProgress.memoizedState, unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !hasForceUpdate) return "function" == typeof instance.componentDidUpdate && (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) && (workInProgress.flags |= 4), "function" == typeof instance.getSnapshotBeforeUpdate && (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) && (workInProgress.flags |= 256), !1; if (processUpdateQueue(workInProgress, newProps, instance, renderLanes), newState = workInProgress.memoizedState, unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !hasForceUpdate) return "function" == typeof instance.componentDidUpdate && (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) && (workInProgress.flags |= 4), "function" == typeof instance.getSnapshotBeforeUpdate && (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) && (workInProgress.flags |= 256), !1;
"function" == typeof getDerivedStateFromProps && (applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps), newState = workInProgress.memoizedState); "function" == typeof getDerivedStateFromProps && (applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps), newState = workInProgress.memoizedState);
@ -6322,13 +6286,13 @@
} }
function updateSuspenseComponent(current, workInProgress, renderLanes) { function updateSuspenseComponent(current, workInProgress, renderLanes) {
var nextProps = workInProgress.pendingProps; var nextProps = workInProgress.pendingProps;
shouldSuspendImpl(fiber = workInProgress) && (workInProgress.flags |= 64); shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 64);
var suspenseContext = suspenseStackCursor.current, showFallback = !1; var suspenseContext = suspenseStackCursor.current, showFallback = !1;
if ((64 & workInProgress.flags) == 0 && (suspenseContext1 = suspenseContext, null !== (current1 = current) && null === current1.memoizedState ? 1 : (2 & suspenseContext1) == 0)) (null === current || null !== current.memoizedState) && void 0 !== nextProps.fallback && !0 !== nextProps.unstable_avoidThisFallback && (suspenseContext |= 1); if ((64 & workInProgress.flags) == 0 && (suspenseContext1 = suspenseContext, null !== (current1 = current) && null === current1.memoizedState ? 1 : (2 & suspenseContext1) == 0)) (null === current || null !== current.memoizedState) && void 0 !== nextProps.fallback && !0 !== nextProps.unstable_avoidThisFallback && (suspenseContext |= 1);
else showFallback = !0, workInProgress.flags &= -65; else showFallback = !0, workInProgress.flags &= -65;
if (pushSuspenseContext(workInProgress, suspenseContext &= 1), null === current) { if (push(suspenseStackCursor, suspenseContext &= 1, workInProgress), null === current) {
void 0 !== nextProps.fallback && tryToClaimNextHydratableInstance(workInProgress); void 0 !== nextProps.fallback && tryToClaimNextHydratableInstance(workInProgress);
var fiber, suspenseContext1, current1, workInProgress1, renderLanes1, workInProgress2, primaryChildren, renderLanes2, mode, primaryChildFragment, nextPrimaryChildren = nextProps.children, nextFallbackChildren = nextProps.fallback; var suspenseContext1, current1, workInProgress1, renderLanes1, workInProgress2, primaryChildren, renderLanes2, mode, primaryChildFragment, nextPrimaryChildren = nextProps.children, nextFallbackChildren = nextProps.fallback;
if (showFallback) { if (showFallback) {
var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);
return workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, fallbackFragment; return workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, fallbackFragment;
@ -6459,7 +6423,7 @@
} }
node.sibling.return = node.return, node = node.sibling; node.sibling.return = node.return, node = node.sibling;
} }
}(workInProgress, workInProgress.child, renderLanes), suspenseContext &= 1), pushSuspenseContext(workInProgress, suspenseContext), (2 & workInProgress.mode) == 0) workInProgress.memoizedState = null; }(workInProgress, workInProgress.child, renderLanes), suspenseContext &= 1), push(suspenseStackCursor, suspenseContext, workInProgress), (2 & workInProgress.mode) == 0) workInProgress.memoizedState = null;
else switch(revealOrder){ else switch(revealOrder){
case "forwards": case "forwards":
var tail, lastContentRow = function(firstChild) { var tail, lastContentRow = function(firstChild) {
@ -6493,9 +6457,6 @@
return workInProgress.child; return workInProgress.child;
} }
var hasWarnedAboutUsingNoValuePropOnContextProvider = !1, hasWarnedAboutUsingContextAsConsumer = !1; var hasWarnedAboutUsingNoValuePropOnContextProvider = !1, hasWarnedAboutUsingContextAsConsumer = !1;
function markWorkInProgressReceivedUpdate() {
didReceiveUpdate = !0;
}
function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {
return (null !== current && (workInProgress.dependencies = current.dependencies), profilerStartTime = -1, markSkippedUpdateLanes(workInProgress.lanes), (renderLanes & workInProgress.childLanes) != 0) ? (!function(current, workInProgress) { return (null !== current && (workInProgress.dependencies = current.dependencies), profilerStartTime = -1, markSkippedUpdateLanes(workInProgress.lanes), (renderLanes & workInProgress.childLanes) != 0) ? (!function(current, workInProgress) {
if (!(null === current || workInProgress.child === current.child)) throw Error("Resuming work not yet implemented."); if (!(null === current || workInProgress.child === current.child)) throw Error("Resuming work not yet implemented.");
@ -6551,21 +6512,21 @@
case 13: case 13:
if (null !== workInProgress.memoizedState) { if (null !== workInProgress.memoizedState) {
if (a2 = renderLanes, (a2 & workInProgress.child.childLanes) != 0) return updateSuspenseComponent(current, workInProgress, renderLanes); if (a2 = renderLanes, (a2 & workInProgress.child.childLanes) != 0) return updateSuspenseComponent(current, workInProgress, renderLanes);
pushSuspenseContext(workInProgress, 1 & suspenseStackCursor.current); newContext1 = 1 & suspenseStackCursor.current, push(suspenseStackCursor, newContext1, workInProgress);
var a2, child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); var a2, newContext, newContext1, child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);
if (null !== child) return child.sibling; if (null !== child) return child.sibling;
return null; return null;
} }
pushSuspenseContext(workInProgress, 1 & suspenseStackCursor.current); newContext = 1 & suspenseStackCursor.current, push(suspenseStackCursor, newContext, workInProgress);
break; break;
case 19: case 19:
var a3, didSuspendBefore = (64 & current.flags) != 0, _hasChildWork = (a3 = renderLanes, (a3 & workInProgress.childLanes) != 0); var a3, newContext2, didSuspendBefore = (64 & current.flags) != 0, _hasChildWork = (a3 = renderLanes, (a3 & workInProgress.childLanes) != 0);
if (didSuspendBefore) { if (didSuspendBefore) {
if (_hasChildWork) return updateSuspenseListComponent(current, workInProgress, renderLanes); if (_hasChildWork) return updateSuspenseListComponent(current, workInProgress, renderLanes);
workInProgress.flags |= 64; workInProgress.flags |= 64;
} }
var renderState = workInProgress.memoizedState; var renderState = workInProgress.memoizedState;
if (null !== renderState && (renderState.rendering = null, renderState.tail = null, renderState.lastEffect = null), pushSuspenseContext(workInProgress, suspenseStackCursor.current), !_hasChildWork) return null; if (null !== renderState && (renderState.rendering = null, renderState.tail = null, renderState.lastEffect = null), newContext2 = suspenseStackCursor.current, push(suspenseStackCursor, newContext2, workInProgress), !_hasChildWork) return null;
break; break;
case 23: case 23:
case 24: case 24:
@ -7063,7 +7024,7 @@
} }
return null; return null;
case 13: case 13:
popSuspenseContext(workInProgress); pop(suspenseStackCursor, workInProgress);
var nextState = workInProgress.memoizedState; var nextState = workInProgress.memoizedState;
if ((64 & workInProgress.flags) != 0) return workInProgress.lanes = renderLanes, (8 & workInProgress.mode) != 0 && transferActualDuration(workInProgress), workInProgress; if ((64 & workInProgress.flags) != 0) return workInProgress.lanes = renderLanes, (8 & workInProgress.mode) != 0 && transferActualDuration(workInProgress), workInProgress;
var nextDidTimeout = null !== nextState, prevDidTimeout = !1; var nextDidTimeout = null !== nextState, prevDidTimeout = !1;
@ -7073,7 +7034,7 @@
case 10: case 10:
return popProvider(workInProgress), null; return popProvider(workInProgress), null;
case 19: case 19:
popSuspenseContext(workInProgress); pop(suspenseStackCursor, workInProgress);
var renderState = workInProgress.memoizedState; var renderState = workInProgress.memoizedState;
if (null === renderState) return null; if (null === renderState) return null;
var didSuspendAlready = (64 & workInProgress.flags) != 0, renderedTail = renderState.rendering; var didSuspendAlready = (64 & workInProgress.flags) != 0, renderedTail = renderState.rendering;
@ -7084,7 +7045,7 @@
var suspended = findFirstSuspended(row); var suspended = findFirstSuspended(row);
if (null !== suspended) { if (null !== suspended) {
didSuspendAlready = !0, workInProgress.flags |= 64, cutOffTailIfNeeded(renderState, !1); didSuspendAlready = !0, workInProgress.flags |= 64, cutOffTailIfNeeded(renderState, !1);
var newThennables = suspended.updateQueue; var newContext, newThennables = suspended.updateQueue;
return null !== newThennables && (workInProgress.updateQueue = newThennables, workInProgress.flags |= 4), null === renderState.lastEffect && (workInProgress.firstEffect = null), workInProgress.lastEffect = renderState.lastEffect, !function(workInProgress, lanes) { return null !== newThennables && (workInProgress.updateQueue = newThennables, workInProgress.flags |= 4), null === renderState.lastEffect && (workInProgress.firstEffect = null), workInProgress.lastEffect = renderState.lastEffect, !function(workInProgress, lanes) {
for(var child = workInProgress.child; null !== child;)(function(workInProgress, renderLanes) { for(var child = workInProgress.child; null !== child;)(function(workInProgress, renderLanes) {
workInProgress.flags &= 2, workInProgress.nextEffect = null, workInProgress.firstEffect = null, workInProgress.lastEffect = null; workInProgress.flags &= 2, workInProgress.nextEffect = null, workInProgress.firstEffect = null, workInProgress.lastEffect = null;
@ -7099,7 +7060,7 @@
}, workInProgress.selfBaseDuration = current.selfBaseDuration, workInProgress.treeBaseDuration = current.treeBaseDuration; }, workInProgress.selfBaseDuration = current.selfBaseDuration, workInProgress.treeBaseDuration = current.treeBaseDuration;
} }
})(child, lanes), child = child.sibling; })(child, lanes), child = child.sibling;
}(workInProgress, renderLanes), pushSuspenseContext(workInProgress, 1 & suspenseStackCursor.current | 2), workInProgress.child; }(workInProgress, renderLanes), newContext = 1 & suspenseStackCursor.current | 2, push(suspenseStackCursor, newContext, workInProgress), workInProgress.child;
} }
row = row.sibling; row = row.sibling;
} }
@ -7127,7 +7088,7 @@
var next = renderState.tail; var next = renderState.tail;
renderState.rendering = next, renderState.tail = next.sibling, renderState.lastEffect = workInProgress.lastEffect, renderState.renderingStartTime = now(), next.sibling = null; renderState.rendering = next, renderState.tail = next.sibling, renderState.lastEffect = workInProgress.lastEffect, renderState.renderingStartTime = now(), next.sibling = null;
var suspenseContext = suspenseStackCursor.current; var suspenseContext = suspenseStackCursor.current;
return didSuspendAlready ? suspenseContext = 1 & suspenseContext | 2 : suspenseContext &= 1, pushSuspenseContext(workInProgress, suspenseContext), next; return didSuspendAlready ? suspenseContext = 1 & suspenseContext | 2 : suspenseContext &= 1, push(suspenseStackCursor, suspenseContext, workInProgress), next;
} }
return null; return null;
case 20: case 20:
@ -7160,7 +7121,7 @@
break; break;
case 13: case 13:
case 19: case 19:
popSuspenseContext(interruptedWork); pop(suspenseStackCursor, interruptedWork);
break; break;
case 10: case 10:
popProvider(interruptedWork); popProvider(interruptedWork);
@ -7177,6 +7138,22 @@
stack: getStackByFiberInDevAndProd(source) stack: getStackByFiberInDevAndProd(source)
}; };
} }
function logCapturedError(boundary, errorInfo) {
try {
var errorBoundaryMessage, error = errorInfo.value, source = errorInfo.source, stack = errorInfo.stack;
if (null != error && error._suppressLogging) {
if (1 === boundary.tag) return;
console.error(error);
}
var componentName = source ? getComponentName(source.type) : null, errorBoundaryName = getComponentName(boundary.type);
errorBoundaryMessage = errorBoundaryName ? "React will try to recreate this component tree from scratch using the error boundary you provided, " + errorBoundaryName + "." : "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
console.error((componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:") + "\n" + (null !== stack ? stack : "") + "\n\n" + errorBoundaryMessage);
} catch (e) {
setTimeout(function() {
throw e;
});
}
}
appendAllChildren = function(parent, workInProgress, needsVisibilityToggle, isHidden) { appendAllChildren = function(parent, workInProgress, needsVisibilityToggle, isHidden) {
for(var node = workInProgress.child; null !== node;){ for(var node = workInProgress.child; null !== node;){
if (5 === node.tag || 6 === node.tag) !function(parentInstance, child) { if (5 === node.tag || 6 === node.tag) !function(parentInstance, child) {
@ -7257,22 +7234,6 @@
}, updateHostText$1 = function(current, workInProgress, oldText, newText) { }, updateHostText$1 = function(current, workInProgress, oldText, newText) {
oldText !== newText && markUpdate(workInProgress); oldText !== newText && markUpdate(workInProgress);
}; };
function logCapturedError(boundary, errorInfo) {
try {
var errorBoundaryMessage, error = errorInfo.value, source = errorInfo.source, stack = errorInfo.stack;
if (null != error && error._suppressLogging) {
if (1 === boundary.tag) return;
console.error(error);
}
var componentName = source ? getComponentName(source.type) : null, errorBoundaryName = getComponentName(boundary.type);
errorBoundaryMessage = errorBoundaryName ? "React will try to recreate this component tree from scratch using the error boundary you provided, " + errorBoundaryName + "." : "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries.";
console.error((componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:") + "\n" + (null !== stack ? stack : "") + "\n\n" + errorBoundaryMessage);
} catch (e) {
setTimeout(function() {
throw e;
});
}
}
var PossiblyWeakMap$1 = "function" == typeof WeakMap ? WeakMap : Map; var PossiblyWeakMap$1 = "function" == typeof WeakMap ? WeakMap : Map;
function createRootErrorUpdate(fiber, errorInfo, lane) { function createRootErrorUpdate(fiber, errorInfo, lane) {
var update = createUpdate(-1, lane); var update = createUpdate(-1, lane);
@ -7410,7 +7371,7 @@
default: default:
throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."); throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
} }
16 & parentFiber.flags && (resetTextContent(parent), parentFiber.flags &= -17); 16 & parentFiber.flags && (setTextContent(parent, ""), parentFiber.flags &= -17);
var before = function(fiber) { var before = function(fiber) {
var node = fiber; var node = fiber;
siblings: for(;;){ siblings: for(;;){
@ -7697,12 +7658,12 @@
}(root, currentTime); }(root, currentTime);
var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0), newCallbackPriority = return_highestLanePriority; var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0), newCallbackPriority = return_highestLanePriority;
if (0 === nextLanes) { if (0 === nextLanes) {
null !== existingCallbackNode && (cancelCallback(existingCallbackNode), root.callbackNode = null, root.callbackPriority = 0); null !== existingCallbackNode && (existingCallbackNode !== fakeCallbackNode && unstable_cancelCallback(existingCallbackNode), root.callbackNode = null, root.callbackPriority = 0);
return; return;
} }
if (null !== existingCallbackNode) { if (null !== existingCallbackNode) {
if (root.callbackPriority === newCallbackPriority) return; if (root.callbackPriority === newCallbackPriority) return;
cancelCallback(existingCallbackNode); existingCallbackNode !== fakeCallbackNode && unstable_cancelCallback(existingCallbackNode);
} }
15 === newCallbackPriority ? (callback = performSyncWorkOnRoot.bind(null, root), null === syncQueue ? (syncQueue = [ 15 === newCallbackPriority ? (callback = performSyncWorkOnRoot.bind(null, root), null === syncQueue ? (syncQueue = [
callback callback
@ -7753,7 +7714,7 @@
} catch (thrownValue) { } catch (thrownValue) {
handleError(root, thrownValue); handleError(root, thrownValue);
} }
return (resetContextDependencies(), popInteractions(prevInteractions), popDispatcher(prevDispatcher), executionContext = prevExecutionContext, null !== workInProgress) ? 0 : (workInProgressRoot = null, workInProgressRootRenderLanes = 0, workInProgressRootExitStatus); return (resetContextDependencies(), popInteractions(prevInteractions), ReactCurrentDispatcher$2.current = prevDispatcher, executionContext = prevExecutionContext, null !== workInProgress) ? 0 : (workInProgressRoot = null, workInProgressRootRenderLanes = 0, workInProgressRootExitStatus);
}(root, lanes); }(root, lanes);
if (a = workInProgressRootIncludedLanes, (a & workInProgressRootUpdatedLanes) != 0) prepareFreshStack(root, 0); if (a = workInProgressRootIncludedLanes, (a & workInProgressRootUpdatedLanes) != 0) prepareFreshStack(root, 0);
else if (0 !== exitStatus) { else if (0 !== exitStatus) {
@ -7772,12 +7733,14 @@
commitRoot(root); commitRoot(root);
break; break;
case 3: case 3:
if (markRootSuspended$1(root, lanes), includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) { if (markRootSuspended$1(root, lanes), includesOnlyRetries(lanes) && !function() {
return actingUpdatesScopeDepth > 0;
}()) {
var msUntilTimeout = globalMostRecentFallbackTime + 500 - now(); var msUntilTimeout = globalMostRecentFallbackTime + 500 - now();
if (msUntilTimeout > 10) { if (msUntilTimeout > 10) {
if (0 !== getNextLanes(root, 0)) break; if (0 !== getNextLanes(root, 0)) break;
var suspendedLanes = root.suspendedLanes; var suspendedLanes = root.suspendedLanes;
if (!isSubsetOfLanes(suspendedLanes, lanes)) { if ((suspendedLanes & lanes) !== lanes) {
requestEventTime(), markRootPinged(root, suspendedLanes); requestEventTime(), markRootPinged(root, suspendedLanes);
break; break;
} }
@ -7789,7 +7752,9 @@
break; break;
case 4: case 4:
if (markRootSuspended$1(root, lanes), (4186112 & lanes) === lanes) break; if (markRootSuspended$1(root, lanes), (4186112 & lanes) === lanes) break;
if (!shouldForceFlushFallbacksInDEV()) { if (!function() {
return actingUpdatesScopeDepth > 0;
}()) {
var timeElapsed, mostRecentEventTime = function(root, lanes) { var timeElapsed, mostRecentEventTime = function(root, lanes) {
for(var eventTimes = root.eventTimes, mostRecentEventTime = -1; lanes > 0;){ for(var eventTimes = root.eventTimes, mostRecentEventTime = -1; lanes > 0;){
var index = pickArbitraryLaneIndex(lanes), lane = 1 << index, eventTime = eventTimes[index]; var index = pickArbitraryLaneIndex(lanes), lane = 1 << index, eventTime = eventTimes[index];
@ -7960,9 +7925,6 @@
var prevDispatcher = ReactCurrentDispatcher$2.current; var prevDispatcher = ReactCurrentDispatcher$2.current;
return (ReactCurrentDispatcher$2.current = ContextOnlyDispatcher, null === prevDispatcher) ? ContextOnlyDispatcher : prevDispatcher; return (ReactCurrentDispatcher$2.current = ContextOnlyDispatcher, null === prevDispatcher) ? ContextOnlyDispatcher : prevDispatcher;
} }
function popDispatcher(prevDispatcher) {
ReactCurrentDispatcher$2.current = prevDispatcher;
}
function pushInteractions(root) { function pushInteractions(root) {
var prevInteractions = __interactionsRef.current; var prevInteractions = __interactionsRef.current;
return __interactionsRef.current = root.memoizedInteractions, prevInteractions; return __interactionsRef.current = root.memoizedInteractions, prevInteractions;
@ -7986,7 +7948,7 @@
} catch (thrownValue) { } catch (thrownValue) {
handleError(root, thrownValue); handleError(root, thrownValue);
} }
if (resetContextDependencies(), popInteractions(prevInteractions), executionContext = prevExecutionContext, popDispatcher(prevDispatcher), null !== workInProgress) throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."); if (resetContextDependencies(), popInteractions(prevInteractions), executionContext = prevExecutionContext, ReactCurrentDispatcher$2.current = prevDispatcher, null !== workInProgress) throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
return workInProgressRoot = null, workInProgressRootRenderLanes = 0, workInProgressRootExitStatus; return workInProgressRoot = null, workInProgressRootRenderLanes = 0, workInProgressRootExitStatus;
} }
function performUnitOfWork(unitOfWork) { function performUnitOfWork(unitOfWork) {
@ -8034,12 +7996,12 @@
case 5: case 5:
return popHostContext(workInProgress), null; return popHostContext(workInProgress), null;
case 13: case 13:
popSuspenseContext(workInProgress); pop(suspenseStackCursor, workInProgress);
var _flags2 = workInProgress.flags; var _flags2 = workInProgress.flags;
if (4096 & _flags2) return workInProgress.flags = -4097 & _flags2 | 64, (8 & workInProgress.mode) != 0 && transferActualDuration(workInProgress), workInProgress; if (4096 & _flags2) return workInProgress.flags = -4097 & _flags2 | 64, (8 & workInProgress.mode) != 0 && transferActualDuration(workInProgress), workInProgress;
return null; return null;
case 19: case 19:
return popSuspenseContext(workInProgress), null; return pop(suspenseStackCursor, workInProgress), null;
case 4: case 4:
return popHostContainer(workInProgress), null; return popHostContainer(workInProgress), null;
case 10: case 10:
@ -8091,10 +8053,10 @@
entanglements[index] = 0, eventTimes[index] = -1, expirationTimes[index] = -1, lanes &= ~lane; entanglements[index] = 0, eventTimes[index] = -1, expirationTimes[index] = -1, lanes &= ~lane;
} }
}(root, remainingLanes), null !== rootsWithPendingDiscreteUpdates && !((24 & remainingLanes) != 0) && rootsWithPendingDiscreteUpdates.has(root) && rootsWithPendingDiscreteUpdates.delete(root), root === workInProgressRoot && (workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0), finishedWork.flags > 1 ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect, null !== firstEffect) { }(root, remainingLanes), null !== rootsWithPendingDiscreteUpdates && !((24 & remainingLanes) != 0) && rootsWithPendingDiscreteUpdates.has(root) && rootsWithPendingDiscreteUpdates.delete(root), root === workInProgressRoot && (workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0), finishedWork.flags > 1 ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect, null !== firstEffect) {
var input, selection, containerInfo, focusedElem, containerInfo1, prevExecutionContext = executionContext; var containerInfo, focusedElem, input, selection, containerInfo1, prevExecutionContext = executionContext;
executionContext |= 32; executionContext |= 32;
var prevInteractions = pushInteractions(root); var prevInteractions = pushInteractions(root);
ReactCurrentOwner$2.current = null, root.containerInfo, eventsEnabled = _enabled, selectionInformation = { ReactCurrentOwner$2.current = null, containerInfo = root.containerInfo, eventsEnabled = _enabled, selectionInformation = {
focusedElem: focusedElem = getActiveElementDeep(), focusedElem: focusedElem = getActiveElementDeep(),
selectionRange: hasSelectionCapabilities(focusedElem) ? ("selectionStart" in (input = focusedElem) ? { selectionRange: hasSelectionCapabilities(focusedElem) ? ("selectionStart" in (input = focusedElem) ? {
start: input.selectionStart, start: input.selectionStart,
@ -8128,19 +8090,19 @@
start: 0, start: 0,
end: 0 end: 0
} : null } : null
}, setEnabled(!1), focusedInstanceHandle = null, shouldFireAfterActiveInstanceBlur = !1, nextEffect = firstEffect; }, _enabled = !1, focusedInstanceHandle = null, shouldFireAfterActiveInstanceBlur = !1, nextEffect = firstEffect;
do if (invokeGuardedCallback(null, commitBeforeMutationEffects, null), hasError) { do if (invokeGuardedCallback(null, commitBeforeMutationEffects, null), hasError) {
if (!(null !== nextEffect)) throw Error("Should be working on an effect."); if (!(null !== nextEffect)) throw Error("Should be working on an effect.");
captureCommitPhaseError(nextEffect, clearCaughtError()), nextEffect = nextEffect.nextEffect; captureCommitPhaseError(nextEffect, clearCaughtError()), nextEffect = nextEffect.nextEffect;
} }
while (null !== nextEffect) while (null !== nextEffect)
focusedInstanceHandle = null, recordCommitTime(), nextEffect = firstEffect; focusedInstanceHandle = null, commitTime = unstable_now(), nextEffect = firstEffect;
do if (invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel), hasError) { do if (invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel), hasError) {
if (!(null !== nextEffect)) throw Error("Should be working on an effect."); if (!(null !== nextEffect)) throw Error("Should be working on an effect.");
captureCommitPhaseError(nextEffect, clearCaughtError()), nextEffect = nextEffect.nextEffect; captureCommitPhaseError(nextEffect, clearCaughtError()), nextEffect = nextEffect.nextEffect;
} }
while (null !== nextEffect) while (null !== nextEffect)
root.containerInfo, function(priorSelectionInformation) { containerInfo1 = root.containerInfo, function(priorSelectionInformation) {
var curFocusedElem = getActiveElementDeep(), priorFocusedElem = priorSelectionInformation.focusedElem, priorSelectionRange = priorSelectionInformation.selectionRange; var curFocusedElem = getActiveElementDeep(), priorFocusedElem = priorSelectionInformation.focusedElem, priorSelectionRange = priorSelectionInformation.selectionRange;
if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && function containsNode(outerNode, innerNode) { if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && function containsNode(outerNode, innerNode) {
if (!outerNode || !innerNode) return !1; if (!outerNode || !innerNode) return !1;
@ -8178,14 +8140,14 @@
info.element.scrollLeft = info.left, info.element.scrollTop = info.top; info.element.scrollLeft = info.left, info.element.scrollTop = info.top;
} }
} }
}(selectionInformation), setEnabled(eventsEnabled), eventsEnabled = null, selectionInformation = null, root.current = finishedWork, nextEffect = firstEffect; }(selectionInformation), _enabled = !!eventsEnabled, eventsEnabled = null, selectionInformation = null, root.current = finishedWork, nextEffect = firstEffect;
do if (invokeGuardedCallback(null, commitLayoutEffects, null, root, lanes), hasError) { do if (invokeGuardedCallback(null, commitLayoutEffects, null, root, lanes), hasError) {
if (!(null !== nextEffect)) throw Error("Should be working on an effect."); if (!(null !== nextEffect)) throw Error("Should be working on an effect.");
captureCommitPhaseError(nextEffect, clearCaughtError()), nextEffect = nextEffect.nextEffect; captureCommitPhaseError(nextEffect, clearCaughtError()), nextEffect = nextEffect.nextEffect;
} }
while (null !== nextEffect) while (null !== nextEffect)
nextEffect = null, requestPaint(), popInteractions(prevInteractions), executionContext = prevExecutionContext; nextEffect = null, requestPaint(), popInteractions(prevInteractions), executionContext = prevExecutionContext;
} else root.current = finishedWork, recordCommitTime(); } else root.current = finishedWork, commitTime = unstable_now();
var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
if (rootDoesHavePassiveEffects) rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = root, pendingPassiveEffectsLanes = lanes, pendingPassiveEffectsRenderPriority = renderPriorityLevel; if (rootDoesHavePassiveEffects) rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = root, pendingPassiveEffectsLanes = lanes, pendingPassiveEffectsRenderPriority = renderPriorityLevel;
else for(nextEffect = firstEffect; null !== nextEffect;){ else for(nextEffect = firstEffect; null !== nextEffect;){
@ -8263,7 +8225,7 @@
for(; null !== nextEffect;){ for(; null !== nextEffect;){
setCurrentFiber(nextEffect); setCurrentFiber(nextEffect);
var flags = nextEffect.flags; var flags = nextEffect.flags;
if (16 & flags && resetTextContent(nextEffect.stateNode), 128 & flags) { if (16 & flags && setTextContent(nextEffect.stateNode, ""), 128 & flags) {
var current = nextEffect.alternate; var current = nextEffect.alternate;
null !== current && function(current) { null !== current && function(current) {
var currentRef = current.ref; var currentRef = current.ref;
@ -8505,7 +8467,7 @@
var pingCache = root.pingCache; var pingCache = root.pingCache;
null !== pingCache && pingCache.delete(wakeable); null !== pingCache && pingCache.delete(wakeable);
var eventTime = requestEventTime(); var eventTime = requestEventTime();
markRootPinged(root, pingedLanes), workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes) && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < 500 ? prepareFreshStack(root, 0) : workInProgressRootPingedLanes = workInProgressRootPingedLanes | pingedLanes), ensureRootIsScheduled(root, eventTime), schedulePendingInteractions(root, pingedLanes); markRootPinged(root, pingedLanes), workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < 500 ? prepareFreshStack(root, 0) : workInProgressRootPingedLanes = workInProgressRootPingedLanes | pingedLanes), ensureRootIsScheduled(root, eventTime), schedulePendingInteractions(root, pingedLanes);
} }
function resolveRetryWakeable(boundaryFiber, wakeable) { function resolveRetryWakeable(boundaryFiber, wakeable) {
var retryCache, retryLane, eventTime, root, lane, mode; var retryCache, retryLane, eventTime, root, lane, mode;
@ -9082,7 +9044,7 @@
"function" == typeof arguments[0] && error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."); "function" == typeof arguments[0] && error("unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect().");
var root = this._internalRoot, container = root.containerInfo; var root = this._internalRoot, container = root.containerInfo;
updateContainer(null, root, null, function() { updateContainer(null, root, null, function() {
unmarkContainerAsRoot(container); container[internalContainerInstanceKey] = null;
}); });
}; };
var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner, warnedAboutHydrateAPI = !1; var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner, warnedAboutHydrateAPI = !1;
@ -9296,17 +9258,17 @@
}(componentOrElement, "findDOMNode"); }(componentOrElement, "findDOMNode");
}, exports1.flushSync = flushSync, exports1.hydrate = function(element, container, callback) { }, exports1.flushSync = flushSync, exports1.hydrate = function(element, container, callback) {
if (!isValidContainer(container)) throw Error("Target container is not a DOM element."); if (!isValidContainer(container)) throw Error("Target container is not a DOM element.");
return isContainerMarkedAsRoot(container) && void 0 === container._reactRootContainer && error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?"), legacyRenderSubtreeIntoContainer(null, element, container, !0, callback); return container[internalContainerInstanceKey] && void 0 === container._reactRootContainer && error("You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?"), legacyRenderSubtreeIntoContainer(null, element, container, !0, callback);
}, exports1.render = function(element, container, callback) { }, exports1.render = function(element, container, callback) {
if (!isValidContainer(container)) throw Error("Target container is not a DOM element."); if (!isValidContainer(container)) throw Error("Target container is not a DOM element.");
return isContainerMarkedAsRoot(container) && void 0 === container._reactRootContainer && error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?"), legacyRenderSubtreeIntoContainer(null, element, container, !1, callback); return container[internalContainerInstanceKey] && void 0 === container._reactRootContainer && error("You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?"), legacyRenderSubtreeIntoContainer(null, element, container, !1, callback);
}, exports1.unmountComponentAtNode = function(container) { }, exports1.unmountComponentAtNode = function(container) {
if (!isValidContainer(container)) throw Error("unmountComponentAtNode(...): Target container is not a DOM element."); if (!isValidContainer(container)) throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
if (isContainerMarkedAsRoot(container) && void 0 === container._reactRootContainer && error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?"), container._reactRootContainer) { if (container[internalContainerInstanceKey] && void 0 === container._reactRootContainer && error("You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?"), container._reactRootContainer) {
var rootEl = getReactRootElementInContainer(container); var rootEl = getReactRootElementInContainer(container);
return rootEl && !getInstanceFromNode(rootEl) && error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."), unbatchedUpdates(function() { return rootEl && !getInstanceFromNode(rootEl) && error("unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React."), unbatchedUpdates(function() {
legacyRenderSubtreeIntoContainer(null, null, container, !1, function() { legacyRenderSubtreeIntoContainer(null, null, container, !1, function() {
container._reactRootContainer = null, unmarkContainerAsRoot(container); container._reactRootContainer = null, container[internalContainerInstanceKey] = null;
}); });
}), !0; }), !0;
} }

View File

@ -1,4 +1,5 @@
console.log(function n(o) { var a;
var r; function g(n) {
return x((r = o, y(n(r)))); return y(x(g(n)));
}(c)); }
console.log((a = c, x(g(a))));

View File

@ -1,5 +1,3 @@
console.log( console.log(function g() {
(function g() { return g.caller.arguments;
return g.caller.arguments; }().length);
})().length
);

View File

@ -1,4 +1,4 @@
for (var x, i = 2; --i >= 0; ) { for(var x, i = 2; --i >= 0;){
var y = x; var y = x;
x = f; x = f;
console.log(x === y); console.log(x === y);