From f8358fbe2bf17de6a04870c58f58768d0966ec18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 29 Sep 2022 19:11:18 +0900 Subject: [PATCH] fix(es/minifier): Remove wrong variable joiner pass (#5992) **Description:** We had two passes for joining variables. This PR removes one in the full optimizer, which is wrong. **Related issue:** - Closes https://github.com/swc-project/swc/issues/5989. --- ...ImportNotAsPrimaryExpression.2.minified.js | 4 +- ...lassExtendsItselfIndirectly2.2.minified.js | 10 +- .../exportsAndImports1-amd.2.minified.js | 10 +- .../exportsAndImports3-amd.2.minified.js | 14 +- ...uleWithStatementsOfEveryKind.2.minified.js | 4 +- .../parserRealSource14.2.minified.js | 12 +- .../parserRealSource2.2.minified.js | 4 +- .../react-instantsearch/2/output/index.js | 126 +- .../src/compress/optimize/mod.rs | 80 +- crates/swc_ecma_minifier/src/lib.rs | 4 +- crates/swc_ecma_minifier/src/util/mod.rs | 1 + .../tests/benches-full/d3.js | 14 +- .../tests/benches-full/echarts.js | 294 +- .../tests/benches-full/jquery.js | 8 +- .../tests/benches-full/lodash.js | 8 +- .../tests/benches-full/moment.js | 12 +- .../tests/benches-full/react.js | 2 +- .../tests/benches-full/terser.js | 8 +- .../tests/benches-full/three.js | 8 +- .../tests/benches-full/victory.js | 72 +- .../tests/benches-full/vue.js | 159 +- .../tests/fixture/issues/2257/full/output.js | 16 +- .../fixture/issues/emotion/react/1/output.js | 16 +- .../fixture/issues/firebase-core/1/output.js | 20 +- .../tests/fixture/issues/moment/1/output.js | 4 +- .../fixture/issues/quagga2/1.4.2/1/output.js | 22 +- .../fixture/issues/react-countup/1/output.js | 20 +- .../issues/react-instancesearch/004/output.js | 4 +- .../fixture/issues/typescript/1/output.js | 4 +- .../1606726a.10299989c08cb523/output.js | 2 +- .../d6e1aeb5-38a8d7ae57119c23/output.js | 34 +- .../pages/index-cb36c1bf7f830e3c/output.js | 10 +- .../pages/index-1bd068cedc2b5af3/output.js | 22 +- .../tests/fixture/next/chakra/output.js | 12 +- .../next/feedback-2/codemirror/output.js | 48 +- .../pages/_app-72ad41192608e93a/output.js | 8 +- .../8a28b14e.d8fbda268ed281a1/output.js | 10 +- .../fixture/next/react-pdf-renderer/output.js | 624 +- .../framework-798bab57daac3897/output.js | 14 +- .../next/styled-components/1/output.js | 10 +- .../syncfusion/933-e9f9a6bf671b96fc/output.js | 62 +- .../fixture/next/target-es2015/config.json | 5 + .../chunks/main-04b5934c26266542/input.js | 5286 +++++++++++++++++ .../chunks/main-04b5934c26266542/output.js | 3254 ++++++++++ .../fixture/next/wrap-contracts/output.js | 4 +- .../chunks/hoofd.module.6c5395cb/output.js | 2 +- .../2c796e83-0724e2af5f19128a/output.js | 2 +- .../785-e1932cc99ac3bb67/output.js | 2 +- .../full/issue-5912-bigdecimal/output.js | 2 +- .../projects/output/jquery.mobile-1.4.2.js | 2 +- .../tests/projects/output/mootools-1.4.5.js | 4 +- .../tests/projects/output/react-17.0.1.js | 2 +- .../tests/projects/output/react-dom-17.0.2.js | 96 +- .../block_scope/do_not_hoist_let/output.js | 3 +- .../compress/hoist_vars/statements/output.js | 6 +- 55 files changed, 9480 insertions(+), 1006 deletions(-) create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/target-es2015/config.json create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/output.js diff --git a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression.2.minified.js b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression.2.minified.js index d8724540117..d1cae8b9615 100644 --- a/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression.2.minified.js +++ b/crates/swc/tests/tsc-references/amdImportNotAsPrimaryExpression.2.minified.js @@ -14,7 +14,7 @@ define([ }); }(exports, { E1: function() { - return E1; + return E11; }, C1: function() { return C1; @@ -24,7 +24,7 @@ define([ "use strict"; _classCallCheck(this, C1), this.m1 = 42; }; - C1.s1 = !0, (E11 = E1 || (E1 = {}))[E11.A = 0] = "A", E11[E11.B = 1] = "B", E11[E11.C = 2] = "C"; + C1.s1 = !0, (E1 = E11 || (E11 = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C"; }); //// [foo_1.ts] define([ diff --git a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js index f5538e77681..1bca648219f 100644 --- a/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js +++ b/crates/swc/tests/tsc-references/classExtendsItselfIndirectly2.2.minified.js @@ -34,7 +34,7 @@ var M, N, O, C = function(_E) { }(M.D); N.E = E; }(N || (N = {})), function(O) { - var P, Q, P1, D2, Q1, E2, C2 = function(_E2) { + var P, D2, Q, E2, P1, Q1, C2 = function(_E2) { "use strict"; _inherits(C2, _E2); var _super = _create_super(C2); @@ -42,8 +42,8 @@ var M, N, O, C = function(_E) { return _class_call_check(this, C2), _super.apply(this, arguments); } return C2; - }(Q.E2); - P1 = P || (P = {}), D2 = function(C2) { + }(Q1.E2); + P = P1 || (P1 = {}), D2 = function(C2) { "use strict"; _inherits(D2, C2); var _super = _create_super(D2); @@ -51,7 +51,7 @@ var M, N, O, C = function(_E) { return _class_call_check(this, D2), _super.apply(this, arguments); } return D2; - }(C2), P1.D2 = D2, Q1 = Q || (Q = {}), E2 = function(_D2) { + }(C2), P.D2 = D2, Q = Q1 || (Q1 = {}), E2 = function(_D2) { "use strict"; _inherits(E2, _D2); var _super = _create_super(E2); @@ -59,5 +59,5 @@ var M, N, O, C = function(_E) { return _class_call_check(this, E2), _super.apply(this, arguments); } return E2; - }(P.D2), Q1.E2 = E2; + }(P1.D2), Q.E2 = E2; }(O || (O = {})); diff --git a/crates/swc/tests/tsc-references/exportsAndImports1-amd.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports1-amd.2.minified.js index ca77bc363ac..d8dafb8b9a1 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports1-amd.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports1-amd.2.minified.js @@ -27,10 +27,10 @@ define([ return C; }, E: function() { - return E; + return E1; }, D: function() { - return D; + return D1; }, M: function() { return M; @@ -39,13 +39,13 @@ define([ return a; } }), _classCallCheck = _classCallCheck.default; - var E, D, M, v = 1; + var E, D, x, E1, D1, M, v = 1; function f() {} - var E1, D1, x, C = function C() { + var C = function C() { "use strict"; _classCallCheck(this, C); }; - (E1 = E || (E = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", (D1 = D || (D = {}))[D1.A = 0] = "A", D1[D1.B = 1] = "B", D1[D1.C = 2] = "C", (M || (M = {})).x = x; + (E = E1 || (E1 = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D1 || (D1 = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (M || (M = {})).x = x; var a = M.x; }); //// [t2.ts] diff --git a/crates/swc/tests/tsc-references/exportsAndImports3-amd.2.minified.js b/crates/swc/tests/tsc-references/exportsAndImports3-amd.2.minified.js index 76c195b9b47..1aa0cb8ee6c 100644 --- a/crates/swc/tests/tsc-references/exportsAndImports3-amd.2.minified.js +++ b/crates/swc/tests/tsc-references/exportsAndImports3-amd.2.minified.js @@ -18,10 +18,10 @@ define([ }); }(exports, { E: function() { - return E; + return E1; }, D: function() { - return D; + return D1; }, M: function() { return M; @@ -48,10 +48,10 @@ define([ return C; }, E1: function() { - return E; + return E1; }, D1: function() { - return D; + return D1; }, M1: function() { return M; @@ -60,13 +60,13 @@ define([ return a; } }), _classCallCheck = _classCallCheck.default; - var E, D, M, v = 1; + var E, D, x, E1, D1, M, v = 1; function f() {} - var E1, D1, x, C = function C() { + var C = function C() { "use strict"; _classCallCheck(this, C); }; - (E1 = E || (E = {}))[E1.A = 0] = "A", E1[E1.B = 1] = "B", E1[E1.C = 2] = "C", (D1 = D || (D = {}))[D1.A = 0] = "A", D1[D1.B = 1] = "B", D1[D1.C = 2] = "C", (M || (M = {})).x = x; + (E = E1 || (E1 = {}))[E.A = 0] = "A", E[E.B = 1] = "B", E[E.C = 2] = "C", (D = D1 || (D1 = {}))[D.A = 0] = "A", D[D.B = 1] = "B", D[D.C = 2] = "C", (M || (M = {})).x = x; var a = M.x; }); //// [t2.ts] diff --git a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js index 9b6dd451315..f31e9ce02b3 100644 --- a/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js +++ b/crates/swc/tests/tsc-references/moduleWithStatementsOfEveryKind.2.minified.js @@ -7,7 +7,7 @@ import _create_super from "@swc/helpers/src/_create_super.mjs"; var Module, Color, Color1; Module || (Module = {}), (Color1 = Color || (Color = {}))[Color1.Blue = 0] = "Blue", Color1[Color1.Red = 1] = "Red"; }(A || (A = {})), function(Y) { - var F = function(s) { + var Color, F = function(s) { return 2; }, A = function A() { "use strict"; @@ -29,7 +29,7 @@ import _create_super from "@swc/helpers/src/_create_super.mjs"; return B; }(AA); Y.B = B; - var Color, BB = function(A) { + var BB = function(A) { "use strict"; _inherits(BB, A); var _super = _create_super(BB); diff --git a/crates/swc/tests/tsc-references/parserRealSource14.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource14.2.minified.js index 76c89c62e80..37940ed9652 100644 --- a/crates/swc/tests/tsc-references/parserRealSource14.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource14.2.minified.js @@ -2,7 +2,7 @@ var TypeScript; import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; !function(TypeScript1) { - var GetAstPathOptions, lastOf = function(items) { + var GetAstPathOptions, GetAstPathOptions1, lastOf = function(items) { return null === items || 0 === items.length ? null : items[items.length - 1]; }, max = function(a, b) { return a >= b ? a : b; @@ -11,19 +11,19 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; }, isValidAstNode = function(ast) { return null !== ast && -1 !== ast.minChar && -1 !== ast.limChar; }, getAstPathToPosition = function(script, pos) { - var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : GetAstPathOptions.Default, lookInComments = function(comments) { + var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : GetAstPathOptions1.Default, lookInComments = function(comments) { if (comments && comments.length > 0) for(var i = 0; i < comments.length; i++){ var minChar = comments[i].minChar, limChar = comments[i].limChar; !comments[i].isBlockComment && limChar++, pos >= minChar && pos < limChar && ctx.path.push(comments[i]); } }, pre = function(cur, parent, walker) { if (isValidAstNode(cur)) { - var inclusive = hasFlag(options, GetAstPathOptions.EdgeInclusive) || cur.nodeType === TypeScript.NodeType.Name || pos === script.limChar, minChar = cur.minChar, limChar = cur.limChar + (inclusive ? 1 : 0); + var inclusive = hasFlag(options, GetAstPathOptions1.EdgeInclusive) || cur.nodeType === TypeScript.NodeType.Name || pos === script.limChar, minChar = cur.minChar, limChar = cur.limChar + (inclusive ? 1 : 0); if (pos >= minChar && pos < limChar) { var previous = ctx.path.ast(); (null == previous || cur.minChar >= previous.minChar && cur.limChar <= previous.limChar) && ctx.path.push(cur); } - pos < limChar && lookInComments(cur.preComments), pos >= minChar && lookInComments(cur.postComments), hasFlag(options, GetAstPathOptions.DontPruneSearchBasedOnPosition) || (walker.options.goChildren = minChar <= pos && pos <= limChar); + pos < limChar && lookInComments(cur.preComments), pos >= minChar && lookInComments(cur.postComments), hasFlag(options, GetAstPathOptions1.DontPruneSearchBasedOnPosition) || (walker.options.goChildren = minChar <= pos && pos <= limChar); } return cur; }, ctx = new AstPathContext(); @@ -185,9 +185,9 @@ import _class_call_check from "@swc/helpers/src/_class_call_check.mjs"; }, AstPath; }(); TypeScript1.AstPath = AstPath, TypeScript1.isValidAstNode = isValidAstNode; - var GetAstPathOptions1, AstPathContext = function AstPathContext() { + var AstPathContext = function AstPathContext() { "use strict"; _class_call_check(this, AstPathContext), this.path = new TypeScript.AstPath(); }; - TypeScript1.AstPathContext = AstPathContext, (GetAstPathOptions1 = GetAstPathOptions = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = {}))[GetAstPathOptions1.Default = 0] = "Default", GetAstPathOptions1[GetAstPathOptions1.EdgeInclusive = 1] = "EdgeInclusive", GetAstPathOptions1[GetAstPathOptions1.DontPruneSearchBasedOnPosition = 2] = "DontPruneSearchBasedOnPosition", TypeScript1.getAstPathToPosition = getAstPathToPosition, TypeScript1.getTokenizationOffset = getTokenizationOffset, TypeScript1.walkAST = walkAST; + TypeScript1.AstPathContext = AstPathContext, (GetAstPathOptions = GetAstPathOptions1 = TypeScript1.GetAstPathOptions || (TypeScript1.GetAstPathOptions = {}))[GetAstPathOptions.Default = 0] = "Default", GetAstPathOptions[GetAstPathOptions.EdgeInclusive = 1] = "EdgeInclusive", GetAstPathOptions[GetAstPathOptions.DontPruneSearchBasedOnPosition = 2] = "DontPruneSearchBasedOnPosition", TypeScript1.getAstPathToPosition = getAstPathToPosition, TypeScript1.getTokenizationOffset = getTokenizationOffset, TypeScript1.walkAST = walkAST; }(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/tsc-references/parserRealSource2.2.minified.js b/crates/swc/tests/tsc-references/parserRealSource2.2.minified.js index 7194cd2eebd..f80b589b335 100644 --- a/crates/swc/tests/tsc-references/parserRealSource2.2.minified.js +++ b/crates/swc/tests/tsc-references/parserRealSource2.2.minified.js @@ -1,7 +1,7 @@ //// [parserRealSource2.ts] var TypeScript; !function(TypeScript) { - var CodeGenTarget, ModuleGenTarget, ErrorRecoverySet, AllowedElements, Modifiers, ASTFlags, DeclFlags, ModuleFlags, SymbolFlags, VarFlags, FncFlags, SignatureFlags, TypeFlags, TypeRelationshipFlags, CodeGenTarget1, ModuleGenTarget1, hasFlag = function(val, flag) { + var ErrorRecoverySet, AllowedElements, Modifiers, ASTFlags, DeclFlags, ModuleFlags, SymbolFlags, VarFlags, FncFlags, SignatureFlags, TypeFlags, TypeRelationshipFlags, CodeGenTarget, ModuleGenTarget, CodeGenTarget1, ModuleGenTarget1, hasFlag = function(val, flag) { return (val & flag) != 0; }, ToDeclFlags = function(fncOrVarOrSymbolOrModuleFlags) { return fncOrVarOrSymbolOrModuleFlags; @@ -14,5 +14,5 @@ var TypeScript; } return builder; }; - TypeScript.hasFlag = hasFlag, (ErrorRecoverySet = TypeScript.ErrorRecoverySet || (TypeScript.ErrorRecoverySet = {}))[ErrorRecoverySet.None = 0] = "None", ErrorRecoverySet[ErrorRecoverySet.Comma = 1] = "Comma", ErrorRecoverySet[ErrorRecoverySet.SColon = 2] = "SColon", ErrorRecoverySet[ErrorRecoverySet.Asg = 4] = "Asg", ErrorRecoverySet[ErrorRecoverySet.BinOp = 8] = "BinOp", ErrorRecoverySet[ErrorRecoverySet.RBrack = 16] = "RBrack", ErrorRecoverySet[ErrorRecoverySet.RCurly = 32] = "RCurly", ErrorRecoverySet[ErrorRecoverySet.RParen = 64] = "RParen", ErrorRecoverySet[ErrorRecoverySet.Dot = 128] = "Dot", ErrorRecoverySet[ErrorRecoverySet.Colon = 256] = "Colon", ErrorRecoverySet[ErrorRecoverySet.PrimType = 512] = "PrimType", ErrorRecoverySet[ErrorRecoverySet.AddOp = 1024] = "AddOp", ErrorRecoverySet[ErrorRecoverySet.LCurly = 2048] = "LCurly", ErrorRecoverySet[ErrorRecoverySet.PreOp = 4096] = "PreOp", ErrorRecoverySet[ErrorRecoverySet.RegExp = 8192] = "RegExp", ErrorRecoverySet[ErrorRecoverySet.LParen = 16384] = "LParen", ErrorRecoverySet[ErrorRecoverySet.LBrack = 32768] = "LBrack", ErrorRecoverySet[ErrorRecoverySet.Scope = 65536] = "Scope", ErrorRecoverySet[ErrorRecoverySet.In = 131072] = "In", ErrorRecoverySet[ErrorRecoverySet.SCase = 262144] = "SCase", ErrorRecoverySet[ErrorRecoverySet.Else = 524288] = "Else", ErrorRecoverySet[ErrorRecoverySet.Catch = 1048576] = "Catch", ErrorRecoverySet[ErrorRecoverySet.Var = 2097152] = "Var", ErrorRecoverySet[ErrorRecoverySet.Stmt = 4194304] = "Stmt", ErrorRecoverySet[ErrorRecoverySet.While = 8388608] = "While", ErrorRecoverySet[ErrorRecoverySet.ID = 16777216] = "ID", ErrorRecoverySet[ErrorRecoverySet.Prefix = 33554432] = "Prefix", ErrorRecoverySet[ErrorRecoverySet.Literal = 67108864] = "Literal", ErrorRecoverySet[ErrorRecoverySet.RLit = 134217728] = "RLit", ErrorRecoverySet[ErrorRecoverySet.Func = 268435456] = "Func", ErrorRecoverySet[ErrorRecoverySet.EOF = 536870912] = "EOF", ErrorRecoverySet[ErrorRecoverySet.TypeScriptS = 1073741824] = "TypeScriptS", ErrorRecoverySet[ErrorRecoverySet.ExprStart = 520158210] = "ExprStart", ErrorRecoverySet[ErrorRecoverySet.StmtStart = 1608580098] = "StmtStart", ErrorRecoverySet[ErrorRecoverySet.Postfix = 49280] = "Postfix", (AllowedElements = TypeScript.AllowedElements || (TypeScript.AllowedElements = {}))[AllowedElements.None = 0] = "None", AllowedElements[AllowedElements.ModuleDeclarations = 4] = "ModuleDeclarations", AllowedElements[AllowedElements.ClassDeclarations = 8] = "ClassDeclarations", AllowedElements[AllowedElements.InterfaceDeclarations = 16] = "InterfaceDeclarations", AllowedElements[AllowedElements.AmbientDeclarations = 1024] = "AmbientDeclarations", AllowedElements[AllowedElements.Properties = 2048] = "Properties", AllowedElements[AllowedElements.Global = 1052] = "Global", AllowedElements[AllowedElements.QuickParse = 3100] = "QuickParse", (Modifiers = TypeScript.Modifiers || (TypeScript.Modifiers = {}))[Modifiers.None = 0] = "None", Modifiers[Modifiers.Private = 1] = "Private", Modifiers[Modifiers.Public = 2] = "Public", Modifiers[Modifiers.Readonly = 4] = "Readonly", Modifiers[Modifiers.Ambient = 8] = "Ambient", Modifiers[Modifiers.Exported = 16] = "Exported", Modifiers[Modifiers.Getter = 32] = "Getter", Modifiers[Modifiers.Setter = 64] = "Setter", Modifiers[Modifiers.Static = 128] = "Static", (ASTFlags = TypeScript.ASTFlags || (TypeScript.ASTFlags = {}))[ASTFlags.None = 0] = "None", ASTFlags[ASTFlags.ExplicitSemicolon = 1] = "ExplicitSemicolon", ASTFlags[ASTFlags.AutomaticSemicolon = 2] = "AutomaticSemicolon", ASTFlags[ASTFlags.Writeable = 4] = "Writeable", ASTFlags[ASTFlags.Error = 8] = "Error", ASTFlags[ASTFlags.DotLHSPartial = 16] = "DotLHSPartial", ASTFlags[ASTFlags.DotLHS = 32] = "DotLHS", ASTFlags[ASTFlags.IsStatement = 64] = "IsStatement", ASTFlags[ASTFlags.StrictMode = 128] = "StrictMode", ASTFlags[ASTFlags.PossibleOptionalParameter = 256] = "PossibleOptionalParameter", ASTFlags[ASTFlags.ClassBaseConstructorCall = 512] = "ClassBaseConstructorCall", ASTFlags[ASTFlags.OptionalName = 1024] = "OptionalName", ASTFlags[ASTFlags.SkipNextRParen = 2048] = "SkipNextRParen", (DeclFlags = TypeScript.DeclFlags || (TypeScript.DeclFlags = {}))[DeclFlags.None = 0] = "None", DeclFlags[DeclFlags.Exported = 1] = "Exported", DeclFlags[DeclFlags.Private = 2] = "Private", DeclFlags[DeclFlags.Public = 4] = "Public", DeclFlags[DeclFlags.Ambient = 8] = "Ambient", DeclFlags[DeclFlags.Static = 16] = "Static", DeclFlags[DeclFlags.LocalStatic = 32] = "LocalStatic", DeclFlags[DeclFlags.GetAccessor = 64] = "GetAccessor", DeclFlags[DeclFlags.SetAccessor = 128] = "SetAccessor", (ModuleFlags = TypeScript.ModuleFlags || (TypeScript.ModuleFlags = {}))[ModuleFlags.None = 0] = "None", ModuleFlags[ModuleFlags.Exported = 1] = "Exported", ModuleFlags[ModuleFlags.Private = 2] = "Private", ModuleFlags[ModuleFlags.Public = 4] = "Public", ModuleFlags[ModuleFlags.Ambient = 8] = "Ambient", ModuleFlags[ModuleFlags.Static = 16] = "Static", ModuleFlags[ModuleFlags.LocalStatic = 32] = "LocalStatic", ModuleFlags[ModuleFlags.GetAccessor = 64] = "GetAccessor", ModuleFlags[ModuleFlags.SetAccessor = 128] = "SetAccessor", ModuleFlags[ModuleFlags.IsEnum = 256] = "IsEnum", ModuleFlags[ModuleFlags.ShouldEmitModuleDecl = 512] = "ShouldEmitModuleDecl", ModuleFlags[ModuleFlags.IsWholeFile = 1024] = "IsWholeFile", ModuleFlags[ModuleFlags.IsDynamic = 2048] = "IsDynamic", ModuleFlags[ModuleFlags.MustCaptureThis = 4096] = "MustCaptureThis", (SymbolFlags = TypeScript.SymbolFlags || (TypeScript.SymbolFlags = {}))[SymbolFlags.None = 0] = "None", SymbolFlags[SymbolFlags.Exported = 1] = "Exported", SymbolFlags[SymbolFlags.Private = 2] = "Private", SymbolFlags[SymbolFlags.Public = 4] = "Public", SymbolFlags[SymbolFlags.Ambient = 8] = "Ambient", SymbolFlags[SymbolFlags.Static = 16] = "Static", SymbolFlags[SymbolFlags.LocalStatic = 32] = "LocalStatic", SymbolFlags[SymbolFlags.GetAccessor = 64] = "GetAccessor", SymbolFlags[SymbolFlags.SetAccessor = 128] = "SetAccessor", SymbolFlags[SymbolFlags.Property = 256] = "Property", SymbolFlags[SymbolFlags.Readonly = 512] = "Readonly", SymbolFlags[SymbolFlags.ModuleMember = 1024] = "ModuleMember", SymbolFlags[SymbolFlags.InterfaceMember = 2048] = "InterfaceMember", SymbolFlags[SymbolFlags.ClassMember = 4096] = "ClassMember", SymbolFlags[SymbolFlags.BuiltIn = 8192] = "BuiltIn", SymbolFlags[SymbolFlags.TypeSetDuringScopeAssignment = 16384] = "TypeSetDuringScopeAssignment", SymbolFlags[SymbolFlags.Constant = 32768] = "Constant", SymbolFlags[SymbolFlags.Optional = 65536] = "Optional", SymbolFlags[SymbolFlags.RecursivelyReferenced = 131072] = "RecursivelyReferenced", SymbolFlags[SymbolFlags.Bound = 262144] = "Bound", SymbolFlags[SymbolFlags.CompilerGenerated = 524288] = "CompilerGenerated", (VarFlags = TypeScript.VarFlags || (TypeScript.VarFlags = {}))[VarFlags.None = 0] = "None", VarFlags[VarFlags.Exported = 1] = "Exported", VarFlags[VarFlags.Private = 2] = "Private", VarFlags[VarFlags.Public = 4] = "Public", VarFlags[VarFlags.Ambient = 8] = "Ambient", VarFlags[VarFlags.Static = 16] = "Static", VarFlags[VarFlags.LocalStatic = 32] = "LocalStatic", VarFlags[VarFlags.GetAccessor = 64] = "GetAccessor", VarFlags[VarFlags.SetAccessor = 128] = "SetAccessor", VarFlags[VarFlags.AutoInit = 256] = "AutoInit", VarFlags[VarFlags.Property = 512] = "Property", VarFlags[VarFlags.Readonly = 1024] = "Readonly", VarFlags[VarFlags.Class = 2048] = "Class", VarFlags[VarFlags.ClassProperty = 4096] = "ClassProperty", VarFlags[VarFlags.ClassBodyProperty = 8192] = "ClassBodyProperty", VarFlags[VarFlags.ClassConstructorProperty = 16384] = "ClassConstructorProperty", VarFlags[VarFlags.ClassSuperMustBeFirstCallInConstructor = 32768] = "ClassSuperMustBeFirstCallInConstructor", VarFlags[VarFlags.Constant = 65536] = "Constant", VarFlags[VarFlags.MustCaptureThis = 131072] = "MustCaptureThis", (FncFlags = TypeScript.FncFlags || (TypeScript.FncFlags = {}))[FncFlags.None = 0] = "None", FncFlags[FncFlags.Exported = 1] = "Exported", FncFlags[FncFlags.Private = 2] = "Private", FncFlags[FncFlags.Public = 4] = "Public", FncFlags[FncFlags.Ambient = 8] = "Ambient", FncFlags[FncFlags.Static = 16] = "Static", FncFlags[FncFlags.LocalStatic = 32] = "LocalStatic", FncFlags[FncFlags.GetAccessor = 64] = "GetAccessor", FncFlags[FncFlags.SetAccessor = 128] = "SetAccessor", FncFlags[FncFlags.Definition = 256] = "Definition", FncFlags[FncFlags.Signature = 512] = "Signature", FncFlags[FncFlags.Method = 1024] = "Method", FncFlags[FncFlags.HasReturnExpression = 2048] = "HasReturnExpression", FncFlags[FncFlags.CallMember = 4096] = "CallMember", FncFlags[FncFlags.ConstructMember = 8192] = "ConstructMember", FncFlags[FncFlags.HasSelfReference = 16384] = "HasSelfReference", FncFlags[FncFlags.IsFatArrowFunction = 32768] = "IsFatArrowFunction", FncFlags[FncFlags.IndexerMember = 65536] = "IndexerMember", FncFlags[FncFlags.IsFunctionExpression = 131072] = "IsFunctionExpression", FncFlags[FncFlags.ClassMethod = 262144] = "ClassMethod", FncFlags[FncFlags.ClassPropertyMethodExported = 524288] = "ClassPropertyMethodExported", (SignatureFlags = TypeScript.SignatureFlags || (TypeScript.SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer", TypeScript.ToDeclFlags = ToDeclFlags, (TypeFlags = TypeScript.TypeFlags || (TypeScript.TypeFlags = {}))[TypeFlags.None = 0] = "None", TypeFlags[TypeFlags.HasImplementation = 1] = "HasImplementation", TypeFlags[TypeFlags.HasSelfReference = 2] = "HasSelfReference", TypeFlags[TypeFlags.MergeResult = 4] = "MergeResult", TypeFlags[TypeFlags.IsEnum = 8] = "IsEnum", TypeFlags[TypeFlags.BuildingName = 16] = "BuildingName", TypeFlags[TypeFlags.HasBaseType = 32] = "HasBaseType", TypeFlags[TypeFlags.HasBaseTypeOfObject = 64] = "HasBaseTypeOfObject", TypeFlags[TypeFlags.IsClass = 128] = "IsClass", (TypeRelationshipFlags = TypeScript.TypeRelationshipFlags || (TypeScript.TypeRelationshipFlags = {}))[TypeRelationshipFlags.SuccessfulComparison = 0] = "SuccessfulComparison", TypeRelationshipFlags[TypeRelationshipFlags.SourceIsNullTargetIsVoidOrUndefined = 1] = "SourceIsNullTargetIsVoidOrUndefined", TypeRelationshipFlags[TypeRelationshipFlags.RequiredPropertyIsMissing = 2] = "RequiredPropertyIsMissing", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleSignatures = 4] = "IncompatibleSignatures", TypeRelationshipFlags[TypeRelationshipFlags.SourceSignatureHasTooManyParameters = 3] = "SourceSignatureHasTooManyParameters", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleReturnTypes = 16] = "IncompatibleReturnTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatiblePropertyTypes = 32] = "IncompatiblePropertyTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleParameterTypes = 64] = "IncompatibleParameterTypes", (CodeGenTarget1 = CodeGenTarget = TypeScript.CodeGenTarget || (TypeScript.CodeGenTarget = {}))[CodeGenTarget1.ES3 = 0] = "ES3", CodeGenTarget1[CodeGenTarget1.ES5 = 1] = "ES5", (ModuleGenTarget1 = ModuleGenTarget = TypeScript.ModuleGenTarget || (TypeScript.ModuleGenTarget = {}))[ModuleGenTarget1.Synchronous = 0] = "Synchronous", ModuleGenTarget1[ModuleGenTarget1.Asynchronous = 1] = "Asynchronous", ModuleGenTarget1[ModuleGenTarget1.Local = 2] = "Local", TypeScript.codeGenTarget = CodeGenTarget.ES3, TypeScript.moduleGenTarget = ModuleGenTarget.Synchronous, TypeScript.optimizeModuleCodeGen = !0, TypeScript.flagsToString = flagsToString; + TypeScript.hasFlag = hasFlag, (ErrorRecoverySet = TypeScript.ErrorRecoverySet || (TypeScript.ErrorRecoverySet = {}))[ErrorRecoverySet.None = 0] = "None", ErrorRecoverySet[ErrorRecoverySet.Comma = 1] = "Comma", ErrorRecoverySet[ErrorRecoverySet.SColon = 2] = "SColon", ErrorRecoverySet[ErrorRecoverySet.Asg = 4] = "Asg", ErrorRecoverySet[ErrorRecoverySet.BinOp = 8] = "BinOp", ErrorRecoverySet[ErrorRecoverySet.RBrack = 16] = "RBrack", ErrorRecoverySet[ErrorRecoverySet.RCurly = 32] = "RCurly", ErrorRecoverySet[ErrorRecoverySet.RParen = 64] = "RParen", ErrorRecoverySet[ErrorRecoverySet.Dot = 128] = "Dot", ErrorRecoverySet[ErrorRecoverySet.Colon = 256] = "Colon", ErrorRecoverySet[ErrorRecoverySet.PrimType = 512] = "PrimType", ErrorRecoverySet[ErrorRecoverySet.AddOp = 1024] = "AddOp", ErrorRecoverySet[ErrorRecoverySet.LCurly = 2048] = "LCurly", ErrorRecoverySet[ErrorRecoverySet.PreOp = 4096] = "PreOp", ErrorRecoverySet[ErrorRecoverySet.RegExp = 8192] = "RegExp", ErrorRecoverySet[ErrorRecoverySet.LParen = 16384] = "LParen", ErrorRecoverySet[ErrorRecoverySet.LBrack = 32768] = "LBrack", ErrorRecoverySet[ErrorRecoverySet.Scope = 65536] = "Scope", ErrorRecoverySet[ErrorRecoverySet.In = 131072] = "In", ErrorRecoverySet[ErrorRecoverySet.SCase = 262144] = "SCase", ErrorRecoverySet[ErrorRecoverySet.Else = 524288] = "Else", ErrorRecoverySet[ErrorRecoverySet.Catch = 1048576] = "Catch", ErrorRecoverySet[ErrorRecoverySet.Var = 2097152] = "Var", ErrorRecoverySet[ErrorRecoverySet.Stmt = 4194304] = "Stmt", ErrorRecoverySet[ErrorRecoverySet.While = 8388608] = "While", ErrorRecoverySet[ErrorRecoverySet.ID = 16777216] = "ID", ErrorRecoverySet[ErrorRecoverySet.Prefix = 33554432] = "Prefix", ErrorRecoverySet[ErrorRecoverySet.Literal = 67108864] = "Literal", ErrorRecoverySet[ErrorRecoverySet.RLit = 134217728] = "RLit", ErrorRecoverySet[ErrorRecoverySet.Func = 268435456] = "Func", ErrorRecoverySet[ErrorRecoverySet.EOF = 536870912] = "EOF", ErrorRecoverySet[ErrorRecoverySet.TypeScriptS = 1073741824] = "TypeScriptS", ErrorRecoverySet[ErrorRecoverySet.ExprStart = 520158210] = "ExprStart", ErrorRecoverySet[ErrorRecoverySet.StmtStart = 1608580098] = "StmtStart", ErrorRecoverySet[ErrorRecoverySet.Postfix = 49280] = "Postfix", (AllowedElements = TypeScript.AllowedElements || (TypeScript.AllowedElements = {}))[AllowedElements.None = 0] = "None", AllowedElements[AllowedElements.ModuleDeclarations = 4] = "ModuleDeclarations", AllowedElements[AllowedElements.ClassDeclarations = 8] = "ClassDeclarations", AllowedElements[AllowedElements.InterfaceDeclarations = 16] = "InterfaceDeclarations", AllowedElements[AllowedElements.AmbientDeclarations = 1024] = "AmbientDeclarations", AllowedElements[AllowedElements.Properties = 2048] = "Properties", AllowedElements[AllowedElements.Global = 1052] = "Global", AllowedElements[AllowedElements.QuickParse = 3100] = "QuickParse", (Modifiers = TypeScript.Modifiers || (TypeScript.Modifiers = {}))[Modifiers.None = 0] = "None", Modifiers[Modifiers.Private = 1] = "Private", Modifiers[Modifiers.Public = 2] = "Public", Modifiers[Modifiers.Readonly = 4] = "Readonly", Modifiers[Modifiers.Ambient = 8] = "Ambient", Modifiers[Modifiers.Exported = 16] = "Exported", Modifiers[Modifiers.Getter = 32] = "Getter", Modifiers[Modifiers.Setter = 64] = "Setter", Modifiers[Modifiers.Static = 128] = "Static", (ASTFlags = TypeScript.ASTFlags || (TypeScript.ASTFlags = {}))[ASTFlags.None = 0] = "None", ASTFlags[ASTFlags.ExplicitSemicolon = 1] = "ExplicitSemicolon", ASTFlags[ASTFlags.AutomaticSemicolon = 2] = "AutomaticSemicolon", ASTFlags[ASTFlags.Writeable = 4] = "Writeable", ASTFlags[ASTFlags.Error = 8] = "Error", ASTFlags[ASTFlags.DotLHSPartial = 16] = "DotLHSPartial", ASTFlags[ASTFlags.DotLHS = 32] = "DotLHS", ASTFlags[ASTFlags.IsStatement = 64] = "IsStatement", ASTFlags[ASTFlags.StrictMode = 128] = "StrictMode", ASTFlags[ASTFlags.PossibleOptionalParameter = 256] = "PossibleOptionalParameter", ASTFlags[ASTFlags.ClassBaseConstructorCall = 512] = "ClassBaseConstructorCall", ASTFlags[ASTFlags.OptionalName = 1024] = "OptionalName", ASTFlags[ASTFlags.SkipNextRParen = 2048] = "SkipNextRParen", (DeclFlags = TypeScript.DeclFlags || (TypeScript.DeclFlags = {}))[DeclFlags.None = 0] = "None", DeclFlags[DeclFlags.Exported = 1] = "Exported", DeclFlags[DeclFlags.Private = 2] = "Private", DeclFlags[DeclFlags.Public = 4] = "Public", DeclFlags[DeclFlags.Ambient = 8] = "Ambient", DeclFlags[DeclFlags.Static = 16] = "Static", DeclFlags[DeclFlags.LocalStatic = 32] = "LocalStatic", DeclFlags[DeclFlags.GetAccessor = 64] = "GetAccessor", DeclFlags[DeclFlags.SetAccessor = 128] = "SetAccessor", (ModuleFlags = TypeScript.ModuleFlags || (TypeScript.ModuleFlags = {}))[ModuleFlags.None = 0] = "None", ModuleFlags[ModuleFlags.Exported = 1] = "Exported", ModuleFlags[ModuleFlags.Private = 2] = "Private", ModuleFlags[ModuleFlags.Public = 4] = "Public", ModuleFlags[ModuleFlags.Ambient = 8] = "Ambient", ModuleFlags[ModuleFlags.Static = 16] = "Static", ModuleFlags[ModuleFlags.LocalStatic = 32] = "LocalStatic", ModuleFlags[ModuleFlags.GetAccessor = 64] = "GetAccessor", ModuleFlags[ModuleFlags.SetAccessor = 128] = "SetAccessor", ModuleFlags[ModuleFlags.IsEnum = 256] = "IsEnum", ModuleFlags[ModuleFlags.ShouldEmitModuleDecl = 512] = "ShouldEmitModuleDecl", ModuleFlags[ModuleFlags.IsWholeFile = 1024] = "IsWholeFile", ModuleFlags[ModuleFlags.IsDynamic = 2048] = "IsDynamic", ModuleFlags[ModuleFlags.MustCaptureThis = 4096] = "MustCaptureThis", (SymbolFlags = TypeScript.SymbolFlags || (TypeScript.SymbolFlags = {}))[SymbolFlags.None = 0] = "None", SymbolFlags[SymbolFlags.Exported = 1] = "Exported", SymbolFlags[SymbolFlags.Private = 2] = "Private", SymbolFlags[SymbolFlags.Public = 4] = "Public", SymbolFlags[SymbolFlags.Ambient = 8] = "Ambient", SymbolFlags[SymbolFlags.Static = 16] = "Static", SymbolFlags[SymbolFlags.LocalStatic = 32] = "LocalStatic", SymbolFlags[SymbolFlags.GetAccessor = 64] = "GetAccessor", SymbolFlags[SymbolFlags.SetAccessor = 128] = "SetAccessor", SymbolFlags[SymbolFlags.Property = 256] = "Property", SymbolFlags[SymbolFlags.Readonly = 512] = "Readonly", SymbolFlags[SymbolFlags.ModuleMember = 1024] = "ModuleMember", SymbolFlags[SymbolFlags.InterfaceMember = 2048] = "InterfaceMember", SymbolFlags[SymbolFlags.ClassMember = 4096] = "ClassMember", SymbolFlags[SymbolFlags.BuiltIn = 8192] = "BuiltIn", SymbolFlags[SymbolFlags.TypeSetDuringScopeAssignment = 16384] = "TypeSetDuringScopeAssignment", SymbolFlags[SymbolFlags.Constant = 32768] = "Constant", SymbolFlags[SymbolFlags.Optional = 65536] = "Optional", SymbolFlags[SymbolFlags.RecursivelyReferenced = 131072] = "RecursivelyReferenced", SymbolFlags[SymbolFlags.Bound = 262144] = "Bound", SymbolFlags[SymbolFlags.CompilerGenerated = 524288] = "CompilerGenerated", (VarFlags = TypeScript.VarFlags || (TypeScript.VarFlags = {}))[VarFlags.None = 0] = "None", VarFlags[VarFlags.Exported = 1] = "Exported", VarFlags[VarFlags.Private = 2] = "Private", VarFlags[VarFlags.Public = 4] = "Public", VarFlags[VarFlags.Ambient = 8] = "Ambient", VarFlags[VarFlags.Static = 16] = "Static", VarFlags[VarFlags.LocalStatic = 32] = "LocalStatic", VarFlags[VarFlags.GetAccessor = 64] = "GetAccessor", VarFlags[VarFlags.SetAccessor = 128] = "SetAccessor", VarFlags[VarFlags.AutoInit = 256] = "AutoInit", VarFlags[VarFlags.Property = 512] = "Property", VarFlags[VarFlags.Readonly = 1024] = "Readonly", VarFlags[VarFlags.Class = 2048] = "Class", VarFlags[VarFlags.ClassProperty = 4096] = "ClassProperty", VarFlags[VarFlags.ClassBodyProperty = 8192] = "ClassBodyProperty", VarFlags[VarFlags.ClassConstructorProperty = 16384] = "ClassConstructorProperty", VarFlags[VarFlags.ClassSuperMustBeFirstCallInConstructor = 32768] = "ClassSuperMustBeFirstCallInConstructor", VarFlags[VarFlags.Constant = 65536] = "Constant", VarFlags[VarFlags.MustCaptureThis = 131072] = "MustCaptureThis", (FncFlags = TypeScript.FncFlags || (TypeScript.FncFlags = {}))[FncFlags.None = 0] = "None", FncFlags[FncFlags.Exported = 1] = "Exported", FncFlags[FncFlags.Private = 2] = "Private", FncFlags[FncFlags.Public = 4] = "Public", FncFlags[FncFlags.Ambient = 8] = "Ambient", FncFlags[FncFlags.Static = 16] = "Static", FncFlags[FncFlags.LocalStatic = 32] = "LocalStatic", FncFlags[FncFlags.GetAccessor = 64] = "GetAccessor", FncFlags[FncFlags.SetAccessor = 128] = "SetAccessor", FncFlags[FncFlags.Definition = 256] = "Definition", FncFlags[FncFlags.Signature = 512] = "Signature", FncFlags[FncFlags.Method = 1024] = "Method", FncFlags[FncFlags.HasReturnExpression = 2048] = "HasReturnExpression", FncFlags[FncFlags.CallMember = 4096] = "CallMember", FncFlags[FncFlags.ConstructMember = 8192] = "ConstructMember", FncFlags[FncFlags.HasSelfReference = 16384] = "HasSelfReference", FncFlags[FncFlags.IsFatArrowFunction = 32768] = "IsFatArrowFunction", FncFlags[FncFlags.IndexerMember = 65536] = "IndexerMember", FncFlags[FncFlags.IsFunctionExpression = 131072] = "IsFunctionExpression", FncFlags[FncFlags.ClassMethod = 262144] = "ClassMethod", FncFlags[FncFlags.ClassPropertyMethodExported = 524288] = "ClassPropertyMethodExported", (SignatureFlags = TypeScript.SignatureFlags || (TypeScript.SignatureFlags = {}))[SignatureFlags.None = 0] = "None", SignatureFlags[SignatureFlags.IsIndexer = 1] = "IsIndexer", SignatureFlags[SignatureFlags.IsStringIndexer = 2] = "IsStringIndexer", SignatureFlags[SignatureFlags.IsNumberIndexer = 4] = "IsNumberIndexer", TypeScript.ToDeclFlags = ToDeclFlags, (TypeFlags = TypeScript.TypeFlags || (TypeScript.TypeFlags = {}))[TypeFlags.None = 0] = "None", TypeFlags[TypeFlags.HasImplementation = 1] = "HasImplementation", TypeFlags[TypeFlags.HasSelfReference = 2] = "HasSelfReference", TypeFlags[TypeFlags.MergeResult = 4] = "MergeResult", TypeFlags[TypeFlags.IsEnum = 8] = "IsEnum", TypeFlags[TypeFlags.BuildingName = 16] = "BuildingName", TypeFlags[TypeFlags.HasBaseType = 32] = "HasBaseType", TypeFlags[TypeFlags.HasBaseTypeOfObject = 64] = "HasBaseTypeOfObject", TypeFlags[TypeFlags.IsClass = 128] = "IsClass", (TypeRelationshipFlags = TypeScript.TypeRelationshipFlags || (TypeScript.TypeRelationshipFlags = {}))[TypeRelationshipFlags.SuccessfulComparison = 0] = "SuccessfulComparison", TypeRelationshipFlags[TypeRelationshipFlags.SourceIsNullTargetIsVoidOrUndefined = 1] = "SourceIsNullTargetIsVoidOrUndefined", TypeRelationshipFlags[TypeRelationshipFlags.RequiredPropertyIsMissing = 2] = "RequiredPropertyIsMissing", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleSignatures = 4] = "IncompatibleSignatures", TypeRelationshipFlags[TypeRelationshipFlags.SourceSignatureHasTooManyParameters = 3] = "SourceSignatureHasTooManyParameters", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleReturnTypes = 16] = "IncompatibleReturnTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatiblePropertyTypes = 32] = "IncompatiblePropertyTypes", TypeRelationshipFlags[TypeRelationshipFlags.IncompatibleParameterTypes = 64] = "IncompatibleParameterTypes", (CodeGenTarget = CodeGenTarget1 = TypeScript.CodeGenTarget || (TypeScript.CodeGenTarget = {}))[CodeGenTarget.ES3 = 0] = "ES3", CodeGenTarget[CodeGenTarget.ES5 = 1] = "ES5", (ModuleGenTarget = ModuleGenTarget1 = TypeScript.ModuleGenTarget || (TypeScript.ModuleGenTarget = {}))[ModuleGenTarget.Synchronous = 0] = "Synchronous", ModuleGenTarget[ModuleGenTarget.Asynchronous = 1] = "Asynchronous", ModuleGenTarget[ModuleGenTarget.Local = 2] = "Local", TypeScript.codeGenTarget = CodeGenTarget1.ES3, TypeScript.moduleGenTarget = ModuleGenTarget1.Synchronous, TypeScript.optimizeModuleCodeGen = !0, TypeScript.flagsToString = flagsToString; }(TypeScript || (TypeScript = {})); diff --git a/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js b/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js index 3671007c18d..64afe7a1290 100644 --- a/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js +++ b/crates/swc/tests/vercel/full/react-instantsearch/2/output/index.js @@ -28,19 +28,19 @@ var f = function(e) { return r && !a ? -1 : !r && a ? 1 : 0; }; export default function S(u) { - var o = u.indexName, l = u.initialState, S = u.searchClient, v = u.resultsState, x = u.stalledSearchDelay, y = function() { + var o, l, S, v, x, y = u.indexName, w = u.initialState, F = u.searchClient, _ = u.resultsState, V = u.stalledSearchDelay, I = function() { U = !0; - }, w = function(e) { - d(e), W.setClient(e), I(); - }, F = function() { - W.clearCache(), I(); - }, _ = function(e) { + }, j = function(e) { + d(e), k.setClient(e), R(); + }, b = function() { + k.clearCache(), R(); + }, A = function(e) { return G.getWidgets().filter(function(e) { return Boolean(e.getMetadata); }).map(function(t) { return t.getMetadata(e); }); - }, V = function() { + }, P = function() { var a = G.getWidgets().filter(function(e) { return Boolean(e.getSearchParameters); }).filter(function(e) { @@ -50,14 +50,14 @@ export default function S(u) { }, z), n = G.getWidgets().filter(function(e) { return Boolean(e.getSearchParameters); }).filter(function(e) { - var t = f(e) && m(e, o), r = p(e) && g(e, o); + var t = f(e) && m(e, y), r = p(e) && g(e, y); return t || r; }).sort(h).reduce(function(e, t) { return t.getSearchParameters(e); }, a), s = G.getWidgets().filter(function(e) { return Boolean(e.getSearchParameters); }).filter(function(e) { - var t = f(e) && !m(e, o), r = p(e) && !g(e, o); + var t = f(e) && !m(e, y), r = p(e) && !g(e, y); return t || r; }).sort(h).reduce(function(a, n) { var s = f(n) ? n.props.indexContextValue.targetedIndex : n.props.indexId, c = a[s] || []; @@ -74,27 +74,27 @@ export default function S(u) { mainParameters: n, derivedParameters: c }; - }, I = function() { + }, R = function() { if (!U) { - var e = V(W.state), t = e.mainParameters, r = e.derivedParameters; - W.derivedHelpers.slice().forEach(function(e) { + var e = P(k.state), t = e.mainParameters, r = e.derivedParameters; + k.derivedHelpers.slice().forEach(function(e) { e.detach(); }), r.forEach(function(e) { var t = e.indexId, r = e.parameters; - W.derive(function() { + k.derive(function() { return r; - }).on("result", j({ + }).on("result", C({ indexId: t - })).on("error", b); - }), W.setState(t), W.search(); + })).on("error", N); + }), k.setState(t), k.search(); } - }, j = function(n) { + }, C = function(n) { var s = n.indexId; return function(n) { - var c = K.getState(), i = !W.derivedHelpers.length, u = c.results ? c.results : {}; + var c = K.getState(), i = !k.derivedHelpers.length, u = c.results ? c.results : {}; u = !i && u.getFacetByName ? {} : u, u = i ? n.results : r(t({}, u), e({}, s, n.results)); var o = K.getState(), l = o.isSearchStalled; - W.hasPendingRequests() || (clearTimeout(D), D = null, l = !1), o.resultsFacetValues; + k.hasPendingRequests() || (clearTimeout(D), D = null, l = !1), o.resultsFacetValues; var d = a(o, [ "resultsFacetValues" ]); @@ -105,9 +105,9 @@ export default function S(u) { error: null })); }; - }, b = function(e) { + }, N = function(e) { var n = e.error, s = K.getState(), c = s.isSearchStalled; - W.hasPendingRequests() || (clearTimeout(D), c = !1), s.resultsFacetValues; + k.hasPendingRequests() || (clearTimeout(D), c = !1), s.resultsFacetValues; var i = a(s, [ "resultsFacetValues" ]); @@ -116,7 +116,7 @@ export default function S(u) { error: n, searching: !1 })); - }, A = function() { + }, O = function() { if (!D) { var e; D = setTimeout(function() { @@ -126,9 +126,9 @@ export default function S(u) { K.setState(r(t({}, n), { isSearchStalled: !0 })); - }, x); + }, V); } - }, P = function(a, n) { + }, q = function(a, n) { if (a.transporter) { a.transporter.responsesCache.set({ method: "search", @@ -164,7 +164,7 @@ export default function S(u) { return e.concat(t.rawResults); }, []) }))); - }, R = function(a, n) { + }, B = function(a, n) { if (a.transporter) { a.transporter.responsesCache.set({ method: "search", @@ -192,31 +192,31 @@ export default function S(u) { a.cache = r(t({}, a.cache), e({}, s, JSON.stringify({ results: n.rawResults }))); - }, C = function() { - var e = _(K.getState().widgets); + }, H = function() { + var e = A(K.getState().widgets); K.setState(r(t({}, K.getState()), { metadata: e, searching: !0 - })), I(); - }, N = function(e) { + })), R(); + }, W = function(e) { var t = K.getState().widgets; return G.getWidgets().filter(function(e) { return Boolean(e.transitionState); }).reduce(function(e, r) { return r.transitionState(t, e); }, e); - }, O = function(e) { - var a = _(e); + }, M = function(e) { + var a = A(e); K.setState(r(t({}, K.getState()), { widgets: e, metadata: a, searching: !0 - })), I(); - }, q = function(a) { + })), R(); + }, J = function(a) { var n = a.facetName, s = a.query, c = a.maxFacetHits; K.setState(r(t({}, K.getState()), { searchingForFacetValues: !0 - })), W.searchForFacetValues(n, s, Math.max(1, Math.min(void 0 === c ? 10 : c, 100))).then(function(a) { + })), k.searchForFacetValues(n, s, Math.max(1, Math.min(void 0 === c ? 10 : c, 100))).then(function(a) { var c; K.setState(r(t({}, K.getState()), { error: null, @@ -233,17 +233,17 @@ export default function S(u) { throw e; }); }); - }, B = function(e) { + }, E = function(e) { z = z.setIndex(e); - }, H = function() { + }, T = function() { return K.getState().metadata.reduce(function(e, t) { return void 0 !== t.id ? e.concat(t.id) : e; }, []); - }, W = s(S, o, t({}, i)); - d(S), W.on("search", A).on("result", j({ - indexId: o - })).on("error", b); - var M, J, E, T, k, U = !1, D = null, z = W.state, G = c(C); + }, k = s(F, y, t({}, i)); + d(F), k.on("search", O).on("result", C({ + indexId: y + })).on("error", N); + var U = !1, D = null, z = k.state, G = c(H); !function(e, a) { if (a && (e.transporter && !e._cacheHydrated || e._useCache && "function" == typeof e.addAlgoliaAgent)) { if (e.transporter && !e._cacheHydrated) { @@ -279,15 +279,15 @@ export default function S(u) { }; } if (Array.isArray(a.results)) { - P(e, a.results); + q(e, a.results); return; } - R(e, a); + B(e, a); } - }(S, v); - var K = (E = J = { - widgets: void 0 === l ? {} : l, - metadata: (k = v, k ? k.metadata.map(function(e) { + }(F, _); + var K = (v = S = { + widgets: void 0 === w ? {} : w, + metadata: (o = _, o ? o.metadata.map(function(e) { return r(t({ value: function() { return {}; @@ -310,39 +310,39 @@ export default function S(u) { }) }); }) : []), - results: v ? Array.isArray(v.results) ? v.results.reduce(function(a, n) { + results: _ ? Array.isArray(_.results) ? _.results.reduce(function(a, n) { return r(t({}, a), e({}, n._internalIndexId, new s.SearchResults(new s.SearchParameters(n.state), n.rawResults))); - }, {}) : new s.SearchResults(new s.SearchParameters(v.state), v.rawResults) : null, + }, {}) : new s.SearchResults(new s.SearchParameters(_.state), _.rawResults) : null, error: null, searching: !1, isSearchStalled: !0, searchingForFacetValues: !1 - }, T = [], { + }, x = [], { getState: function() { - return E; + return v; }, setState: function(e) { - E = e, T.forEach(function(e) { + v = e, x.forEach(function(e) { return e(); }); }, subscribe: function(e) { - return T.push(e), function() { - T.splice(T.indexOf(e), 1); + return x.push(e), function() { + x.splice(x.indexOf(e), 1); }; } }); return { store: K, widgetsManager: G, - getWidgetsIds: H, - getSearchParameters: V, - onSearchForFacetValues: q, - onExternalStateUpdate: O, - transitionState: N, - updateClient: w, - updateIndex: B, - clearCache: F, - skipSearch: y + getWidgetsIds: T, + getSearchParameters: P, + onSearchForFacetValues: J, + onExternalStateUpdate: M, + transitionState: W, + updateClient: j, + updateIndex: E, + clearCache: b, + skipSearch: I }; } diff --git a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs index 547ce4435e0..cde23daf17e 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs @@ -34,8 +34,7 @@ use crate::{ mode::Mode, option::CompressOptions, util::{ - contains_eval, contains_leaping_continue_with_label, contains_leaping_yield, make_number, - ExprOptExt, ModuleItemExt, + contains_eval, contains_leaping_continue_with_label, make_number, ExprOptExt, ModuleItemExt, }, }; @@ -1154,81 +1153,6 @@ where Some(e.take()) } - fn merge_var_decls(&mut self, stmts: &mut Vec) { - if !self.options.join_vars && !self.options.hoist_vars { - return; - } - if self.ctx.in_asm { - return; - } - - // Merge var declarations fully, if possible. - if stmts.windows(2).any(|stmts| match (&stmts[0], &stmts[1]) { - (Stmt::Decl(Decl::Var(a)), Stmt::Decl(Decl::Var(b))) => { - a.kind == b.kind && !contains_leaping_yield(a) && !contains_leaping_yield(b) - } - _ => false, - }) { - self.changed = true; - - report_change!("Merging variable declarations"); - dump_change_detail!( - "[Before]: {}", - dump( - &BlockStmt { - span: DUMMY_SP, - stmts: stmts.clone() - }, - false - ) - ); - - let orig = take(stmts); - let mut new = Vec::with_capacity(orig.len()); - - let mut var_decl: Option> = None; - - for stmt in orig { - match stmt { - Stmt::Decl(Decl::Var(below)) => { - // - match var_decl.take() { - Some(mut upper) if upper.kind == below.kind => { - upper.decls.extend(below.decls); - var_decl = Some(upper); - } - d => { - new.extend(d.map(Decl::Var).map(Stmt::Decl)); - var_decl = Some(below); - } - } - } - _ => { - // If it's not a var decl, - - new.extend(var_decl.take().map(Decl::Var).map(Stmt::Decl)); - new.push(stmt); - } - } - } - - new.extend(var_decl.take().map(Decl::Var).map(Stmt::Decl)); - - dump_change_detail!( - "[Change] merged: {}", - dump( - &BlockStmt { - span: DUMMY_SP, - stmts: new.clone() - }, - false - ) - ); - - *stmts = new - } - } - fn try_removing_block(&mut self, s: &mut Stmt, unwrap_more: bool, allow_fn_decl: bool) { match s { Stmt::Block(bs) => { @@ -2527,8 +2451,6 @@ where self.with_ctx(ctx).handle_stmt_likes(stmts); - self.with_ctx(ctx).merge_var_decls(stmts); - drop_invalid_stmts(stmts); if stmts.len() == 1 { diff --git a/crates/swc_ecma_minifier/src/lib.rs b/crates/swc_ecma_minifier/src/lib.rs index 78354612a9e..4a701ceaa87 100644 --- a/crates/swc_ecma_minifier/src/lib.rs +++ b/crates/swc_ecma_minifier/src/lib.rs @@ -279,13 +279,13 @@ fn perform_dce(m: &mut Program, options: &CompressOptions, extra: &ExtraOptions) loop { #[cfg(feature = "debug")] - let start = crate::debug::dump(&m, false); + let start = crate::debug::dump(&*m, false); m.visit_mut_with(&mut visitor); #[cfg(feature = "debug")] if visitor.changed() { - let src = crate::debug::dump(&m, false); + let src = crate::debug::dump(&*m, false); tracing::debug!( "===== Before DCE =====\n{}\n===== After DCE =====\n{}", start, diff --git a/crates/swc_ecma_minifier/src/util/mod.rs b/crates/swc_ecma_minifier/src/util/mod.rs index 2a23fed60bd..982ced64585 100644 --- a/crates/swc_ecma_minifier/src/util/mod.rs +++ b/crates/swc_ecma_minifier/src/util/mod.rs @@ -200,6 +200,7 @@ where v.found_continue_with_label } +#[allow(unused)] pub(crate) fn contains_leaping_yield(n: &N) -> bool where N: VisitWith, diff --git a/crates/swc_ecma_minifier/tests/benches-full/d3.js b/crates/swc_ecma_minifier/tests/benches-full/d3.js index 8518b9a6b9c..65bcb4382aa 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/d3.js +++ b/crates/swc_ecma_minifier/tests/benches-full/d3.js @@ -259,7 +259,8 @@ } } function maxIndex(values, valueof) { - let max, maxIndex = -1, index = -1; + let max; + let maxIndex = -1, index = -1; if (void 0 === valueof) for (const value of values)++index, null != value && (max < value || void 0 === max && value >= value) && (max = value, maxIndex = index); else for (let value1 of values)null != (value1 = valueof(value1, ++index, values)) && (max < value1 || void 0 === max && value1 >= value1) && (max = value1, maxIndex = index); return maxIndex; @@ -270,7 +271,8 @@ }(arrays)); } function minIndex(values, valueof) { - let min, minIndex = -1, index = -1; + let min; + let minIndex = -1, index = -1; if (void 0 === valueof) for (const value of values)++index, null != value && (min > value || void 0 === min && value >= value) && (min = value, minIndex = index); else for (let value1 of values)null != (value1 = valueof(value1, ++index, values)) && (min > value1 || void 0 === min && value1 >= value1) && (min = value1, minIndex = index); return minIndex; @@ -3648,7 +3650,7 @@ } _clipFinite(i, points) { const n = points.length; - let e0, e1, x0, y0, c0, P = null, x1 = points[n - 2], y1 = points[n - 1], c1 = this._regioncode(x1, y1); + let P = null, e0, e1, x0, y0, x1 = points[n - 2], y1 = points[n - 1], c0, c1 = this._regioncode(x1, y1); for(let j = 0; j < n; j += 2)if (x0 = x1, y0 = y1, x1 = points[j], y1 = points[j + 1], c0 = c1, c1 = this._regioncode(x1, y1), 0 === c0 && 0 === c1) e0 = e1, e1 = 0, P ? P.push(x1, y1) : P = [ x1, y1 @@ -10024,7 +10026,8 @@ }, exports1.geoTransverseMercatorRaw = transverseMercatorRaw, exports1.gray = function(l, opacity) { return new Lab(l, 0, 0, null == opacity ? 1 : opacity); }, exports1.greatest = function(values, compare = ascending) { - let max, defined = !1; + let max; + let defined = !1; if (1 === compare.length) { let maxValue; for (const element of values){ @@ -10103,7 +10106,8 @@ }, exports1.lab = lab, exports1.lch = function(l, c, h, opacity) { return 1 === arguments.length ? hclConvert(l) : new Hcl(h, c, l, null == opacity ? 1 : opacity); }, exports1.least = function(values, compare = ascending) { - let min, defined = !1; + let min; + let defined = !1; if (1 === compare.length) { let minValue; for (const element of values){ diff --git a/crates/swc_ecma_minifier/tests/benches-full/echarts.js b/crates/swc_ecma_minifier/tests/benches-full/echarts.js index 7fcf34cb4e4..e3e09ffeaf5 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/echarts.js +++ b/crates/swc_ecma_minifier/tests/benches-full/echarts.js @@ -4,7 +4,7 @@ ], factory) : factory((global1 = 'undefined' != typeof globalThis ? globalThis : global1 || self).echarts = {}); }(this, function(exports1) { 'use strict'; - var mainType, creator, _ctx, _cachedFont, requestAnimationFrame, reCreateSeriesIndices, assertSeriesInitialized, initBase, _a, _b, _c, providerMethods, mountMethods, seriesType, nodeParsers, prepare, prepareView, updateDirectly, updateMethods, doConvertPixel, updateStreamModes, doDispatchAction, flushPendingActions, triggerUpdatedEvent, bindRenderedEvent, bindMouseEvent, clearColorPalette, render, renderComponents, renderSeries, performPostUpdateFuncs, createExtensionAPI, enableConnect, setTransitionOpt, markStatusToUpdate, applyChangedStates, defaultDimValueGetters, prepareInvertedIndex, getIndicesCtor, prepareStorage, getRawIndexWithoutIndices, getRawIndexWithIndices, getId, getIdNameFromStore, makeIdFromName, normalizeDimensions, validateDimensions, cloneListForMapAndSample, getInitialExtent, setItemDataAndSeriesIndex, transferProperties, checkNonStyleTansitionRefer, checkTransformPropRefer, extendStatics = function(d, b) { + var ua, env, browser, firefox, ie, edge, weChat, style, mouseHandlerNames, pointerEventNameMap, pointerHandlerNames, ShapeClass, ShapeClass1, ShapeClass2, ShapeClass3, ShapeClass4, ShapeClass5, ShapeClass6, ShapeClass7, ShapeClass8, ShapeClass9, target, classAttr, target1, subTypeDefaulters, loadingFx, theme, theme1, _super, mainType, creator, _ctx, _cachedFont, requestAnimationFrame, reCreateSeriesIndices, assertSeriesInitialized, initBase, _a, _b, _c, providerMethods, mountMethods, seriesType, nodeParsers, prepare, prepareView, updateDirectly, updateMethods, doConvertPixel, updateStreamModes, doDispatchAction, flushPendingActions, triggerUpdatedEvent, bindRenderedEvent, bindMouseEvent, clearColorPalette, render, renderComponents, renderSeries, performPostUpdateFuncs, createExtensionAPI, enableConnect, setTransitionOpt, markStatusToUpdate, applyChangedStates, defaultDimValueGetters, prepareInvertedIndex, getIndicesCtor, prepareStorage, getRawIndexWithoutIndices, getRawIndexWithIndices, getId, getIdNameFromStore, makeIdFromName, normalizeDimensions, validateDimensions, cloneListForMapAndSample, getInitialExtent, setItemDataAndSeriesIndex, transferProperties, checkNonStyleTansitionRefer, checkTransformPropRefer, extendStatics = function(d, b) { return (extendStatics = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -30,7 +30,7 @@ for(var r = Array(s), k = 0, i = 0; i < il; i++)for(var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)r[k] = a[j]; return r; } - var ua, env, browser, firefox, ie, edge, weChat, style, Browser = function() { + var Browser = function() { this.firefox = !1, this.ie = !1, this.edge = !1, this.newEdge = !1, this.weChat = !1; }, env1 = new function() { this.browser = new Browser(), this.node = !1, this.wxa = !1, this.worker = !1, this.canvasSupported = !1, this.svgSupported = !1, this.touchEventsSupported = !1, this.pointerEventsSupported = !1, this.domSupported = !1, this.transformSupported = !1, this.transform3dSupported = !1; @@ -878,23 +878,23 @@ var proxy = this.proxy; proxy.setCursor && proxy.setCursor(cursorStyle); }, Handler.prototype.dispatchToElement = function(targetInfo, eventName, event) { - var el = (targetInfo = targetInfo || {}).target; + var eveType, targetInfo1, event1, el = (targetInfo = targetInfo || {}).target; if (!el || !el.silent) { - for(var eveType, targetInfo1, event1, eventKey = 'on' + eventName, eventPacket = (targetInfo1 = targetInfo, { - type: eventName, - event: event, + for(var eventKey = 'on' + eventName, eventPacket = (eveType = eventName, targetInfo1 = targetInfo, event1 = event, { + type: eveType, + event: event1, target: targetInfo1.target, topTarget: targetInfo1.topTarget, cancelBubble: !1, - offsetX: event.zrX, - offsetY: event.zrY, - gestureEvent: event.gestureEvent, - pinchX: event.pinchX, - pinchY: event.pinchY, - pinchScale: event.pinchScale, - wheelDelta: event.zrDelta, - zrByTouch: event.zrByTouch, - which: event.which, + offsetX: event1.zrX, + offsetY: event1.zrY, + gestureEvent: event1.gestureEvent, + pinchX: event1.pinchX, + pinchY: event1.pinchY, + pinchScale: event1.pinchScale, + wheelDelta: event1.zrDelta, + zrByTouch: event1.zrByTouch, + which: event1.which, stop: stopEvent }); el && (el[eventKey] && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket)), el.trigger(eventName, eventPacket), el = el.__hostTarget ? el.__hostTarget : el.parent, !eventPacket.cancelBubble);); !eventPacket.cancelBubble && (this.trigger(eventName, eventPacket), this.painter && this.painter.eachOtherLayer && this.painter.eachOtherLayer(function(layer) { @@ -3540,7 +3540,7 @@ requestAnimationFrame = 'undefined' != typeof window && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) { return setTimeout(func, 16); }; - var mouseHandlerNames, pointerEventNameMap, pointerHandlerNames, Animation = function(_super) { + var Animation = function(_super) { function Animation(opts) { var _this = _super.call(this) || this; return _this._running = !1, _this._time = 0, _this._pausedTime = 0, _this._pauseStart = 0, _this._paused = !1, opts = opts || {}, _this.stage = opts.stage || {}, _this.onframe = opts.onframe || function() {}, _this; @@ -4184,9 +4184,9 @@ return !isObject(dataItem) || isArray(dataItem) || dataItem instanceof Date ? dataItem : dataItem.value; } function mappingToExists(existings, newCmptOptions, mode) { - var isNormalMergeMode = 'normalMerge' === mode, isReplaceMergeMode = 'replaceMerge' === mode; + var result, existings1, existingIdIdxMap, newCmptOptions1, result1, newCmptOptions2, result2, newCmptOptions3, brandNew, result3, newCmptOptions4, mapResult, idMap, isNormalMergeMode = 'normalMerge' === mode, isReplaceMergeMode = 'replaceMerge' === mode; existings = existings || [], newCmptOptions = (newCmptOptions || []).slice(); - var existingIdIdxMap = createHashMap(); + var existingIdIdxMap1 = createHashMap(); each(newCmptOptions, function(cmptOption, index) { if (!isObject(cmptOption)) { newCmptOptions[index] = null; @@ -4194,7 +4194,7 @@ } null == cmptOption.id || isValidIdOrName(cmptOption.id) || warnInvalidateIdOrName(cmptOption.id), null == cmptOption.name || isValidIdOrName(cmptOption.name) || warnInvalidateIdOrName(cmptOption.name); }); - var result, existings1, existingIdIdxMap1, newCmptOptions1, result1, newCmptOptions2, result2, newCmptOptions3, brandNew, result3, newCmptOptions4, mapResult, idMap, result4 = function(existings, existingIdIdxMap, mode) { + var result4 = function(existings, existingIdIdxMap, mode) { var result = []; if ('replaceAll' === mode) return result; for(var index = 0; index < existings.length; index++){ @@ -4207,10 +4207,10 @@ }); } return result; - }(existings, existingIdIdxMap, mode); - return (isNormalMergeMode || isReplaceMergeMode) && (result = result4, existings1 = existings, existingIdIdxMap1 = existingIdIdxMap, newCmptOptions1 = newCmptOptions, each(newCmptOptions1, function(cmptOption, index) { + }(existings, existingIdIdxMap1, mode); + return (isNormalMergeMode || isReplaceMergeMode) && (result = result4, existings1 = existings, existingIdIdxMap = existingIdIdxMap1, newCmptOptions1 = newCmptOptions, each(newCmptOptions1, function(cmptOption, index) { if (cmptOption && null != cmptOption.id) { - var optionId = makeComparableKey(cmptOption.id), existingIdx = existingIdIdxMap1.get(optionId); + var optionId = makeComparableKey(cmptOption.id), existingIdx = existingIdIdxMap.get(optionId); if (null != existingIdx) { var resultItem = result[existingIdx]; assert(!resultItem.newOption, 'Duplicated option on id "' + optionId + '".'), resultItem.newOption = cmptOption, resultItem.existing = existings1[existingIdx], newCmptOptions1[index] = null; @@ -4435,7 +4435,7 @@ var componentFullType = clz.type || clz.prototype.type; if (componentFullType) { componentType = componentFullType, assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal'), clz.prototype.type = componentFullType; - var componentType, componentTypeInfo, container, componentTypeInfo1 = parseClassType(componentFullType); + var componentTypeInfo, container, componentType, componentTypeInfo1 = parseClassType(componentFullType); componentTypeInfo1.sub ? componentTypeInfo1.sub !== IS_CONTAINER && ((componentTypeInfo = componentTypeInfo1, container = storage[componentTypeInfo.main], container && container[IS_CONTAINER] || ((container = storage[componentTypeInfo.main] = {})[IS_CONTAINER] = !0), container)[componentTypeInfo1.sub] = clz) : (storage[componentTypeInfo1.main] && console.warn(componentTypeInfo1.main + ' exists.'), storage[componentTypeInfo1.main] = clz); } return clz; @@ -5611,9 +5611,9 @@ return __extends(ZRImage, _super), ZRImage.prototype.createStyle = function(obj) { return createObject(DEFAULT_IMAGE_STYLE, obj); }, ZRImage.prototype._getSize = function(dim) { - var style = this.style, size = style[dim]; + var source, style = this.style, size = style[dim]; if (null != size) return size; - var source, imageSource = (source = style.image) && 'string' != typeof source && source.width && source.height ? style.image : this.__image; + var imageSource = (source = style.image) && 'string' != typeof source && source.width && source.height ? style.image : this.__image; if (!imageSource) return 0; var otherDim = 'width' === dim ? 'height' : 'width', otherDimSize = style[otherDim]; return null == otherDimSize ? imageSource[dim] : imageSource[dim] / imageSource[otherDim] * otherDimSize; @@ -6994,11 +6994,11 @@ } } function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { - var x1, y1, x2, y2, val, mx = a2x - a1x, my = a2y - a1y, nx = b2x - b1x, ny = b2y - b1y, nmCrossProduct = (x1 = nx, y1 = ny, x2 = mx, y2 = my, x1 * y2 - x2 * y1); + var x1, y1, x2, y2, val, x11, y11, x21, y21, x12, y12, x22, y22, mx = a2x - a1x, my = a2y - a1y, nx = b2x - b1x, ny = b2y - b1y, nmCrossProduct = (x1 = nx, y1 = ny, x2 = mx, y2 = my, x1 * y2 - x2 * y1); if (val = nmCrossProduct, val <= 1e-6 && val >= -0.000001) return !1; - var x11, y11, x21, y21, b1a1x = a1x - b1x, b1a1y = a1y - b1y, q = (x11 = b1a1x, y11 = b1a1y, x21 = mx, y21 = my, (x11 * y21 - x21 * y11) / nmCrossProduct); + var b1a1x = a1x - b1x, b1a1y = a1y - b1y, q = (x11 = b1a1x, y11 = b1a1y, x21 = mx, y21 = my, (x11 * y21 - x21 * y11) / nmCrossProduct); if (q < 0 || q > 1) return !1; - var x12, y12, x22, y22, p = (x12 = b1a1x, y12 = b1a1y, x22 = nx, y22 = ny, (x12 * y22 - x22 * y12) / nmCrossProduct); + var p = (x12 = b1a1x, y12 = b1a1y, x22 = nx, y22 = ny, (x12 * y22 - x22 * y12) / nmCrossProduct); return !(p < 0) && !(p > 1); } function setTooltipConfig(opt) { @@ -7025,7 +7025,7 @@ }, itemTooltipOptionObj) }; } - ShapeClass = Circle, _customShapeMap.circle = ShapeClass, ShapeClass1 = Ellipse, _customShapeMap.ellipse = ShapeClass1, ShapeClass2 = Sector, _customShapeMap.sector = ShapeClass2, ShapeClass3 = Ring, _customShapeMap.ring = ShapeClass3, ShapeClass4 = Polygon, _customShapeMap.polygon = ShapeClass4, ShapeClass5 = Polyline, _customShapeMap.polyline = ShapeClass5, ShapeClass6 = Rect, _customShapeMap.rect = ShapeClass6, ShapeClass7 = Line, _customShapeMap.line = ShapeClass7, ShapeClass8 = BezierCurve, _customShapeMap.bezierCurve = ShapeClass8, ShapeClass9 = Arc, _customShapeMap.arc = ShapeClass9; + _customShapeMap.circle = Circle, _customShapeMap.ellipse = Ellipse, _customShapeMap.sector = Sector, _customShapeMap.ring = Ring, _customShapeMap.polygon = Polygon, _customShapeMap.polyline = Polyline, _customShapeMap.rect = Rect, _customShapeMap.line = Line, _customShapeMap.bezierCurve = BezierCurve, _customShapeMap.arc = Arc; var graphic = Object.freeze({ __proto__: null, extendShape: extendShape, @@ -7273,7 +7273,7 @@ }); } } - var ShapeClass, ShapeClass1, ShapeClass2, ShapeClass3, ShapeClass4, ShapeClass5, ShapeClass6, ShapeClass7, ShapeClass8, ShapeClass9, target, classAttr, PATH_COLOR = [ + var PATH_COLOR = [ 'textStyle', 'color' ], tmpRichText = new ZRText(), TextStyleMixin = function() { @@ -8140,7 +8140,7 @@ }), target; } curry(boxLayout, 'vertical'), curry(boxLayout, 'horizontal'); - var target1, subTypeDefaulters, inner = makeInner(), ComponentModel = function(_super) { + var inner = makeInner(), ComponentModel = function(_super) { var proto; function ComponentModel(option, parentModel, ecModel) { var _this = _super.call(this, option, parentModel, ecModel) || this; @@ -10607,7 +10607,7 @@ '#ff8a45', '#8d48e3', '#dd79ff' - ], theme = { + ], theme2 = { darkMode: !0, color: colorPalette, backgroundColor: backgroundColor, @@ -10759,7 +10759,7 @@ } } }; - theme.categoryAxis.splitLine.show = !1; + theme2.categoryAxis.splitLine.show = !1; var ECEventProcessor = function() { function ECEventProcessor() {} return ECEventProcessor.prototype.normalizeQuery = function(query) { @@ -11698,7 +11698,7 @@ }, !0); } function brush(ctx, el, scope, isLast) { - var ctx1, el1, prevEl, forceSetAll, scope1, m = el.transform; + var style, hasFill, hasStroke, m0, m1, ctx1, el1, prevEl, forceSetAll, scope1, m = el.transform; if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, !1, !1)) { el.__dirty &= ~Element.REDARAW_BIT, el.__isRendered = !1; return; @@ -11715,9 +11715,9 @@ return; } el.beforeBrush && el.beforeBrush(), el.innerBeforeBrush(); - var style, hasFill, hasStroke, prevEl1 = scope.prevEl; + var prevEl1 = scope.prevEl; prevEl1 || (forceSetStyle = forceSetTransform = !0); - var m0, m1, canBatchPath = el instanceof Path && el.autoBatch && (hasFill = styleHasFill(style = el.style), hasStroke = styleHasStroke(style), !(style.lineDash || !(+hasFill ^ +hasStroke) || hasFill && 'string' != typeof style.fill || hasStroke && 'string' != typeof style.stroke || style.strokePercent < 1 || style.strokeOpacity < 1 || style.fillOpacity < 1)); + var canBatchPath = el instanceof Path && el.autoBatch && (hasFill = styleHasFill(style = el.style), hasStroke = styleHasStroke(style), !(style.lineDash || !(+hasFill ^ +hasStroke) || hasFill && 'string' != typeof style.fill || hasStroke && 'string' != typeof style.stroke || style.strokePercent < 1 || style.strokeOpacity < 1 || style.fillOpacity < 1)); !forceSetTransform && (m1 = prevEl1.transform, m && m1 ? m[0] === m1[0] && m[1] === m1[1] && m[2] === m1[2] && m[3] === m1[3] && m[4] === m1[4] && m[5] === m1[5] : m || m1 ? 0 : 1) ? canBatchPath || flushPathDrawn(ctx, scope) : (flushPathDrawn(ctx, scope), setContextTransform(ctx, el)); var style1 = getStyle(el, scope.inHover); el instanceof Path ? (1 !== scope.lastDrawType && (forceSetStyle = !0, scope.lastDrawType = 1), bindPathAndTextCommonStyle(ctx, el, prevEl1, forceSetStyle, scope), canBatchPath && (scope.batchFill || scope.batchStroke) || ctx.beginPath(), function(ctx, el, style, inBatch) { @@ -11821,7 +11821,7 @@ repeat: 'repeat' }; return function(pattern) { - for(var cacheKey, ctx, keys = [ + for(var dash, cacheKey, ctx, keys = [ dpr ], isValidKey = !0, i = 0; i < decalKeys.length; ++i){ var value = decalOpt[decalKeys[i]], valueType = typeof value; @@ -11836,7 +11836,7 @@ var cache = decalCache.get(cacheKey); cache && (isSVG ? pattern.svgElement = cache : pattern.image = cache); } - var dash, dashArrayX = function normalizeDashArrayX(dash) { + var dashArrayX = function normalizeDashArrayX(dash) { if (!dash || 0 === dash.length) return [ [ 0, @@ -13703,18 +13703,18 @@ clearStates(componentModel, componentView), componentView.render(componentModel, ecModel, api, payload), updateZ(componentModel, componentView), updateStates(componentModel, componentView); }); }, renderSeries = function(ecIns, ecModel, api, payload, dirtyMap) { - var scheduler = ecIns._scheduler, labelManager = ecIns._labelManager; + var ecIns1, ecModel1, storage, elCount, scheduler = ecIns._scheduler, labelManager = ecIns._labelManager; labelManager.clearLabels(); - var ecIns1, ecModel1, storage, elCount, unfinished = !1; + var unfinished = !1; ecModel.eachSeries(function(seriesModel) { - var chartView = ecIns._chartsMap[seriesModel.__viewId]; - chartView.__alive = !0; - var seriesModel1, chartView1, blendMode, renderTask = chartView.renderTask; - scheduler.updatePayload(renderTask, payload), clearStates(seriesModel, chartView), dirtyMap && dirtyMap.get(seriesModel.uid) && renderTask.dirty(), renderTask.perform(scheduler.getPerformArgs(renderTask)) && (unfinished = !0), seriesModel.__transientTransitionOpt = null, chartView.group.silent = !!seriesModel.get('silent'), seriesModel1 = seriesModel, chartView1 = chartView, blendMode = seriesModel1.get('blendMode') || null, !env1.canvasSupported && blendMode && 'source-over' !== blendMode && console.warn('Only canvas support blendMode'), chartView1.group.traverse(function(el) { + var seriesModel1, chartView, blendMode, chartView1 = ecIns._chartsMap[seriesModel.__viewId]; + chartView1.__alive = !0; + var renderTask = chartView1.renderTask; + scheduler.updatePayload(renderTask, payload), clearStates(seriesModel, chartView1), dirtyMap && dirtyMap.get(seriesModel.uid) && renderTask.dirty(), renderTask.perform(scheduler.getPerformArgs(renderTask)) && (unfinished = !0), seriesModel.__transientTransitionOpt = null, chartView1.group.silent = !!seriesModel.get('silent'), seriesModel1 = seriesModel, chartView = chartView1, blendMode = seriesModel1.get('blendMode') || null, !env1.canvasSupported && blendMode && 'source-over' !== blendMode && console.warn('Only canvas support blendMode'), chartView.group.traverse(function(el) { el.isGroup || (el.style.blend = blendMode), el.eachPendingDisplayable && el.eachPendingDisplayable(function(displayable) { displayable.style.blend = blendMode; }); - }), updateSeriesElementSelection(seriesModel), labelManager.addLabelsOfSeries(chartView); + }), updateSeriesElementSelection(seriesModel), labelManager.addLabelsOfSeries(chartView1); }), scheduler.unfinished = unfinished || scheduler.unfinished, labelManager.updateLayoutConfig(api), labelManager.layout(api), labelManager.processLabelsOverall(), ecModel.eachSeries(function(seriesModel) { var chartView = ecIns._chartsMap[seriesModel.__viewId]; updateZ(seriesModel, chartView), updateStates(seriesModel, chartView); @@ -13894,7 +13894,7 @@ function registerMap(mapName, geoJson, specialAreas) { geoSourceManager.registerMap(mapName, geoJson, specialAreas); } - var loadingFx, theme1, theme2, registerTransform = function(externalTransform) { + var registerTransform = function(externalTransform) { var type = (externalTransform = clone(externalTransform)).type, errMsg = ''; type || throwError('Must have a `type` when `registerTransform`.'); var typeParsed = type.split(':'); @@ -14125,7 +14125,7 @@ type: TOGGLE_SELECT_ACTION_TYPE, event: TOGGLE_SELECT_ACTION_TYPE, update: TOGGLE_SELECT_ACTION_TYPE - }, noop), theme1 = { + }, noop), theme = { color: colorAll, colorLayer: [ [ @@ -14154,7 +14154,7 @@ ], colorAll ] - }, themeStorage.light = theme1, themeStorage.dark = theme; + }, themeStorage.light = theme, themeStorage.dark = theme2; var extensions = [], extensionRegisters = { registerPreprocessor: registerPreprocessor, registerProcessor: registerProcessor, @@ -16142,7 +16142,7 @@ merge: merge }), inner$4 = makeInner(); function makeCategoryLabelsActually(axis, labelModel) { - var labels, numericLabelInterval, axis1, result, labelsCache = getListCache(axis, 'labels'), optionLabelInterval = getOptionCategoryInterval(labelModel), result1 = listCacheGet(labelsCache, optionLabelInterval); + var axis1, result, labels, numericLabelInterval, labelsCache = getListCache(axis, 'labels'), optionLabelInterval = getOptionCategoryInterval(labelModel), result1 = listCacheGet(labelsCache, optionLabelInterval); return result1 || (isFunction(optionLabelInterval) ? labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval) : (numericLabelInterval = 'auto' === optionLabelInterval ? (axis1 = axis, result = inner$4(axis1).autoInterval, null != result ? result : inner$4(axis1).autoInterval = axis1.calculateCategoryInterval()) : optionLabelInterval, labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval)), listCacheSet(labelsCache, optionLabelInterval, { labels: labels, labelCategoryInterval: numericLabelInterval @@ -16482,7 +16482,7 @@ middle: 'middle' }, svgText = { brush: function(el) { - var style = el.style, text = style.text; + var y, lineHeight, textBaseline, style = el.style, text = style.text; if (null != text && (text += ''), !(!text || isNaN(style.x) || isNaN(style.y))) { var textSvgEl = el.__svgEl; textSvgEl || (!function(el, key, val) { @@ -16490,7 +16490,7 @@ }(textSvgEl = createElement('text'), 'xml:space', 'preserve'), el.__svgEl = textSvgEl); var font = style.font || DEFAULT_FONT; textSvgEl.style.font = font, textSvgEl.textContent = text, bindStyle(textSvgEl, style, el), setTransform(textSvgEl, el.transform); - var y, lineHeight, textBaseline, x = style.x || 0, y1 = (y = style.y || 0, lineHeight = getLineHeight(font), 'top' === (textBaseline = style.textBaseline) ? y += lineHeight / 2 : 'bottom' === textBaseline && (y -= lineHeight / 2), y), textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign] || style.textAlign; + var x = style.x || 0, y1 = (y = style.y || 0, lineHeight = getLineHeight(font), 'top' === (textBaseline = style.textBaseline) ? y += lineHeight / 2 : 'bottom' === textBaseline && (y -= lineHeight / 2), y), textAlign = TEXT_ALIGN_TO_ANCHOR[style.textAlign] || style.textAlign; attr(textSvgEl, 'dominant-baseline', 'central'), attr(textSvgEl, 'text-anchor', textAlign), attr(textSvgEl, 'x', x + ''), attr(textSvgEl, 'y', y1 + ''); } } @@ -16869,13 +16869,13 @@ var svgProxy = getSvgProxy(el); return svgProxy && svgProxy.brush(el), getSvgElement(el); }, SVGPainter.prototype._paintList = function(list) { - var prevSvgElement, topPrevSvgElement, prevDisplayable, currentClipGroup, gradientManager = this._gradientManager, patternManager = this._patternManager, clipPathManager = this._clipPathManager, shadowManager = this._shadowManager; + var oldArr, newArr, prevSvgElement, topPrevSvgElement, prevDisplayable, currentClipGroup, gradientManager = this._gradientManager, patternManager = this._patternManager, clipPathManager = this._clipPathManager, shadowManager = this._shadowManager; gradientManager.markAllUnused(), patternManager.markAllUnused(), clipPathManager.markAllUnused(), shadowManager.markAllUnused(); for(var svgRoot = this._svgRoot, visibleList = this._visibleList, listLen = list.length, newVisibleList = [], i = 0; i < listLen; i++){ var displayable = list[i], svgProxy = getSvgProxy(displayable), svgElement = getSvgElement(displayable); !displayable.invisible && ((displayable.__dirty || !svgElement) && (svgProxy && svgProxy.brush(displayable), (svgElement = getSvgElement(displayable)) && displayable.style && (gradientManager.update(displayable.style.fill), gradientManager.update(displayable.style.stroke), patternManager.update(displayable.style.fill), patternManager.update(displayable.style.stroke), shadowManager.update(svgElement, displayable)), displayable.__dirty = 0), svgElement && newVisibleList.push(displayable)); } - for(var oldArr, newArr, diff = function(oldArr, newArr, equals) { + for(var diff = function(oldArr, newArr, equals) { equals || (equals = function(a, b) { return a === b; }), oldArr = oldArr.slice(); @@ -18846,7 +18846,7 @@ } }; function updateStyle(el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar) { - var style = data.getItemVisual(dataIndex, 'style'); + var layout1, style = data.getItemVisual(dataIndex, 'style'); isPolar || el.setShape('r', itemModel.get([ 'itemStyle', 'borderRadius' @@ -18865,7 +18865,7 @@ return getDefaultInterpolatedLabel(data, value); }); } - var layout1, emphasisModel = itemModel.getModel([ + var emphasisModel = itemModel.getModel([ 'emphasis' ]); enableHoverEmphasis(el, emphasisModel.get('focus'), emphasisModel.get('blurScope')), setStatesStylesFromModel(el, itemModel), null != layout.startAngle && null != layout.endAngle && layout.startAngle === layout.endAngle && (el.style.fill = 'none', el.style.stroke = 'none', each(el.states, function(state) { @@ -18884,13 +18884,13 @@ }, LargePath; }(Path); function createLarge(seriesModel, group, incremental) { - var data = seriesModel.getData(), startPoint = [], baseDimIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; - startPoint[1 - baseDimIdx] = data.getLayout('valueAxisStart'); - var largeDataIndices = data.getLayout('largeDataIndices'), barWidth = data.getLayout('barWidth'), backgroundModel = seriesModel.getModel('backgroundStyle'); + var el, seriesModel1, data, globalStyle, data1 = seriesModel.getData(), startPoint = [], baseDimIdx = data1.getLayout('valueAxisHorizontal') ? 1 : 0; + startPoint[1 - baseDimIdx] = data1.getLayout('valueAxisStart'); + var largeDataIndices = data1.getLayout('largeDataIndices'), barWidth = data1.getLayout('barWidth'), backgroundModel = seriesModel.getModel('backgroundStyle'); if (seriesModel.get('showBackground', !0)) { - var points = data.getLayout('largeBackgroundPoints'), backgroundStartPoint = []; - backgroundStartPoint[1 - baseDimIdx] = data.getLayout('backgroundStart'); - var el, backgroundModel1, data1, borderColor, itemStyle, bgEl = new LargePath({ + var el1, backgroundModel1, data2, borderColor, itemStyle, points = data1.getLayout('largeBackgroundPoints'), backgroundStartPoint = []; + backgroundStartPoint[1 - baseDimIdx] = data1.getLayout('backgroundStart'); + var bgEl = new LargePath({ shape: { points: points }, @@ -18898,15 +18898,15 @@ silent: !0, z2: 0 }); - bgEl.__startPoint = backgroundStartPoint, bgEl.__baseDimIdx = baseDimIdx, bgEl.__largeDataIndices = largeDataIndices, bgEl.__barWidth = barWidth, el = bgEl, backgroundModel1 = backgroundModel, data1 = data, borderColor = backgroundModel1.get('borderColor') || backgroundModel1.get('color'), itemStyle = backgroundModel1.getItemStyle(), el.useStyle(itemStyle), el.style.fill = null, el.style.stroke = borderColor, el.style.lineWidth = data1.getLayout('barWidth'), group.add(bgEl); + bgEl.__startPoint = backgroundStartPoint, bgEl.__baseDimIdx = baseDimIdx, bgEl.__largeDataIndices = largeDataIndices, bgEl.__barWidth = barWidth, el1 = bgEl, backgroundModel1 = backgroundModel, data2 = data1, borderColor = backgroundModel1.get('borderColor') || backgroundModel1.get('color'), itemStyle = backgroundModel1.getItemStyle(), el1.useStyle(itemStyle), el1.style.fill = null, el1.style.stroke = borderColor, el1.style.lineWidth = data2.getLayout('barWidth'), group.add(bgEl); } - var el1, seriesModel1, data2, globalStyle, el2 = new LargePath({ + var el2 = new LargePath({ shape: { - points: data.getLayout('largePoints') + points: data1.getLayout('largePoints') }, incremental: !!incremental }); - el2.__startPoint = startPoint, el2.__baseDimIdx = baseDimIdx, el2.__largeDataIndices = largeDataIndices, el2.__barWidth = barWidth, group.add(el2), el1 = el2, seriesModel1 = seriesModel, globalStyle = (data2 = data).getVisual('style'), el1.useStyle(extend({}, globalStyle)), el1.style.fill = null, el1.style.stroke = globalStyle.fill, el1.style.lineWidth = data2.getLayout('barWidth'), getECData(el2).seriesIndex = seriesModel.seriesIndex, seriesModel.get('silent') || (el2.on('mousedown', largePathUpdateDataIndex), el2.on('mousemove', largePathUpdateDataIndex)); + el2.__startPoint = startPoint, el2.__baseDimIdx = baseDimIdx, el2.__largeDataIndices = largeDataIndices, el2.__barWidth = barWidth, group.add(el2), el = el2, seriesModel1 = seriesModel, globalStyle = (data = data1).getVisual('style'), el.useStyle(extend({}, globalStyle)), el.style.fill = null, el.style.stroke = globalStyle.fill, el.style.lineWidth = data.getLayout('barWidth'), getECData(el2).seriesIndex = seriesModel.seriesIndex, seriesModel.get('silent') || (el2.on('mousedown', largePathUpdateDataIndex), el2.on('mousemove', largePathUpdateDataIndex)); } var largePathUpdateDataIndex = throttle(function(event) { var dataIndex = function(largePath, x, y) { @@ -20504,9 +20504,9 @@ }, AxisView.prototype.dispose = function(ecModel, api) { this._disposeAxisPointer(api), _super.prototype.dispose.apply(this, arguments); }, AxisView.prototype._doUpdateAxisPointerClass = function(axisModel, api, forceRender) { - var Clazz = AxisView.getAxisPointerClass(this.axisPointerClass); + var axisModel1, axisInfo, Clazz = AxisView.getAxisPointerClass(this.axisPointerClass); if (Clazz) { - var axisModel1, axisInfo, axisPointerModel = (axisInfo = getAxisInfo(axisModel)) && axisInfo.axisPointerModel; + var axisPointerModel = (axisModel1 = axisModel, (axisInfo = getAxisInfo(axisModel1)) && axisInfo.axisPointerModel); axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api, forceRender) : this._disposeAxisPointer(api); } }, AxisView.prototype._disposeAxisPointer = function(api) { @@ -20743,9 +20743,9 @@ return __extends(RadarView, _super), RadarView.prototype.render = function(seriesModel, ecModel, api) { var polar = seriesModel.coordinateSystem, group = this.group, data = seriesModel.getData(), oldData = this._data; function createSymbol$1(data, idx) { - var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; + var symbolSize, symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; if ('none' !== symbolType) { - var symbolSize, symbolSize1 = (symbolSize = data.getItemVisual(idx, 'symbolSize'), isArray(symbolSize) || (symbolSize = [ + var symbolSize1 = (symbolSize = data.getItemVisual(idx, 'symbolSize'), isArray(symbolSize) || (symbolSize = [ +symbolSize, +symbolSize ]), symbolSize), symbolPath = createSymbol(symbolType, -1, -1, 2, 2), symbolRotate = data.getItemVisual(idx, 'symbolRotate') || 0; @@ -22682,9 +22682,9 @@ }, Tree.createTree = function(dataRoot, hostModel, beforeLink) { var tree = new Tree(hostModel), listData = [], dimMax = 1; (function buildHierarchy(dataNode, parentNode) { - var value = dataNode.value; + var child, node, children, value = dataNode.value; dimMax = Math.max(dimMax, isArray(value) ? value.length : 1), listData.push(dataNode); - var child, node, children, node1 = new TreeNode(convertOptionIdName(dataNode.name, ''), tree); + var node1 = new TreeNode(convertOptionIdName(dataNode.name, ''), tree); parentNode ? (child = node1, node = parentNode, children = node.children, child.parentNode !== node && (children.push(child), child.parentNode = node)) : tree.root = node1, tree._nodes.push(node1); var children1 = dataNode.children; if (children1) for(var i = 0; i < children1.length; i++)buildHierarchy(children1[i], node1); @@ -23631,12 +23631,12 @@ } var VisualMapping = function() { function VisualMapping(option) { - var mappingMethod = option.mappingMethod, visualType = option.type, thisOption = this.option = clone(option); + var thisOption, pieceList, mappingMethod = option.mappingMethod, visualType = option.type, thisOption1 = this.option = clone(option); this.type = visualType, this.mappingMethod = mappingMethod, this._normalizeData = normalizers[mappingMethod]; - var thisOption1, pieceList, visualHandler = VisualMapping.visualHandlers[visualType]; - this.applyVisual = visualHandler.applyVisual, this.getColorMapper = visualHandler.getColorMapper, this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod], 'piecewise' === mappingMethod ? (normalizeVisualRange(thisOption), pieceList = (thisOption1 = thisOption).pieceList, thisOption1.hasSpecialVisual = !1, each(pieceList, function(piece, index) { - piece.originIndex = index, null != piece.visual && (thisOption1.hasSpecialVisual = !0); - })) : 'category' === mappingMethod ? thisOption.categories ? function(thisOption) { + var visualHandler = VisualMapping.visualHandlers[visualType]; + this.applyVisual = visualHandler.applyVisual, this.getColorMapper = visualHandler.getColorMapper, this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod], 'piecewise' === mappingMethod ? (normalizeVisualRange(thisOption1), pieceList = (thisOption = thisOption1).pieceList, thisOption.hasSpecialVisual = !1, each(pieceList, function(piece, index) { + piece.originIndex = index, null != piece.visual && (thisOption.hasSpecialVisual = !0); + })) : 'category' === mappingMethod ? thisOption1.categories ? function(thisOption) { var categories = thisOption.categories, categoryMap = thisOption.categoryMap = {}, visual = thisOption.visual; if (each(categories, function(cate, index) { categoryMap[cate] = index; @@ -23648,7 +23648,7 @@ }) : visualArr_1[-1] = visual, visual = setVisualToOption(thisOption, visualArr_1); } for(var i = categories.length - 1; i >= 0; i--)null == visual[i] && (delete categoryMap[categories[i]], categories.pop()); - }(thisOption) : normalizeVisualRange(thisOption, !0) : (assert('linear' !== mappingMethod || thisOption.dataExtent), normalizeVisualRange(thisOption)); + }(thisOption1) : normalizeVisualRange(thisOption1, !0) : (assert('linear' !== mappingMethod || thisOption1.dataExtent), normalizeVisualRange(thisOption1)); } return VisualMapping.prototype.mapValueToVisual = function(value) { var normalized = this._normalizeData(value); @@ -24561,7 +24561,7 @@ return ecModel.eachSeriesByType('graph', function(seriesModel) { var coordSysType = seriesModel.get('coordinateSystem'); if (!coordSysType || 'view' === coordSysType) { - var data_1 = seriesModel.getData(), positions = data_1.mapArray(function(idx) { + var seriesModel1, api1, aspect, option, data_1 = seriesModel.getData(), positions = data_1.mapArray(function(idx) { var itemModel = data_1.getItemModel(idx); return [ +itemModel.get('x'), @@ -24569,7 +24569,7 @@ ]; }), min = [], max = []; fromPoints(positions, min, max), max[0] - min[0] == 0 && (max[0] += 1, min[0] -= 1), max[1] - min[1] == 0 && (max[1] += 1, min[1] -= 1); - var seriesModel1, api1, aspect, option, aspect1 = (max[0] - min[0]) / (max[1] - min[1]), viewRect = (option = extend(seriesModel.getBoxLayoutParams(), { + var aspect1 = (max[0] - min[0]) / (max[1] - min[1]), viewRect = (option = extend(seriesModel.getBoxLayoutParams(), { aspect: aspect1 }), getLayoutRect(option, { width: api.getWidth(), @@ -24587,7 +24587,7 @@ } }), viewList; } - var _super, straightLineProto = Line.prototype, bezierCurveProto = BezierCurve.prototype, StraightLineShape = function() { + var straightLineProto = Line.prototype, bezierCurveProto = BezierCurve.prototype, StraightLineShape = function() { this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1; }; function isStraightLine(shape) { @@ -27097,9 +27097,8 @@ mousemove: function(e) { var x = e.offsetX, y = e.offsetY, localCursorPoint = this.group.transformCoordToLocal(x, y); if (!function(controller, e, localCursorPoint) { - var controller1, x, y, zr; if (!(!controller._brushType || (controller1 = controller, x = e.offsetX, y = e.offsetY, zr = controller1._zr, x < 0 || x > zr.getWidth() || y < 0 || y > zr.getHeight()))) { - var zr1 = controller._zr, covers = controller._covers, currPanel = getPanelByPoint(controller, e, localCursorPoint); + var controller1, x, y, zr, zr1 = controller._zr, covers = controller._covers, currPanel = getPanelByPoint(controller, e, localCursorPoint); if (!controller._dragging) for(var i = 0; i < covers.length; i++){ var brushOption = covers[i].__brushOption; if (currPanel && (!0 === currPanel || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i], localCursorPoint[0], localCursorPoint[1])) return; @@ -27613,23 +27612,23 @@ }(SeriesModel); function sankeyLayout(ecModel, api) { ecModel.eachSeriesByType('sankey', function(seriesModel) { - var seriesModel1, api1, nodeWidth = seriesModel.get('nodeWidth'), nodeGap = seriesModel.get('nodeGap'), layoutInfo = (seriesModel1 = seriesModel, api1 = api, getLayoutRect(seriesModel1.getBoxLayoutParams(), { + var seriesModel1, api1, nodes, nodes1, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign, nodes2, orient1, keyAttr, nodeWidth1 = seriesModel.get('nodeWidth'), nodeGap1 = seriesModel.get('nodeGap'), layoutInfo = (seriesModel1 = seriesModel, api1 = api, getLayoutRect(seriesModel1.getBoxLayoutParams(), { width: api1.getWidth(), height: api1.getHeight() })); seriesModel.layoutInfo = layoutInfo; - var nodes, width = layoutInfo.width, height = layoutInfo.height, graph = seriesModel.getGraph(), nodes1 = graph.nodes, edges = graph.edges; - nodes = nodes1, each(nodes, function(node) { + var width1 = layoutInfo.width, height1 = layoutInfo.height, graph = seriesModel.getGraph(), nodes3 = graph.nodes, edges1 = graph.edges; + nodes = nodes3, each(nodes, function(node) { var value1 = sum(node.outEdges, getEdgeValue), value2 = sum(node.inEdges, getEdgeValue), nodeRawValue = node.getValue() || 0; node.setLayout({ value: Math.max(value1, value2, nodeRawValue) }, !0); }); - var nodes2, edges1, nodeWidth1, nodeGap1, width1, height1, iterations, orient, nodeAlign, nodes3, orient1, keyAttr, iterations1 = 0 !== filter(nodes1, function(node) { + var iterations1 = 0 !== filter(nodes3, function(node) { return 0 === node.getLayout().value; }).length ? 0 : seriesModel.get('layoutIterations'), orient2 = seriesModel.get('orient'); - nodes2 = nodes1, edges1 = edges, nodeWidth1 = nodeWidth, nodeGap1 = nodeGap, width1 = width, height1 = height, iterations = iterations1, orient = orient2, nodeAlign = seriesModel.get('nodeAlign'), function(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { - for(var remainEdges = [], indegreeArr = [], zeroIndegrees = [], nextTargetNode = [], x = 0, i = 0; i < edges.length; i++)remainEdges[i] = 1; + nodes1 = nodes3, edges = edges1, nodeWidth = nodeWidth1, nodeGap = nodeGap1, width = width1, height = height1, iterations = iterations1, orient = orient2, nodeAlign = seriesModel.get('nodeAlign'), function(nodes, edges, nodeWidth, width, height, orient, nodeAlign) { + for(var nodes1, kx, orient1, remainEdges = [], indegreeArr = [], zeroIndegrees = [], nextTargetNode = [], x = 0, i = 0; i < edges.length; i++)remainEdges[i] = 1; for(var i = 0; i < nodes.length; i++)indegreeArr[i] = nodes[i].inEdges.length, 0 === indegreeArr[i] && zeroIndegrees.push(nodes[i]); for(var maxNodeDepth = -1; zeroIndegrees.length;){ for(var idx = 0; idx < zeroIndegrees.length; idx++){ @@ -27651,7 +27650,7 @@ ++x, zeroIndegrees = nextTargetNode, nextTargetNode = []; } for(var i = 0; i < remainEdges.length; i++)if (1 === remainEdges[i]) throw Error('Sankey is a DAG, the original data has cycle!'); - var nodes1, kx, orient1, maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; + var maxDepth = maxNodeDepth > x - 1 ? maxNodeDepth : x - 1; nodeAlign && 'left' !== nodeAlign && function(nodes, nodeAlign, orient, maxDepth) { if ('right' === nodeAlign) { for(var nodes1, maxDepth1, nextSourceNode = [], remainNodes = nodes, nodeHeight = 0; remainNodes.length;){ @@ -27687,7 +27686,7 @@ x: nodeDepth }, !0); }); - }(nodes2, edges1, nodeWidth1, width1, height1, orient, nodeAlign), function(nodes, edges, height, width, nodeGap, iterations, orient) { + }(nodes1, edges, nodeWidth, width, height, orient, nodeAlign), function(nodes, edges, height, width, nodeGap, iterations, orient) { var nodes1, orient1, nodesByBreadth, keyAttr, groupResult, nodesByBreadth1, edges1, height1, width1, nodeGap1, orient2, minKy, nodesByBreadth2 = (nodes1 = nodes, orient1 = orient, nodesByBreadth = [], keyAttr = 'vertical' === orient1 ? 'y' : 'x', groupResult = groupData(nodes1, function(node) { return node.getLayout()[keyAttr]; }), groupResult.keys.sort(function(a, b) { @@ -27722,13 +27721,13 @@ }, !0); }), resolveCollisions(nodesByBreadth2, nodeGap, height, width, orient); for(var alpha = 1; iterations > 0; iterations--)relaxRightToLeft(nodesByBreadth2, alpha *= 0.99, orient), resolveCollisions(nodesByBreadth2, nodeGap, height, width, orient), relaxLeftToRight(nodesByBreadth2, alpha, orient), resolveCollisions(nodesByBreadth2, nodeGap, height, width, orient); - }(nodes2, edges1, height1, width1, nodeGap1, iterations, orient), nodes3 = nodes2, keyAttr = 'vertical' === (orient1 = orient) ? 'x' : 'y', each(nodes3, function(node) { + }(nodes1, edges, height, width, nodeGap, iterations, orient), nodes2 = nodes1, keyAttr = 'vertical' === (orient1 = orient) ? 'x' : 'y', each(nodes2, function(node) { node.outEdges.sort(function(a, b) { return a.node2.getLayout()[keyAttr] - b.node2.getLayout()[keyAttr]; }), node.inEdges.sort(function(a, b) { return a.node1.getLayout()[keyAttr] - b.node1.getLayout()[keyAttr]; }); - }), each(nodes3, function(node) { + }), each(nodes2, function(node) { var sy = 0, ty = 0; each(node.outEdges, function(edge) { edge.setLayout({ @@ -28536,9 +28535,9 @@ }, EffectSymbol.prototype.downplay = function() { leaveEmphasis(this); }, EffectSymbol.prototype.updateData = function(data, idx) { - var _this = this, seriesModel = data.hostModel; + var symbolSize, _this = this, seriesModel = data.hostModel; this.childAt(0).updateData(data, idx); - var symbolSize, rippleGroup = this.childAt(1), itemModel = data.getItemModel(idx), symbolType = data.getItemVisual(idx, 'symbol'), symbolSize1 = (symbolSize = data.getItemVisual(idx, 'symbolSize'), isArray(symbolSize) || (symbolSize = [ + var rippleGroup = this.childAt(1), itemModel = data.getItemModel(idx), symbolType = data.getItemVisual(idx, 'symbol'), symbolSize1 = (symbolSize = data.getItemVisual(idx, 'symbolSize'), isArray(symbolSize) || (symbolSize = [ +symbolSize, +symbolSize ]), symbolSize), symbolStyle = data.getItemVisual(idx, 'style'), color = symbolStyle && symbolStyle.fill; @@ -29247,11 +29246,11 @@ }), rect.ensureState('emphasis').style = emphasisStyle, rect.ensureState('blur').style = blurStyle, rect.ensureState('select').style = selectStyle, enableHoverEmphasis(rect, focus, blurScope), rect.incremental = incremental, incremental && (rect.states.emphasis.hoverLayer = !0), group.add(rect), data.setItemGraphicEl(idx, rect); } }, HeatmapView.prototype._renderOnGeo = function(geo, seriesModel, visualMapModel, api) { - var inRangeVisuals = visualMapModel.targetVisuals.inRange, outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange, data = seriesModel.getData(), hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer(); + var dataExtent, range, dataSpan, dataExtent1, pieceList, selected, dataSpan1, len, lastIndex, inRangeVisuals = visualMapModel.targetVisuals.inRange, outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange, data = seriesModel.getData(), hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer(); hmLayer.blurSize = seriesModel.get('blurSize'), hmLayer.pointSize = seriesModel.get('pointSize'), hmLayer.minOpacity = seriesModel.get('minOpacity'), hmLayer.maxOpacity = seriesModel.get('maxOpacity'); var rect = geo.getViewRect().clone(), roamTransform = geo.getRoamTransform(); rect.applyTransform(roamTransform); - var dataExtent, range, dataSpan, dataExtent1, pieceList, selected, dataSpan1, len, lastIndex, x = Math.max(rect.x, 0), y = Math.max(rect.y, 0), x2 = Math.min(rect.width + rect.x, api.getWidth()), y2 = Math.min(rect.height + rect.y, api.getHeight()), width = x2 - x, height = y2 - y, dims = [ + var x = Math.max(rect.x, 0), y = Math.max(rect.y, 0), x2 = Math.min(rect.width + rect.x, api.getWidth()), y2 = Math.min(rect.height + rect.y, api.getHeight()), width = x2 - x, height = y2 - y, dims = [ data.mapDimension('lng'), data.mapDimension('lat'), data.mapDimension('value') @@ -29393,16 +29392,16 @@ data.setItemGraphicEl(dataIndex, bar), group.add(bar), updateCommon$1(bar, opt, symbolMeta); } }).update(function(newIndex, oldIndex) { - var bar = oldData.getItemGraphicEl(oldIndex); + var bar, opt1, symbolMeta, animationModel, dataIndex, bar1 = oldData.getItemGraphicEl(oldIndex); if (!data.hasValue(newIndex)) { - group.remove(bar); + group.remove(bar1); return; } - var bar1, opt1, symbolMeta, animationModel, dataIndex, itemModel = getItemModel(data, newIndex), symbolMeta1 = getSymbolMeta(data, newIndex, itemModel, opt), pictorialShapeStr = getShapeStr(data, symbolMeta1); - bar && pictorialShapeStr !== bar.__pictorialShapeStr && (group.remove(bar), data.setItemGraphicEl(newIndex, null), bar = null), bar ? (bar1 = bar, opt1 = opt, symbolMeta = symbolMeta1, animationModel = symbolMeta.animationModel, dataIndex = symbolMeta.dataIndex, updateProps(bar1.__pictorialBundle, { + var itemModel = getItemModel(data, newIndex), symbolMeta1 = getSymbolMeta(data, newIndex, itemModel, opt), pictorialShapeStr = getShapeStr(data, symbolMeta1); + bar1 && pictorialShapeStr !== bar1.__pictorialShapeStr && (group.remove(bar1), data.setItemGraphicEl(newIndex, null), bar1 = null), bar1 ? (bar = bar1, opt1 = opt, symbolMeta = symbolMeta1, animationModel = symbolMeta.animationModel, dataIndex = symbolMeta.dataIndex, updateProps(bar.__pictorialBundle, { x: symbolMeta.bundlePosition[0], y: symbolMeta.bundlePosition[1] - }, animationModel, dataIndex), symbolMeta.symbolRepeat ? createOrUpdateRepeatSymbols(bar1, opt1, symbolMeta, !0) : createOrUpdateSingleSymbol(bar1, opt1, symbolMeta, !0), createOrUpdateBarRect(bar1, symbolMeta, !0), createOrUpdateClip(bar1, opt1, symbolMeta, !0)) : bar = createBar(data, opt, symbolMeta1, !0), data.setItemGraphicEl(newIndex, bar), bar.__pictorialSymbolMeta = symbolMeta1, group.add(bar), updateCommon$1(bar, opt, symbolMeta1); + }, animationModel, dataIndex), symbolMeta.symbolRepeat ? createOrUpdateRepeatSymbols(bar, opt1, symbolMeta, !0) : createOrUpdateSingleSymbol(bar, opt1, symbolMeta, !0), createOrUpdateBarRect(bar, symbolMeta, !0), createOrUpdateClip(bar, opt1, symbolMeta, !0)) : bar1 = createBar(data, opt, symbolMeta1, !0), data.setItemGraphicEl(newIndex, bar1), bar1.__pictorialSymbolMeta = symbolMeta1, group.add(bar1), updateCommon$1(bar1, opt, symbolMeta1); }).remove(function(dataIndex) { var bar = oldData.getItemGraphicEl(dataIndex); bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); @@ -30004,9 +30003,9 @@ return _this.type = SunburstView.type, _this; } return __extends(SunburstView, _super), SunburstView.prototype.render = function(seriesModel, ecModel, api, payload) { - var self1 = this; + var virtualRoot, viewRoot, self1 = this; this.seriesModel = seriesModel, this.api = api, this.ecModel = ecModel; - var virtualRoot, viewRoot, data = seriesModel.getData(), virtualRoot1 = data.tree.root, newRoot = seriesModel.getViewRoot(), group = this.group, renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'), newChildren = []; + var data = seriesModel.getData(), virtualRoot1 = data.tree.root, newRoot = seriesModel.getViewRoot(), group = this.group, renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'), newChildren = []; newRoot.eachNode(function(node) { newChildren.push(node); }), function(newChildren, oldChildren) { @@ -31208,7 +31207,7 @@ fromTransformable && (transitionFrom[name] = fromTransformable[name]); } function makeRenderItem(customSeries, data, ecModel, api) { - var currDataIndexInside, currItemModel, data1, encodeDef, renderItem = customSeries.get('renderItem'), coordSys = customSeries.coordinateSystem, prepareResult = {}; + var data1, encodeDef, currDataIndexInside, currItemModel, renderItem = customSeries.get('renderItem'), coordSys = customSeries.coordinateSystem, prepareResult = {}; coordSys && (assert(renderItem, 'series.render is required.'), assert(coordSys.prepareCustoms || prepareCustoms[coordSys.type], 'This coordSys does not support custom series.'), prepareResult = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys)); for(var userAPI = defaults({ getWidth: api.getWidth, @@ -31741,7 +31740,7 @@ return 'line' === axisPointerType ? (style = styleModel.getLineStyle()).fill = null : 'shadow' === axisPointerType && ((style = styleModel.getAreaStyle()).stroke = null), style; } function buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos) { - var text = getValueLabel(axisPointerModel.get('value'), axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), { + var position, width, height, api1, viewWidth, viewHeight, text = getValueLabel(axisPointerModel.get('value'), axisModel.axis, axisModel.ecModel, axisPointerModel.get('seriesDataIndices'), { precision: axisPointerModel.get([ 'label', 'precision' @@ -31750,18 +31749,18 @@ 'label', 'formatter' ]) - }), labelModel = axisPointerModel.getModel('label'), paddings = normalizeCssArray(labelModel.get('padding') || 0), font = labelModel.getFont(), textRect = getBoundingRect(text, font), position = labelPos.position, width = textRect.width + paddings[1] + paddings[3], height = textRect.height + paddings[0] + paddings[2], align = labelPos.align; - 'right' === align && (position[0] -= width), 'center' === align && (position[0] -= width / 2); - var position1, width1, height1, api1, viewWidth, viewHeight, verticalAlign = labelPos.verticalAlign; - 'bottom' === verticalAlign && (position[1] -= height), 'middle' === verticalAlign && (position[1] -= height / 2), position1 = position, width1 = width, height1 = height, viewWidth = (api1 = api).getWidth(), viewHeight = api1.getHeight(), position1[0] = Math.min(position1[0] + width1, viewWidth) - width1, position1[1] = Math.min(position1[1] + height1, viewHeight) - height1, position1[0] = Math.max(position1[0], 0), position1[1] = Math.max(position1[1], 0); + }), labelModel = axisPointerModel.getModel('label'), paddings = normalizeCssArray(labelModel.get('padding') || 0), font = labelModel.getFont(), textRect = getBoundingRect(text, font), position1 = labelPos.position, width1 = textRect.width + paddings[1] + paddings[3], height1 = textRect.height + paddings[0] + paddings[2], align = labelPos.align; + 'right' === align && (position1[0] -= width1), 'center' === align && (position1[0] -= width1 / 2); + var verticalAlign = labelPos.verticalAlign; + 'bottom' === verticalAlign && (position1[1] -= height1), 'middle' === verticalAlign && (position1[1] -= height1 / 2), position = position1, width = width1, height = height1, viewWidth = (api1 = api).getWidth(), viewHeight = api1.getHeight(), position[0] = Math.min(position[0] + width, viewWidth) - width, position[1] = Math.min(position[1] + height, viewHeight) - height, position[0] = Math.max(position[0], 0), position[1] = Math.max(position[1], 0); var bgColor = labelModel.get('backgroundColor'); bgColor && 'auto' !== bgColor || (bgColor = axisModel.get([ 'axisLine', 'lineStyle', 'color' ])), elOption.label = { - x: position[0], - y: position[1], + x: position1[0], + y: position1[1], style: createTextStyle(labelModel, { text: text, font: font, @@ -32082,11 +32081,11 @@ seriesIndex: payload.seriesIndex, dataIndex: payload.dataIndex }, ecModel).point); - var isIllegalPoint = illegalPoint(point), inputAxesInfo = payload.axesInfo, axesInfo = coordSysAxesInfo.axesInfo, shouldHide = 'leave' === currTrigger || illegalPoint(point), outputPayload = {}, showValueMap = {}, dataByCoordSys = { + var showValueMap, axesInfo, outputPayload, outputAxesInfo, axesInfo1, dispatchAction1, api1, zr, highDownKey, lastHighlights, newHighlights, toHighlight, toDownplay, isIllegalPoint = illegalPoint(point), inputAxesInfo = payload.axesInfo, axesInfo2 = coordSysAxesInfo.axesInfo, shouldHide = 'leave' === currTrigger || illegalPoint(point), outputPayload1 = {}, showValueMap1 = {}, dataByCoordSys = { list: [], map: {} }, updaters = { - showPointer: curry(showPointer, showValueMap), + showPointer: curry(showPointer, showValueMap1), showTooltip: curry(showTooltip, dataByCoordSys) }; each(coordSysAxesInfo.coordSysMap, function(coordSys, coordSysKey) { @@ -32100,24 +32099,24 @@ }(inputAxesInfo, axisInfo); if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { var val = inputAxisInfo && inputAxisInfo.value; - null != val || isIllegalPoint || (val = axis.pointToData(point)), null != val && processOnAxis(axisInfo, val, updaters, !1, outputPayload); + null != val || isIllegalPoint || (val = axis.pointToData(point)), null != val && processOnAxis(axisInfo, val, updaters, !1, outputPayload1); } }); }); - var showValueMap1, axesInfo1, outputPayload1, outputAxesInfo, axesInfo2, dispatchAction1, api1, zr, highDownKey, lastHighlights, newHighlights, toHighlight, toDownplay, linkTriggers = {}; - return each(axesInfo, function(tarAxisInfo, tarKey) { + var linkTriggers = {}; + return each(axesInfo2, function(tarAxisInfo, tarKey) { var linkGroup = tarAxisInfo.linkGroup; - linkGroup && !showValueMap[tarKey] && each(linkGroup.axesInfo, function(srcAxisInfo, srcKey) { - var srcValItem = showValueMap[srcKey]; + linkGroup && !showValueMap1[tarKey] && each(linkGroup.axesInfo, function(srcAxisInfo, srcKey) { + var srcValItem = showValueMap1[srcKey]; if (srcAxisInfo !== tarAxisInfo && srcValItem) { var val = srcValItem.value; linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo)))), linkTriggers[tarAxisInfo.key] = val; } }); }), each(linkTriggers, function(val, tarKey) { - processOnAxis(axesInfo[tarKey], val, updaters, !0, outputPayload); - }), showValueMap1 = showValueMap, axesInfo1 = axesInfo, outputAxesInfo = (outputPayload1 = outputPayload).axesInfo = [], each(axesInfo1, function(axisInfo, key) { - var option = axisInfo.axisPointerModel.option, valItem = showValueMap1[key]; + processOnAxis(axesInfo2[tarKey], val, updaters, !0, outputPayload1); + }), showValueMap = showValueMap1, axesInfo = axesInfo2, outputAxesInfo = (outputPayload = outputPayload1).axesInfo = [], each(axesInfo, function(axisInfo, key) { + var option = axisInfo.axisPointerModel.option, valItem = showValueMap[key]; valItem ? (axisInfo.useHandle || (option.status = 'show'), option.value = valItem.value, option.seriesDataIndices = (valItem.payloadBatch || []).slice()) : axisInfo.useHandle || (option.status = 'hide'), 'show' === option.status && outputAxesInfo.push({ axisDim: axisInfo.axis.dim, axisIndex: axisInfo.axis.model.componentIndex, @@ -32143,7 +32142,7 @@ seriesIndex: sampleItem.seriesIndex, dataByCoordSys: dataByCoordSys.list }); - }(dataByCoordSys, point, payload, dispatchAction), axesInfo2 = axesInfo, dispatchAction1 = dispatchAction, zr = (api1 = api).getZr(), highDownKey = 'axisPointerLastHighlights', lastHighlights = inner$c(zr)[highDownKey] || {}, newHighlights = inner$c(zr)[highDownKey] = {}, each(axesInfo2, function(axisInfo, key) { + }(dataByCoordSys, point, payload, dispatchAction), axesInfo1 = axesInfo2, dispatchAction1 = dispatchAction, zr = (api1 = api).getZr(), highDownKey = 'axisPointerLastHighlights', lastHighlights = inner$c(zr)[highDownKey] || {}, newHighlights = inner$c(zr)[highDownKey] = {}, each(axesInfo1, function(axisInfo, key) { var option = axisInfo.axisPointerModel.option; 'show' === option.status && each(option.seriesDataIndices, function(batchItem) { newHighlights[batchItem.seriesIndex + ' | ' + batchItem.dataIndex] = batchItem; @@ -32162,7 +32161,7 @@ escapeConnect: !0, notBlur: !0, batch: toHighlight - }), outputPayload; + }), outputPayload1; } } function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) { @@ -32628,10 +32627,10 @@ create: function(ecModel, api) { var polarList = []; return ecModel.eachComponent('polar', function(polarModel, idx) { - var polar = new Polar(idx + ''); - polar.update = updatePolarScale; - var polar1, polarModel1, api1, center, width, height, radiusAxis, size, radius, parsedRadius, radiusAxis1 = polar.getRadiusAxis(), angleAxis = polar.getAngleAxis(), radiusAxisModel = polarModel.findAxisModel('radiusAxis'), angleAxisModel = polarModel.findAxisModel('angleAxis'); - setAxis(radiusAxis1, radiusAxisModel), setAxis(angleAxis, angleAxisModel), polar1 = polar, center = polarModel.get('center'), width = api.getWidth(), height = api.getHeight(), polar1.cx = parsePercent$1(center[0], width), polar1.cy = parsePercent$1(center[1], height), radiusAxis = polar1.getRadiusAxis(), size = Math.min(width, height) / 2, null == (radius = polarModel.get('radius')) ? radius = [ + var polar, polarModel1, api1, center, width, height, radiusAxis, size, radius, parsedRadius, polar1 = new Polar(idx + ''); + polar1.update = updatePolarScale; + var radiusAxis1 = polar1.getRadiusAxis(), angleAxis = polar1.getAngleAxis(), radiusAxisModel = polarModel.findAxisModel('radiusAxis'), angleAxisModel = polarModel.findAxisModel('angleAxis'); + setAxis(radiusAxis1, radiusAxisModel), setAxis(angleAxis, angleAxisModel), polar = polar1, center = polarModel.get('center'), width = api.getWidth(), height = api.getHeight(), polar.cx = parsePercent$1(center[0], width), polar.cy = parsePercent$1(center[1], height), radiusAxis = polar.getRadiusAxis(), size = Math.min(width, height) / 2, null == (radius = polarModel.get('radius')) ? radius = [ 0, '100%' ] : isArray(radius) || (radius = [ @@ -32640,7 +32639,7 @@ ]), parsedRadius = [ parsePercent$1(radius[0], size), parsePercent$1(radius[1], size) - ], radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]), polarList.push(polar), polarModel.coordinateSystem = polar, polar.model = polarModel; + ], radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]), polarList.push(polar1), polarModel.coordinateSystem = polar1, polar1.model = polarModel; }), ecModel.eachSeries(function(seriesModel) { if ('polar' === seriesModel.get('coordinateSystem')) { var polarModel = seriesModel.getReferringComponents('polar', SINGLE_REFERRING).models[0]; @@ -34063,7 +34062,7 @@ var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, !0); !textConfig && convertResult.textConfig && (textConfig = elOption.textConfig = convertResult.textConfig), !textContentOption && convertResult.textContent && (textContentOption = convertResult.textContent); } - var elOption1, elOptionCleaned = (elOption1 = elOption, elOption1 = extend({}, elOption1), each([ + var elOptionCleaned = (elOption1 = elOption, elOption1 = extend({}, elOption1), each([ 'id', 'parentId', '$action', @@ -34084,7 +34083,7 @@ } else 'replace' === $action && el.setTextContent(new ZRText(textContentOption)); } if (el) { - var el1, graphicModel1, elOption2, eventData, elInner = inner$e(el); + var elOption1, el1, graphicModel1, elOption2, eventData, elInner = inner$e(el); elInner.__ecGraphicWidthOption = elOption.width, elInner.__ecGraphicHeightOption = elOption.height, el1 = el, graphicModel1 = graphicModel, elOption2 = elOption, eventData = getECData(el1).eventData, el1.silent || el1.ignore || eventData || (eventData = getECData(el1).eventData = { componentType: 'graphic', componentIndex: graphicModel1.componentIndex, @@ -35001,7 +35000,7 @@ return null !== _super && _super.apply(this, arguments) || this; } return __extends(DataView, _super), DataView.prototype.onclick = function(ecModel, api) { - var container = api.getDom(), model = this.model; + var ecModel1, ecModel2, seriesGroupByCategoryAxis, otherSeries, meta, result, groups, tables, series, container = api.getDom(), model = this.model; this._dom && container.removeChild(this._dom); var root = document.createElement('div'); root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;', root.style.backgroundColor = model.get('backgroundColor') || '#fff'; @@ -35009,7 +35008,7 @@ header.innerHTML = lang[0] || model.get('title'), header.style.cssText = 'margin: 10px 20px;', header.style.color = model.get('textColor'); var viewMain = document.createElement('div'), textarea = document.createElement('textarea'); viewMain.style.cssText = 'display:block;width:100%;overflow:auto;'; - var ecModel1, ecModel2, seriesGroupByCategoryAxis, otherSeries, meta, result, groups, tables, series, optionToContent = model.get('optionToContent'), contentToOption = model.get('contentToOption'), result1 = (seriesGroupByCategoryAxis = {}, otherSeries = [], meta = [], ecModel.eachRawSeries(function(seriesModel) { + var optionToContent = model.get('optionToContent'), contentToOption = model.get('contentToOption'), result1 = (seriesGroupByCategoryAxis = {}, otherSeries = [], meta = [], ecModel.eachRawSeries(function(seriesModel) { var coordSys = seriesModel.coordinateSystem; if (coordSys && ('cartesian2d' === coordSys.type || 'polar' === coordSys.type)) { var baseAxis = coordSys.getBaseAxis(); @@ -35516,9 +35515,9 @@ }, DataZoomFeature.prototype.dispose = function(ecModel, api) { this._brushController && this._brushController.dispose(); }, DataZoomFeature.prototype._onBrush = function(eventParam) { - var areas = eventParam.areas; + var ecModel, newSnapshot, storedSnapshots, areas = eventParam.areas; if (eventParam.isEnd && areas.length) { - var ecModel, newSnapshot, storedSnapshots, snapshot = {}, ecModel1 = this.ecModel; + var snapshot = {}, ecModel1 = this.ecModel; this._brushController.updateCovers([]), new BrushTargetManager(makeAxisFinder(this.model), ecModel1, { include: [ 'grid' @@ -35531,10 +35530,10 @@ lineY: 'y' }[brushType], coordSys, coordRange); } - }), storedSnapshots = getStoreSnapshots(ecModel1), each(snapshot, function(batchItem, dataZoomId) { + }), ecModel = ecModel1, newSnapshot = snapshot, storedSnapshots = getStoreSnapshots(ecModel), each(newSnapshot, function(batchItem, dataZoomId) { for(var i = storedSnapshots.length - 1; i >= 0 && !storedSnapshots[i][dataZoomId]; i--); if (i < 0) { - var dataZoomModel = ecModel1.queryComponents({ + var dataZoomModel = ecModel.queryComponents({ mainType: 'dataZoom', subType: 'select', id: dataZoomId @@ -35548,7 +35547,7 @@ }; } } - }), storedSnapshots.push(snapshot), this._dispatchZoomAction(snapshot); + }), storedSnapshots.push(newSnapshot), this._dispatchZoomAction(snapshot); } function setBatch(dimName, coordSys, minMax) { var dimName1, axisModel, ecModel, found, axis = coordSys.getAxis(dimName), axisModel1 = axis.model, dataZoomModel = (dimName1 = dimName, axisModel = axisModel1, ecModel = ecModel1, ecModel.eachComponent({ @@ -36330,7 +36329,7 @@ function brushPreprocessor(option, isNew) { var brushComponents = normalizeToArray(option ? option.brush : []); if (brushComponents.length) { - var brushComponentSpecifiedBtns = []; + var arr, map, brushComponentSpecifiedBtns = []; each(brushComponents, function(brushOpt) { var tbs = brushOpt.hasOwnProperty('toolbox') ? brushOpt.toolbox : []; tbs instanceof Array && (brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs)); @@ -36341,7 +36340,7 @@ }, option.toolbox = [ toolbox ]); - var arr, map, toolboxFeature = toolbox.feature || (toolbox.feature = {}), toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}), brushTypes = toolboxBrush.type || (toolboxBrush.type = []); + var toolboxFeature = toolbox.feature || (toolbox.feature = {}), toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}), brushTypes = toolboxBrush.type || (toolboxBrush.type = []); brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns), map = {}, each(arr = brushTypes, function(val) { map[val] = 1; }), arr.length = 0, each(map, function(flag, val) { @@ -36489,11 +36488,10 @@ 'parallel' === seriesModel.subType ? (seriesModel1 = seriesModel, seriesIndex1 = seriesIndex, coordSys = seriesModel1.coordinateSystem, hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed(), linkOthers(seriesIndex1) && coordSys.eachActiveState(seriesModel1.getData(), function(activeState, dataIndex) { 'active' === activeState && (selectedDataIndexForLink[dataIndex] = 1); })) : function(seriesModel, seriesIndex, rangeInfoList) { - var brushModel1, seriesIndex1, seriesIndices; if (!(!seriesModel.brushSelector || (brushModel1 = brushModel, seriesIndex1 = seriesIndex, seriesIndices = brushModel1.option.seriesIndex, null != seriesIndices && 'all' !== seriesIndices && (isArray(seriesIndices) ? 0 > indexOf(seriesIndices, seriesIndex1) : seriesIndex1 !== seriesIndices))) && (each(areas, function(area) { brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel) && rangeInfoList.push(area), hasBrushExists = hasBrushExists || brushed(rangeInfoList); }), linkOthers(seriesIndex) && brushed(rangeInfoList))) { - var data_1 = seriesModel.getData(); + var brushModel1, seriesIndex1, seriesIndices, data_1 = seriesModel.getData(); data_1.each(function(dataIndex) { checkInRange(seriesModel, rangeInfoList, data_1, dataIndex) && (selectedDataIndexForLink[dataIndex] = 1); }); @@ -38958,21 +38956,21 @@ }); }); }), coordSysRecordMap.each(function(coordSysRecord) { - var firstDzInfo, controller = coordSysRecord.controller, dataZoomInfoMap = coordSysRecord.dataZoomInfoMap; - if (dataZoomInfoMap) { - var firstDzKey = dataZoomInfoMap.keys()[0]; - null != firstDzKey && (firstDzInfo = dataZoomInfoMap.get(firstDzKey)); + var dataZoomInfoMap, controlType, prefix, typePriority, preventDefaultMouseMove, firstDzInfo, controller = coordSysRecord.controller, dataZoomInfoMap1 = coordSysRecord.dataZoomInfoMap; + if (dataZoomInfoMap1) { + var firstDzKey = dataZoomInfoMap1.keys()[0]; + null != firstDzKey && (firstDzInfo = dataZoomInfoMap1.get(firstDzKey)); } if (!firstDzInfo) { disposeCoordSysRecord(coordSysRecordMap, coordSysRecord); return; } - var dataZoomInfoMap1, controlType, prefix, typePriority, preventDefaultMouseMove, controllerParams = (prefix = 'type_', typePriority = { + var controllerParams = (prefix = 'type_', typePriority = { type_true: 2, type_move: 1, type_false: 0, type_undefined: -1 - }, preventDefaultMouseMove = !0, dataZoomInfoMap.each(function(dataZoomInfo) { + }, preventDefaultMouseMove = !0, dataZoomInfoMap1.each(function(dataZoomInfo) { var dataZoomModel = dataZoomInfo.model, oneType = !dataZoomModel.get('disabled', !0) && (!dataZoomModel.get('zoomLock', !0) || 'move'); typePriority[prefix + oneType] > typePriority[prefix + controlType] && (controlType = oneType), preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get('preventDefaultMouseMove', !0); }), { @@ -41200,7 +41198,7 @@ }(), filterTransform = { type: 'echarts:filter', transform: function(params) { - for(var rawItem, exprOption, getters, upstream = params.upstream, condition = (exprOption = params.config, getters = { + for(var exprOption, getters, rawItem, upstream = params.upstream, condition = (exprOption = params.config, getters = { valueGetterAttrMap: createHashMap({ dimension: !0 }), diff --git a/crates/swc_ecma_minifier/tests/benches-full/jquery.js b/crates/swc_ecma_minifier/tests/benches-full/jquery.js index 089cce7a72f..77e72e89c26 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/jquery.js +++ b/crates/swc_ecma_minifier/tests/benches-full/jquery.js @@ -6,7 +6,7 @@ } : factory(global); }("undefined" != typeof window ? window : this, function(window1, noGlobal) { "use strict"; - var arr = [], getProto = Object.getPrototypeOf, slice = arr.slice, flat = arr.flat ? function(array) { + var body, arr = [], getProto = Object.getPrototypeOf, slice = arr.slice, flat = arr.flat ? function(array) { return arr.flat.call(array); } : function(array) { return arr.concat.apply([], array); @@ -1323,7 +1323,7 @@ }); } }); - var div, input, rcheckableType = /^(?:checkbox|radio)$/i, rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, rscriptType = /^$|^module$|\/(?:java|ecma)script/i; + var rcheckableType = /^(?:checkbox|radio)$/i, rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, rscriptType = /^$|^module$|\/(?:java|ecma)script/i; div = document.createDocumentFragment().appendChild(document.createElement("div")), (input = document.createElement("input")).setAttribute("type", "radio"), input.setAttribute("checked", "checked"), input.setAttribute("name", "t"), div.appendChild(input), support.checkClone = div.cloneNode(!0).cloneNode(!0).lastChild.checked, div.innerHTML = "", support.noCloneChecked = !!div.cloneNode(!0).lastChild.defaultValue, div.innerHTML = "", support.option = !!div.lastChild; var wrapMap = { thead: [ @@ -2014,7 +2014,7 @@ }, _default: "swing" }, jQuery.fx = Tween.prototype.init, jQuery.fx.step = {}; - var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; + var div, input, fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; function createFxNow() { return window1.setTimeout(function() { fxNow = void 0; @@ -2904,7 +2904,7 @@ }; } }); - var body, oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; + var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { diff --git a/crates/swc_ecma_minifier/tests/benches-full/lodash.js b/crates/swc_ecma_minifier/tests/benches-full/lodash.js index c5557ac7b06..fd0b6e98ad9 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/lodash.js +++ b/crates/swc_ecma_minifier/tests/benches-full/lodash.js @@ -514,7 +514,7 @@ '"': '"', ''': "'" }), _ = function runInContext(context) { - var uid, Array1 = (context = null == context ? root : _.defaults(root.Object(), context, _.pick(root, contextProps))).Array, Date = context.Date, Error = context.Error, Function1 = context.Function, Math = context.Math, Object1 = context.Object, RegExp1 = context.RegExp, String = context.String, TypeError = context.TypeError, arrayProto = Array1.prototype, funcProto = Function1.prototype, objectProto = Object1.prototype, coreJsData = context['__core-js_shared__'], funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, idCounter = 0, maskSrcKey = (uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '')) ? 'Symbol(src)_1.' + uid : '', nativeObjectToString = objectProto.toString, objectCtorString = funcToString.call(Object1), oldDash = root._, reIsNative = RegExp1('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'), Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object1.getPrototypeOf, Object1), objectCreate = Object1.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined, defineProperty = function() { + var uid, func, result, cache, source, Array1 = (context = null == context ? root : _.defaults(root.Object(), context, _.pick(root, contextProps))).Array, Date = context.Date, Error = context.Error, Function1 = context.Function, Math = context.Math, Object1 = context.Object, RegExp1 = context.RegExp, String = context.String, TypeError = context.TypeError, arrayProto = Array1.prototype, funcProto = Function1.prototype, objectProto = Object1.prototype, coreJsData = context['__core-js_shared__'], funcToString = funcProto.toString, hasOwnProperty = objectProto.hasOwnProperty, idCounter = 0, maskSrcKey = (uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '')) ? 'Symbol(src)_1.' + uid : '', nativeObjectToString = objectProto.toString, objectCtorString = funcToString.call(Object1), oldDash = root._, reIsNative = RegExp1('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'), Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object1.getPrototypeOf, Object1), objectCreate = Object1.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined, defineProperty = function() { try { var func = getNative(Object1, 'defineProperty'); return func({}, '', {}), func; @@ -1759,7 +1759,7 @@ }); } : identity); function setWrapToString(wrapper, reference, bitmask) { - var source, match, details, bitmask1, source1 = reference + ''; + var details, bitmask1, source, match, source1 = reference + ''; return setToString(wrapper, function(source, details) { var length = details.length; if (!length) return source; @@ -1788,7 +1788,7 @@ } return array.length = size, array; } - var func, result, cache, stringToPath = (cache = (result = memoize(func = function(string) { + var stringToPath = (cache = (result = memoize(func = function(string) { var result = []; return 46 === string.charCodeAt(0) && result.push(''), string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match); @@ -2387,7 +2387,7 @@ function stubTrue() { return !0; } - var source, add = createMathOperation(function(augend, addend) { + var add = createMathOperation(function(augend, addend) { return augend + addend; }, 0), ceil = createRound('ceil'), divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; diff --git a/crates/swc_ecma_minifier/tests/benches-full/moment.js b/crates/swc_ecma_minifier/tests/benches-full/moment.js index 460bf906a35..94aba6d2263 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/moment.js +++ b/crates/swc_ecma_minifier/tests/benches-full/moment.js @@ -80,7 +80,7 @@ for(i = 0; i < len; i++)if (i in t && fun.call(this, t[i], i, t)) return !0; return !1; }; - var token, getSetMillisecond, momentProperties = hooks.momentProperties = [], updateInProgress = !1; + var callback, token, getSetMillisecond, momentProperties = hooks.momentProperties = [], updateInProgress = !1; function copyConfig(to, from) { var i, prop, val; if (isUndefined(from._isAMomentObject) || (to._isAMomentObject = from._isAMomentObject), isUndefined(from._i) || (to._i = from._i), isUndefined(from._f) || (to._f = from._f), isUndefined(from._l) || (to._l = from._l), isUndefined(from._strict) || (to._strict = from._strict), isUndefined(from._tzm) || (to._tzm = from._tzm), isUndefined(from._isUTC) || (to._isUTC = from._isUTC), isUndefined(from._offset) || (to._offset = from._offset), isUndefined(from._pf) || (to._pf = getParsingFlags(from)), isUndefined(from._locale) || (to._locale = from._locale), momentProperties.length > 0) for(i = 0; i < momentProperties.length; i++)isUndefined(val = from[prop = momentProperties[i]]) || (to[prop] = val); @@ -932,7 +932,7 @@ hooks.updateOffset = function() {}; var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { - var sign, ret, diffRes, base, other, res, duration = input, match = null; + var base, other, res, sign, ret, diffRes, duration = input, match = null; return isDuration(input) ? duration = { ms: input._milliseconds, d: input._days, @@ -1737,7 +1737,7 @@ var minutes, hours, years, s, totalSign, ymSign, daysSign, hmsSign, seconds = abs$1(this._milliseconds) / 1000, days = abs$1(this._days), months = abs$1(this._months), total = this.asSeconds(); return total ? (minutes = absFloor(seconds / 60), hours = absFloor(minutes / 60), seconds %= 60, minutes %= 60, years = absFloor(months / 12), months %= 12, s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '', totalSign = total < 0 ? '-' : '', ymSign = sign(this._months) !== sign(total) ? '-' : '', daysSign = sign(this._days) !== sign(total) ? '-' : '', hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '', totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '')) : 'P0D'; } - var callback, proto$2 = Duration.prototype; + var proto$2 = Duration.prototype; return proto$2.isValid = function() { return this._isValid; }, proto$2.abs = function() { @@ -1787,8 +1787,8 @@ return absFloor(this.days() / 7); }, proto$2.months = months, proto$2.years = years, proto$2.humanize = function(argWithSuffix, argThresholds) { if (!this.isValid()) return this.localeData().invalidDate(); - var locale, output, posNegDuration, withoutSuffix, thresholds1, locale1, duration, seconds, minutes, hours, days, months, weeks, years, a, withSuffix = !1, th = thresholds; - return 'object' == typeof argWithSuffix && (argThresholds = argWithSuffix, argWithSuffix = !1), 'boolean' == typeof argWithSuffix && (withSuffix = argWithSuffix), 'object' == typeof argThresholds && (th = Object.assign({}, thresholds, argThresholds), null != argThresholds.s && null == argThresholds.ss && (th.ss = argThresholds.s - 1)), locale = this.localeData(), withoutSuffix = !withSuffix, thresholds1 = th, duration = createDuration(this).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = seconds <= thresholds1.ss && [ + var posNegDuration, withoutSuffix, thresholds1, locale, duration, seconds, minutes, hours, days, months, weeks, years, a, locale1, output, withSuffix = !1, th = thresholds; + return 'object' == typeof argWithSuffix && (argThresholds = argWithSuffix, argWithSuffix = !1), 'boolean' == typeof argWithSuffix && (withSuffix = argWithSuffix), 'object' == typeof argThresholds && (th = Object.assign({}, thresholds, argThresholds), null != argThresholds.s && null == argThresholds.ss && (th.ss = argThresholds.s - 1)), locale1 = this.localeData(), withoutSuffix = !withSuffix, thresholds1 = th, duration = createDuration(this).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = seconds <= thresholds1.ss && [ 's', seconds ] || seconds < thresholds1.s && [ @@ -1824,7 +1824,7 @@ ] || [ 'yy', years - ])[2] = withoutSuffix, a[3] = +this > 0, a[4] = locale, output = substituteTimeAgo.apply(null, a), withSuffix && (output = locale.pastFuture(+this, output)), locale.postformat(output); + ])[2] = withoutSuffix, a[3] = +this > 0, a[4] = locale1, output = substituteTimeAgo.apply(null, a), withSuffix && (output = locale1.pastFuture(+this, output)), locale1.postformat(output); }, proto$2.toISOString = toISOString$1, proto$2.toString = toISOString$1, proto$2.toJSON = toISOString$1, proto$2.locale = locale, proto$2.localeData = localeData, proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1), proto$2.lang = lang, addFormatToken('X', 0, 0, 'unix'), addFormatToken('x', 0, 0, 'valueOf'), addRegexToken('x', matchSigned), addRegexToken('X', /[+-]?\d+(\.\d{1,3})?/), addParseToken('X', function(input, array, config) { config._d = new Date(1000 * parseFloat(input)); }), addParseToken('x', function(input, array, config) { diff --git a/crates/swc_ecma_minifier/tests/benches-full/react.js b/crates/swc_ecma_minifier/tests/benches-full/react.js index 117d0e7098a..93f81ed6fd8 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/react.js +++ b/crates/swc_ecma_minifier/tests/benches-full/react.js @@ -578,7 +578,7 @@ function createElementWithValidation(type, props, children) { var validType = isValidElementType(type); if (!validType) { - var typeString, elementProps, source, info = ''; + var source, elementProps, typeString, info = ''; (void 0 === type || 'object' == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var sourceInfo = null != props ? (source = props.__source, void 0 !== source ? '\n\nCheck your code at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + '.' : '') : ''; sourceInfo ? info += sourceInfo : info += getDeclarationErrorAddendum(), null === type ? typeString = 'null' : Array.isArray(type) ? typeString = 'array' : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE ? (typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />", info = ' Did you accidentally export a JSX literal instead of a component?') : typeString = typeof type, error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info); diff --git a/crates/swc_ecma_minifier/tests/benches-full/terser.js b/crates/swc_ecma_minifier/tests/benches-full/terser.js index 97132d27631..02ef160a0c3 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/terser.js +++ b/crates/swc_ecma_minifier/tests/benches-full/terser.js @@ -6,7 +6,7 @@ }(this, function(exports, MOZ_SourceMap) { 'use strict'; let mangle_options; - var def_is_string, def_find_defs, e, MOZ_SourceMap__default = MOZ_SourceMap && 'object' == typeof MOZ_SourceMap && 'default' in MOZ_SourceMap ? MOZ_SourceMap : { + var e, def_is_string, def_find_defs, MOZ_SourceMap__default = MOZ_SourceMap && 'object' == typeof MOZ_SourceMap && 'default' in MOZ_SourceMap ? MOZ_SourceMap : { default: MOZ_SourceMap }; function characters(str) { @@ -482,7 +482,7 @@ case 117: if ("{" == peek()) { for(next(!0), "}" === peek() && parse_error("Expecting hex-character between {}"); "0" == peek();)next(!0); - var result, code, length = find("}", !0) - S.pos; + var code, result, length = find("}", !0) - S.pos; return (length > 6 || (result = hex_bytes(length, strict_hex)) > 0x10FFFF) && parse_error("Unicode reference out of bounds"), next(!0), (code = result) > 0xFFFF ? String.fromCharCode(((code -= 0x10000) >> 10) + 0xD800) + String.fromCharCode(code % 0x400 + 0xDC00) : String.fromCharCode(code); } return String.fromCharCode(hex_bytes(4, strict_hex)); @@ -7080,11 +7080,11 @@ } function can_merge_flow(ab) { if (!ab) return !1; - for(var j = i + 1, len = statements.length; j < len; j++){ + for(var value, j = i + 1, len = statements.length; j < len; j++){ var stat = statements[j]; if (stat instanceof AST_Const || stat instanceof AST_Let) return !1; } - var value, lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null; + var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null; return ab instanceof AST_Return && in_lambda && (!(value = ab.value) || value instanceof AST_UnaryPrefix && "void" == value.operator) || ab instanceof AST_Continue && self1 === loop_body(lct) || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self1 === lct; } function extract_functions() { diff --git a/crates/swc_ecma_minifier/tests/benches-full/three.js b/crates/swc_ecma_minifier/tests/benches-full/three.js index 9c9395978ea..68e77b68c38 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/three.js +++ b/crates/swc_ecma_minifier/tests/benches-full/three.js @@ -5076,7 +5076,7 @@ return 'highp' === parameters.precision ? precisionstring += '\n#define HIGH_PRECISION' : 'mediump' === parameters.precision ? precisionstring += '\n#define MEDIUM_PRECISION' : 'lowp' === parameters.precision && (precisionstring += '\n#define LOW_PRECISION'), precisionstring; } function WebGLProgram(renderer, cacheKey, parameters, bindingStates) { - var encoding, components, prefixVertex, prefixFragment, cachedUniforms, cachedAttributes, parameters1, shadowMapTypeDefine, parameters2, gl = renderer.getContext(), defines = parameters.defines, vertexShader = parameters.vertexShader, fragmentShader = parameters.fragmentShader, shadowMapTypeDefine1 = (shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC', 1 === parameters.shadowMapType ? shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF' : 2 === parameters.shadowMapType ? shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT' : 3 === parameters.shadowMapType && (shadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM'), shadowMapTypeDefine), envMapTypeDefine = function(parameters) { + var parameters1, shadowMapTypeDefine, parameters2, encoding, components, prefixVertex, prefixFragment, cachedUniforms, cachedAttributes, gl = renderer.getContext(), defines = parameters.defines, vertexShader = parameters.vertexShader, fragmentShader = parameters.fragmentShader, shadowMapTypeDefine1 = (shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC', 1 === parameters.shadowMapType ? shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF' : 2 === parameters.shadowMapType ? shadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT' : 3 === parameters.shadowMapType && (shadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM'), shadowMapTypeDefine), envMapTypeDefine = function(parameters) { var envMapTypeDefine = 'ENVMAP_TYPE_CUBE'; if (parameters.envMap) switch(parameters.envMapMode){ case 301: @@ -6401,7 +6401,7 @@ void 0 === textureProperties.__webglInit && (textureProperties.__webglInit = !0, texture.addEventListener('dispose', onTextureDispose), textureProperties.__webglTexture = _gl.createTexture(), info.memory.textures++); } function uploadTexture(textureProperties, texture, slot) { - var mipmap, texture1, textureType = 3553; + var texture1, mipmap, textureType = 3553; texture.isDataTexture2DArray && (textureType = 35866), texture.isDataTexture3D && (textureType = 32879), initTexture(textureProperties, texture), state.activeTexture(33984 + slot), state.bindTexture(textureType, textureProperties.__webglTexture), _gl.pixelStorei(37440, texture.flipY), _gl.pixelStorei(37441, texture.premultiplyAlpha), _gl.pixelStorei(3317, texture.unpackAlignment); var needsPowerOfTwo = !isWebGL2 && (1001 !== texture.wrapS || 1001 !== texture.wrapT || 1003 !== texture.minFilter && 1006 !== texture.minFilter) && !1 === isPowerOfTwo(texture.image), image = resizeImage(texture.image, needsPowerOfTwo, !1, maxTextureSize), supportsMips = isPowerOfTwo(image) || isWebGL2, glFormat = utils.convert(texture.format), glType = utils.convert(texture.type), glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType); setTextureParameters(textureType, texture, supportsMips); @@ -6946,7 +6946,7 @@ } function initMaterial(material, scene, object) { !0 !== scene.isScene && (scene = _emptyScene); - var materialProperties = properties.get(material), lights = currentRenderState.state.lights, shadowsArray = currentRenderState.state.shadowsArray, lightsStateVersion = lights.state.version, parameters = programCache.getParameters(material, lights.state, shadowsArray, scene, object), programCacheKey = programCache.getProgramCacheKey(parameters), program = materialProperties.program, programChange = !0; + var material1, materialProperties = properties.get(material), lights = currentRenderState.state.lights, shadowsArray = currentRenderState.state.shadowsArray, lightsStateVersion = lights.state.version, parameters = programCache.getParameters(material, lights.state, shadowsArray, scene, object), programCacheKey = programCache.getProgramCacheKey(parameters), program = materialProperties.program, programChange = !0; if (void 0 === program) material.addEventListener('dispose', onMaterialDispose); else if (program.cacheKey !== programCacheKey) releaseMaterialProgramReference(material); else if (materialProperties.lightsStateVersion !== lightsStateVersion) programChange = !1; @@ -6956,7 +6956,7 @@ return; } else programChange = !1; programChange && (parameters.uniforms = programCache.getUniforms(material), material.onBeforeCompile(parameters, _this), program = programCache.acquireProgram(parameters, programCacheKey), materialProperties.program = program, materialProperties.uniforms = parameters.uniforms, materialProperties.outputEncoding = parameters.outputEncoding); - var material1, uniforms = materialProperties.uniforms; + var uniforms = materialProperties.uniforms; (material.isShaderMaterial || material.isRawShaderMaterial) && !0 !== material.clipping || (materialProperties.numClippingPlanes = clipping.numPlanes, materialProperties.numIntersection = clipping.numIntersection, uniforms.clippingPlanes = clipping.uniform), materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null, materialProperties.fog = scene.fog, materialProperties.envMap = cubemaps.get(material.envMap || materialProperties.environment), materialProperties.needsLights = (material1 = material, material1.isMeshLambertMaterial || material1.isMeshToonMaterial || material1.isMeshPhongMaterial || material1.isMeshStandardMaterial || material1.isShadowMaterial || material1.isShaderMaterial && !0 === material1.lights), materialProperties.lightsStateVersion = lightsStateVersion, materialProperties.needsLights && (uniforms.ambientLightColor.value = lights.state.ambient, uniforms.lightProbe.value = lights.state.probe, uniforms.directionalLights.value = lights.state.directional, uniforms.directionalLightShadows.value = lights.state.directionalShadow, uniforms.spotLights.value = lights.state.spot, uniforms.spotLightShadows.value = lights.state.spotShadow, uniforms.rectAreaLights.value = lights.state.rectArea, uniforms.ltc_1.value = lights.state.rectAreaLTC1, uniforms.ltc_2.value = lights.state.rectAreaLTC2, uniforms.pointLights.value = lights.state.point, uniforms.pointLightShadows.value = lights.state.pointShadow, uniforms.hemisphereLights.value = lights.state.hemi, uniforms.directionalShadowMap.value = lights.state.directionalShadowMap, uniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix, uniforms.spotShadowMap.value = lights.state.spotShadowMap, uniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix, uniforms.pointShadowMap.value = lights.state.pointShadowMap, uniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix); var progUniforms = materialProperties.program.getUniforms(), uniformsList = WebGLUniforms.seqWithValue(progUniforms.seq, uniforms); materialProperties.uniformsList = uniformsList; diff --git a/crates/swc_ecma_minifier/tests/benches-full/victory.js b/crates/swc_ecma_minifier/tests/benches-full/victory.js index 78c8a4f4a01..b4d04c8b666 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/victory.js +++ b/crates/swc_ecma_minifier/tests/benches-full/victory.js @@ -6720,13 +6720,13 @@ } return new Delaunator(coords); }, Delaunator.prototype.update = function() { - for(var i0, i1, i2, coords = this.coords, hullPrev = this._hullPrev, hullNext = this._hullNext, hullTri = this._hullTri, hullHash = this._hullHash, n = coords.length >> 1, minX = 1 / 0, minY = 1 / 0, maxX = -1 / 0, maxY = -1 / 0, i = 0; i < n; i++){ + for(var ax, ay, bx, by, cx, cy, dx, dy, ex, ey, bl, cl, d, i0, i1, i2, coords = this.coords, hullPrev = this._hullPrev, hullNext = this._hullNext, hullTri = this._hullTri, hullHash = this._hullHash, n = coords.length >> 1, minX = 1 / 0, minY = 1 / 0, maxX = -1 / 0, maxY = -1 / 0, i = 0; i < n; i++){ var x = coords[2 * i], y = coords[2 * i + 1]; x < minX && (minX = x), y < minY && (minY = y), x > maxX && (maxX = x), y > maxY && (maxY = y), this._ids[i] = i; } - for(var cx = (minX + maxX) / 2, cy = (minY + maxY) / 2, minDist = 1 / 0, i$1 = 0; i$1 < n; i$1++){ - var d = dist(cx, cy, coords[2 * i$1], coords[2 * i$1 + 1]); - d < minDist && (i0 = i$1, minDist = d); + for(var cx1 = (minX + maxX) / 2, cy1 = (minY + maxY) / 2, minDist = 1 / 0, i$1 = 0; i$1 < n; i$1++){ + var d1 = dist(cx1, cy1, coords[2 * i$1], coords[2 * i$1 + 1]); + d1 < minDist && (i0 = i$1, minDist = d1); } var i0x = coords[2 * i0], i0y = coords[2 * i0 + 1]; minDist = 1 / 0; @@ -6753,9 +6753,9 @@ var i$6 = i1, x$1 = i1x, y$1 = i1y; i1 = i2, i1x = i2x, i1y = i2y, i2 = i$6, i2x = x$1, i2y = y$1; } - var ax, ay, bx, by, cx1, cy1, dx, dy, ex, ey, bl, cl, d1, center = (ax = i0x, ay = i0y, bx = i1x, by = i1y, cx1 = i2x, cy1 = i2y, dx = bx - ax, dy = by - ay, ex = cx1 - ax, ey = cy1 - ay, bl = dx * dx + dy * dy, cl = ex * ex + ey * ey, d1 = 0.5 / (dx * ey - dy * ex), { - x: ax + (ey * bl - dy * cl) * d1, - y: ay + (dx * cl - ex * bl) * d1 + var center = (ax = i0x, ay = i0y, bx = i1x, by = i1y, cx = i2x, cy = i2y, dx = bx - ax, dy = by - ay, ex = cx - ax, ey = cy - ay, bl = dx * dx + dy * dy, cl = ex * ex + ey * ey, d = 0.5 / (dx * ey - dy * ex), { + x: ax + (ey * bl - dy * cl) * d, + y: ay + (dx * cl - ex * bl) * d }); this._cx = center.x, this._cy = center.y; for(var i$7 = 0; i$7 < n; i$7++)this._dists[i$7] = dist(coords[2 * i$7], coords[2 * i$7 + 1], center.x, center.y); @@ -9696,9 +9696,9 @@ { key: "render", value: function() { - var animationWhitelist = VictoryAxis.animationWhitelist, props = victory_core__WEBPACK_IMPORTED_MODULE_4__.Axis.modifyProps(this.props, fallbackProps); + var arr, animationWhitelist = VictoryAxis.animationWhitelist, props = victory_core__WEBPACK_IMPORTED_MODULE_4__.Axis.modifyProps(this.props, fallbackProps); if (this.shouldAnimate()) return this.animateComponent(props, animationWhitelist); - var arr, gridAndTicks = this.renderGridAndTicks(props), children = [ + var gridAndTicks = this.renderGridAndTicks(props), children = [ this.renderLine(props), this.renderLabel(props) ].concat(function(arr) { @@ -14097,7 +14097,7 @@ }; }; }, interpolateObject = function(a, b) { - var x, y, k, keyData = function(val) { + var k, x, y, keyData = function(val) { return Array.isArray(val) ? lodash_orderBy__WEBPACK_IMPORTED_MODULE_0___default()(val, "key") : val; }, i = {}, c = {}; for(k in (null === a || "object" != typeof a) && (a = {}), (null === b || "object" != typeof b) && (b = {}), b)k in a ? i[k] = (x = keyData(a[k]), y = keyData(b[k]), x !== y && isInterpolatable(x) && isInterpolatable(y) ? "function" == typeof x || "function" == typeof y ? interpolateFunction(x, y) : "object" == typeof x && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(x) || "object" == typeof y && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(y) ? interpolateObject(x, y) : Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__.interpolate)(x, y) : interpolateImmediate(x, y)) : c[k] = b[k]; @@ -17123,18 +17123,18 @@ return void 0 !== props.tickValues && _collection__WEBPACK_IMPORTED_MODULE_13__.default.containsStrings(props.tickValues); } function getTickArray(props) { - var tickValues = props.tickValues, tickFormat = props.tickFormat, axis = getAxis(props), stringMap = props.stringMap && props.stringMap[axis], ticks = tickValues; - stringMap && (props1 = props, axis1 = getAxis(props1), stringMap1 = props1.stringMap && props1.stringMap[axis1], ticksFromCategories = (categories = Array.isArray(props1.categories) ? props1.categories : props1.categories && props1.categories[axis1]) && _collection__WEBPACK_IMPORTED_MODULE_13__.default.containsOnlyStrings(categories) ? categories.map(function(tick) { - return stringMap1[tick]; - }) : void 0, ticksFromStringMap = stringMap1 && lodash_values__WEBPACK_IMPORTED_MODULE_2___default()(stringMap1), ticks = ticksFromCategories && 0 !== ticksFromCategories.length ? ticksFromCategories : ticksFromStringMap), tickValues && _collection__WEBPACK_IMPORTED_MODULE_13__.default.containsStrings(tickValues) && (ticks = stringMap ? tickValues.map(function(tick) { + var props1, axis, stringMap, categories, ticksFromCategories, ticksFromStringMap, arr, newTickArray, domain, tickValues = props.tickValues, tickFormat = props.tickFormat, axis1 = getAxis(props), stringMap1 = props.stringMap && props.stringMap[axis1], ticks = tickValues; + stringMap1 && (props1 = props, axis = getAxis(props1), stringMap = props1.stringMap && props1.stringMap[axis], ticksFromCategories = (categories = Array.isArray(props1.categories) ? props1.categories : props1.categories && props1.categories[axis]) && _collection__WEBPACK_IMPORTED_MODULE_13__.default.containsOnlyStrings(categories) ? categories.map(function(tick) { return stringMap[tick]; + }) : void 0, ticksFromStringMap = stringMap && lodash_values__WEBPACK_IMPORTED_MODULE_2___default()(stringMap), ticks = ticksFromCategories && 0 !== ticksFromCategories.length ? ticksFromCategories : ticksFromStringMap), tickValues && _collection__WEBPACK_IMPORTED_MODULE_13__.default.containsStrings(tickValues) && (ticks = stringMap1 ? tickValues.map(function(tick) { + return stringMap1[tick]; }) : lodash_range__WEBPACK_IMPORTED_MODULE_4___default()(1, tickValues.length + 1)); - var props1, axis1, stringMap1, categories, ticksFromCategories, ticksFromStringMap, arr, newTickArray, domain, tickArray = ticks ? lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default()(ticks) : function() { + var tickArray = ticks ? lodash_uniq__WEBPACK_IMPORTED_MODULE_5___default()(ticks) : function() { if (tickFormat && Array.isArray(tickFormat)) return _collection__WEBPACK_IMPORTED_MODULE_13__.default.containsStrings(tickFormat) ? tickFormat.map(function(t, i) { return i; }) : tickFormat; }(props); - return Array.isArray(tickArray) && tickArray.length ? (newTickArray = [], domain = props.domain && props.domain[axis] || props.domain, tickArray ? (tickArray.forEach(function(t, index) { + return Array.isArray(tickArray) && tickArray.length ? (newTickArray = [], domain = props.domain && props.domain[axis1] || props.domain, tickArray ? (tickArray.forEach(function(t, index) { Array.isArray(domain) ? t >= _collection__WEBPACK_IMPORTED_MODULE_13__.default.getMinValue(domain) && t <= _collection__WEBPACK_IMPORTED_MODULE_13__.default.getMaxValue(domain) && newTickArray.push({ value: t, index: index @@ -17651,7 +17651,7 @@ } function formatData(dataset, props, expectedKeys) { if (!(Array.isArray(dataset) || _immutable__WEBPACK_IMPORTED_MODULE_17__.default.isIterable(dataset)) || 1 > getLength(dataset)) return []; - var defaultKeys = [ + var stringMap, props1, data, hasEventKeyAccessor, key, eventKeyAccessor, defaultKeys = [ "x", "y", "y0" @@ -17664,7 +17664,7 @@ y: -1 !== expectedKeys.indexOf("y") ? createStringMap(props, "y") : void 0, y0: -1 !== expectedKeys.indexOf("y0") ? createStringMap(props, "y") : void 0 }); - var stringMap, props1, data, hasEventKeyAccessor, key, eventKeyAccessor, data1 = preformattedData ? dataset : dataset.reduce(function(dataArr, datum, index) { + var data1 = preformattedData ? dataset : dataset.reduce(function(dataArr, datum, index) { datum = parseDatum(datum); var fallbackValues = { x: index, @@ -18021,9 +18021,9 @@ } function getDomainFromData(props, axis, dataset) { dataset = dataset || _data__WEBPACK_IMPORTED_MODULE_7__.default.getData(props); - var polar = props.polar, _props$startAngle2 = props.startAngle, _props$endAngle2 = props.endAngle, minDomain = getMinFromProps(props, axis), maxDomain = getMaxFromProps(props, axis); + var dataset1, axis1, polar = props.polar, _props$startAngle2 = props.startAngle, _props$endAngle2 = props.endAngle, minDomain = getMinFromProps(props, axis), maxDomain = getMaxFromProps(props, axis); if (dataset.length < 1) return void 0 !== minDomain && void 0 !== maxDomain ? getDomainFromMinMax(minDomain, maxDomain) : void 0; - var dataset1, axis1, min = void 0 !== minDomain ? minDomain : getExtremeFromData(dataset, axis, "min"), max = void 0 !== maxDomain ? maxDomain : getExtremeFromData(dataset, axis, "max"), domain = getDomainFromMinMax(min, max); + var min = void 0 !== minDomain ? minDomain : getExtremeFromData(dataset, axis, "min"), max = void 0 !== maxDomain ? maxDomain : getExtremeFromData(dataset, axis, "max"), domain = getDomainFromMinMax(min, max); return polar && "x" === axis && 360 === Math.abs((void 0 === _props$startAngle2 ? 0 : _props$startAngle2) - (void 0 === _props$endAngle2 ? 360 : _props$endAngle2)) ? getSymmetricDomain(domain, (dataset1 = dataset, lodash_flatten__WEBPACK_IMPORTED_MODULE_5___default()(dataset1).map(function(datum) { return datum["_".concat(axis)] && void 0 !== datum["_".concat(axis)][1] ? datum["_".concat(axis)][1] : datum["_".concat(axis)]; }))) : domain; @@ -18589,12 +18589,12 @@ getDegrees: getDegrees, getProps: function(props, index) { var props1, datum, style, horizontal, sign, labelStyle, props2, datum1, sign1, labelStyle1, props3, datum2, labelStyle2, scale = props.scale, data = props.data, style1 = props.style, horizontal1 = props.horizontal, polar = props.polar, width = props.width, height = props.height, theme = props.theme, labelComponent = props.labelComponent, datum3 = data[index], degrees = getDegrees(props, datum3), textAnchor = polar ? getPolarTextAnchor(props, degrees) : (datum = (datum = datum3) || {}, style = props.style, horizontal = props.horizontal, sign = datum._y >= 0 ? 1 : -1, labelStyle = style && style.labels || {}, datum.verticalAnchor || labelStyle.verticalAnchor ? datum.verticalAnchor || labelStyle.verticalAnchor : horizontal ? sign >= 0 ? "start" : "end" : "middle"), verticalAnchor = polar ? getPolarVerticalAnchor(props, degrees) : (sign1 = (datum1 = (datum1 = datum3) || {})._y >= 0 ? 1 : -1, labelStyle1 = props.style && props.style.labels || {}, datum1.verticalAnchor || labelStyle1.verticalAnchor ? datum1.verticalAnchor || labelStyle1.verticalAnchor : props.horizontal ? "middle" : sign1 >= 0 ? "end" : "start"), angle = (datum2 = (datum2 = datum3) || {}, labelStyle2 = props.style && props.style.labels || {}, void 0 === datum2.angle ? labelStyle2.angle : datum2.angle), text = getText(props, datum3, index), labelPlacement = getLabelPlacement(props), _getPosition = function(props, datum) { - var polar = props.polar, _Helpers$scalePoint = _helpers__WEBPACK_IMPORTED_MODULE_1__.default.scalePoint(props, datum), x = _Helpers$scalePoint.x, y = _Helpers$scalePoint.y; + var props1, datum1, style, degrees, labelStyle, padding, angle, polar = props.polar, _Helpers$scalePoint = _helpers__WEBPACK_IMPORTED_MODULE_1__.default.scalePoint(props, datum), x = _Helpers$scalePoint.x, y = _Helpers$scalePoint.y; if (!polar) return { x: x, y: y }; - var props1, datum1, style, degrees, labelStyle, padding, angle, polarPadding = (props1 = props, datum1 = datum, style = props1.style, degrees = getDegrees(props1, datum1), labelStyle = style.labels || {}, padding = _helpers__WEBPACK_IMPORTED_MODULE_1__.default.evaluateProp(labelStyle.padding, props1) || 0, angle = _helpers__WEBPACK_IMPORTED_MODULE_1__.default.degreesToRadians(degrees), { + var polarPadding = (props1 = props, datum1 = datum, style = props1.style, degrees = getDegrees(props1, datum1), labelStyle = style.labels || {}, padding = _helpers__WEBPACK_IMPORTED_MODULE_1__.default.evaluateProp(labelStyle.padding, props1) || 0, angle = _helpers__WEBPACK_IMPORTED_MODULE_1__.default.degreesToRadians(degrees), { x: padding * Math.cos(angle), y: -padding * Math.sin(angle) }); @@ -22889,9 +22889,9 @@ return Array.isArray(this.componentEvents) && (events = Array.isArray(props.events) ? (_componentEvents = this.componentEvents).concat.apply(_componentEvents, _toConsumableArray(props.events)) : this.componentEvents), events || []; }, getAnimationProps: function(props, child, index) { - var _this = this; + var childrenTransitions, _this = this; if (!props.animate) return child.props.animate; - var childrenTransitions, getTransitions = props.animate && props.animate.getTransitions, state = (childrenTransitions = _this.state && _this.state.childrenTransitions, childrenTransitions = _collection__WEBPACK_IMPORTED_MODULE_17__.default.isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions, lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({ + var getTransitions = props.animate && props.animate.getTransitions, state = (childrenTransitions = _this.state && _this.state.childrenTransitions, childrenTransitions = _collection__WEBPACK_IMPORTED_MODULE_17__.default.isArrayOfArrays(childrenTransitions) ? childrenTransitions[index] : childrenTransitions, lodash_defaults__WEBPACK_IMPORTED_MODULE_8___default()({ childrenTransitions: childrenTransitions }, _this.state)), parentState = props.animate && props.animate.parentState || state; if (!getTransitions) { @@ -24398,7 +24398,7 @@ }), __webpack_require__.d(__webpack_exports__, "getBaseProps", function() { return getBaseProps; }); - var lodash_isNil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../../node_modules/lodash/isNil.js"), lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(lodash_isNil__WEBPACK_IMPORTED_MODULE_0__), lodash_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../node_modules/lodash/assign.js"), lodash_assign__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_1__), victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../victory-core/es/index.js"), victory_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../victory-bar/es/index.js"), react_fast_compare__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../../../node_modules/react-fast-compare/index.js"), react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__), d3_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("../../victory-histogram/node_modules/d3-array/src/index.js"), d3_scale__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("../../../node_modules/d3-scale/index.js"); + var func, lastArgs, lastReturnVal, called, lodash_isNil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../../node_modules/lodash/isNil.js"), lodash_isNil__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(lodash_isNil__WEBPACK_IMPORTED_MODULE_0__), lodash_assign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../../node_modules/lodash/assign.js"), lodash_assign__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(lodash_assign__WEBPACK_IMPORTED_MODULE_1__), victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../victory-core/es/index.js"), victory_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../victory-bar/es/index.js"), react_fast_compare__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../../../node_modules/react-fast-compare/index.js"), react_fast_compare__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_4__), d3_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("../../victory-histogram/node_modules/d3-array/src/index.js"), d3_scale__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("../../../node_modules/d3-scale/index.js"); function _objectSpread(target) { for(var i = 1; i < arguments.length; i++){ var source = null != arguments[i] ? arguments[i] : {}, ownKeys = Object.keys(source); @@ -24418,7 +24418,7 @@ writable: !0 }) : obj[key] = value, obj; } - var func, lastArgs, lastReturnVal, called, dataOrBinsContainDates = function(_ref) { + var dataOrBinsContainDates = function(_ref) { var data = _ref.data, bins = _ref.bins, x = _ref.x, xAccessor = victory_core__WEBPACK_IMPORTED_MODULE_2__.Helpers.createAccessor(x || "x"), dataIsDates = data.some(function(datum) { return xAccessor(datum) instanceof Date; }), binsHasDates = Array.isArray(bins) && bins.some(function(bin) { @@ -25008,7 +25008,8 @@ }); var _ascending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../victory-histogram/node_modules/d3-array/src/ascending.js"); function greatest(values, compare = _ascending_js__WEBPACK_IMPORTED_MODULE_0__.default) { - let max, defined = !1; + let max; + let defined = !1; if (1 === compare.length) { let maxValue; for (const element of values){ @@ -25256,7 +25257,8 @@ }); var _ascending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../victory-histogram/node_modules/d3-array/src/ascending.js"); function least(values, compare = _ascending_js__WEBPACK_IMPORTED_MODULE_0__.default) { - let min, defined = !1; + let min; + let defined = !1; if (1 === compare.length) { let minValue; for (const element of values){ @@ -25299,7 +25301,8 @@ "../../victory-histogram/node_modules/d3-array/src/maxIndex.js": function(module1, __webpack_exports__, __webpack_require__) { "use strict"; function maxIndex(values, valueof) { - let max, maxIndex = -1, index = -1; + let max; + let maxIndex = -1, index = -1; if (void 0 === valueof) for (const value of values)++index, null != value && (max < value || void 0 === max && value >= value) && (max = value, maxIndex = index); else for (let value1 of values)null != (value1 = valueof(value1, ++index, values)) && (max < value1 || void 0 === max && value1 >= value1) && (max = value1, maxIndex = index); return maxIndex; @@ -25360,7 +25363,8 @@ "../../victory-histogram/node_modules/d3-array/src/minIndex.js": function(module1, __webpack_exports__, __webpack_require__) { "use strict"; function minIndex(values, valueof) { - let min, minIndex = -1, index = -1; + let min; + let minIndex = -1, index = -1; if (void 0 === valueof) for (const value of values)++index, null != value && (min > value || void 0 === min && value >= value) && (min = value, minIndex = index); else for (let value1 of values)null != (value1 = valueof(value1, ++index, values)) && (min > value1 || void 0 === min && value1 >= value1) && (min = value1, minIndex = index); return minIndex; @@ -27994,7 +27998,7 @@ }, onMouseDown: function(evt, targetProps) { evt.preventDefault(); - var activateSelectedData = targetProps.activateSelectedData, allowSelection = targetProps.allowSelection, polar = targetProps.polar, selectedData = targetProps.selectedData; + var arr, activateSelectedData = targetProps.activateSelectedData, allowSelection = targetProps.allowSelection, polar = targetProps.polar, selectedData = targetProps.selectedData; if (!allowSelection) return {}; var dimension = this.getDimension(targetProps), parentSVG = targetProps.parentSVG || victory_core__WEBPACK_IMPORTED_MODULE_5__.Selection.getParentSVG(evt), _Selection$getSVGEven = victory_core__WEBPACK_IMPORTED_MODULE_5__.Selection.getSVGEventCoordinates(evt, parentSVG), x = _Selection$getSVGEven.x, y = _Selection$getSVGEven.y, x1 = polar || "y" !== dimension ? x : victory_core__WEBPACK_IMPORTED_MODULE_5__.Selection.getDomainCoordinates(targetProps).x[0], y1 = polar || "x" !== dimension ? y : victory_core__WEBPACK_IMPORTED_MODULE_5__.Selection.getDomainCoordinates(targetProps).y[0], x2 = polar || "y" !== dimension ? x : victory_core__WEBPACK_IMPORTED_MODULE_5__.Selection.getDomainCoordinates(targetProps).x[1], y2 = polar || "x" !== dimension ? y : victory_core__WEBPACK_IMPORTED_MODULE_5__.Selection.getDomainCoordinates(targetProps).y[1], mutatedProps = { x1: x1, @@ -28005,7 +28009,7 @@ parentSVG: parentSVG }; selectedData && lodash_isFunction__WEBPACK_IMPORTED_MODULE_1___default()(targetProps.onSelectionCleared) && targetProps.onSelectionCleared(lodash_defaults__WEBPACK_IMPORTED_MODULE_3___default()({}, mutatedProps, targetProps)); - var arr, parentMutation = [ + var parentMutation = [ { target: "parent", mutation: function() { @@ -28639,9 +28643,9 @@ }; function getCalculatedProps(props, childComponents) { childComponents = childComponents || react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.toArray(props.children); - var role = "stack"; + var props1, childComponents1, filterNullChildData, props2, datasets, fillInMissingData, xMap, xKeys, xArr, datasets1, role = "stack"; props = victory_core__WEBPACK_IMPORTED_MODULE_4__.Helpers.modifyProps(props, fallbackProps, role); - var props1, childComponents1, filterNullChildData, props2, datasets, fillInMissingData, xMap, xKeys, xArr, datasets1, style = victory_core__WEBPACK_IMPORTED_MODULE_4__.Wrapper.getStyle(props.theme, props.style, role), categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_4__.Wrapper.getCategories(props, childComponents), datasets2 = props.datasets || (props1 = props, childComponents1 = childComponents, filterNullChildData = victory_core__WEBPACK_IMPORTED_MODULE_4__.Wrapper.getDataFromChildren(props1, childComponents1).map(function(dataset) { + var style = victory_core__WEBPACK_IMPORTED_MODULE_4__.Wrapper.getStyle(props.theme, props.style, role), categories = props.categories || victory_core__WEBPACK_IMPORTED_MODULE_4__.Wrapper.getCategories(props, childComponents), datasets2 = props.datasets || (props1 = props, childComponents1 = childComponents, filterNullChildData = victory_core__WEBPACK_IMPORTED_MODULE_4__.Wrapper.getDataFromChildren(props1, childComponents1).map(function(dataset) { return dataset.filter(function(datum) { return null !== datum._x && null !== datum._y; }); diff --git a/crates/swc_ecma_minifier/tests/benches-full/vue.js b/crates/swc_ecma_minifier/tests/benches-full/vue.js index e1ffc5fab68..8bdbaa50f5c 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/vue.js +++ b/crates/swc_ecma_minifier/tests/benches-full/vue.js @@ -2,7 +2,7 @@ 'object' == typeof exports && 'undefined' != typeof module ? module.exports = factory() : 'function' == typeof define && define.amd ? define(factory) : (global1 = global1 || self).Vue = factory(); }(this, function() { 'use strict'; - var _isServer, _Set, timerFunc, mark, measure, initProxy, target, len, str, chr, index$1, expressionPos, expressionEndPos, warn$1, target$1, svgContainer, emptyStyle, decoder, warn$2, delimiters, transforms, preTransforms, postTransforms, platformIsPreTag, platformMustUseProp, platformGetTagNamespace, maybeComponent, isStaticKey, isPlatformReservedTag, div, emptyObject = Object.freeze({}); + var Vue, Vue1, dataDef, propsDef, Vue2, hookRE, Vue3, Vue4, Vue5, configDef, Vue6, Vue7, Vue8, cid, Vue9, modules, baseCompile, _isServer, _Set, timerFunc, mark, measure, initProxy, target, len, str, chr, index$1, expressionPos, expressionEndPos, warn$1, target$1, svgContainer, emptyStyle, decoder, warn$2, delimiters, transforms, preTransforms, postTransforms, platformIsPreTag, platformMustUseProp, platformGetTagNamespace, maybeComponent, isStaticKey, isPlatformReservedTag, div, emptyObject = Object.freeze({}); function isUndef(v) { return null == v; } @@ -1325,8 +1325,8 @@ } return options; } - function Vue(options) { - this instanceof Vue || warn('Vue is a constructor and should be called with the `new` keyword'), this._init(options); + function Vue10(options) { + this instanceof Vue10 || warn('Vue is a constructor and should be called with the `new` keyword'), this._init(options); } function getComponentName(opts) { return opts && (opts.Ctor.options.name || opts.tag); @@ -1348,28 +1348,28 @@ var cached$$1 = cache[key]; cached$$1 && (!current || cached$$1.tag !== current.tag) && cached$$1.componentInstance.$destroy(), cache[key] = null, remove(keys, key); } - (Vue1 = Vue).prototype._init = function(options) { - var startTag, endTag, vm, listeners, vm1, options1, parentVnode, renderContext, parentData, vm2, opts, vm3, provide, vm4, options2, opts1, parentVnode1, vnodeComponentOptions, vm5, value, value1, result, vm6 = this; - vm6._uid = uid$3++, config.performance && mark && (startTag = "vue-perf-start:" + vm6._uid, endTag = "vue-perf-end:" + vm6._uid, mark(startTag)), vm6._isVue = !0, options && options._isComponent ? (vm4 = vm6, options2 = options, opts1 = vm4.$options = Object.create(vm4.constructor.options), parentVnode1 = options2._parentVnode, opts1.parent = options2.parent, opts1._parentVnode = parentVnode1, vnodeComponentOptions = parentVnode1.componentOptions, opts1.propsData = vnodeComponentOptions.propsData, opts1._parentListeners = vnodeComponentOptions.listeners, opts1._renderChildren = vnodeComponentOptions.children, opts1._componentTag = vnodeComponentOptions.tag, options2.render && (opts1.render = options2.render, opts1.staticRenderFns = options2.staticRenderFns)) : vm6.$options = mergeOptions(resolveConstructorOptions(vm6.constructor), options || {}, vm6), initProxy(vm6), vm6._self = vm6, function(vm) { + (Vue = Vue10).prototype._init = function(options) { + var vm, options1, opts, parentVnode, vnodeComponentOptions, vm1, value, value1, result, vm2, listeners, vm3, options2, parentVnode1, renderContext, parentData, vm4, opts1, vm5, provide, startTag, endTag, vm6 = this; + vm6._uid = uid$3++, config.performance && mark && (startTag = "vue-perf-start:" + vm6._uid, endTag = "vue-perf-end:" + vm6._uid, mark(startTag)), vm6._isVue = !0, options && options._isComponent ? (vm = vm6, options1 = options, opts = vm.$options = Object.create(vm.constructor.options), parentVnode = options1._parentVnode, opts.parent = options1.parent, opts._parentVnode = parentVnode, vnodeComponentOptions = parentVnode.componentOptions, opts.propsData = vnodeComponentOptions.propsData, opts._parentListeners = vnodeComponentOptions.listeners, opts._renderChildren = vnodeComponentOptions.children, opts._componentTag = vnodeComponentOptions.tag, options1.render && (opts.render = options1.render, opts.staticRenderFns = options1.staticRenderFns)) : vm6.$options = mergeOptions(resolveConstructorOptions(vm6.constructor), options || {}, vm6), initProxy(vm6), vm6._self = vm6, function(vm) { var options = vm.$options, parent = options.parent; if (parent && !options.abstract) { for(; parent.$options.abstract && parent.$parent;)parent = parent.$parent; parent.$children.push(vm); } vm.$parent = parent, vm.$root = parent ? parent.$root : vm, vm.$children = [], vm.$refs = {}, vm._watcher = null, vm._inactive = null, vm._directInactive = !1, vm._isMounted = !1, vm._isDestroyed = !1, vm._isBeingDestroyed = !1; - }(vm6), (vm = vm6)._events = Object.create(null), vm._hasHookEvent = !1, (listeners = vm.$options._parentListeners) && updateComponentListeners(vm, listeners), (vm1 = vm6)._vnode = null, vm1._staticTrees = null, options1 = vm1.$options, renderContext = (parentVnode = vm1.$vnode = options1._parentVnode) && parentVnode.context, vm1.$slots = resolveSlots(options1._renderChildren, renderContext), vm1.$scopedSlots = emptyObject, vm1._c = function(a, b, c, d) { - return createElement(vm1, a, b, c, d, !1); - }, vm1.$createElement = function(a, b, c, d) { - return createElement(vm1, a, b, c, d, !0); - }, parentData = parentVnode && parentVnode.data, defineReactive$$1(vm1, '$attrs', parentData && parentData.attrs || emptyObject, function() { - isUpdatingChildComponent || warn("$attrs is readonly.", vm1); - }, !0), defineReactive$$1(vm1, '$listeners', options1._parentListeners || emptyObject, function() { - isUpdatingChildComponent || warn("$listeners is readonly.", vm1); - }, !0), callHook(vm6, 'beforeCreate'), vm5 = vm6, (result = resolveInject(vm5.$options.inject, vm5)) && (shouldObserve = value = !1, Object.keys(result).forEach(function(key) { - defineReactive$$1(vm5, key, result[key], function() { - warn('Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "' + key + "\"", vm5); + }(vm6), (vm2 = vm6)._events = Object.create(null), vm2._hasHookEvent = !1, (listeners = vm2.$options._parentListeners) && updateComponentListeners(vm2, listeners), (vm3 = vm6)._vnode = null, vm3._staticTrees = null, options2 = vm3.$options, renderContext = (parentVnode1 = vm3.$vnode = options2._parentVnode) && parentVnode1.context, vm3.$slots = resolveSlots(options2._renderChildren, renderContext), vm3.$scopedSlots = emptyObject, vm3._c = function(a, b, c, d) { + return createElement(vm3, a, b, c, d, !1); + }, vm3.$createElement = function(a, b, c, d) { + return createElement(vm3, a, b, c, d, !0); + }, parentData = parentVnode1 && parentVnode1.data, defineReactive$$1(vm3, '$attrs', parentData && parentData.attrs || emptyObject, function() { + isUpdatingChildComponent || warn("$attrs is readonly.", vm3); + }, !0), defineReactive$$1(vm3, '$listeners', options2._parentListeners || emptyObject, function() { + isUpdatingChildComponent || warn("$listeners is readonly.", vm3); + }, !0), callHook(vm6, 'beforeCreate'), vm1 = vm6, (result = resolveInject(vm1.$options.inject, vm1)) && (shouldObserve = value = !1, Object.keys(result).forEach(function(key) { + defineReactive$$1(vm1, key, result[key], function() { + warn('Avoid mutating an injected value directly since the changes will be overwritten whenever the provided component re-renders. injection being mutated: "' + key + "\"", vm1); }); - }), shouldObserve = value1 = !0), (vm2 = vm6)._watchers = [], (opts = vm2.$options).props && function(vm, propsOptions) { + }), shouldObserve = value1 = !0), (vm4 = vm6)._watchers = [], (opts1 = vm4.$options).props && function(vm, propsOptions) { var value, value1, propsData = vm.$options.propsData || {}, props = vm._props = {}, keys = vm.$options._propKeys = [], isRoot = !vm.$parent; !isRoot && (shouldObserve = value = !1); var loop = function(key) { @@ -1381,10 +1381,10 @@ }; for(var key in propsOptions)loop(key); shouldObserve = !0; - }(vm2, opts.props), opts.methods && function(vm, methods) { + }(vm4, opts1.props), opts1.methods && function(vm, methods) { var props = vm.$options.props; for(var key in methods)'function' != typeof methods[key] && warn("Method \"" + key + "\" has type \"" + typeof methods[key] + '" in the component definition. Did you reference the function correctly?', vm), props && hasOwn(props, key) && warn("Method \"" + key + "\" has already been defined as a prop.", vm), key in vm && isReserved(key) && warn("Method \"" + key + '" conflicts with an existing Vue instance method. Avoid defining component methods that start with _ or $.'), vm[key] = 'function' != typeof methods[key] ? noop : bind(methods[key], vm); - }(vm2, opts.methods), opts.data ? function(vm) { + }(vm4, opts1.methods), opts1.data ? function(vm) { var data = vm.$options.data; data = vm._data = 'function' == typeof data ? function(data, vm) { pushTarget(); @@ -1401,20 +1401,20 @@ methods && hasOwn(methods, key) && warn("Method \"" + key + "\" has already been defined as a data property.", vm), props && hasOwn(props, key) ? warn("The data property \"" + key + '" is already declared as a prop. Use prop default value instead.', vm) : isReserved(key) || proxy(vm, "_data", key); } observe(data, !0); - }(vm2) : observe(vm2._data = {}, !0), opts.computed && function(vm, computed) { + }(vm4) : observe(vm4._data = {}, !0), opts1.computed && function(vm, computed) { var watchers = vm._computedWatchers = Object.create(null), isSSR = isServerRendering(); for(var key in computed){ var userDef = computed[key], getter = 'function' == typeof userDef ? userDef : userDef.get; null == getter && warn("Getter is missing for computed property \"" + key + "\".", vm), isSSR || (watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions)), key in vm ? key in vm.$data ? warn("The computed property \"" + key + "\" is already defined in data.", vm) : vm.$options.props && key in vm.$options.props && warn("The computed property \"" + key + "\" is already defined as a prop.", vm) : defineComputed(vm, key, userDef); } - }(vm2, opts.computed), opts.watch && opts.watch !== nativeWatch && function(vm, watch) { + }(vm4, opts1.computed), opts1.watch && opts1.watch !== nativeWatch && function(vm, watch) { for(var key in watch){ var handler = watch[key]; if (Array.isArray(handler)) for(var i = 0; i < handler.length; i++)createWatcher(vm, key, handler[i]); else createWatcher(vm, key, handler); } - }(vm2, opts.watch), (provide = (vm3 = vm6).$options.provide) && (vm3._provided = 'function' == typeof provide ? provide.call(vm3) : provide), callHook(vm6, 'created'), config.performance && mark && (vm6._name = formatComponentName(vm6, !1), mark(endTag), measure("vue " + vm6._name + " init", startTag, endTag)), vm6.$options.el && vm6.$mount(vm6.$options.el); - }, Vue2 = Vue, (dataDef = {}).get = function() { + }(vm4, opts1.watch), (provide = (vm5 = vm6).$options.provide) && (vm5._provided = 'function' == typeof provide ? provide.call(vm5) : provide), callHook(vm6, 'created'), config.performance && mark && (vm6._name = formatComponentName(vm6, !1), mark(endTag), measure("vue " + vm6._name + " init", startTag, endTag)), vm6.$options.el && vm6.$mount(vm6.$options.el); + }, Vue1 = Vue10, (dataDef = {}).get = function() { return this._data; }, (propsDef = {}).get = function() { return this._props; @@ -1422,7 +1422,7 @@ warn("Avoid replacing instance root $data. Use nested data properties instead.", this); }, propsDef.set = function() { warn("$props is readonly.", this); - }, Object.defineProperty(Vue2.prototype, '$data', dataDef), Object.defineProperty(Vue2.prototype, '$props', propsDef), Vue2.prototype.$set = set, Vue2.prototype.$delete = del, Vue2.prototype.$watch = function(expOrFn, cb, options) { + }, Object.defineProperty(Vue1.prototype, '$data', dataDef), Object.defineProperty(Vue1.prototype, '$props', propsDef), Vue1.prototype.$set = set, Vue1.prototype.$delete = del, Vue1.prototype.$watch = function(expOrFn, cb, options) { if (isPlainObject(cb)) return createWatcher(this, expOrFn, cb, options); (options = options || {}).user = !0; var watcher = new Watcher(this, expOrFn, cb, options); @@ -1434,18 +1434,18 @@ return function() { watcher.teardown(); }; - }, Vue3 = Vue, hookRE = /^hook:/, Vue3.prototype.$on = function(event, fn) { + }, Vue2 = Vue10, hookRE = /^hook:/, Vue2.prototype.$on = function(event, fn) { var vm = this; if (Array.isArray(event)) for(var i = 0, l = event.length; i < l; i++)vm.$on(event[i], fn); else (vm._events[event] || (vm._events[event] = [])).push(fn), hookRE.test(event) && (vm._hasHookEvent = !0); return vm; - }, Vue3.prototype.$once = function(event, fn) { + }, Vue2.prototype.$once = function(event, fn) { var vm = this; function on() { vm.$off(event, on), fn.apply(vm, arguments); } return on.fn = fn, vm.$on(event, on), vm; - }, Vue3.prototype.$off = function(event, fn) { + }, Vue2.prototype.$off = function(event, fn) { var cb, vm = this; if (!arguments.length) return vm._events = Object.create(null), vm; if (Array.isArray(event)) { @@ -1460,7 +1460,7 @@ break; } return vm; - }, Vue3.prototype.$emit = function(event) { + }, Vue2.prototype.$emit = function(event) { var lowerCaseEvent = event.toLowerCase(); lowerCaseEvent !== event && this._events[lowerCaseEvent] && tip("Event \"" + lowerCaseEvent + "\" is emitted in component " + formatComponentName(this) + " but the handler is registered for \"" + event + '". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "' + hyphenate(event) + "\" instead of \"" + event + "\"."); var cbs = this._events[event]; @@ -1469,12 +1469,12 @@ for(var args = toArray(arguments, 1), info = "event handler for \"" + event + "\"", i = 0, l = cbs.length; i < l; i++)invokeWithErrorHandling(cbs[i], this, args, this, info); } return this; - }, (Vue4 = Vue).prototype._update = function(vnode, hydrating) { + }, (Vue3 = Vue10).prototype._update = function(vnode, hydrating) { var vm = this, prevEl = vm.$el, prevVnode = vm._vnode, restoreActiveInstance = setActiveInstance(vm); vm._vnode = vnode, prevVnode ? vm.$el = vm.__patch__(prevVnode, vnode) : vm.$el = vm.__patch__(vm.$el, vnode, hydrating, !1), restoreActiveInstance(), prevEl && (prevEl.__vue__ = null), vm.$el && (vm.$el.__vue__ = vm), vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode && (vm.$parent.$el = vm.$el); - }, Vue4.prototype.$forceUpdate = function() { + }, Vue3.prototype.$forceUpdate = function() { this._watcher && this._watcher.update(); - }, Vue4.prototype.$destroy = function() { + }, Vue3.prototype.$destroy = function() { var vm = this; if (!vm._isBeingDestroyed) { callHook(vm, 'beforeDestroy'), vm._isBeingDestroyed = !0; @@ -1483,9 +1483,9 @@ for(var i = vm._watchers.length; i--;)vm._watchers[i].teardown(); vm._data.__ob__ && vm._data.__ob__.vmCount--, vm._isDestroyed = !0, vm.__patch__(vm._vnode, null), callHook(vm, 'destroyed'), vm.$off(), vm.$el && (vm.$el.__vue__ = null), vm.$vnode && (vm.$vnode.parent = null); } - }, Vue5 = Vue, installRenderHelpers(Vue5.prototype), Vue5.prototype.$nextTick = function(fn) { + }, Vue4 = Vue10, installRenderHelpers(Vue4.prototype), Vue4.prototype.$nextTick = function(fn) { return nextTick(fn, this); - }, Vue5.prototype._render = function() { + }, Vue4.prototype._render = function() { var vnode, vm = this, ref = vm.$options, render = ref.render, _parentVnode = ref._parentVnode; _parentVnode && (vm.$scopedSlots = normalizeScopedSlots(_parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots)), vm.$vnode = _parentVnode; try { @@ -1502,25 +1502,25 @@ } return Array.isArray(vnode) && 1 === vnode.length && (vnode = vnode[0]), vnode instanceof VNode || (Array.isArray(vnode) && warn("Multiple root nodes returned from render function. Render function should return a single root node.", vm), vnode = createEmptyVNode()), vnode.parent = _parentVnode, vnode; }; - var Vue1, Vue2, dataDef, propsDef, Vue3, hookRE, Vue4, Vue5, Vue6, configDef, Vue7, Vue8, Vue9, cid, Vue10, patternTypes = [ + var patternTypes = [ String, RegExp, Array ]; - Vue6 = Vue, (configDef = {}).get = function() { + Vue5 = Vue10, (configDef = {}).get = function() { return config; }, configDef.set = function() { warn('Do not replace the Vue.config object, set individual fields instead.'); - }, Object.defineProperty(Vue6, 'config', configDef), Vue6.util = { + }, Object.defineProperty(Vue5, 'config', configDef), Vue5.util = { warn: warn, extend: extend, mergeOptions: mergeOptions, defineReactive: defineReactive$$1 - }, Vue6.set = set, Vue6.delete = del, Vue6.nextTick = nextTick, Vue6.observable = function(obj) { + }, Vue5.set = set, Vue5.delete = del, Vue5.nextTick = nextTick, Vue5.observable = function(obj) { return observe(obj), obj; - }, Vue6.options = Object.create(null), ASSET_TYPES.forEach(function(type) { - Vue6.options[type + 's'] = Object.create(null); - }), Vue6.options._base = Vue6, extend(Vue6.options.components, { + }, Vue5.options = Object.create(null), ASSET_TYPES.forEach(function(type) { + Vue5.options[type + 's'] = Object.create(null); + }), Vue5.options._base = Vue5, extend(Vue5.options.components, { KeepAlive: { name: 'keep-alive', abstract: !0, @@ -1561,14 +1561,14 @@ return vnode || slot && slot[0]; } } - }), (Vue7 = Vue6).use = function(plugin) { + }), (Vue6 = Vue5).use = function(plugin) { var installedPlugins = this._installedPlugins || (this._installedPlugins = []); if (installedPlugins.indexOf(plugin) > -1) return this; var args = toArray(arguments, 1); return args.unshift(this), 'function' == typeof plugin.install ? plugin.install.apply(plugin, args) : 'function' == typeof plugin && plugin.apply(null, args), installedPlugins.push(plugin), this; - }, (Vue8 = Vue6).mixin = function(mixin) { + }, (Vue7 = Vue5).mixin = function(mixin) { return this.options = mergeOptions(this.options, mixin), this; - }, (Vue9 = Vue6).cid = 0, cid = 1, Vue9.extend = function(extendOptions) { + }, (Vue8 = Vue5).cid = 0, cid = 1, Vue8.extend = function(extendOptions) { extendOptions = extendOptions || {}; var Super = this, SuperId = Super.cid, cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); if (cachedCtors[SuperId]) return cachedCtors[SuperId]; @@ -1586,22 +1586,22 @@ }(Sub), Sub.extend = Super.extend, Sub.mixin = Super.mixin, Sub.use = Super.use, ASSET_TYPES.forEach(function(type) { Sub[type] = Super[type]; }), name && (Sub.options.components[name] = Sub), Sub.superOptions = Super.options, Sub.extendOptions = extendOptions, Sub.sealedOptions = extend({}, Sub.options), cachedCtors[SuperId] = Sub, Sub; - }, Vue10 = Vue6, ASSET_TYPES.forEach(function(type) { - Vue10[type] = function(id, definition) { + }, Vue9 = Vue5, ASSET_TYPES.forEach(function(type) { + Vue9[type] = function(id, definition) { return definition ? ('component' === type && validateComponentName(id), 'component' === type && isPlainObject(definition) && (definition.name = definition.name || id, definition = this.options._base.extend(definition)), 'directive' === type && 'function' == typeof definition && (definition = { bind: definition, update: definition }), this.options[type + 's'][id] = definition, definition) : this.options[type + 's'][id]; }; - }), Object.defineProperty(Vue.prototype, '$isServer', { + }), Object.defineProperty(Vue10.prototype, '$isServer', { get: isServerRendering - }), Object.defineProperty(Vue.prototype, '$ssrContext', { + }), Object.defineProperty(Vue10.prototype, '$ssrContext', { get: function() { return this.$vnode && this.$vnode.ssrContext; } - }), Object.defineProperty(Vue, 'FunctionalRenderContext', { + }), Object.defineProperty(Vue10, 'FunctionalRenderContext', { value: FunctionalRenderContext - }), Vue.version = '2.6.12'; + }), Vue10.version = '2.6.12'; var isReservedAttr = makeMap('style,class'), acceptValue = makeMap('input,textarea,option,select,progress'), mustUseProp = function(tag, type, attr) { return 'value' === attr && acceptValue(tag) && 'button' !== type || 'selected' === attr && 'option' === tag || 'checked' === attr && 'input' === tag || 'muted' === attr && 'video' === tag; }, isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'), isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only'), isBooleanAttr = makeMap("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"), xlinkNS = 'http://www.w3.org/1999/xlink', isXlink = function(name) { @@ -2254,7 +2254,7 @@ function _enter(_, vnode) { !0 !== vnode.data.show && enter(vnode); } - var modules = [ + var modules1 = [ { create: updateAttrs, update: updateAttrs @@ -2497,7 +2497,7 @@ }; }({ nodeOps: nodeOps, - modules: modules + modules: modules1 }); isIE9 && document.addEventListener('selectionchange', function() { var el = document.activeElement; @@ -2619,13 +2619,13 @@ s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)", s.transitionDuration = '0s'; } } - delete props.mode, Vue.config.mustUseProp = mustUseProp, Vue.config.isReservedTag = isReservedTag, Vue.config.isReservedAttr = isReservedAttr, Vue.config.getTagNamespace = getTagNamespace, Vue.config.isUnknownElement = function(tag) { + delete props.mode, Vue10.config.mustUseProp = mustUseProp, Vue10.config.isReservedTag = isReservedTag, Vue10.config.isReservedAttr = isReservedAttr, Vue10.config.getTagNamespace = getTagNamespace, Vue10.config.isUnknownElement = function(tag) { if (!inBrowser) return !0; if (isReservedTag(tag)) return !1; if (null != unknownElementCache[tag = tag.toLowerCase()]) return unknownElementCache[tag]; var el = document.createElement(tag); return tag.indexOf('-') > -1 ? unknownElementCache[tag] = el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement : unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()); - }, extend(Vue.options.directives, { + }, extend(Vue10.options.directives, { model: directive, show: { bind: function(el, ref, vnode) { @@ -2646,7 +2646,7 @@ isDestroy || (el.style.display = el.__vOriginalDisplay); } } - }), extend(Vue.options.components, { + }), extend(Vue10.options.components, { Transition: { name: 'transition', props: transitionProps, @@ -2666,15 +2666,15 @@ if (this._leaving) return placeholder(h, rawChild); var id = "__transition-" + this._uid + "-"; child.key = null == child.key ? child.isComment ? id + 'comment' : id + child.tag : isPrimitive(child.key) ? 0 === String(child.key).indexOf(id) ? child.key : id + child.key : child.key; - var child1, oldChild, data = (child.data || (child.data = {})).transition = extractTransitionData(this), oldRawChild = this._vnode, oldChild1 = getRealChild(oldRawChild); - if (child.data.directives && child.data.directives.some(isVShowDirective) && (child.data.show = !0), oldChild1 && oldChild1.data && (oldChild1.key !== child.key || oldChild1.tag !== child.tag) && !isAsyncPlaceholder(oldChild1) && !(oldChild1.componentInstance && oldChild1.componentInstance._vnode.isComment)) { - var oldData = oldChild1.data.transition = extend({}, data); + var data = (child.data || (child.data = {})).transition = extractTransitionData(this), oldRawChild = this._vnode, oldChild = getRealChild(oldRawChild); + if (child.data.directives && child.data.directives.some(isVShowDirective) && (child.data.show = !0), oldChild && oldChild.data && (child1 = child, (oldChild1 = oldChild).key !== child1.key || oldChild1.tag !== child1.tag) && !isAsyncPlaceholder(oldChild) && !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)) { + var oldData = oldChild.data.transition = extend({}, data); if ('out-in' === mode) return this._leaving = !0, mergeVNodeHook(oldData, 'afterLeave', function() { this$1._leaving = !1, this$1.$forceUpdate(); }), placeholder(h, rawChild); if ('in-out' === mode) { if (isAsyncPlaceholder(child)) return oldRawChild; - var delayedLeave, performLeave = function() { + var child1, oldChild1, delayedLeave, performLeave = function() { delayedLeave(); }; mergeVNodeHook(data, 'afterEnter', performLeave), mergeVNodeHook(data, 'enterCancelled', performLeave), mergeVNodeHook(oldData, 'delayLeave', function(leave) { @@ -2739,7 +2739,7 @@ } } } - }), Vue.prototype.__patch__ = inBrowser ? patch : noop, Vue.prototype.$mount = function(el, hydrating) { + }), Vue10.prototype.__patch__ = inBrowser ? patch : noop, Vue10.prototype.$mount = function(el, hydrating) { var vm, el1, hydrating1, updateComponent; return el = el && inBrowser ? query(el) : void 0, vm = this, el1 = el, hydrating1 = hydrating, vm.$el = el1, vm.$options.render || (vm.$options.render = createEmptyVNode, vm.$options.template && '#' !== vm.$options.template.charAt(0) || vm.$options.el || el1 ? warn("You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.", vm) : warn('Failed to mount component: template or render function not defined.', vm)), callHook(vm, 'beforeMount'), updateComponent = config.performance && mark ? function() { var name = vm._name, id = vm._uid, startTag = "vue-perf-start:" + id, endTag = "vue-perf-end:" + id; @@ -2754,7 +2754,7 @@ } }, !0), hydrating1 = !1, null == vm.$vnode && (vm._isMounted = !0, callHook(vm, 'mounted')), vm; }, inBrowser && setTimeout(function() { - config.devtools && (devtools ? devtools.emit('init', Vue) : console[console.info ? 'info' : 'log']("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")), !1 !== config.productionTip && 'undefined' != typeof console && console[console.info ? 'info' : 'log']("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html"); + config.devtools && (devtools ? devtools.emit('init', Vue10) : console[console.info ? 'info' : 'log']("Download the Vue Devtools extension for a better development experience:\nhttps://github.com/vuejs/vue-devtools")), !1 !== config.productionTip && 'undefined' != typeof console && console[console.info ? 'info' : 'log']("You are running Vue in development mode.\nMake sure to turn on production mode when deploying for production.\nSee more tips at https://vuejs.org/guide/deployment.html"); }, 0); var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g, regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g, buildRegex = cached(function(delimiters) { var open = delimiters[0].replace(regexEscapeRE, '\\$&'), close = delimiters[1].replace(regexEscapeRE, '\\$&'); @@ -2810,7 +2810,6 @@ }; } function processElement(element, options) { - var el, ref, el1, el2, binding; (function(el) { var exp = getBindingAttr(el, 'key'); if (exp) { @@ -2847,7 +2846,7 @@ } } }(element), 'slot' === (el1 = element).tag && (el1.slotName = getBindingAttr(el1, 'name'), el1.key && warn$2("`key` does not work on because slots are abstract outlets and can possibly expand into multiple elements. Use the key on a wrapping element instead.", getRawBindingAttr(el1, 'key'))), (binding = getBindingAttr(el2 = element, 'is')) && (el2.component = binding), null != getAndRemoveAttr(el2, 'inline-template') && (el2.inlineTemplate = !0); - for(var i = 0; i < transforms.length; i++)element = transforms[i](element, options) || element; + for(var el, ref, el1, el2, binding, i = 0; i < transforms.length; i++)element = transforms[i](element, options) || element; return function(el) { var i, l, name, rawName, value, modifiers, syncGen, isDynamic, list = el.attrsList; for(i = 0, l = list.length; i < l; i++)if (name = rawName = list[i].name, value = list[i].value, dirRE.test(name)) { @@ -2904,7 +2903,7 @@ function cloneASTElement(el) { return createASTElement(el.tag, el.attrsList.slice(), el.parent); } - var modules1, modules$1 = [ + var modules$1 = [ { staticKeys: [ 'staticClass' @@ -3340,7 +3339,7 @@ }), noop; } } - var baseCompile, ref$1 = (baseCompile = function(template, options) { + var ref$1 = (baseCompile = function(template, options) { var root, options1, ast = function(template, options) { warn$2 = options.warn || baseWarn, platformIsPreTag = options.isPreTag || no, platformMustUseProp = options.mustUseProp || no, platformGetTagNamespace = options.getTagNamespace || no; var root, currentParent, isReservedTag = options.isReservedTag || no; @@ -3501,7 +3500,7 @@ shouldKeepComment: options.comments, outputSourceRange: options.outputSourceRange, start: function(tag, attrs, unary, start$1, end) { - var el, el1, ns = currentParent && currentParent.ns || platformGetTagNamespace(tag); + var el, el1, el2, ns = currentParent && currentParent.ns || platformGetTagNamespace(tag); isIE && 'svg' === ns && (attrs = function(attrs) { for(var res = [], i = 0; i < attrs.length; i++){ var attr = attrs[i]; @@ -3509,7 +3508,7 @@ } return res; }(attrs)); - var el2, element = createASTElement(tag, attrs, currentParent); + var element = createASTElement(tag, attrs, currentParent); ns && (element.ns = ns), options.outputSourceRange && (element.start = start$1, element.end = end, element.rawAttrsMap = element.attrsList.reduce(function(cumulated, attr) { return cumulated[attr.name] = attr, cumulated; }, {})), attrs.forEach(function(attr) { @@ -3517,11 +3516,11 @@ start: attr.start + attr.name.indexOf("["), end: attr.start + attr.name.length }); - }), el2 = element, 'style' !== el2.tag && ('script' !== el2.tag || el2.attrsMap.type && 'text/javascript' !== el2.attrsMap.type) || isServerRendering() || (element.forbidden = !0, warn$2("Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <" + tag + ">, as they will not be parsed.", { + }), el = element, 'style' !== el.tag && ('script' !== el.tag || el.attrsMap.type && 'text/javascript' !== el.attrsMap.type) || isServerRendering() || (element.forbidden = !0, warn$2("Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <" + tag + ">, as they will not be parsed.", { start: element.start })); for(var i = 0; i < preTransforms.length; i++)element = preTransforms[i](element, options) || element; - !inVPre && (el = element, null != getAndRemoveAttr(el, 'v-pre') && (el.pre = !0), element.pre && (inVPre = !0)), platformIsPreTag(element.tag) && (inPre = !0), inVPre ? function(el) { + !inVPre && (el1 = element, null != getAndRemoveAttr(el1, 'v-pre') && (el1.pre = !0), element.pre && (inVPre = !0)), platformIsPreTag(element.tag) && (inPre = !0), inVPre ? function(el) { var list = el.attrsList, len = list.length; if (len) for(var attrs = el.attrs = Array(len), i = 0; i < len; i++)attrs[i] = { name: list[i].name, @@ -3539,7 +3538,7 @@ var elseif = getAndRemoveAttr(el, 'v-else-if'); elseif && (el.elseif = elseif); } - }(element), el1 = element, null != getAndRemoveAttr(el1, 'v-once') && (el1.once = !0)), root || (root = element, checkRootConstraints(root)), unary ? closeElement(element) : (currentParent = element, stack.push(element)); + }(element), el2 = element, null != getAndRemoveAttr(el2, 'v-once') && (el2.once = !0)), root || (root = element, checkRootConstraints(root)), unary ? closeElement(element) : (currentParent = element, stack.push(element)); }, end: function(tag, start, end$1) { var element = stack[stack.length - 1]; @@ -3555,7 +3554,7 @@ return; } if (!isIE || 'textarea' !== currentParent.tag || currentParent.attrsMap.placeholder !== text) { - var res, child, el, children = currentParent.children; + var el, res, child, children = currentParent.children; (text = inPre || text.trim() ? (el = currentParent, 'script' === el.tag || 'style' === el.tag) ? text : decodeHTMLCached(text) : children.length ? whitespaceOption ? 'condense' === whitespaceOption && lineBreakRE.test(text) ? '' : ' ' : preserveWhitespace ? ' ' : '' : '') && (inPre || 'condense' !== whitespaceOption || (text = text.replace(whitespaceRE$1, ' ')), !inVPre && ' ' !== text && (res = parseText(text, delimiters)) ? child = { type: 2, expression: res.expression, @@ -3613,13 +3612,13 @@ }, function(baseOptions) { var compile, cache; function compile1(template, options) { - var finalOptions = Object.create(baseOptions), errors = [], tips = [], warn = function(msg, range, tip) { + var ast, warn, finalOptions = Object.create(baseOptions), errors = [], tips = [], warn1 = function(msg, range, tip) { (tip ? tips : errors).push(msg); }; if (options) { if (options.outputSourceRange) { var leadingSpaceLength = template.match(/^\s*/)[0].length; - warn = function(msg, range, tip) { + warn1 = function(msg, range, tip) { var data = { msg: msg }; @@ -3628,9 +3627,9 @@ } for(var key in options.modules && (finalOptions.modules = (baseOptions.modules || []).concat(options.modules)), options.directives && (finalOptions.directives = extend(Object.create(baseOptions.directives || null), options.directives)), options)'modules' !== key && 'directives' !== key && (finalOptions[key] = options[key]); } - finalOptions.warn = warn; - var ast, warn1, compiled = baseCompile(template.trim(), finalOptions); - return ast = compiled.ast, warn1 = warn, ast && function checkNode(node, warn) { + finalOptions.warn = warn1; + var compiled = baseCompile(template.trim(), finalOptions); + return ast = compiled.ast, warn = warn1, ast && function checkNode(node, warn) { if (1 === node.type) { for(var name in node.attrsMap)if (dirRE.test(name)) { var value = node.attrsMap[name]; @@ -3641,7 +3640,7 @@ } if (node.children) for(var i = 0; i < node.children.length; i++)checkNode(node.children[i], warn); } else 2 === node.type && checkExpression(node.expression, node.text, warn, node); - }(ast, warn1), compiled.errors = errors, compiled.tips = tips, compiled; + }(ast, warn), compiled.errors = errors, compiled.tips = tips, compiled; } return { compile: compile1, @@ -3703,8 +3702,8 @@ var shouldDecodeNewlines = !!inBrowser && getShouldDecode(!1), shouldDecodeNewlinesForHref = !!inBrowser && getShouldDecode(!0), idToTemplate = cached(function(id) { var el = query(id); return el && el.innerHTML; - }), mount = Vue.prototype.$mount; - return Vue.prototype.$mount = function(el, hydrating) { + }), mount = Vue10.prototype.$mount; + return Vue10.prototype.$mount = function(el, hydrating) { if ((el = el && query(el)) === document.body || el === document.documentElement) return warn("Do not mount Vue to or - mount to normal elements instead."), this; var options = this.$options; if (!options.render) { @@ -3733,5 +3732,5 @@ } } return mount.call(this, el, hydrating); - }, Vue.compile = compileToFunctions, Vue; + }, Vue10.compile = compileToFunctions, Vue10; }); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js index f0c60661594..64ea11604ed 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js @@ -2253,13 +2253,13 @@ }, 52275: function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; - var process = __webpack_require__(97671), utils = __webpack_require__(99677), normalizeHeaderName = __webpack_require__(43907), enhanceError = __webpack_require__(16488), DEFAULT_CONTENT_TYPE = { + var adapter, process = __webpack_require__(97671), utils = __webpack_require__(99677), normalizeHeaderName = __webpack_require__(43907), enhanceError = __webpack_require__(16488), DEFAULT_CONTENT_TYPE = { "Content-Type": "application/x-www-form-urlencoded" }; function setContentTypeIfUnset(headers, value) { !utils.isUndefined(headers) && utils.isUndefined(headers["Content-Type"]) && (headers["Content-Type"] = value); } - var adapter, defaults = { + var defaults = { transitional: { silentJSONParsing: !0, forcedJSONParsing: !0, @@ -9113,7 +9113,7 @@ return withPageLifeCycle; } }); - var _a, SHOW = "show", HIDE = "hide", LAUNCH = "launch", ERROR = "error"; + var extendStatics, _a, SHOW = "show", HIDE = "hide", LAUNCH = "launch", ERROR = "error"; (_a = {})[SHOW] = "miniapp_pageshow", _a[HIDE] = "miniapp_pagehide"; var DEFAULT_APP_CONFIG = { app: { @@ -9150,7 +9150,7 @@ Object.assign(current, value); } }); - var extendStatics, lib_router = router, __extends = (extendStatics = function(d, b) { + var lib_router = router, __extends = (extendStatics = function(d, b) { return (extendStatics = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -13809,18 +13809,18 @@ retryLane: 0 }; function ti(a, b, c) { - var g, a1, b1, c1, d, e, f, g1, h, a2, b2, c2, d1, e1, d2 = b.pendingProps, e2 = P.current, f1 = !1; - return ((g = 0 != (64 & b.flags)) || (g = (null === a || null !== a.memoizedState) && 0 != (2 & e2)), g ? (f1 = !0, b.flags &= -65) : null !== a && null === a.memoizedState || void 0 === d2.fallback || !0 === d2.unstable_avoidThisFallback || (e2 |= 1), I(P, 1 & e2), null === a) ? (void 0 !== d2.fallback && ph(b), a = d2.children, e2 = d2.fallback, f1) ? (a = ui(b, a, e2, c), b.child.memoizedState = { + var a1, b1, c1, d, e, f, g, h, a2, b2, c2, d1, e1, g1, d2 = b.pendingProps, e2 = P.current, f1 = !1; + return ((g1 = 0 != (64 & b.flags)) || (g1 = (null === a || null !== a.memoizedState) && 0 != (2 & e2)), g1 ? (f1 = !0, b.flags &= -65) : null !== a && null === a.memoizedState || void 0 === d2.fallback || !0 === d2.unstable_avoidThisFallback || (e2 |= 1), I(P, 1 & e2), null === a) ? (void 0 !== d2.fallback && ph(b), a = d2.children, e2 = d2.fallback, f1) ? (a = ui(b, a, e2, c), b.child.memoizedState = { baseLanes: c }, b.memoizedState = si, a) : "number" == typeof d2.unstable_expectedLoadTime ? (a = ui(b, a, e2, c), b.child.memoizedState = { baseLanes: c }, b.memoizedState = si, b.lanes = 33554432, a) : ((c = vi({ mode: "visible", children: a - }, b.mode, c, null)).return = b, b.child = c) : (a.memoizedState, f1 ? (a1 = a, b1 = b, c1 = d2.children, d = d2.fallback, e = c, f = b1.mode, a1 = (g1 = a1.child).sibling, h = { + }, b.mode, c, null)).return = b, b.child = c) : (a.memoizedState, f1 ? (a1 = a, b1 = b, c1 = d2.children, d = d2.fallback, e = c, f = b1.mode, a1 = (g = a1.child).sibling, h = { mode: "hidden", children: c1 - }, 0 == (2 & f) && b1.child !== g1 ? ((c1 = b1.child).childLanes = 0, c1.pendingProps = h, null !== (g1 = c1.lastEffect) ? (b1.firstEffect = c1.firstEffect, b1.lastEffect = g1, g1.nextEffect = null) : b1.firstEffect = b1.lastEffect = null) : c1 = Tg(g1, h), null !== a1 ? d = Tg(a1, d) : (d = Xg(d, f, e, null), d.flags |= 2), d.return = b1, c1.return = b1, c1.sibling = d, b1.child = c1, d2 = d, f1 = b.child, e2 = a.child.memoizedState, f1.memoizedState = null === e2 ? { + }, 0 == (2 & f) && b1.child !== g ? ((c1 = b1.child).childLanes = 0, c1.pendingProps = h, null !== (g = c1.lastEffect) ? (b1.firstEffect = c1.firstEffect, b1.lastEffect = g, g.nextEffect = null) : b1.firstEffect = b1.lastEffect = null) : c1 = Tg(g, h), null !== a1 ? d = Tg(a1, d) : (d = Xg(d, f, e, null), d.flags |= 2), d.return = b1, c1.return = b1, c1.sibling = d, b1.child = c1, d2 = d, f1 = b.child, e2 = a.child.memoizedState, f1.memoizedState = null === e2 ? { baseLanes: c } : { baseLanes: e2.baseLanes | c diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/emotion/react/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/emotion/react/1/output.js index f07fcdb5f6d..159219ad7ba 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/emotion/react/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/emotion/react/1/output.js @@ -10,7 +10,7 @@ return Global; } }); - var cursor, react = __webpack_require__(7294), StyleSheet = function() { + var fn, cache, func, cursor, react = __webpack_require__(7294), StyleSheet = function() { function StyleSheet(options) { var _this = this; this._insertTag = function(tag) { @@ -199,7 +199,7 @@ function declaration(value, root, parent, length) { return node(value, root, parent, DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length); } - var fn, cache, 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(); return slice(begin, position); }, toRules = function(parsed, points) { @@ -223,10 +223,10 @@ return parsed; }, fixedElements = new WeakMap(), compat = function(element) { 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; - if ((1 !== element.props.length || 58 === value.charCodeAt(0) || fixedElements.get(parent)) && !isImplicitRule) { + for(var value, points, value1 = 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 === value1.charCodeAt(0) || fixedElements.get(parent)) && !isImplicitRule) { 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 points1 = [], rules = (value = value1, points = points1, 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] = points1[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; } } }, removeLabel = function(element) { @@ -525,7 +525,7 @@ }; Object.prototype.hasOwnProperty; var EmotionCacheContext = (0, react.createContext)("undefined" != typeof HTMLElement ? function(options) { - var key = options.key; + var collection, length, key = options.key; if ("css" === key) { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(ssrStyles, function(node) { @@ -537,7 +537,7 @@ for(var attrib = node.getAttribute("data-emotion").split(" "), i = 1; i < attrib.length; i++)inserted[attrib[i]] = !0; nodesToHydrate.push(node); }); - var callback, container, _insert, currentSheet, collection, length, finalizingPlugins = [ + var callback, container, _insert, currentSheet, finalizingPlugins = [ stringify, (callback = function(rule) { currentSheet.insert(rule); @@ -663,7 +663,7 @@ EmotionCacheContext.Provider; var emotion_element_99289b21_browser_esm_ThemeContext = (0, react.createContext)({}); __webpack_require__(8679); - var func, emotion_utils_browser_esm_insertStyles = function(cache, serialized, isStringTag) { + var emotion_utils_browser_esm_insertStyles = function(cache, serialized, isStringTag) { var className = cache.key + "-" + serialized.name; if (!1 === isStringTag && void 0 === cache.registered[className] && (cache.registered[className] = serialized.styles), void 0 === cache.inserted[serialized.name]) { var current = serialized; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/firebase-core/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/firebase-core/1/output.js index 923d0dffd9c..4547aa1fd43 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/firebase-core/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/firebase-core/1/output.js @@ -1713,7 +1713,7 @@ }(); } exports.default = function(_param) { - var sizerSvg, src = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyBoundary = _param.lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete = _param.onLoadingComplete, _loader = _param.loader, loader = void 0 === _loader ? defaultImageLoader : _loader, _placeholder = _param.placeholder, placeholder = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = function(source, excluded) { + var src, arr, sizerSvg, src1 = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyBoundary = _param.lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete = _param.onLoadingComplete, _loader = _param.loader, loader = void 0 === _loader ? defaultImageLoader : _loader, _placeholder = _param.placeholder, placeholder = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = function(source, excluded) { if (null == source) return {}; var key, i, target = function(source, excluded) { if (null == source) return {}; @@ -1745,16 +1745,16 @@ "blurDataURL" ]), layout = sizes ? "responsive" : "intrinsic"; "layout" in all && (all.layout && (layout = all.layout), delete all.layout); - var src1, staticSrc = ""; - if ("object" == typeof (src1 = src) && (isStaticRequire(src1) || void 0 !== src1.src)) { - var staticImageData = isStaticRequire(src) ? src.default : src; + var staticSrc = ""; + if ("object" == typeof (src = src1) && (isStaticRequire(src) || void 0 !== src.src)) { + var staticImageData = isStaticRequire(src1) ? src1.default : src1; if (!staticImageData.src) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ".concat(JSON.stringify(staticImageData))); if (blurDataURL = blurDataURL || staticImageData.blurDataURL, staticSrc = staticImageData.src, (!layout || "fill" !== layout) && (height = height || staticImageData.height, width = width || staticImageData.width, !staticImageData.height || !staticImageData.width)) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ".concat(JSON.stringify(staticImageData))); } - src = "string" == typeof src ? src : staticSrc; + src1 = "string" == typeof src1 ? src1 : staticSrc; var widthInt = getInt(width), heightInt = getInt(height), qualityInt = getInt(quality), isLazy = !priority && ("lazy" === loading || void 0 === loading); - (src.startsWith("data:") || src.startsWith("blob:")) && (unoptimized = !0, isLazy = !1), loadedImageURLs.has(src) && (isLazy = !1); - var arr, ref2 = function(arr) { + (src1.startsWith("data:") || src1.startsWith("blob:")) && (unoptimized = !0, isLazy = !1), loadedImageURLs.has(src1) && (isLazy = !1); + var ref2 = function(arr) { if (Array.isArray(arr)) return arr; }(arr = _useIntersection.useIntersection({ rootMargin: void 0 === _lazyBoundary ? "200px" : _lazyBoundary, @@ -1832,7 +1832,7 @@ sizes: void 0 }; isVisible && (imgAttributes = generateImgAttrs({ - src: src, + src: src1, unoptimized: unoptimized, layout: layout, width: widthInt, @@ -1840,7 +1840,7 @@ sizes: sizes, loader: loader })); - var srcString = src; + var srcString = src1; return _react.default.createElement("span", { style: wrapperStyle }, hasSizer ? _react.default.createElement("span", { @@ -1881,7 +1881,7 @@ }, style: _objectSpread({}, imgStyle, blurStyle) })), _react.default.createElement("noscript", null, _react.default.createElement("img", Object.assign({}, all, generateImgAttrs({ - src: src, + src: src1, unoptimized: unoptimized, layout: layout, width: widthInt, diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js index c00b7497b8a..f5e6c4e1b37 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js @@ -931,7 +931,7 @@ hooks.updateOffset = function() {}; var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { - var sign, ret, diffRes, base, other, res, duration = input, match = null; + var base, other, res, sign, ret, diffRes, duration = input, match = null; return isDuration(input) ? duration = { ms: input._milliseconds, d: input._days, @@ -1775,7 +1775,7 @@ return absFloor(this.days() / 7); }, proto$2.months = months, proto$2.years = years, proto$2.humanize = function(argWithSuffix, argThresholds) { if (!this.isValid()) return this.localeData().invalidDate(); - var locale, output, withoutSuffix, thresholds1, duration, seconds, minutes, hours, days, months, weeks, years, a, withSuffix = !1, th = thresholds; + var withoutSuffix, thresholds1, duration, seconds, minutes, hours, days, months, weeks, years, a, locale, output, withSuffix = !1, th = thresholds; return "object" == typeof argWithSuffix && (argThresholds = argWithSuffix, argWithSuffix = !1), "boolean" == typeof argWithSuffix && (withSuffix = argWithSuffix), "object" == typeof argThresholds && (th = Object.assign({}, thresholds, argThresholds), null != argThresholds.s && null == argThresholds.ss && (th.ss = argThresholds.s - 1)), locale = this.localeData(), withoutSuffix = !withSuffix, thresholds1 = th, duration = createDuration(this).abs(), seconds = round(duration.as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), weeks = round(duration.as("w")), years = round(duration.as("y")), a = seconds <= thresholds1.ss && [ "s", seconds diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/quagga2/1.4.2/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/quagga2/1.4.2/1/output.js index b39dbe5ac7e..6939d307403 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/quagga2/1.4.2/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/quagga2/1.4.2/1/output.js @@ -3178,7 +3178,7 @@ }), __webpack_require__.d(__webpack_exports__, "ResultCollector", function() { return result_collector; }); - var BarcodeDirection, streamRef, reader_namespaceObject = {}; + var BarcodeDirection, BarcodeDirection1, streamRef, reader_namespaceObject = {}; __webpack_require__.r(reader_namespaceObject), __webpack_require__.d(reader_namespaceObject, "BarcodeReader", function() { return barcode_reader; }), __webpack_require__.d(reader_namespaceObject, "TwoOfFiveReader", function() { @@ -3262,8 +3262,8 @@ for(i = 0, canvas.width = line.length, ctx.fillColor = "black"; i < line.length; i++)1 === line[i] && ctx.fillRect(i, 0, 1, 100); } }; - var BarcodeDirection1, image_debug = __webpack_require__(9), classCallCheck = __webpack_require__(3), classCallCheck_default = __webpack_require__.n(classCallCheck), createClass = __webpack_require__(4), createClass_default = __webpack_require__.n(createClass), assertThisInitialized = __webpack_require__(1), assertThisInitialized_default = __webpack_require__.n(assertThisInitialized), inherits = __webpack_require__(6), inherits_default = __webpack_require__.n(inherits), possibleConstructorReturn = __webpack_require__(5), possibleConstructorReturn_default = __webpack_require__.n(possibleConstructorReturn), getPrototypeOf = __webpack_require__(2), getPrototypeOf_default = __webpack_require__.n(getPrototypeOf), defineProperty = __webpack_require__(0), defineProperty_default = __webpack_require__.n(defineProperty), array_helper = __webpack_require__(10); - (BarcodeDirection1 = BarcodeDirection || (BarcodeDirection = {}))[BarcodeDirection1.Forward = 1] = "Forward", BarcodeDirection1[BarcodeDirection1.Reverse = -1] = "Reverse"; + var image_debug = __webpack_require__(9), classCallCheck = __webpack_require__(3), classCallCheck_default = __webpack_require__.n(classCallCheck), createClass = __webpack_require__(4), createClass_default = __webpack_require__.n(createClass), assertThisInitialized = __webpack_require__(1), assertThisInitialized_default = __webpack_require__.n(assertThisInitialized), inherits = __webpack_require__(6), inherits_default = __webpack_require__.n(inherits), possibleConstructorReturn = __webpack_require__(5), possibleConstructorReturn_default = __webpack_require__.n(possibleConstructorReturn), getPrototypeOf = __webpack_require__(2), getPrototypeOf_default = __webpack_require__.n(getPrototypeOf), defineProperty = __webpack_require__(0), defineProperty_default = __webpack_require__.n(defineProperty), array_helper = __webpack_require__(10); + (BarcodeDirection = BarcodeDirection1 || (BarcodeDirection1 = {}))[BarcodeDirection.Forward = 1] = "Forward", BarcodeDirection[BarcodeDirection.Reverse = -1] = "Reverse"; var barcode_reader = function() { function BarcodeReader(config, supplements) { return classCallCheck_default()(this, BarcodeReader), defineProperty_default()(this, "_row", []), defineProperty_default()(this, "config", {}), defineProperty_default()(this, "supplements", []), defineProperty_default()(this, "SINGLE_CODE_ERROR", 0), defineProperty_default()(this, "FORMAT", "unknown"), defineProperty_default()(this, "CONFIG_KEYS", {}), this._row = [], this.config = config || {}, supplements && (this.supplements = supplements), this; @@ -3309,7 +3309,7 @@ value: function(pattern) { this._row = pattern; var result = this.decode(); - return null === result ? (this._row.reverse(), (result = this.decode()) && (result.direction = BarcodeDirection.Reverse, result.start = this._row.length - result.start, result.end = this._row.length - result.end)) : result.direction = BarcodeDirection.Forward, result && (result.format = this.FORMAT), result; + return null === result ? (this._row.reverse(), (result = this.decode()) && (result.direction = BarcodeDirection1.Reverse, result.start = this._row.length - result.start, result.end = this._row.length - result.end)) : result.direction = BarcodeDirection1.Forward, result && (result.format = this.FORMAT), result; } }, { @@ -6438,7 +6438,7 @@ }; } function _decodeFromBoundingBox(box) { - var line, result, line1, ctx = _canvas.ctx.overlay; + var line, line1, result, ctx = _canvas.ctx.overlay; config.debug.drawBoundingBox && ctx && image_debug.a.drawPath(box, { x: 0, y: 1 @@ -6446,7 +6446,7 @@ color: "blue", lineWidth: 2 }); - var lineLength = Math.sqrt(Math.pow(Math.abs((line1 = line = [ + var lineLength = Math.sqrt(Math.pow(Math.abs((line = line1 = [ { x: (box[1][0] - box[0][0]) / 2 + box[0][0], y: (box[1][1] - box[0][1]) / 2 + box[0][1] @@ -6455,8 +6455,8 @@ x: (box[3][0] - box[2][0]) / 2 + box[2][0], y: (box[3][1] - box[2][1]) / 2 + box[2][1] } - ])[1].y - line1[0].y), 2) + Math.pow(Math.abs(line1[1].x - line1[0].x), 2)), lineAngle = Math.atan2(line[1].y - line[0].y, line[1].x - line[0].x); - return null === (line = function(line, angle, ext) { + ])[1].y - line[0].y), 2) + Math.pow(Math.abs(line[1].x - line[0].x), 2)), lineAngle = Math.atan2(line1[1].y - line1[0].y, line1[1].x - line1[0].x); + return null === (line1 = function(line, angle, ext) { function extendLine(amount) { var extension = { y: amount * Math.sin(angle), @@ -6466,14 +6466,14 @@ } for(extendLine(ext); ext > 1 && (!inputImageWrapper.inImageWithBorder(line[0]) || !inputImageWrapper.inImageWithBorder(line[1]));)extendLine(-(ext -= Math.ceil(ext / 2))); return line; - }(line, lineAngle, Math.floor(0.1 * lineLength))) ? null : (null === (result = tryDecode(line)) && (result = function(box, line, lineAngle) { + }(line1, lineAngle, Math.floor(0.1 * lineLength))) ? null : (null === (result = tryDecode(line1)) && (result = function(box, line, lineAngle) { var i, dir, extension, sideLength = Math.sqrt(Math.pow(box[1][0] - box[0][0], 2) + Math.pow(box[1][1] - box[0][1], 2)), result = null, xdir = Math.sin(lineAngle), ydir = Math.cos(lineAngle); for(i = 1; i < 16 && null === result; i++)extension = { y: (dir = sideLength / 16 * i * (i % 2 == 0 ? -1 : 1)) * xdir, x: dir * ydir }, line[0].y += extension.x, line[0].x -= extension.y, line[1].y += extension.x, line[1].x -= extension.y, result = tryDecode(line); return result; - }(box, line, lineAngle)), null === result) ? null : (result && config.debug.drawScanline && ctx && image_debug.a.drawPath(line, { + }(box, line1, lineAngle)), null === result) ? null : (result && config.debug.drawScanline && ctx && image_debug.a.drawPath(line1, { x: "x", y: "y" }, ctx, { @@ -6481,7 +6481,7 @@ lineWidth: 3 }), { codeResult: result.codeResult, - line: line, + line: line1, angle: lineAngle, pattern: result.barcodeLine.line, threshold: result.barcodeLine.threshold diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/react-countup/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/react-countup/1/output.js index 42c4b8b4a49..fe481d451a2 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/react-countup/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/react-countup/1/output.js @@ -95,7 +95,7 @@ }(); } exports.default = function(_param) { - var sizerSvg, src = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyBoundary = _param.lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete = _param.onLoadingComplete, _loader = _param.loader, loader = void 0 === _loader ? defaultImageLoader : _loader, _placeholder = _param.placeholder, placeholder = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = function(source, excluded) { + var src, arr, sizerSvg, src1 = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyBoundary = _param.lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete = _param.onLoadingComplete, _loader = _param.loader, loader = void 0 === _loader ? defaultImageLoader : _loader, _placeholder = _param.placeholder, placeholder = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = function(source, excluded) { if (null == source) return {}; var key, i, target = function(source, excluded) { if (null == source) return {}; @@ -127,16 +127,16 @@ "blurDataURL" ]), layout = sizes ? "responsive" : "intrinsic"; "layout" in all && (all.layout && (layout = all.layout), delete all.layout); - var src1, staticSrc = ""; - if ("object" == typeof (src1 = src) && (isStaticRequire(src1) || void 0 !== src1.src)) { - var staticImageData = isStaticRequire(src) ? src.default : src; + var staticSrc = ""; + if ("object" == typeof (src = src1) && (isStaticRequire(src) || void 0 !== src.src)) { + var staticImageData = isStaticRequire(src1) ? src1.default : src1; if (!staticImageData.src) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ".concat(JSON.stringify(staticImageData))); if (blurDataURL = blurDataURL || staticImageData.blurDataURL, staticSrc = staticImageData.src, (!layout || "fill" !== layout) && (height = height || staticImageData.height, width = width || staticImageData.width, !staticImageData.height || !staticImageData.width)) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ".concat(JSON.stringify(staticImageData))); } - src = "string" == typeof src ? src : staticSrc; + src1 = "string" == typeof src1 ? src1 : staticSrc; var widthInt = getInt(width), heightInt = getInt(height), qualityInt = getInt(quality), isLazy = !priority && ("lazy" === loading || void 0 === loading); - (src.startsWith("data:") || src.startsWith("blob:")) && (unoptimized = !0, isLazy = !1), loadedImageURLs.has(src) && (isLazy = !1); - var arr, ref2 = function(arr) { + (src1.startsWith("data:") || src1.startsWith("blob:")) && (unoptimized = !0, isLazy = !1), loadedImageURLs.has(src1) && (isLazy = !1); + var ref2 = function(arr) { if (Array.isArray(arr)) return arr; }(arr = _useIntersection.useIntersection({ rootMargin: void 0 === _lazyBoundary ? "200px" : _lazyBoundary, @@ -214,7 +214,7 @@ sizes: void 0 }; isVisible && (imgAttributes = generateImgAttrs({ - src: src, + src: src1, unoptimized: unoptimized, layout: layout, width: widthInt, @@ -222,7 +222,7 @@ sizes: sizes, loader: loader })); - var srcString = src; + var srcString = src1; return _react.default.createElement("span", { style: wrapperStyle }, hasSizer ? _react.default.createElement("span", { @@ -263,7 +263,7 @@ }, style: _objectSpread({}, imgStyle, blurStyle) })), _react.default.createElement("noscript", null, _react.default.createElement("img", Object.assign({}, all, generateImgAttrs({ - src: src, + src: src1, unoptimized: unoptimized, layout: layout, width: widthInt, diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/react-instancesearch/004/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/react-instancesearch/004/output.js index 69bdcee1cf4..03b0c2c9b4b 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/react-instancesearch/004/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/react-instancesearch/004/output.js @@ -24,7 +24,7 @@ var _obj, isMultiIndexContext = function(widget) { return isFirstWidgetIndex && !isSecondWidgetIndex ? -1 : !isFirstWidgetIndex && isSecondWidgetIndex ? 1 : 0; }; export default function createInstantSearchManager(param) { - var indexName = param.indexName, _initialState = param.initialState, searchClient = param.searchClient, resultsState = param.resultsState, stalledSearchDelay = param.stalledSearchDelay, skipSearch = function() { + var state, listeners, indexName = param.indexName, _initialState = param.initialState, searchClient = param.searchClient, resultsState = param.resultsState, stalledSearchDelay = param.stalledSearchDelay, skipSearch = function() { skip = !0; }, updateClient = function(client) { addAlgoliaAgents(client), helper.setClient(client), search(); @@ -235,7 +235,7 @@ export default function createInstantSearchManager(param) { addAlgoliaAgents(searchClient), helper.on("search", handleNewSearch).on("result", handleSearchSuccess({ indexId: indexName })).on("error", handleSearchError); - var state, listeners, skip = !1, stalledSearchTimer = null, initialSearchParameters = helper.state, widgetsManager = createWidgetsManager(onWidgetsUpdate); + var skip = !1, stalledSearchTimer = null, initialSearchParameters = helper.state, widgetsManager = createWidgetsManager(onWidgetsUpdate); !function(client, results) { if (results && (client.transporter && !client._cacheHydrated || client._useCache && "function" == typeof client.addAlgoliaAgent)) { if (client.transporter && !client._cacheHydrated) { diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/typescript/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/typescript/1/output.js index 7600245244e..d313a640b3d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/typescript/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/typescript/1/output.js @@ -207,7 +207,7 @@ var ts; case 271: return function(node) { if (node.moduleSpecifier) { - var generatedName = factory.getGeneratedNameForNode(node); + var innerExpr, generatedName = factory.getGeneratedNameForNode(node); if (node.exportClause && ts.isNamedExports(node.exportClause)) { var statements = []; moduleKind !== ts.ModuleKind.AMD && statements.push(ts.setOriginalNode(ts.setTextRange(factory.createVariableStatement(void 0, factory.createVariableDeclarationList([ @@ -224,7 +224,7 @@ var ts; return ts.singleOrMany(statements); } if (!node.exportClause) return ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(emitHelpers().createExportStarHelper(moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : generatedName)), node), node); - var innerExpr, statements = []; + var statements = []; return statements.push(ts.setOriginalNode(ts.setTextRange(factory.createExpressionStatement(createExportExpression(factory.cloneNode(node.exportClause.name), (innerExpr = moduleKind !== ts.ModuleKind.AMD ? createRequireCall(node) : ts.isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory.createIdentifier(ts.idText(node.exportClause.name)), !ts.getESModuleInterop(compilerOptions) || 67108864 & ts.getEmitFlags(node) ? innerExpr : ts.getExportNeedsImportStarHelper(node) ? emitHelpers().createImportStarHelper(innerExpr) : innerExpr))), node), node)), ts.singleOrMany(statements); } }(node); diff --git a/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js b/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js index 465ccf4224e..21d844da86f 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js @@ -969,7 +969,7 @@ } if (view.domObserver.disconnectSelection(), view.cursorWrapper) domSel = (view1 = view).root.getSelection(), range = document.createRange(), (img = "IMG" == (node = view1.cursorWrapper.dom).nodeName) ? range.setEnd(node.parentNode, domIndex(node) + 1) : range.setEnd(node, 0), range.collapse(!1), domSel.removeAllRanges(), domSel.addRange(range), !img && !view1.state.selection.visible && result.ie && result.ie_version <= 11 && (node.disabled = !0, node.disabled = !1); else { - var view1, domSel, range, node, img, resetEditableFrom, resetEditableTo, view2, doc, domSel1, node1, offset, anchor = sel.anchor, head = sel.head; + var view1, domSel, range, node, img, view2, doc, domSel1, node1, offset, resetEditableFrom, resetEditableTo, anchor = sel.anchor, head = sel.head; !brokenSelectBetweenUneditable || sel instanceof prosemirror_state__WEBPACK_IMPORTED_MODULE_0__.TextSelection || (sel.$from.parent.inlineContent || (resetEditableFrom = temporarilyEditableNear(view, sel.from)), sel.empty || sel.$from.parent.inlineContent || (resetEditableTo = temporarilyEditableNear(view, sel.to))), view.docView.setSelection(anchor, head, view.root, force), brokenSelectBetweenUneditable && (resetEditableFrom && resetEditable(resetEditableFrom), resetEditableTo && resetEditable(resetEditableTo)), sel.visible ? view.dom.classList.remove("ProseMirror-hideselection") : (view.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && ((doc = (view2 = view).dom.ownerDocument).removeEventListener("selectionchange", view2.hideSelectionGuard), node1 = (domSel1 = view2.root.getSelection()).anchorNode, offset = domSel1.anchorOffset, doc.addEventListener("selectionchange", view2.hideSelectionGuard = function() { (domSel1.anchorNode != node1 || domSel1.anchorOffset != offset) && (doc.removeEventListener("selectionchange", view2.hideSelectionGuard), setTimeout(function() { (!editorOwnsSelection(view2) || view2.state.selection.visible) && view2.dom.classList.remove("ProseMirror-hideselection"); diff --git a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js index 827e6ffe497..7bc7049a53d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js @@ -5,7 +5,7 @@ ], { 5215: function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - for(var browserApi, videojs$1, FakeWeakMap, _supportsPassive, EVENT_MAP, canPlayType, Vhs$1, global_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8908), global_window__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(global_window__WEBPACK_IMPORTED_MODULE_0__), global_document__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9144), global_document__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(global_document__WEBPACK_IMPORTED_MODULE_1__), _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7462), _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7326), _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(4578), safe_json_parse_tuple__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5974), safe_json_parse_tuple__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(safe_json_parse_tuple__WEBPACK_IMPORTED_MODULE_2__), keycode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7537), keycode__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(keycode__WEBPACK_IMPORTED_MODULE_3__), _videojs_xhr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9603), _videojs_xhr__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_videojs_xhr__WEBPACK_IMPORTED_MODULE_4__), videojs_vtt_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3407), videojs_vtt_js__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(videojs_vtt_js__WEBPACK_IMPORTED_MODULE_5__), _babel_runtime_helpers_construct__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(8852), _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(136), _videojs_vhs_utils_es_resolve_url_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(779), m3u8_parser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9323), _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2260), _videojs_vhs_utils_es_media_types_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(8485), mpd_parser__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(973), mux_js_lib_tools_parse_sidx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4221), mux_js_lib_tools_parse_sidx__WEBPACK_IMPORTED_MODULE_10___default = __webpack_require__.n(mux_js_lib_tools_parse_sidx__WEBPACK_IMPORTED_MODULE_10__), _videojs_vhs_utils_es_id3_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8925), _videojs_vhs_utils_es_containers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6185), _videojs_vhs_utils_es_byte_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(562), mux_js_lib_utils_clock__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(1489), version$5 = "7.17.0", hooks_ = {}, hooks = function(type, fn) { + for(var match, match1, result, version, browserApi, videojs$1, FakeWeakMap, _supportsPassive, EVENT_MAP, canPlayType, Vhs$1, global_window__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8908), global_window__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(global_window__WEBPACK_IMPORTED_MODULE_0__), global_document__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9144), global_document__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(global_document__WEBPACK_IMPORTED_MODULE_1__), _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(7462), _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(7326), _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(4578), safe_json_parse_tuple__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5974), safe_json_parse_tuple__WEBPACK_IMPORTED_MODULE_2___default = __webpack_require__.n(safe_json_parse_tuple__WEBPACK_IMPORTED_MODULE_2__), keycode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7537), keycode__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(keycode__WEBPACK_IMPORTED_MODULE_3__), _videojs_xhr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9603), _videojs_xhr__WEBPACK_IMPORTED_MODULE_4___default = __webpack_require__.n(_videojs_xhr__WEBPACK_IMPORTED_MODULE_4__), videojs_vtt_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3407), videojs_vtt_js__WEBPACK_IMPORTED_MODULE_5___default = __webpack_require__.n(videojs_vtt_js__WEBPACK_IMPORTED_MODULE_5__), _babel_runtime_helpers_construct__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(8852), _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(136), _videojs_vhs_utils_es_resolve_url_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(779), m3u8_parser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9323), _videojs_vhs_utils_es_codecs_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2260), _videojs_vhs_utils_es_media_types_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(8485), mpd_parser__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(973), mux_js_lib_tools_parse_sidx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4221), mux_js_lib_tools_parse_sidx__WEBPACK_IMPORTED_MODULE_10___default = __webpack_require__.n(mux_js_lib_tools_parse_sidx__WEBPACK_IMPORTED_MODULE_10__), _videojs_vhs_utils_es_id3_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(8925), _videojs_vhs_utils_es_containers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6185), _videojs_vhs_utils_es_byte_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(562), mux_js_lib_utils_clock__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(1489), version$5 = "7.17.0", hooks_ = {}, hooks = function(type, fn) { return hooks_[type] = hooks_[type] || [], fn && (hooks_[type] = hooks_[type].concat(fn)), hooks_[type]; }, hook = function(type, fn) { hooks(type, fn); @@ -156,7 +156,7 @@ } return ""; } - var match, match1, result, version, USER_AGENT = global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator && global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator.userAgent || "", webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT), appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null, IS_IPOD = /iPod/i.test(USER_AGENT), IOS_VERSION = (match = USER_AGENT.match(/OS (\d+)_/i)) && match[1] ? match[1] : null, IS_ANDROID = /Android/i.test(USER_AGENT), ANDROID_VERSION = function() { + var USER_AGENT = global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator && global_window__WEBPACK_IMPORTED_MODULE_0___default().navigator.userAgent || "", webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT), appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null, IS_IPOD = /iPod/i.test(USER_AGENT), IOS_VERSION = (match = USER_AGENT.match(/OS (\d+)_/i)) && match[1] ? match[1] : null, IS_ANDROID = /Android/i.test(USER_AGENT), ANDROID_VERSION = function() { var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); if (!match) return null; var major = match[1] && parseFloat(match[1]), minor = match[2] && parseFloat(match[2]); @@ -4568,14 +4568,14 @@ for(var descriptor = {}, i = 0; i < priority.length && (!(descriptor = Object.getOwnPropertyDescriptor(priority[i], prop)) || !descriptor.set || !descriptor.get); i++); return descriptor.enumerable = !0, descriptor.configurable = !0, descriptor; }, firstSourceWatch = function(tech) { - var el = tech.el(); + var tech1, el = tech.el(); if (!el.resetSourceWatch_) { - var old = {}, innerDescriptor = getDescriptor([ - tech.el(), + var old = {}, innerDescriptor = (tech1 = tech, getDescriptor([ + tech1.el(), global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLMediaElement.prototype, global_window__WEBPACK_IMPORTED_MODULE_0___default().Element.prototype, innerHTMLDescriptorPolyfill - ], "innerHTML"), appendWrapper = function(appendFn) { + ], "innerHTML")), appendWrapper = function(appendFn) { return function() { for(var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++)args[_key] = arguments[_key]; var retval = appendFn.apply(el, args); @@ -4605,13 +4605,13 @@ } }), setupSourceset = function(tech) { if (tech.featuresSourceset) { - var el = tech.el(); + var tech1, el = tech.el(); if (!el.resetSourceset_) { - var srcDescriptor = getDescriptor([ - tech.el(), + var srcDescriptor = (tech1 = tech, getDescriptor([ + tech1.el(), global_window__WEBPACK_IMPORTED_MODULE_0___default().HTMLMediaElement.prototype, srcDescriptorPolyfill - ], "src"), oldSetAttribute = el.setAttribute, oldLoad = el.load; + ], "src")), oldSetAttribute = el.setAttribute, oldLoad = el.load; Object.defineProperty(el, "src", mergeOptions$3(srcDescriptor, { set: function(v) { var retval = srcDescriptor.set.call(el, v); @@ -7169,10 +7169,10 @@ return null; } if (!playlist || !playlist.segments || 0 === playlist.segments.length) return null; - var dateTimeObject, segment = playlist.segments[0]; + var videoTimingInfo, dateTimeObject, segment = playlist.segments[0]; if (dateTimeObject < segment.dateTimeObject) return null; for(var i = 0; i < playlist.segments.length - 1 && (segment = playlist.segments[i], !(dateTimeObject < playlist.segments[i + 1].dateTimeObject)); i++); - var videoTimingInfo, lastSegment = playlist.segments[playlist.segments.length - 1], lastSegmentStart = lastSegment.dateTimeObject, lastSegmentDuration = lastSegment.videoTimingInfo ? (videoTimingInfo = lastSegment.videoTimingInfo).transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds : lastSegment.duration + 0.25 * lastSegment.duration, lastSegmentEnd = new Date(lastSegmentStart.getTime() + 1000 * lastSegmentDuration); + var lastSegment = playlist.segments[playlist.segments.length - 1], lastSegmentStart = lastSegment.dateTimeObject, lastSegmentDuration = lastSegment.videoTimingInfo ? (videoTimingInfo = lastSegment.videoTimingInfo).transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds : lastSegment.duration + 0.25 * lastSegment.duration, lastSegmentEnd = new Date(lastSegmentStart.getTime() + 1000 * lastSegmentDuration); return dateTimeObject > lastSegmentEnd ? null : (dateTimeObject > lastSegmentStart && (segment = lastSegment), { segment: segment, estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)), @@ -7586,7 +7586,7 @@ }, getWorkerString = function(fn) { return fn.toString().replace(/^function.+?{/, "").slice(0, -1); }, workerCode$1 = transform(getWorkerString(function() { - var _TransportPacketStream, _TransportParseStream, _ElementaryStream, _AdtsStream, ExpGolomb, _H264Stream, _NalByteStream, PROFILES_WITH_OPTIONAL_SPS_DATA, _AacStream, _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream, timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, videoSample, audioSample, audioTrun, videoTrun, trunHeader, Stream = function() { + var _TransportPacketStream, _TransportParseStream, _ElementaryStream, _AdtsStream, ExpGolomb, _H264Stream, _NalByteStream, PROFILES_WITH_OPTIONAL_SPS_DATA, _AacStream, _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream, timescale, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, Stream = function() { this.init = function() { var listeners = {}; this.on = function(type, listener) { @@ -8408,7 +8408,7 @@ }, trun$1 = function(track, offset) { return "audio" === track.type ? audioTrun(track, offset) : videoTrun(track, offset); }; - var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS, silence, secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds, mp4Generator = { + var mp4Generator = { ftyp: ftyp, mdat: mdat, moof: moof, @@ -9319,7 +9319,7 @@ }; }; TimestampRolloverStream$1.prototype = new Stream(); - var _MetadataStream, timestampRolloverStream = { + var videoSample, audioSample, audioTrun, videoTrun, trunHeader, box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS, silence, secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds, _MetadataStream, timestampRolloverStream = { TimestampRolloverStream: TimestampRolloverStream$1, handleRollover: handleRollover$1 }, percentEncode$1 = function(bytes, start, end) { @@ -14690,9 +14690,9 @@ for(var keySystem in keySystemOptions)keySystemContentTypes[keySystem] = {}, audioContentType && (keySystemContentTypes[keySystem].audioContentType = audioContentType), videoContentType && (keySystemContentTypes[keySystem].videoContentType = videoContentType), mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh && (keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh), "string" == typeof keySystemOptions[keySystem] && (keySystemContentTypes[keySystem].url = keySystemOptions[keySystem]); return videojs.mergeOptions(keySystemOptions, keySystemContentTypes); }, waitForKeySessionCreation = function(_ref) { - var player = _ref.player, sourceKeySystems = _ref.sourceKeySystems, audioMedia = _ref.audioMedia, mainPlaylists = _ref.mainPlaylists; + var playlists, keySystems, player = _ref.player, sourceKeySystems = _ref.sourceKeySystems, audioMedia = _ref.audioMedia, mainPlaylists = _ref.mainPlaylists; if (!player.eme.initializeMediaKeys) return Promise.resolve(); - var playlists, keySystems, keySystemsOptionsArr = (playlists = audioMedia ? mainPlaylists.concat([ + var keySystemsOptionsArr = (playlists = audioMedia ? mainPlaylists.concat([ audioMedia ]) : mainPlaylists, keySystems = Object.keys(sourceKeySystems), playlists.reduce(function(keySystemsArr, playlist) { if (!playlist.contentProtection) return keySystemsArr; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js index 1306117992c..1f64d959ceb 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js @@ -3495,9 +3495,9 @@ "number" == typeof period.attributes.duration && (periodAttributes.periodDuration = period.attributes.duration); var adaptationSets = findChildren(period.node, "AdaptationSet"), periodSegmentInfo = getSegmentInformation(period.node); return flatten(adaptationSets.map(function(adaptationSet) { - var service, adaptationSetAttributes = parseAttributes(adaptationSet), adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, "BaseURL")), role = findChildren(adaptationSet, "Role")[0], roleAttributes = { + var service, adaptationSetAttributes, adaptationSetAttributes1 = parseAttributes(adaptationSet), adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, "BaseURL")), role = findChildren(adaptationSet, "Role")[0], roleAttributes = { role: parseAttributes(role) - }, attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes), accessibility = findChildren(adaptationSet, "Accessibility")[0], captionServices = "urn:scte:dash:cc:cea-608:2015" === (service = parseAttributes(accessibility)).schemeIdUri ? ("string" != typeof service.value ? [] : service.value.split(";")).map(function(value) { + }, attrs = merge(periodAttributes, adaptationSetAttributes1, roleAttributes), accessibility = findChildren(adaptationSet, "Accessibility")[0], captionServices = "urn:scte:dash:cc:cea-608:2015" === (service = parseAttributes(accessibility)).schemeIdUri ? ("string" != typeof service.value ? [] : service.value.split(";")).map(function(value) { if (language = value, /^CC\d=/.test(value)) { var channel, language, _value$split = value.split("="); channel = _value$split[0], language = _value$split[1]; @@ -3547,9 +3547,9 @@ Object.keys(contentProtection).length && (attrs = merge(attrs, { contentProtection: contentProtection })); - var adaptationSetAttributes1, segmentInfo = getSegmentInformation(adaptationSet), representations = findChildren(adaptationSet, "Representation"), adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo); - return flatten(representations.map((adaptationSetAttributes1 = attrs, function(representation) { - var repBaseUrlElements = findChildren(representation, "BaseURL"), repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements), attributes = merge(adaptationSetAttributes1, parseAttributes(representation)), representationSegmentInfo = getSegmentInformation(representation); + var segmentInfo = getSegmentInformation(adaptationSet), representations = findChildren(adaptationSet, "Representation"), adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo); + return flatten(representations.map((adaptationSetAttributes = attrs, function(representation) { + var repBaseUrlElements = findChildren(representation, "BaseURL"), repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements), attributes = merge(adaptationSetAttributes, parseAttributes(representation)), representationSegmentInfo = getSegmentInformation(representation); return repBaseUrls.map(function(baseUrl) { return { segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo), diff --git a/crates/swc_ecma_minifier/tests/fixture/next/39538/static/chunks/pages/index-1bd068cedc2b5af3/output.js b/crates/swc_ecma_minifier/tests/fixture/next/39538/static/chunks/pages/index-1bd068cedc2b5af3/output.js index 450df1b1218..d87c397c391 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/39538/static/chunks/pages/index-1bd068cedc2b5af3/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/39538/static/chunks/pages/index-1bd068cedc2b5af3/output.js @@ -31,7 +31,7 @@ Object.defineProperty(exports, "__esModule", { value: !0 }), exports.default = function(_param) { - var sizerSvgUrl, _obj, src = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyRoot = _param.lazyRoot, lazyBoundary = _param.lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, style = _param.style, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete = _param.onLoadingComplete, _placeholder = _param.placeholder, placeholder = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = _object_without_properties_loose(_param, [ + var src, sizerSvgUrl, _obj, src1 = _param.src, sizes = _param.sizes, _unoptimized = _param.unoptimized, unoptimized = void 0 !== _unoptimized && _unoptimized, _priority = _param.priority, priority = void 0 !== _priority && _priority, loading = _param.loading, _lazyRoot = _param.lazyRoot, lazyBoundary = _param.lazyBoundary, className = _param.className, quality = _param.quality, width = _param.width, height = _param.height, style = _param.style, objectFit = _param.objectFit, objectPosition = _param.objectPosition, onLoadingComplete = _param.onLoadingComplete, _placeholder = _param.placeholder, placeholder = void 0 === _placeholder ? "empty" : _placeholder, blurDataURL = _param.blurDataURL, all = _object_without_properties_loose(_param, [ "src", "sizes", "unoptimized", @@ -77,15 +77,15 @@ } delete all.loader; } - var src1, staticSrc = ""; - if ("object" == typeof (src1 = src) && (isStaticRequire(src1) || void 0 !== src1.src)) { - var staticImageData = isStaticRequire(src) ? src.default : src; + var staticSrc = ""; + if ("object" == typeof (src = src1) && (isStaticRequire(src) || void 0 !== src.src)) { + var staticImageData = isStaticRequire(src1) ? src1.default : src1; if (!staticImageData.src) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ".concat(JSON.stringify(staticImageData))); if (blurDataURL = blurDataURL || staticImageData.blurDataURL, staticSrc = staticImageData.src, (!layout || "fill" !== layout) && (height = height || staticImageData.height, width = width || staticImageData.width, !staticImageData.height || !staticImageData.width)) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ".concat(JSON.stringify(staticImageData))); } - src = "string" == typeof src ? src : staticSrc; + src1 = "string" == typeof src1 ? src1 : staticSrc; var isLazy = !priority && ("lazy" === loading || void 0 === loading); - (src.startsWith("data:") || src.startsWith("blob:")) && (unoptimized = !0, isLazy = !1), loadedImageURLs.has(src) && (isLazy = !1), experimentalUnoptimized && (unoptimized = !0); + (src1.startsWith("data:") || src1.startsWith("blob:")) && (unoptimized = !0, isLazy = !1), loadedImageURLs.has(src1) && (isLazy = !1), experimentalUnoptimized && (unoptimized = !0); var ref = _slicedToArray(_react.useState(!1), 2), blurComplete = ref[0], setBlurComplete = ref[1], ref1 = _slicedToArray(_useIntersection.useIntersection({ rootRef: void 0 === _lazyRoot ? null : _lazyRoot, rootMargin: lazyBoundary || "200px", @@ -148,7 +148,7 @@ }; isVisible && (imgAttributes = generateImgAttrs({ config: config, - src: src, + src: src1, unoptimized: unoptimized, layout: layout, width: widthInt, @@ -156,18 +156,18 @@ sizes: sizes, loader: loader })); - var srcString = src, imageSizesPropName = "imagesizes"; + var srcString = src1, imageSizesPropName = "imagesizes"; imageSizesPropName = "imageSizes"; - var linkProps = (_defineProperty(_obj = {}, "imageSrcSet", imgAttributes.srcSet), _defineProperty(_obj, imageSizesPropName, imgAttributes.sizes), _obj), useLayoutEffect = _react.default.useLayoutEffect, onLoadingCompleteRef = _react.useRef(onLoadingComplete), previousImageSrc = _react.useRef(src); + var linkProps = (_defineProperty(_obj = {}, "imageSrcSet", imgAttributes.srcSet), _defineProperty(_obj, imageSizesPropName, imgAttributes.sizes), _obj), useLayoutEffect = _react.default.useLayoutEffect, onLoadingCompleteRef = _react.useRef(onLoadingComplete), previousImageSrc = _react.useRef(src1); _react.useEffect(function() { onLoadingCompleteRef.current = onLoadingComplete; }, [ onLoadingComplete ]), useLayoutEffect(function() { - previousImageSrc.current !== src && (resetIntersected(), previousImageSrc.current = src); + previousImageSrc.current !== src1 && (resetIntersected(), previousImageSrc.current = src1); }, [ resetIntersected, - src + src1 ]); var imgElementArgs = _extends({ isLazy: isLazy, diff --git a/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js b/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js index 30832411b70..05ead2c7abd 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js @@ -18,7 +18,7 @@ return _app; } }); - var _lg$1, _md$1, _sm$1, _baseStyleRoot, _Input$baseStyle$fiel, _Input$baseStyle, _Input$variants$unsty$1, _xs, _sm, _md, _lg, _xl, _container2, _container3, _container4, _Input$variants$unsty, _Input$sizes$xs$field, _Input$sizes$sm$field, _Input$sizes$md$field, _Input$sizes$lg$field, jsx_runtime = __webpack_require__(5893), react = __webpack_require__(7294), emotion_react_browser_esm = __webpack_require__(917), CSSReset = function() { + var initialState, state, listeners, setState, _lg$1, _md$1, _sm$1, _baseStyleRoot, _Input$baseStyle$fiel, _Input$baseStyle, _Input$variants$unsty$1, _xs, _sm, _md, _lg, _xl, _container2, _container3, _container4, _Input$variants$unsty, _Input$sizes$xs$field, _Input$sizes$sm$field, _Input$sizes$md$field, _Input$sizes$lg$field, jsx_runtime = __webpack_require__(5893), react = __webpack_require__(7294), emotion_react_browser_esm = __webpack_require__(917), CSSReset = function() { return react.createElement(emotion_react_browser_esm.xB, { styles: '\n html {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n font-family: system-ui, sans-serif;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n -moz-osx-font-smoothing: grayscale;\n touch-action: manipulation;\n }\n\n body {\n position: relative;\n min-height: 100%;\n font-feature-settings: \'kern\';\n }\n\n *,\n *::before,\n *::after {\n border-width: 0;\n border-style: solid;\n box-sizing: border-box;\n }\n\n main {\n display: block;\n }\n\n hr {\n border-top-width: 1px;\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n }\n\n pre,\n code,\n kbd,\n samp {\n font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;\n font-size: 1em;\n }\n\n a {\n background-color: transparent;\n color: inherit;\n text-decoration: inherit;\n }\n\n abbr[title] {\n border-bottom: none;\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n\n b,\n strong {\n font-weight: bold;\n }\n\n small {\n font-size: 80%;\n }\n\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n sub {\n bottom: -0.25em;\n }\n\n sup {\n top: -0.5em;\n }\n\n img {\n border-style: none;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n line-height: 1.15;\n margin: 0;\n }\n\n button,\n input {\n overflow: visible;\n }\n\n button,\n select {\n text-transform: none;\n }\n\n button::-moz-focus-inner,\n [type="button"]::-moz-focus-inner,\n [type="reset"]::-moz-focus-inner,\n [type="submit"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n\n fieldset {\n padding: 0.35em 0.75em 0.625em;\n }\n\n legend {\n box-sizing: border-box;\n color: inherit;\n display: table;\n max-width: 100%;\n padding: 0;\n white-space: normal;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n textarea {\n overflow: auto;\n }\n\n [type="checkbox"],\n [type="radio"] {\n box-sizing: border-box;\n padding: 0;\n }\n\n [type="number"]::-webkit-inner-spin-button,\n [type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none !important;\n }\n\n input[type="number"] {\n -moz-appearance: textfield;\n }\n\n [type="search"] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n [type="search"]::-webkit-search-decoration {\n -webkit-appearance: none !important;\n }\n\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n details {\n display: block;\n }\n\n summary {\n display: list-item;\n }\n\n template {\n display: none;\n }\n\n [hidden] {\n display: none !important;\n }\n\n body,\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre {\n margin: 0;\n }\n\n button {\n background: transparent;\n padding: 0;\n }\n\n fieldset {\n margin: 0;\n padding: 0;\n }\n\n ol,\n ul {\n margin: 0;\n padding: 0;\n }\n\n textarea {\n resize: vertical;\n }\n\n button,\n [role="button"] {\n cursor: pointer;\n }\n\n button::-moz-focus-inner {\n border: 0 !important;\n }\n\n table {\n border-collapse: collapse;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n }\n\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n }\n\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n\n [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) {\n outline: none;\n box-shadow: none;\n }\n\n select::-ms-expand {\n display: none;\n }\n ' }); @@ -1391,13 +1391,13 @@ return valueStr.includes("\\.") ? value : Number.isInteger(parseFloat(value.toString())) ? value : valueStr.replace(".", "\\."); } function cssVar(name, options) { - var prefix, prefix1, fallback, fallback1, cssVariable = (void 0 === (prefix = null == options ? void 0 : options.prefix) && (prefix = ""), "--" + (void 0 === (prefix1 = prefix) && (prefix1 = ""), [ + var fallback, prefix, prefix1, fallback1, cssVariable = (void 0 === (prefix = null == options ? void 0 : options.prefix) && (prefix = ""), "--" + (void 0 === (prefix1 = prefix) && (prefix1 = ""), [ prefix1, chakra_ui_theme_tools_esm_escape(name) ].filter(Boolean).join("-"))); return { variable: cssVariable, - reference: (fallback = "string" == typeof (fallback1 = null == options ? void 0 : options.fallback) ? fallback1 : null == fallback1 ? void 0 : fallback1.reference, "var(" + chakra_ui_theme_tools_esm_escape(cssVariable) + (fallback ? ", " + fallback : "") + ")") + reference: (fallback1 = "string" == typeof (fallback = null == options ? void 0 : options.fallback) ? fallback : null == fallback ? void 0 : fallback.reference, "var(" + chakra_ui_theme_tools_esm_escape(cssVariable) + (fallback1 ? ", " + fallback1 : "") + ")") }; } var accordionAnatomy = anatomy("accordion").parts("root", "container", "button", "panel").extend("icon"), alertAnatomy = anatomy("alert").parts("title", "description", "container").extend("icon", "spinner"), avatarAnatomy = anatomy("avatar").parts("label", "badge", "container").extend("excessLabel", "group"), breadcrumbAnatomy = anatomy("breadcrumb").parts("link", "item", "container").extend("separator"); @@ -1601,11 +1601,11 @@ string: name }, fallback = (function random(options) { if (void 0 === options && (options = {}), void 0 !== options.count && null !== options.count) { - var totalColors = options.count, colors = []; + var hue, seed, hueRange, res, totalColors = options.count, colors = []; for(options.count = void 0; totalColors > colors.length;)options.count = null, options.seed && (options.seed += 1), colors.push(random(options)); return options.count = totalColors, colors; } - var hue, seed, hueRange, res, h = (hue = options.hue, seed = options.seed, hueRange = function(colorInput) { + var h = (hue = options.hue, seed = options.seed, hueRange = function(colorInput) { var num = parseInt(colorInput, 10); if (!Number.isNaN(num) && num < 360 && num > 0) return [ num, @@ -4400,7 +4400,7 @@ index: index }; } - var initialState, state, listeners, setState, getToastPosition = function(toasts, id) { + var getToastPosition = function(toasts, id) { var _Object$values$flat$f; return null == (_Object$values$flat$f = Object.values(toasts).flat().find(function(toast) { return toast.id === id; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/feedback-2/codemirror/output.js b/crates/swc_ecma_minifier/tests/fixture/next/feedback-2/codemirror/output.js index c62856c8ef9..d01d11ac94a 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/feedback-2/codemirror/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/feedback-2/codemirror/output.js @@ -2,7 +2,7 @@ "object" == typeof exports && "undefined" != typeof module ? module.exports = factory() : "function" == typeof define && define.amd ? define(factory) : (global = global || self).CodeMirror = factory(); }(this, function() { "use strict"; - var CodeMirror, optionHandlers, helpers, CodeMirror1, range, zwspSupported, badBidiRects, measureText, lastClick, lastDoubleClick, userAgent = navigator.userAgent, platform = navigator.platform, gecko = /gecko\/\d/i.test(userAgent), ie_upto10 = /MSIE \d/.test(userAgent), ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent), edge = /Edge\/(\d+)/.exec(userAgent), ie = ie_upto10 || ie_11up || edge, ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]), webkit = !edge && /WebKit\//.test(userAgent), qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent), chrome = !edge && /Chrome\//.test(userAgent), presto = /Opera\//.test(userAgent), safari = /Apple Computer/.test(navigator.vendor), mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent), phantom = /PhantomJS/.test(userAgent), ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2), android = /Android/.test(userAgent), mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent), mac = ios || /Mac/.test(platform), chromeOS = /\bCrOS\b/.test(userAgent), windows = /win/i.test(platform), presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + var e, CodeMirror, optionHandlers, helpers, CodeMirror1, range, zwspSupported, badBidiRects, measureText, lastClick, lastDoubleClick, userAgent = navigator.userAgent, platform = navigator.platform, gecko = /gecko\/\d/i.test(userAgent), ie_upto10 = /MSIE \d/.test(userAgent), ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent), edge = /Edge\/(\d+)/.exec(userAgent), ie = ie_upto10 || ie_11up || edge, ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]), webkit = !edge && /WebKit\//.test(userAgent), qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent), chrome = !edge && /Chrome\//.test(userAgent), presto = /Opera\//.test(userAgent), safari = /Apple Computer/.test(navigator.vendor), mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent), phantom = /PhantomJS/.test(userAgent), ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2), android = /Android/.test(userAgent), mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent), mac = ios || /Mac/.test(platform), chromeOS = /\bCrOS\b/.test(userAgent), windows = /win/i.test(platform), presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); presto_version && (presto_version = Number(presto_version[1])), presto_version && presto_version >= 15 && (presto = !1, webkit = !0); var flipCtrlCmd = mac && (qtwebkit || presto && (null == presto_version || presto_version < 12.11)), captureRightClick = gecko || ie && ie_version >= 9; function classTest(cls) { @@ -340,7 +340,7 @@ var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")), r0 = range(txt, 0, 1).getBoundingClientRect(), r1 = range(txt, 1, 2).getBoundingClientRect(); return removeChildren(measure), !!r0 && r0.left != r0.right && (badBidiRects = r1.right - r0.right < 3); } - var e, splitLinesAuto = 3 != "\n\nb".split(/\n/).length ? function(string) { + var splitLinesAuto = 3 != "\n\nb".split(/\n/).length ? function(string) { for(var pos = 0, result = [], l = string.length; pos <= l;){ var nl = string.indexOf("\n", pos); -1 == nl && (nl = string.length); @@ -2081,16 +2081,16 @@ this.viewport = viewport, this.visible = visibleLines(display, cm.doc, viewport), this.editorIsHidden = !display.wrapper.offsetWidth, this.wrapperHeight = display.wrapper.clientHeight, this.wrapperWidth = display.wrapper.clientWidth, this.oldDisplayWidth = displayWidth(cm), this.force = force, this.dims = getDimensions(cm), this.events = []; }; function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; + var from, to, display, display1 = cm.display, doc = cm.doc; if (update.editorIsHidden) return resetView(cm), !1; - if (!update.force && update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && (null == display.updateLineNumbers || display.updateLineNumbers >= display.viewTo) && display.renderedView == display.view && 0 == countDirtyView(cm)) return !1; + if (!update.force && update.visible.from >= display1.viewFrom && update.visible.to <= display1.viewTo && (null == display1.updateLineNumbers || display1.updateLineNumbers >= display1.viewTo) && display1.renderedView == display1.view && 0 == countDirtyView(cm)) return !1; maybeUpdateLineNumberWidth(cm) && (resetView(cm), update.dims = getDimensions(cm)); - var end = doc.first + doc.size, from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first), to = Math.min(end, update.visible.to + cm.options.viewportMargin); - display.viewFrom < from && from - display.viewFrom < 20 && (from = Math.max(doc.first, display.viewFrom)), display.viewTo > to && display.viewTo - to < 20 && (to = Math.min(end, display.viewTo)), sawCollapsedSpans && (from = visualLineNo(cm.doc, from), to = visualLineEndNo(cm.doc, to)); - var from1, to1, display1, different = from != display.viewFrom || to != display.viewTo || display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - from1 = from, to1 = to, 0 == (display1 = cm.display).view.length || from1 >= display1.viewTo || to1 <= display1.viewFrom ? (display1.view = buildViewArray(cm, from1, to1), display1.viewFrom = from1) : (display1.viewFrom > from1 ? display1.view = buildViewArray(cm, from1, display1.viewFrom).concat(display1.view) : display1.viewFrom < from1 && (display1.view = display1.view.slice(findViewIndex(cm, from1))), display1.viewFrom = from1, display1.viewTo < to1 ? display1.view = display1.view.concat(buildViewArray(cm, display1.viewTo, to1)) : display1.viewTo > to1 && (display1.view = display1.view.slice(0, findViewIndex(cm, to1)))), display1.viewTo = to1, display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)), cm.display.mover.style.top = display.viewOffset + "px"; + var end = doc.first + doc.size, from1 = Math.max(update.visible.from - cm.options.viewportMargin, doc.first), to1 = Math.min(end, update.visible.to + cm.options.viewportMargin); + display1.viewFrom < from1 && from1 - display1.viewFrom < 20 && (from1 = Math.max(doc.first, display1.viewFrom)), display1.viewTo > to1 && display1.viewTo - to1 < 20 && (to1 = Math.min(end, display1.viewTo)), sawCollapsedSpans && (from1 = visualLineNo(cm.doc, from1), to1 = visualLineEndNo(cm.doc, to1)); + var different = from1 != display1.viewFrom || to1 != display1.viewTo || display1.lastWrapHeight != update.wrapperHeight || display1.lastWrapWidth != update.wrapperWidth; + from = from1, to = to1, 0 == (display = cm.display).view.length || from >= display.viewTo || to <= display.viewFrom ? (display.view = buildViewArray(cm, from, to), display.viewFrom = from) : (display.viewFrom > from ? display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view) : display.viewFrom < from && (display.view = display.view.slice(findViewIndex(cm, from))), display.viewFrom = from, display.viewTo < to ? display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)) : display.viewTo > to && (display.view = display.view.slice(0, findViewIndex(cm, to)))), display.viewTo = to, display1.viewOffset = heightAtLine(getLine(cm.doc, display1.viewFrom)), cm.display.mover.style.top = display1.viewOffset + "px"; var toUpdate = countDirtyView(cm); - if (!different && 0 == toUpdate && !update.force && display.renderedView == display.view && (null == display.updateLineNumbers || display.updateLineNumbers >= display.viewTo)) return !1; + if (!different && 0 == toUpdate && !update.force && display1.renderedView == display1.view && (null == display1.updateLineNumbers || display1.updateLineNumbers >= display1.viewTo)) return !1; var selSnapshot = function(cm) { if (cm.hasFocus()) return null; var active = activeElt(); @@ -2104,7 +2104,7 @@ } return result; }(cm); - return toUpdate > 4 && (display.lineDiv.style.display = "none"), function(cm, updateNumbersFrom, dims) { + return toUpdate > 4 && (display1.lineDiv.style.display = "none"), function(cm, updateNumbersFrom, dims) { var display = cm.display, lineNumbers = cm.options.lineNumbers, container = display.lineDiv, cur = container.firstChild; function rm(node) { var next = node.nextSibling; @@ -2124,12 +2124,12 @@ lineN += lineView.size; } for(; cur;)cur = rm(cur); - }(cm, display.updateLineNumbers, update.dims), toUpdate > 4 && (display.lineDiv.style.display = ""), display.renderedView = display.view, !function(snapshot) { + }(cm, display1.updateLineNumbers, update.dims), toUpdate > 4 && (display1.lineDiv.style.display = ""), display1.renderedView = display1.view, !function(snapshot) { if (snapshot && snapshot.activeElt && snapshot.activeElt != activeElt() && (snapshot.activeElt.focus(), !/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode))) { var sel = window.getSelection(), range = document.createRange(); range.setEnd(snapshot.anchorNode, snapshot.anchorOffset), range.collapse(!1), sel.removeAllRanges(), sel.addRange(range), sel.extend(snapshot.focusNode, snapshot.focusOffset); } - }(selSnapshot), removeChildren(display.cursorDiv), removeChildren(display.selectionDiv), display.gutters.style.height = display.sizer.style.minHeight = 0, different && (display.lastWrapHeight = update.wrapperHeight, display.lastWrapWidth = update.wrapperWidth, startWorker(cm, 400)), display.updateLineNumbers = null, !0; + }(selSnapshot), removeChildren(display1.cursorDiv), removeChildren(display1.selectionDiv), display1.gutters.style.height = display1.sizer.style.minHeight = 0, different && (display1.lastWrapHeight = update.wrapperHeight, display1.lastWrapWidth = update.wrapperWidth, startWorker(cm, 400)), display1.updateLineNumbers = null, !0; } function postUpdateDisplay(cm, update) { for(var viewport = update.viewport, first = !0;; first = !1){ @@ -4135,7 +4135,7 @@ this.time = time, this.pos = pos, this.button = button; }; function onMouseDown(e) { - var cm, pos, repeat, event, contained, behavior, sel, cm1, event1, pos1, behavior1, display, moved, dragEnd, mouseMove, dragStart, display1 = this.display; + var cm, button, pos, repeat, event, name, cm1, pos1, repeat1, event1, behavior, contained, sel, cm2, event2, pos2, behavior1, display, moved, dragEnd, mouseMove, dragStart, now, display1 = this.display; if (!(signalDOMEvent(this, e) || display1.activeTouch && display1.input.supportsTouch())) { if (display1.input.ensurePolled(), display1.shift = e.shiftKey, eventInWidget(display1, e)) { webkit || (display1.scroller.draggable = !1, setTimeout(function() { @@ -4144,34 +4144,34 @@ return; } if (!clickInGutter(this, e)) { - var now, cm2, name, pos2 = posFromMouse(this, e), button = e_button(e), repeat1 = pos2 ? (now = +new Date(), lastDoubleClick && lastDoubleClick.compare(now, pos2, button) ? (lastClick = lastDoubleClick = null, "triple") : lastClick && lastClick.compare(now, pos2, button) ? (lastDoubleClick = new PastClick(now, pos2, button), lastClick = null, "double") : (lastClick = new PastClick(now, pos2, button), lastDoubleClick = null, "single")) : "single"; - window.focus(), 1 == button && this.state.selectingText && this.state.selectingText(e), !(pos2 && (cm2 = this, name = "Click", "double" == repeat1 ? name = "Double" + name : "triple" == repeat1 && (name = "Triple" + name), dispatchKey(cm2, addModifierNames(name = (1 == button ? "Left" : 2 == button ? "Middle" : "Right") + name, e), e, function(bound) { + var pos3 = posFromMouse(this, e), button1 = e_button(e), repeat2 = pos3 ? (now = +new Date(), lastDoubleClick && lastDoubleClick.compare(now, pos3, button1) ? (lastClick = lastDoubleClick = null, "triple") : lastClick && lastClick.compare(now, pos3, button1) ? (lastDoubleClick = new PastClick(now, pos3, button1), lastClick = null, "double") : (lastClick = new PastClick(now, pos3, button1), lastDoubleClick = null, "single")) : "single"; + window.focus(), 1 == button1 && this.state.selectingText && this.state.selectingText(e), !(pos3 && (cm = this, button = button1, pos = pos3, repeat = repeat2, event = e, name = "Click", "double" == repeat ? name = "Double" + name : "triple" == repeat && (name = "Triple" + name), dispatchKey(cm, addModifierNames(name = (1 == button ? "Left" : 2 == button ? "Middle" : "Right") + name, event), event, function(bound) { if ("string" == typeof bound && (bound = commands[bound]), !bound) return !1; var done = !1; try { - cm2.isReadOnly() && (cm2.state.suppressEdits = !0), done = bound(cm2, pos2) != Pass; + cm.isReadOnly() && (cm.state.suppressEdits = !0), done = bound(cm, pos) != Pass; } finally{ - cm2.state.suppressEdits = !1; + cm.state.suppressEdits = !1; } return done; - }))) && (1 == button ? pos2 ? (cm = this, pos = pos2, repeat = repeat1, event = e, ie ? setTimeout(bind(ensureFocus, cm), 0) : cm.curOp.focus = activeElt(), behavior = function(cm, repeat, event) { + }))) && (1 == button1 ? pos3 ? (cm1 = this, pos1 = pos3, repeat1 = repeat2, event1 = e, ie ? setTimeout(bind(ensureFocus, cm1), 0) : cm1.curOp.focus = activeElt(), behavior = function(cm, repeat, event) { var option = cm.getOption("configureMouse"), value = option ? option(cm, repeat, event) : {}; if (null == value.unit) { var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; value.unit = rect ? "rectangle" : "single" == repeat ? "char" : "double" == repeat ? "word" : "line"; } return (null == value.extend || cm.doc.extend) && (value.extend = cm.doc.extend || event.shiftKey), null == value.addNew && (value.addNew = mac ? event.metaKey : event.ctrlKey), null == value.moveOnDrag && (value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey)), value; - }(cm, repeat, event), sel = cm.doc.sel, cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && "single" == repeat && (contained = sel.contains(pos)) > -1 && (0 > cmp((contained = sel.ranges[contained]).from(), pos) || pos.xRel > 0) && (cmp(contained.to(), pos) > 0 || pos.xRel < 0) ? (cm1 = cm, event1 = event, pos1 = pos, behavior1 = behavior, display = cm1.display, moved = !1, dragEnd = operation(cm1, function(e) { - webkit && (display.scroller.draggable = !1), cm1.state.draggingText = !1, cm1.state.delayingBlurEvent && (cm1.hasFocus() ? cm1.state.delayingBlurEvent = !1 : delayBlurEvent(cm1)), off(display.wrapper.ownerDocument, "mouseup", dragEnd), off(display.wrapper.ownerDocument, "mousemove", mouseMove), off(display.scroller, "dragstart", dragStart), off(display.scroller, "drop", dragEnd), moved || (e_preventDefault(e), behavior1.addNew || extendSelection(cm1.doc, pos1, null, null, behavior1.extend), webkit && !safari || ie && 9 == ie_version ? setTimeout(function() { + }(cm1, repeat1, event1), sel = cm1.doc.sel, cm1.options.dragDrop && dragAndDrop && !cm1.isReadOnly() && "single" == repeat1 && (contained = sel.contains(pos1)) > -1 && (0 > cmp((contained = sel.ranges[contained]).from(), pos1) || pos1.xRel > 0) && (cmp(contained.to(), pos1) > 0 || pos1.xRel < 0) ? (cm2 = cm1, event2 = event1, pos2 = pos1, behavior1 = behavior, display = cm2.display, moved = !1, dragEnd = operation(cm2, function(e) { + webkit && (display.scroller.draggable = !1), cm2.state.draggingText = !1, cm2.state.delayingBlurEvent && (cm2.hasFocus() ? cm2.state.delayingBlurEvent = !1 : delayBlurEvent(cm2)), off(display.wrapper.ownerDocument, "mouseup", dragEnd), off(display.wrapper.ownerDocument, "mousemove", mouseMove), off(display.scroller, "dragstart", dragStart), off(display.scroller, "drop", dragEnd), moved || (e_preventDefault(e), behavior1.addNew || extendSelection(cm2.doc, pos2, null, null, behavior1.extend), webkit && !safari || ie && 9 == ie_version ? setTimeout(function() { display.wrapper.ownerDocument.body.focus({ preventScroll: !0 }), display.input.focus(); }, 20) : display.input.focus()); }), mouseMove = function(e2) { - moved = moved || Math.abs(event1.clientX - e2.clientX) + Math.abs(event1.clientY - e2.clientY) >= 10; + moved = moved || Math.abs(event2.clientX - e2.clientX) + Math.abs(event2.clientY - e2.clientY) >= 10; }, dragStart = function() { return moved = !0; - }, webkit && (display.scroller.draggable = !0), cm1.state.draggingText = dragEnd, dragEnd.copy = !behavior1.moveOnDrag, on(display.wrapper.ownerDocument, "mouseup", dragEnd), on(display.wrapper.ownerDocument, "mousemove", mouseMove), on(display.scroller, "dragstart", dragStart), on(display.scroller, "drop", dragEnd), cm1.state.delayingBlurEvent = !0, setTimeout(function() { + }, webkit && (display.scroller.draggable = !0), cm2.state.draggingText = dragEnd, dragEnd.copy = !behavior1.moveOnDrag, on(display.wrapper.ownerDocument, "mouseup", dragEnd), on(display.wrapper.ownerDocument, "mousemove", mouseMove), on(display.scroller, "dragstart", dragStart), on(display.scroller, "drop", dragEnd), cm2.state.delayingBlurEvent = !0, setTimeout(function() { return display.input.focus(); }, 20), display.scroller.dragDrop && display.scroller.dragDrop()) : function(cm, event, start, behavior) { ie && delayBlurEvent(cm); @@ -4252,9 +4252,9 @@ }(e) : done(e); }), up = operation(cm, done); cm.state.selectingText = up, on(display.wrapper.ownerDocument, "mousemove", move), on(display.wrapper.ownerDocument, "mouseup", up); - }(cm, event, pos, behavior)) : e_target(e) == display1.scroller && e_preventDefault(e) : 2 == button ? (pos2 && extendSelection(this.doc, pos2), setTimeout(function() { + }(cm1, event1, pos1, behavior)) : e_target(e) == display1.scroller && e_preventDefault(e) : 2 == button1 ? (pos3 && extendSelection(this.doc, pos3), setTimeout(function() { return display1.input.focus(); - }, 20)) : 3 == button && (captureRightClick ? this.display.input.onContextMenu(e) : delayBlurEvent(this))); + }, 20)) : 3 == button1 && (captureRightClick ? this.display.input.onContextMenu(e) : delayBlurEvent(this))); } } } diff --git a/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js b/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js index bc027630c84..49ec9810e3d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/feedback-util-promisify/chunks/pages/_app-72ad41192608e93a/output.js @@ -19,7 +19,7 @@ 8484: function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); - var _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4051), _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0__), react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893), react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7294), util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9720), util__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_3__); + var fn, _ref, _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4051), _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0__), react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5893), react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7294), util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9720), util__WEBPACK_IMPORTED_MODULE_3___default = __webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_3__); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg), value = info.value; @@ -38,7 +38,7 @@ }) : obj[key] = value, obj; } __webpack_require__(6774); - var fn, _ref, initBranch = (fn = _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() { + var initBranch = (fn = _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() { return _Users_kdy1_projects_lab_swc_minify_issue_node_modules_next_dist_compiled_regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_0___default().wrap(function(_ctx) { for(;;)switch(_ctx.prev = _ctx.next){ case 0: @@ -1984,7 +1984,7 @@ } function formatValue(r, e, o) { if (r.customInspect && e && isFunction(e.inspect) && e.inspect !== t.inspect && !(e.constructor && e.constructor.prototype === e)) { - var t1, e1, o1, l, n = e.inspect(o, r); + var t1, e1, o1, r1, t2, l, n = e.inspect(o, r); return isString(n) || (n = formatValue(r, n, o)), n; } var i = function(r, t) { @@ -1996,7 +1996,7 @@ return isNumber(t) ? r.stylize("" + t, "number") : isBoolean(t) ? r.stylize("" + t, "boolean") : isNull(t) ? r.stylize("null", "null") : void 0; }(r, e); if (i) return i; - var r1, t2, a = Object.keys(e), y = (r1 = a, t2 = {}, r1.forEach(function(r, e) { + var a = Object.keys(e), y = (r1 = a, t2 = {}, r1.forEach(function(r, e) { t2[r] = !0; }), t2); if (r.showHidden && (a = Object.getOwnPropertyNames(e)), isError(e) && (a.indexOf("message") >= 0 || a.indexOf("description") >= 0)) return formatError(e); diff --git a/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js b/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js index 50613e6f714..dc5e0b0eba0 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js @@ -758,7 +758,7 @@ ], function(require, exports, module) { "use strict"; var event = require("../lib/event"), useragent = require("../lib/useragent"), dom = require("../lib/dom"), lang = require("../lib/lang"), clipboard = require("../clipboard"), BROKEN_SETDATA = useragent.isChrome < 18, USE_IE_MIME_TYPE = useragent.isIE, HAS_FOCUS_ARGS = useragent.isChrome > 63, KEYS = require("../lib/keys"), MODS = KEYS.KEY_MODS, isIOS = useragent.isIOS, valueResetRegex = isIOS ? /\s/ : /\n/, isMobile = useragent.isMobile, TextInput = function(parentNode, host) { - var closeTimeout, text = dom.createElement("textarea"); + var typingResetTimeout, typing, detectArrowKeys, closeTimeout, text = dom.createElement("textarea"); text.className = "ace_text-input", text.setAttribute("wrap", "off"), text.setAttribute("autocorrect", "off"), text.setAttribute("autocapitalize", "off"), text.setAttribute("spellcheck", !1), text.style.opacity = "0", parentNode.insertBefore(text, parentNode.firstChild); var copied = !1, pasted = !1, inComposition = !1, sendingText = !1, tempStyle = ""; isMobile || (text.style.fontSize = "1px"); @@ -950,7 +950,7 @@ }; move(e), "mousedown" == e.type && (host.renderer.$isMousePressed = !0, clearTimeout(closeTimeout), useragent.isWin && event.capture(host.container, move, onContextMenuClose)); }, this.onContextMenuClose = onContextMenuClose; - var typingResetTimeout, typing, detectArrowKeys, onContextMenu = function(e) { + var onContextMenu = function(e) { host.textInput.onContextMenu(e), onContextMenuClose(); }; event.addListener(text, "mouseup", onContextMenu, host), event.addListener(text, "mousedown", function(e) { @@ -11784,9 +11784,9 @@ margin: 0 10px;\ } sel.fromOrientedRange(sel.ranges[0]); }, this.selectMore = function(dir, skip, stopAtFirst) { - var session = this.session, range = session.multiSelect.toOrientedRange(); - if (!range.isEmpty() || ((range = session.getWordRange(range.start.row, range.start.column)).cursor = -1 == dir ? range.start : range.end, this.multiSelect.addRange(range), !stopAtFirst)) { - var needle = session.getTextRange(range), newRange = (search.$options.wrap = !0, search.$options.needle = needle, search.$options.backwards = -1 == dir, search.find(session)); + var session, needle, dir1, session1 = this.session, range = session1.multiSelect.toOrientedRange(); + if (!range.isEmpty() || ((range = session1.getWordRange(range.start.row, range.start.column)).cursor = -1 == dir ? range.start : range.end, this.multiSelect.addRange(range), !stopAtFirst)) { + var needle1 = session1.getTextRange(range), newRange = (session = session1, needle = needle1, dir1 = dir, search.$options.wrap = !0, search.$options.needle = needle, search.$options.backwards = -1 == dir1, search.find(session)); newRange && (newRange.cursor = -1 == dir ? newRange.start : newRange.end, this.session.unfold(newRange), this.multiSelect.addRange(newRange), this.renderer.scrollCursorIntoView(null, 0.5)), skip && this.multiSelect.substractPoint(range.cursor); } }, this.alignCursors = function() { diff --git a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js index b4521ba3ea2..8dd0299f7ab 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js @@ -653,15 +653,15 @@ }, 1384: function(e, t, r) { "use strict"; - var n = r(1876).Buffer, i = r(8926), o = r(7154), a = r(7757), u = r(7316); + var n, i = r(1876).Buffer, o = r(8926), a = r(7154), u = r(7757), l = r(7316); r(8079); - var l = r(4098), s = r(6855); - function c(e) { + var s = r(4098), c = r(6855); + function f(e) { return e && "object" == typeof e && "default" in e ? e : { default: e }; } - var f, d = c(i), p = c(o), h = c(a), y = c(u), g = c(l), v = c(s), b = [ + var d = f(o), p = f(a), h = f(u), y = f(l), g = f(s), v = f(c), b = [ "src", "fontWeight", "fontStyle" @@ -680,23 +680,23 @@ extrabold: 800, heavy: 900, black: 900 - }, D = (f = d.default(h.default.mark(function e(t, r) { - var i, o; + }, D = (n = d.default(h.default.mark(function e(t, r) { + var n, o; return h.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ case 0: return e.next = 2, g.default(t, r); case 2: - return i = e.sent, e.next = 5, i.buffer ? i.buffer() : i.arrayBuffer(); + return n = e.sent, e.next = 5, n.buffer ? n.buffer() : n.arrayBuffer(); case 5: - return o = e.sent, e.abrupt("return", "Buffer" === o.constructor.name ? o : n.from(o)); + return o = e.sent, e.abrupt("return", "Buffer" === o.constructor.name ? o : i.from(o)); case 7: case "end": return e.stop(); } }, e); })), function(e, t) { - return f.apply(this, arguments); + return n.apply(this, arguments); }), w = function(e) { var t = e.split(",")[0], r = "data:" === t.substring(0, 5), n = "base64" === t.split(";")[1]; return r && n; @@ -708,7 +708,7 @@ this.src = e, this.fontFamily = t, this.fontStyle = r || "normal", this.fontWeight = n || 400, this.data = null, this.loading = !1, this.options = i; } return t.prototype.load = (e = d.default(h.default.mark(function e() { - var t, r, i, o, a, u, l, s = this; + var t, r, n, o, a, u, l, s = this; return h.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ case 0: @@ -716,13 +716,13 @@ e.next = 6; break; } - this.data = v.default.create(n.from(this.src.split(",")[1], "base64"), t), e.next = 17; + this.data = v.default.create(i.from(this.src.split(",")[1], "base64"), t), e.next = 17; break; case 6: - return i = (r = this.options).headers, o = r.body, u = void 0 === (a = r.method) ? "GET" : a, e.next = 10, D(this.src, { + return n = (r = this.options).headers, o = r.body, u = void 0 === (a = r.method) ? "GET" : a, e.next = 10, D(this.src, { method: u, body: o, - headers: i + headers: n }); case 10: l = e.sent, this.data = v.default.create(l, t), e.next = 17; @@ -856,25 +856,25 @@ }, 7515: function(e, t, r) { "use strict"; - var n = r(1876).Buffer; + var n, i, o, a, u = r(1876).Buffer; Object.defineProperty(t, "__esModule", { value: !0 }); - var i = r(8926), o = r(7757), a = r(4098), u = r(1852); - function l(e) { + var l = r(8926), s = r(7757), c = r(4098), f = r(1852); + function d(e) { return e && "object" == typeof e && "default" in e ? e : { default: e }; } - var s = l(i), c = l(o), f = l(a), d = l(u); - d.default.isValid = function(e) { + var p = d(l), h = d(s), y = d(c), g = d(f); + g.default.isValid = function(e) { try { - return new d.default(e), !0; + return new g.default(e), !0; } catch (t) { return !1; } }; - var p = [ + var v = [ 0xffc0, 0xffc1, 0xffc2, @@ -890,83 +890,83 @@ 0xffcd, 0xffce, 0xffcf - ], h = function(e) { + ], b = function(e) { if (this.data = null, this.width = null, this.height = null, this.data = e, 0xffd8 !== e.readUInt16BE(0)) throw Error("SOI not found in JPEG"); - for(var t, r = 2; r < e.length && (t = e.readUInt16BE(r), r += 2, !p.includes(t));)r += e.readUInt16BE(r); - if (!p.includes(t)) throw Error("Invalid JPEG."); + for(var t, r = 2; r < e.length && (t = e.readUInt16BE(r), r += 2, !v.includes(t));)r += e.readUInt16BE(r); + if (!v.includes(t)) throw Error("Invalid JPEG."); r += 3, this.height = e.readUInt16BE(r), r += 2, this.width = e.readUInt16BE(r); }; - h.isValid = function(e) { - if (!e || !n.isBuffer(e) || 0xffd8 !== e.readUInt16BE(0)) return !1; - for(var t, r = 2; r < e.length && (t = e.readUInt16BE(r), r += 2, !p.includes(t));)r += e.readUInt16BE(r); - return !!p.includes(t); + b.isValid = function(e) { + if (!e || !u.isBuffer(e) || 0xffd8 !== e.readUInt16BE(0)) return !1; + for(var t, r = 2; r < e.length && (t = e.readUInt16BE(r), r += 2, !v.includes(t));)r += e.readUInt16BE(r); + return !!v.includes(t); }; - var y, g, v, b = (y = {}, g = [], { + var m = (n = {}, i = [], { get: function(e) { - return y[e]; + return n[e]; }, set: function(e, t) { - g.push(e), g.length > 30 && delete y[g.shift()], y[e] = t; + i.push(e), i.length > 30 && delete n[i.shift()], n[e] = t; }, reset: function() { - y = {}, g = []; + n = {}, i = []; }, length: function() { - return g.length; + return i.length; } - }), m = (v = s.default(c.default.mark(function e(t, r) { - var i, o; - return c.default.wrap(function(e) { + }), D = (o = p.default(h.default.mark(function e(t, r) { + var n, i; + return h.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ case 0: - return e.next = 2, f.default(t, r); + return e.next = 2, y.default(t, r); case 2: - return i = e.sent, e.next = 5, i.buffer ? i.buffer() : i.arrayBuffer(); + return n = e.sent, e.next = 5, n.buffer ? n.buffer() : n.arrayBuffer(); case 5: - return o = e.sent, e.abrupt("return", "Buffer" === o.constructor.name ? o : n.from(o)); + return i = e.sent, e.abrupt("return", "Buffer" === i.constructor.name ? i : u.from(i)); case 7: case "end": return e.stop(); } }, e); })), function(e, t) { - return v.apply(this, arguments); - }), D = function(e) { + return o.apply(this, arguments); + }), w = function(e) { var t = e.toLowerCase(); return "jpg" === t || "jpeg" === t || "png" === t; - }, w = function(e) { - var t; - return h.isValid(e) ? t = "jpg" : d.default.isValid(e) && (t = "png"), t; }, E = function(e) { + var t; + return b.isValid(e) ? t = "jpg" : g.default.isValid(e) && (t = "png"), t; + }, _ = function(e) { var t = e.uri; return /^data:image\/[a-zA-Z]*;base64,[^"]*/g.test(t); }; - function _(e, t) { + function x(e, t) { switch(t.toLowerCase()){ case "jpg": case "jpeg": - return new h(e); + return new b(e); case "png": - return new d.default(e); + return new g.default(e); default: return null; } } - var x, S = function(e) { - var t = e.uri, r = /^data:image\/([a-zA-Z]*);base64,([^"]*)/g.exec(t), i = r[1], o = r[2]; - if (!D(i)) throw Error("Base64 image invalid format: " + i); + var S = function(e) { + var t = e.uri, r = /^data:image\/([a-zA-Z]*);base64,([^"]*)/g.exec(t), n = r[1], i = r[2]; + if (!w(n)) throw Error("Base64 image invalid format: " + n); return new Promise(function(e) { - return e(_(n.from(o, "base64"), i)); + return e(x(u.from(i, "base64"), n)); }); }, A = function(e) { if (e.data && e.format) return new Promise(function(t) { - return t(_(e.data, e.format)); + return t(x(e.data, e.format)); }); throw Error("Invalid data given for local file: " + JSON.stringify(e)); }, k = function(e) { - var t = w(e); + var t = E(e); return t ? new Promise(function(r) { - return r(_(e, t)); + return r(x(e, t)); }) : Promise.resolve(); }, T = function(e) { var t = 137 === e[0] && 80 === e[1] && 78 === e[2] && 71 === e[3] && 13 === e[4] && 10 === e[5] && 26 === e[6] && 10 === e[7], r = 255 === e[0] && 216 === e[1] && 255 === e[2], n = ""; @@ -974,9 +974,9 @@ else if (r) n = "jpg"; else throw Error("Not valid image extension"); return n; - }, O = (x = s.default(c.default.mark(function e(t) { + }, O = (a = p.default(h.default.mark(function e(t) { var r, n, i, o, a, u, l; - return c.default.wrap(function(e) { + return h.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ case 0: r = t.uri, n = t.body, i = t.headers, a = void 0 === (o = t.method) ? "GET" : o, e.next = 7; @@ -985,7 +985,7 @@ e.t0 = e.sent, e.next = 10; break; case 7: - return e.next = 9, m(r, { + return e.next = 9, D(r, { body: n, headers: i, method: a @@ -993,31 +993,31 @@ case 9: e.t0 = e.sent; case 10: - return l = T(u = e.t0), e.abrupt("return", _(u, l)); + return l = T(u = e.t0), e.abrupt("return", x(u, l)); case 13: case "end": return e.stop(); } }, e); })), function(e) { - return x.apply(this, arguments); + return a.apply(this, arguments); }), C = function(e, t) { - var r, i = (void 0 === t ? {} : t).cache, o = void 0 === i || i, a = e.data ? e.data.toString() : e.uri; - if (o && b.get(a)) return b.get(a); - if (!(r = E(e) ? S(e) : n.isBuffer(e) ? k(e) : "object" == typeof e && e.data ? A(e) : O(e))) throw Error("Cannot resolve image"); - return o && b.set(a, r), r; + var r, n = (void 0 === t ? {} : t).cache, i = void 0 === n || n, o = e.data ? e.data.toString() : e.uri; + if (i && m.get(o)) return m.get(o); + if (!(r = _(e) ? S(e) : u.isBuffer(e) ? k(e) : "object" == typeof e && e.data ? A(e) : O(e))) throw Error("Cannot resolve image"); + return i && m.set(o, r), r; }; t.default = C; }, 791: function(e, t, r) { "use strict"; - var n = r(4354), i = r(368), o = r(6335), a = r(4825), u = r(7335), l = r(9186), s = r(9276), c = r(4915), f = r(32), d = r(2779), p = r(3913), h = r(6054), y = r(8926), g = r(7757), v = r(7154), b = r(5648), m = r(7515), D = r(4340), w = r(9745), E = r(7316), _ = r(7106); - function x(e) { + var n, i, o, a = r(4354), u = r(368), l = r(6335), s = r(4825), c = r(7335), f = r(9186), d = r(9276), p = r(4915), h = r(32), y = r(2779), g = r(3913), v = r(6054), b = r(8926), m = r(7757), D = r(7154), w = r(5648), E = r(7515), _ = r(4340), x = r(9745), S = r(7316), A = r(7106); + function k(e) { return e && "object" == typeof e && "default" in e ? e : { default: e }; } - var S, A, k, T = function(e) { + var T = function(e) { if (e && e.__esModule) return e; var t = Object.create(null); return e && Object.keys(e).forEach(function(r) { @@ -1031,22 +1031,22 @@ }); } }), t.default = e, Object.freeze(t); - }(i), O = x(o), C = x(a), P = x(u), F = x(l), R = x(s), I = x(c), j = x(f), B = x(d), M = x(p), N = x(y), L = x(g), U = x(v), z = x(b), W = x(m), G = x(D), q = x(w), V = x(E), H = x(_), Z = function(e, t) { + }(u), O = k(l), C = k(s), P = k(c), F = k(f), R = k(d), I = k(p), j = k(h), B = k(y), M = k(g), N = k(b), L = k(m), U = k(D), z = k(w), W = k(E), G = k(_), q = k(x), V = k(S), H = k(A), Z = function(e, t) { switch(t){ case "uppercase": return e.toUpperCase(); case "lowercase": return e.toLowerCase(); case "capitalize": - return n.capitalize(e); + return a.capitalize(e); case "upperfirst": - return n.upperFirst(e); + return a.upperFirst(e); default: return e; } }, X = function() { function e(e) { - this.name = e, this.src = h.PDFFont.open(null, e); + this.name = e, this.src = v.PDFFont.open(null, e); } var t = e.prototype; return t.encode = function(e) { @@ -1167,7 +1167,7 @@ return Q("Helvetica"); }, ee = function() { return function(e) { - for(var t = e.string, r = e.runs, i = null, o = null, a = 0, u = 0, l = [], s = 0; s < r.length; s += 1){ + for(var t = e.string, r = e.runs, n = null, i = null, o = 0, u = 0, l = [], s = 0; s < r.length; s += 1){ var c = r[s], f = "string" == typeof c.attributes.font ? Q(c.attributes.font) : c.attributes.font; if (0 === t.length) { l.push({ @@ -1181,24 +1181,24 @@ } for(var d = t.slice(c.start, c.end), p = 0; p < d.length; p += 1){ var h, y = d[p], g = (h = y.codePointAt(), !f || !Y.includes(h) && !f.hasGlyphForCodePoint(h) && $().hasGlyphForCodePoint(h)) ? $() : f, v = K(c); - (g !== i || v !== o || g.unitsPerEm !== i.unitsPerEm) && (i && l.push({ - start: a, + (g !== n || v !== i || g.unitsPerEm !== n.unitsPerEm) && (n && l.push({ + start: o, end: u, attributes: { - font: i, - scale: o / i.unitsPerEm + font: n, + scale: i / n.unitsPerEm } - }), i = g, o = v, a = u), u += y.length; + }), n = g, i = v, o = u), u += y.length; } } - if (a < t.length) { - var b = K(n.last(r)); + if (o < t.length) { + var b = K(a.last(r)); l.push({ - start: a, + start: o, end: t.length, attributes: { - font: i, - scale: b / i.unitsPerEm + font: n, + scale: b / n.unitsPerEm } }); } @@ -1350,7 +1350,7 @@ "wordSpacing" ], eg = function(e) { var t = e.props || {}; - return n.pick(ey, t); + return a.pick(ey, t); }, ev = function e(t) { if (!t.children) return t; var r = eg(t), n = t.children.map(function(t) { @@ -1405,13 +1405,13 @@ }; }, e_ = eE(T.Svg), ex = eE(T.Text), eS = eE(T.TextInstance), eA = function(e) { return function(t) { - return n.mapValues(t, function(t, r) { - var i = n.matchPercent(t); - return i && eD.includes(r) ? i.percent * e.height : i && ew.includes(r) ? i.percent * e.width : t; + return a.mapValues(t, function(t, r) { + var n = a.matchPercent(t); + return n && eD.includes(r) ? n.percent * e.height : n && ew.includes(r) ? n.percent * e.width : t; }); }; }, ek = function(e) { - var t = n.matchPercent(e); + var t = a.matchPercent(e); return t ? t.percent : parseFloat(e); }, eT = function(e) { var t = Object.assign({}, e.style || {}, e.props); @@ -1421,17 +1421,17 @@ }, eO = function(e) { var t = function(e) { return "none" === e ? null : e; - }, r = n.mapValues(e.props, t); + }, r = a.mapValues(e.props, t); return Object.assign({}, e, { props: r }); }, eC = function(e) { - var t = e.props || {}, r = Object.assign({}, n.pick(em, t), e.style || {}); + var t = e.props || {}, r = Object.assign({}, a.pick(em, t), e.style || {}); return Object.assign({}, e, { style: r }); }, eP = function(e) { - var t = n.evolve({ + var t = a.evolve({ width: parseFloat, height: parseFloat, viewBox: ep, @@ -1456,7 +1456,7 @@ }); }, eR = function(e, t) { var r = eh(e); - return n.compose(ed, function e(t) { + return a.compose(ed, function e(t) { return function(r) { if (ex(r)) return eo(t, r); if (!r.children) return r; @@ -1468,9 +1468,9 @@ }(t), eP, eC, ev, function e(t) { return function(r) { if (!r.children) return r; - var i = n.compose(e(t), n.compose(function(e) { + var n = a.compose(e(t), a.compose(function(e) { var r = eA(t)(e.props); - return r = n.evolve({ + return r = a.evolve({ x: parseFloat, x1: parseFloat, x2: parseFloat, @@ -1485,18 +1485,18 @@ width: parseFloat, height: parseFloat, offset: ek, - fill: o.transformColor, + fill: l.transformColor, opacity: ek, - stroke: o.transformColor, + stroke: l.transformColor, stopOpacity: ek, - stopColor: o.transformColor, - transform: o.processTransform + stopColor: l.transformColor, + transform: l.processTransform }, r), Object.assign({}, e, { props: r }); - }, eF, eO, eT)), a = r.children.map(i); + }, eF, eO, eT)), i = r.children.map(n); return Object.assign({}, r, { - children: a + children: i }); }; }(r))(e); @@ -1581,7 +1581,7 @@ }, eV = function(e) { var t, r, n; return (null === (t = e.props) || void 0 === t ? void 0 : t.src) || (null === (r = e.props) || void 0 === r ? void 0 : r.source) || (null === (n = e.props) || void 0 === n ? void 0 : n.href); - }, eH = (S = N.default(L.default.mark(function e(t) { + }, eH = (n = N.default(L.default.mark(function e(t) { var r; return L.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ @@ -1608,8 +1608,8 @@ } }, e); })), function(e) { - return S.apply(this, arguments); - }), eZ = (A = N.default(L.default.mark(function e(t) { + return n.apply(this, arguments); + }), eZ = (i = N.default(L.default.mark(function e(t) { var r, n, i; return L.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ @@ -1651,7 +1651,7 @@ ] ]); })), function(e) { - return A.apply(this, arguments); + return i.apply(this, arguments); }), eX = function(e, t) { for(var r = [], n = (null === (o = t.children) || void 0 === o ? void 0 : o.slice(0)) || [], i = e ? e.getEmojiSource() : null; n.length > 0;){ var o, a, u = n.shift(); @@ -1660,7 +1660,7 @@ }); } return r; - }, eJ = (k = N.default(L.default.mark(function e(t, r) { + }, eJ = (o = N.default(L.default.mark(function e(t, r) { var n; return L.default.wrap(function(e) { for(;;)switch(e.prev = e.next){ @@ -1674,7 +1674,7 @@ } }, e); })), function(e, t) { - return k.apply(this, arguments); + return o.apply(this, arguments); }), eY = { color: "blue", textDecoration: "underline" @@ -1708,15 +1708,15 @@ }); }, e0 = function(e) { return function(t) { - var r, i; - return n.isNil(null === (r = t.style) || void 0 === r ? void 0 : r[e]) ? "50%" : null === (i = t.style) || void 0 === i ? void 0 : i[e]; + var r, n; + return a.isNil(null === (r = t.style) || void 0 === r ? void 0 : r[e]) ? "50%" : null === (n = t.style) || void 0 === n ? void 0 : n[e]; }; }, e1 = function(e) { if (!e.box) return {}; - var t = e.box, r = t.left, i = t.top, o = t.width, a = t.height, u = e0("transformOriginX")(e), l = e0("transformOriginY")(e), s = n.matchPercent(u), c = n.matchPercent(l), f = s ? o * s.percent : u, d = c ? a * c.percent : l; + var t = e.box, r = t.left, n = t.top, i = t.width, o = t.height, u = e0("transformOriginX")(e), l = e0("transformOriginY")(e), s = a.matchPercent(u), c = a.matchPercent(l), f = s ? i * s.percent : u, d = c ? o * c.percent : l; return { left: r + f, - top: i + d + top: n + d }; }, e2 = function e(t) { var r = e1(t), n = Object.assign({}, t, { @@ -1985,13 +1985,13 @@ e ]); }, tr = function(e) { - var t, r, n, i, o, a = (null === (t = e.props) || void 0 === t ? void 0 : t.size) || "A4", u = parseFloat((null === (r = e.props) || void 0 === r ? void 0 : r.dpi) || 72), l = typeof a, s = a; - return "string" === l ? s = te(a) : Array.isArray(a) ? s = e9(a) : "number" === l && (s = tt(a)), n = s, i = u / 72, s = { - width: n.width ? n.width * i : n.width, - height: n.height ? n.height * i : n.height + var t, r, n, i, o, a = (null === (i = e.props) || void 0 === i ? void 0 : i.size) || "A4", u = parseFloat((null === (o = e.props) || void 0 === o ? void 0 : o.dpi) || 72), l = typeof a, s = a; + return "string" === l ? s = te(a) : Array.isArray(a) ? s = e9(a) : "number" === l && (s = tt(a)), t = s, r = u / 72, s = { + width: t.width ? t.width * r : t.width, + height: t.height ? t.height * r : t.height }, "landscape" === e6(e) ? { - width: (o = s).height, - height: o.width + width: (n = s).height, + height: n.width } : s; }, tn = function(e) { var t = tr(e), r = G.default(e.style || {}); @@ -2026,17 +2026,17 @@ } return r; }, tl = function(e, t) { - var r = n.get(e, [ + var r = a.get(e, [ "box", "top" - ], 0), i = n.get(e, [ + ], 0), n = a.get(e, [ "props", "widows" - ], 2), o = n.get(e, [ + ], 2), i = a.get(e, [ "props", "orphans" - ], 2), a = e.lines.length, u = ta(e, t - r); - return 0 === u ? 0 : a < o ? a : u < o || a < o + i ? 0 : a === o + i ? o : a - u < i ? a - i : u; + ], 2), o = e.lines.length, u = ta(e, t - r); + return 0 === u ? 0 : o < i ? o : u < i || o < i + n ? 0 : o === i + n ? i : o - u < n ? o - n : u; }, ts = function(e, t) { var r = tl(e, t), n = tu(e, r), i = e.box.height - n, o = Object.assign({}, e, { box: U.default({}, e.box, { @@ -2075,7 +2075,7 @@ return (null === (t = e.box) || void 0 === t ? void 0 : t.top) || 0; }, tf = function(e) { var t; - return !n.isNil(null === (t = e.style) || void 0 === t ? void 0 : t.height); + return !a.isNil(null === (t = e.style) || void 0 === t ? void 0 : t.height); }, td = function(e, t) { if (!e) return [ null, @@ -2118,7 +2118,7 @@ T.Canvas ], th = function(e) { var t; - return !tp.includes(e.type) && (!!n.isNil(null === (t = e.props) || void 0 === t ? void 0 : t.wrap) || e.props.wrap); + return !tp.includes(e.type) && (!!a.isNil(null === (t = e.props) || void 0 === t ? void 0 : t.wrap) || e.props.wrap); }, ty = function(e, t) { var r = e._yogaNode; return r ? r.getComputedPadding(t) : null; @@ -2144,14 +2144,14 @@ }, tw = function e(t) { if (!t) return null; if (tD(t) || "number" == typeof t) return { - type: i.TextInstance, + type: u.TextInstance, value: "" + t }; if (!tD(t.type)) return e(t.type(t.props)); - var r = t.type, o = t.props, a = o.style, u = o.children, l = V.default(o, tm), s = n.castArray(void 0 === u ? [] : u).map(e); + var r = t.type, n = t.props, i = n.style, o = n.children, l = V.default(n, tm), s = a.castArray(void 0 === o ? [] : o).map(e); return { type: r, - style: void 0 === a ? {} : a, + style: void 0 === i ? {} : i, props: l, box: {}, children: s @@ -2333,14 +2333,14 @@ }), r; }, tq = function e(t) { if (t.type === T.Svg || !t.children) return t; - var r = n.pick(tW, t.style || {}), i = n.compose(e, function(e) { + var r = a.pick(tW, t.style || {}), n = a.compose(e, function(e) { var t = tG(r, e.style || {}); return Object.assign({}, e, { style: t }); - }), o = t.children.map(i); + }), i = t.children.map(n); return Object.assign({}, t, { - children: o + children: i }); }, tV = function(e, t) { var r = e._yogaNode; @@ -2388,14 +2388,14 @@ "wrap-reverse": q.default.WRAP_WRAP_REVERSE }, t0 = function(e, t) { return function(r) { - return function(i) { - var o = i._yogaNode; - if (!n.isNil(r) && o) { - var a, u, l, s, c, f, d = !n.isNil(t), p = "set" + n.upperFirst(e), h = p + "Auto", y = p + "Percent", g = n.matchPercent(r); - if (g && !o[y]) throw Error("You can't pass percentage values to " + e + " property"); - g ? d ? null === (a = o[y]) || void 0 === a || a.call(o, t, g.value) : null === (u = o[y]) || void 0 === u || u.call(o, g.value) : "auto" === r ? d ? null === (l = o[h]) || void 0 === l || l.call(o, t) : "flexBasis" === e ? o.setFlexBasis(q.default.UNIT_AUTO) : null === (s = o[h]) || void 0 === s || s.call(o) : d ? null === (c = o[p]) || void 0 === c || c.call(o, t, r) : null === (f = o[p]) || void 0 === f || f.call(o, r); + return function(n) { + var i = n._yogaNode; + if (!a.isNil(r) && i) { + var o, u, l, s, c, f, d = !a.isNil(t), p = "set" + a.upperFirst(e), h = p + "Auto", y = p + "Percent", g = a.matchPercent(r); + if (g && !i[y]) throw Error("You can't pass percentage values to " + e + " property"); + g ? d ? null === (o = i[y]) || void 0 === o || o.call(i, t, g.value) : null === (u = i[y]) || void 0 === u || u.call(i, g.value) : "auto" === r ? d ? null === (l = i[h]) || void 0 === l || l.call(i, t) : "flexBasis" === e ? i.setFlexBasis(q.default.UNIT_AUTO) : null === (s = i[h]) || void 0 === s || s.call(i) : d ? null === (c = i[p]) || void 0 === c || c.call(i, t, r) : null === (f = i[p]) || void 0 === f || f.call(i, r); } - return i; + return n; }; }; }, t1 = t0("flexBasis"), t2 = { @@ -2409,10 +2409,10 @@ }, t3 = function(e) { return function(t) { return function(r) { - var i = r._yogaNode, o = "items" === e ? q.default.ALIGN_STRETCH : q.default.ALIGN_AUTO; - if (i) { - var a = t2[t] || o; - i["setAlign" + n.upperFirst(e)](a); + var n = r._yogaNode, i = "items" === e ? q.default.ALIGN_STRETCH : q.default.ALIGN_AUTO; + if (n) { + var o = t2[t] || i; + n["setAlign" + a.upperFirst(e)](o); } return r; }; @@ -2445,7 +2445,7 @@ return null !== (t = e.image) && void 0 !== t && t.data ? e.image.width / e.image.height : 1; }, rS = function(e) { var t; - return n.isNil(null === (t = e.box) || void 0 === t ? void 0 : t.height); + return a.isNil(null === (t = e.box) || void 0 === t ? void 0 : t.height); }, rA = function(e) { return Math.max.apply(Math, [ -1 / 0 @@ -2486,44 +2486,44 @@ var t = rI(e) ? e.box.height : e.style.height; return rb(t); }, rL = function(e) { - var t, r, i, o, a, u, l, s, c; - n.compose(rN(e), ry(e.style.width), rg(e.style.minWidth), rv(e.style.maxWidth), rm(e.style.minHeight), rD(e.style.maxHeight), t9(e.style.marginTop), re(e.style.marginRight), rt(e.style.marginBottom), rr(e.style.marginLeft), rn(e.style.paddingTop), ri(e.style.paddingRight), ro(e.style.paddingBottom), ra(e.style.paddingLeft), (t = e.style.position, function(e) { + var t, r, n, i, o, u, l, s, c; + a.compose(rN(e), ry(e.style.width), rg(e.style.minWidth), rv(e.style.maxWidth), rm(e.style.minHeight), rD(e.style.maxHeight), t9(e.style.marginTop), re(e.style.marginRight), rt(e.style.marginBottom), rr(e.style.marginLeft), rn(e.style.paddingTop), ri(e.style.paddingRight), ro(e.style.paddingBottom), ra(e.style.paddingLeft), (t = e.style.position, function(e) { var r = e._yogaNode; - return !n.isNil(t) && r && r.setPositionType("absolute" === t ? q.default.POSITION_TYPE_ABSOLUTE : q.default.POSITION_TYPE_RELATIVE), e; + return !a.isNil(t) && r && r.setPositionType("absolute" === t ? q.default.POSITION_TYPE_ABSOLUTE : q.default.POSITION_TYPE_RELATIVE), e; }), rf(e.style.top), rd(e.style.right), rp(e.style.bottom), rh(e.style.left), ru(e.style.borderTopWidth), rl(e.style.borderRightWidth), rs(e.style.borderBottomWidth), rc(e.style.borderLeftWidth), (r = e.style.display, function(e) { var t = e._yogaNode; return t && t.setDisplay("none" === r ? q.default.DISPLAY_NONE : q.default.DISPLAY_FLEX), e; - }), (i = e.style.flexDirection, function(e) { + }), (n = e.style.flexDirection, function(e) { var t = e._yogaNode; if (t) { - var r = t6[i] || q.default.FLEX_DIRECTION_COLUMN; + var r = t6[n] || q.default.FLEX_DIRECTION_COLUMN; t.setFlexDirection(r); } return e; - }), t4(e.style.alignSelf), t8(e.style.alignContent), t5(e.style.alignItems), (o = e.style.justifyContent, function(e) { + }), t4(e.style.alignSelf), t8(e.style.alignContent), t5(e.style.alignItems), (i = e.style.justifyContent, function(e) { var t = e._yogaNode; - if (!n.isNil(o) && t) { - var r = t7[o] || q.default.JUSTIFY_FLEX_START; + if (!a.isNil(i) && t) { + var r = t7[i] || q.default.JUSTIFY_FLEX_START; t.setJustifyContent(r); } return e; - }), (a = e.style.flexWrap, function(e) { + }), (o = e.style.flexWrap, function(e) { var t = e._yogaNode; if (t) { - var r = t$[a] || q.default.WRAP_NO_WRAP; + var r = t$[o] || q.default.WRAP_NO_WRAP; t.setFlexWrap(r); } return e; }), (u = e.style.overflow, function(e) { var t = e._yogaNode; - if (!n.isNil(u) && t) { + if (!a.isNil(u) && t) { var r = tQ[u] || q.default.OVERFLOW_VISIBLE; t.setOverflow(r); } return e; }), (l = e.style.aspectRatio, function(e) { var t = e._yogaNode; - return !n.isNil(l) && t && t.setAspectRatio(l), e; + return !a.isNil(l) && t && t.setAspectRatio(l), e; }), t1(e.style.flexBasis), (s = e.style.flexGrow, function(e) { return t0("flexGrow")(s || 0)(e); }), (c = e.style.flexShrink, function(e) { @@ -2603,16 +2603,16 @@ }, rq = function(e) { return e[rT] && e[rT].freeRecursive(), e; }, rV = function(e, t) { - return n.isNil(e) ? null : n.compose(rG, rq, rW, rz, function e(t, r) { - return function(i) { - var o = q.default.Node.createWithConfig(rO), a = Object.assign({}, i); - if (a[rT] = o, rL(a), !rF(i) && !rR(i) && !rP(i) && i.children) { - var u = n.compose(function(e) { - return o.insertChild(e[rT], o.getChildCount()), e; + return a.isNil(e) ? null : a.compose(rG, rq, rW, rz, function e(t, r) { + return function(n) { + var i = q.default.Node.createWithConfig(rO), o = Object.assign({}, n); + if (o[rT] = i, rL(o), u = n, !rF(u) && !rR(u) && !rP(u) && n.children) { + var u, l = a.compose(function(e) { + return i.insertChild(e[rT], i.getChildCount()), e; }, e(t, r)); - a.children = i.children.map(u); + o.children = n.children.map(l); } - return rU(a, t, r), a; + return rU(o, t, r), o; }; }(e, t))(e); }, rH = function(e, t) { @@ -2634,8 +2634,8 @@ return (null === (t = e.box) || void 0 === t ? void 0 : t.top) || 0; }, rY = function(e) { var t; - return !n.isNil(null === (t = e.props) || void 0 === t ? void 0 : t.render); - }, rK = n.compose(tz, tq, rV), rQ = function(e) { + return !a.isNil(null === (t = e.props) || void 0 === t ? void 0 : t.render); + }, rK = a.compose(tz, tq, rV), rQ = function(e) { console.warn("Node of type " + e.type + " can't wrap between pages and it's bigger than available page height"); }, r$ = function(e, t, r) { for(var n = [], i = [], o = 0; o < r.length; o += 1){ @@ -2723,9 +2723,9 @@ } return t; }, r8 = function(e, t, r) { - var i = tv(e), o = tb(e), a = r5({ + var n = tv(e), i = tb(e), o = r5({ pageNumber: t - }, e, r), u = e.style.height, l = r$(i, o, a.children), s = l[0], c = l[1], f = function(e) { + }, e, r), u = e.style.height, l = r$(n, i, o.children), s = l[0], c = l[1], f = function(e) { return rK(e, r); }, d = U.default({}, e.box, { height: u @@ -2737,7 +2737,7 @@ p, null ]; - var h = n.omit("height", e.box), y = n.omit("bookmark", e.props), g = f(Object.assign({}, e, { + var h = a.omit("height", e.box), y = a.omit("bookmark", e.props), g = f(Object.assign({}, e, { props: y, box: h, children: c @@ -2767,31 +2767,31 @@ ], o = n[1]; null !== o;)i.push((n = r8(o, t + i.length, r))[0]), o = n[1]; return i; }, ne = function(e, t) { - for(var r = [], i = 1, o = 0; o < e.children.length; o += 1){ - var a = r9(e.children[o], i, t); - a = r7(a), i += a.length, r = r.concat(a); + for(var r = [], n = 1, i = 0; i < e.children.length; i += 1){ + var o = r9(e.children[i], n, t); + o = r7(o), n += o.length, r = r.concat(o); } return r = r.map(function() { - for(var e, r = arguments.length, i = Array(r), o = 0; o < r; o++)i[o] = arguments[o]; + for(var e, r = arguments.length, n = Array(r), i = 0; i < r; i++)n[i] = arguments[i]; return e = r6.apply(void 0, [ t - ].concat(i)), n.omit([ + ].concat(n)), a.omit([ "subPageNumber", "subPageTotalPages" ], e); }), rX(r, e); }, nt = function(e) { return function(t) { - var r = n.matchPercent(t); + var r = a.matchPercent(t); return r ? r.percent * e.width : t; }; }, nr = function(e) { return function(t) { - var r = n.matchPercent(t); + var r = a.matchPercent(t); return r ? r.percent * e.height : t; }; }, nn = function(e) { - var t = e.style, r = n.evolve({ + var t = e.style, r = a.evolve({ paddingTop: nr(t), paddingLeft: nt(t), paddingRight: nt(t), @@ -2809,34 +2809,34 @@ }, no = function(e) { return function(t) { if (t) { - var r = n.matchPercent(t); + var r = a.matchPercent(t); return r ? r.percent * Math.min(e.width, e.height) : t; } }; }, na = function e(t) { - var r = n.evolve({ + var r = a.evolve({ borderTopLeftRadius: no(t.box), borderTopRightRadius: no(t.box), borderBottomRightRadius: no(t.box), borderBottomLeftRadius: no(t.box) - }, t.style || {}), i = Object.assign({}, t, { + }, t.style || {}), n = Object.assign({}, t, { style: r }); - if (!t.children) return i; - var o = t.children.map(e); - return Object.assign({}, i, { - children: o + if (!t.children) return n; + var i = t.children.map(e); + return Object.assign({}, n, { + children: i }); }, nu = function(e, t) { - var r = n.matchPercent(t); + var r = a.matchPercent(t); return r ? r.percent * e : t; }, nl = function(e) { var t, r; return e.style.height - ((null === (t = e.style) || void 0 === t ? void 0 : t.paddingTop) || 0) - ((null === (r = e.style) || void 0 === r ? void 0 : r.paddingBottom) || 0); }, ns = function(e, t) { - if (n.isNil(null === (r = e.style) || void 0 === r ? void 0 : r.height) || n.isNil(null === (i = t.style) || void 0 === i ? void 0 : i.height)) return t; - var r, i, o = nl(e), a = nu(o, t.style.height), u = Object.assign({}, t.style, { - height: a + if (a.isNil(null === (r = e.style) || void 0 === r ? void 0 : r.height) || a.isNil(null === (n = t.style) || void 0 === n ? void 0 : n.height)) return t; + var r, n, i = nl(e), o = nu(i, t.style.height), u = Object.assign({}, t.style, { + height: o }); return Object.assign({}, t, { style: u @@ -2886,11 +2886,11 @@ }) : nb(e) ? nm(e) : e : e; }, nw = function e(t) { if (!t.children) return t; - var r = n.compose(nD, e), i = t.children.map(r); + var r = a.compose(nD, e), n = t.children.map(r); return Object.assign({}, t, { - children: i + children: n }); - }, nE = n.asyncCompose(eM, e3, ne, tz, na, rH, eI, eJ, tq, nf, ni, e$, nw, e5, ti); + }, nE = a.asyncCompose(eM, e3, ne, tz, na, rH, eI, eJ, tq, nf, ni, e$, nw, e5, ti); t.Z = nE; }, 5648: function(e) { @@ -4179,31 +4179,31 @@ } }); }, tU = new b.Z(), tz = {}, tW = function(e) { - var t, r = function() { + var t, r, n, i, o = function() { for(var e, t = (null === (e = tz.change) || void 0 === e ? void 0 : e.slice()) || [], r = 0; r < t.length; r += 1)t[r](); - }, n = { + }, u = { type: "ROOT", document: null - }, i = (a = a || tL({ - onChange: r - })).createContainer(n), o = function(e) { - a.updateContainer(e, i, null); + }, l = (a = a || tL({ + onChange: o + })).createContainer(u), s = function(e) { + a.updateContainer(e, l, null); }; - e && o(e); - var u, l, s, c = (t = p(y().mark(function e(t) { - var r, i, o, a, u; + e && s(e); + var c = (t = p(y().mark(function e(t) { + var r, n, i, o, a; return y().wrap(function(e) { for(;;)switch(e.prev = e.next){ case 0: - return void 0 === t && (t = !0), i = (r = n.document.props || {}).pdfVersion, o = r.language, a = new tO.default({ + return void 0 === t && (t = !0), n = (r = u.document.props || {}).pdfVersion, i = r.language, o = new tO.default({ compress: t, - pdfVersion: i, - lang: o, + pdfVersion: n, + lang: i, displayTitle: !0, autoFirstPage: !1 - }), e.next = 6, (0, tC.Z)(n.document, tU); + }), e.next = 6, (0, tC.Z)(u.document, tU); case 6: - return u = e.sent, e.abrupt("return", tT(a, u)); + return a = e.sent, e.abrupt("return", tT(o, a)); case 8: case "end": return e.stop(); @@ -4212,8 +4212,8 @@ })), function(e) { return t.apply(this, arguments); }), f = function(e) { - void 0 === e && (e = {}), n.document.props.onRender && n.document.props.onRender(e); - }, d = (u = p(y().mark(function e() { + void 0 === e && (e = {}), u.document.props.onRender && u.document.props.onRender(e); + }, d = (r = p(y().mark(function e() { var t; return y().wrap(function(e) { for(;;)switch(e.prev = e.next){ @@ -4238,8 +4238,8 @@ } }, e); })), function() { - return u.apply(this, arguments); - }), h = (l = p(y().mark(function e() { + return r.apply(this, arguments); + }), h = (n = p(y().mark(function e() { return y().wrap(function(e) { for(;;)switch(e.prev = e.next){ case 0: @@ -4250,8 +4250,8 @@ } }, e); })), function() { - return l.apply(this, arguments); - }), g = (s = p(y().mark(function e() { + return n.apply(this, arguments); + }), g = (i = p(y().mark(function e() { var t, r; return y().wrap(function(e) { for(;;)switch(e.prev = e.next){ @@ -4275,13 +4275,13 @@ } }, e); })), function() { - return s.apply(this, arguments); + return i.apply(this, arguments); }); return { on: function(e, t) { tz[e] || (tz[e] = []), tz[e].push(t); }, - container: n, + container: u, toBlob: d, toBuffer: h, toString: g, @@ -4291,7 +4291,7 @@ r > -1 && tz[e].splice(r, 1); } }, - updateContainer: o + updateContainer: s }; }, tG = function(e) { var t = e.document, r = (0, f.useRef)(null), n = (0, f.useState)({ @@ -6035,14 +6035,14 @@ }, d = function(e, t) { return function(r) { var n, a = (void 0 === (n = e) && (n = {}), function(e, r, a) { - var u, l, d, p = r === a.length - 1, h = (null === (u = e.runs) || void 0 === u ? void 0 : null === (l = u[0]) || void 0 === l ? void 0 : l.attributes) || {}, y = p ? h.alignLastLine : h.align; - return (0, i.compose)(n.textDecoration(t), (d = n, function(e) { - var r = (0, o.default)(e), n = s[y] || 0, i = Math.max(0, e.box.width - r), a = "justify" === y || r > e.box.width, u = e.box.x + i * n, l = Object.assign({}, e.box, { - x: u - }), c = Object.assign({}, e, { - box: l + var u, l, d, p = r === a.length - 1, h = (null === (l = e.runs) || void 0 === l ? void 0 : null === (d = l[0]) || void 0 === d ? void 0 : d.attributes) || {}, y = p ? h.alignLastLine : h.align; + return (0, i.compose)(n.textDecoration(t), (u = n, function(e) { + var r = (0, o.default)(e), n = s[y] || 0, i = Math.max(0, e.box.width - r), a = "justify" === y || r > e.box.width, l = e.box.x + i * n, c = Object.assign({}, e.box, { + x: l + }), f = Object.assign({}, e, { + box: c }); - return a ? d.justification(t)(c) : c; + return a ? u.justification(t)(f) : f; }), f, c)(e); }); return r.map(function(e) { @@ -14833,7 +14833,7 @@ Object.defineProperty(t, "__esModule", { value: !0 }), t.default = function(e) { - var t, r, n = e.src, u = e.sizes, l = e.unoptimized, h = void 0 !== l && l, D = e.priority, S = void 0 !== D && D, k = e.loading, T = e.lazyRoot, O = e.lazyBoundary, C = e.className, P = e.quality, F = e.width, R = e.height, I = e.style, j = e.objectFit, B = e.objectPosition, M = e.onLoadingComplete, N = e.placeholder, L = void 0 === N ? "empty" : N, U = e.blurDataURL, z = g(e, [ + var t, r, n, u = e.src, l = e.sizes, h = e.unoptimized, D = void 0 !== h && h, S = e.priority, k = void 0 !== S && S, T = e.loading, O = e.lazyRoot, C = e.lazyBoundary, P = e.className, F = e.quality, R = e.width, I = e.height, j = e.style, B = e.objectFit, M = e.objectPosition, N = e.onLoadingComplete, L = e.placeholder, U = void 0 === L ? "empty" : L, z = e.blurDataURL, W = g(e, [ "src", "sizes", "unoptimized", @@ -14851,8 +14851,8 @@ "onLoadingComplete", "placeholder", "blurDataURL" - ]), W = s.useContext(p.ImageConfigContext), G = s.useMemo(function() { - var e = v || W || f.imageConfigDefault, t = a(e.deviceSizes).concat(a(e.imageSizes)).sort(function(e, t) { + ]), G = s.useContext(p.ImageConfigContext), q = s.useMemo(function() { + var e = v || G || f.imageConfigDefault, t = a(e.deviceSizes).concat(a(e.imageSizes)).sort(function(e, t) { return e - t; }), r = e.deviceSizes.sort(function(e, t) { return e - t; @@ -14862,35 +14862,35 @@ deviceSizes: r }); }, [ - W - ]), q = u ? "responsive" : "intrinsic"; - "layout" in z && (z.layout && (q = z.layout), delete z.layout); - var V = x; - if ("loader" in z) { - if (z.loader) { - var H = z.loader; - V = function(e) { + G + ]), V = l ? "responsive" : "intrinsic"; + "layout" in W && (W.layout && (V = W.layout), delete W.layout); + var H = x; + if ("loader" in W) { + if (W.loader) { + var Z = W.loader; + H = function(e) { e.config; var t = g(e, [ "config" ]); - return H(t); + return Z(t); }; } - delete z.loader; + delete W.loader; } - var Z, X = ""; - if ("object" == typeof (Z = n) && (w(Z) || void 0 !== Z.src)) { - var J = w(n) ? n.default : n; + var X = ""; + if ("object" == typeof (t = u) && (w(t) || void 0 !== t.src)) { + var J = w(u) ? u.default : u; if (!J.src) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ".concat(JSON.stringify(J))); - if (U = U || J.blurDataURL, X = J.src, (!q || "fill" !== q) && (R = R || J.height, F = F || J.width, !J.height || !J.width)) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ".concat(JSON.stringify(J))); + if (z = z || J.blurDataURL, X = J.src, (!V || "fill" !== V) && (I = I || J.height, R = R || J.width, !J.height || !J.width)) throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ".concat(JSON.stringify(J))); } - n = "string" == typeof n ? n : X; - var Y = _(F), K = _(R), Q = _(P), $ = !S && ("lazy" === k || void 0 === k); - (n.startsWith("data:") || n.startsWith("blob:")) && (h = !0, $ = !1), b.has(n) && ($ = !1); + u = "string" == typeof u ? u : X; + var Y = _(R), K = _(I), Q = _(F), $ = !k && ("lazy" === T || void 0 === T); + (u.startsWith("data:") || u.startsWith("blob:")) && (D = !0, $ = !1), b.has(u) && ($ = !1); var ee = o(s.useState(!1), 2), et = ee[0], er = ee[1], en = o(d.useIntersection({ - rootRef: void 0 === T ? null : T, - rootMargin: void 0 === O ? "200px" : O, + rootRef: void 0 === O ? null : O, + rootMargin: void 0 === C ? "200px" : C, disabled: !$ }), 3), ei = en[0], eo = en[1], ea = en[2], eu = !$ || eo, el = { boxSizing: "border-box", @@ -14913,7 +14913,7 @@ border: 0, margin: 0, padding: 0 - }, ec = !1, ef = Object.assign({}, I, "raw" === q ? {} : { + }, ec = !1, ef = Object.assign({}, j, "raw" === V ? {} : { position: "absolute", top: 0, left: 0, @@ -14930,18 +14930,18 @@ maxWidth: "100%", minHeight: "100%", maxHeight: "100%", - objectFit: j, - objectPosition: B - }), ed = "blur" !== L || et ? {} : { + objectFit: B, + objectPosition: M + }), ed = "blur" !== U || et ? {} : { filter: "blur(20px)", - backgroundSize: j || "cover", - backgroundImage: 'url("'.concat(U, '")'), - backgroundPosition: B || "0% 0%" + backgroundSize: B || "cover", + backgroundImage: 'url("'.concat(z, '")'), + backgroundPosition: M || "0% 0%" }; - if ("fill" === q) el.display = "block", el.position = "absolute", el.top = 0, el.left = 0, el.bottom = 0, el.right = 0; + if ("fill" === V) el.display = "block", el.position = "absolute", el.top = 0, el.left = 0, el.bottom = 0, el.right = 0; else if (void 0 !== Y && void 0 !== K) { var ep = K / Y, eh = isNaN(ep) ? "100%" : "".concat(100 * ep, "%"); - "responsive" === q ? (el.display = "block", el.position = "relative", ec = !0, es.paddingTop = eh) : "intrinsic" === q ? (el.display = "inline-block", el.position = "relative", el.maxWidth = "100%", ec = !0, es.maxWidth = "100%", t = "data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27".concat(Y, "%27%20height=%27").concat(K, "%27/%3e")) : "fixed" === q && (el.display = "inline-block", el.position = "relative", el.width = Y, el.height = K); + "responsive" === V ? (el.display = "block", el.position = "relative", ec = !0, es.paddingTop = eh) : "intrinsic" === V ? (el.display = "inline-block", el.position = "relative", el.maxWidth = "100%", ec = !0, es.maxWidth = "100%", r = "data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27".concat(Y, "%27%20height=%27").concat(K, "%27/%3e")) : "fixed" === V && (el.display = "inline-block", el.position = "relative", el.width = Y, el.height = K); } var ey = { src: m, @@ -14949,27 +14949,27 @@ sizes: void 0 }; eu && (ey = E({ - config: G, - src: n, - unoptimized: h, - layout: q, + config: q, + src: u, + unoptimized: D, + layout: V, width: Y, quality: Q, - sizes: u, - loader: V + sizes: l, + loader: H })); - var eg = n, ev = "imagesizes"; + var eg = u, ev = "imagesizes"; ev = "imageSizes"; - var eb = (i(r = {}, "imageSrcSet", ey.srcSet), i(r, ev, ey.sizes), r), em = s.default.useLayoutEffect, eD = s.useRef(M), ew = s.useRef(n); + var eb = (i(n = {}, "imageSrcSet", ey.srcSet), i(n, ev, ey.sizes), n), em = s.default.useLayoutEffect, eD = s.useRef(N), ew = s.useRef(u); s.useEffect(function() { - eD.current = M; + eD.current = N; }, [ - M + N ]), em(function() { - ew.current !== n && (ea(), ew.current = n); + ew.current !== u && (ea(), ew.current = u); }, [ ea, - n + u ]); var eE = y({ isLazy: $, @@ -14977,26 +14977,26 @@ heightInt: K, widthInt: Y, qualityInt: Q, - layout: q, - className: C, + layout: V, + className: P, imgStyle: ef, blurStyle: ed, - loading: k, - config: G, - unoptimized: h, - placeholder: L, - loader: V, + loading: T, + config: q, + unoptimized: D, + placeholder: U, + loader: H, srcString: eg, onLoadingCompleteRef: eD, setBlurComplete: er, setIntersection: ei, isVisible: eu - }, z); - return s.default.createElement(s.default.Fragment, null, "raw" === q ? s.default.createElement(A, Object.assign({}, eE)) : s.default.createElement("span", { + }, W); + return s.default.createElement(s.default.Fragment, null, "raw" === V ? s.default.createElement(A, Object.assign({}, eE)) : s.default.createElement("span", { style: el }, ec ? s.default.createElement("span", { style: es - }, t ? s.default.createElement("img", { + }, r ? s.default.createElement("img", { style: { display: "block", maxWidth: "100%", @@ -15010,8 +15010,8 @@ }, alt: "", "aria-hidden": !0, - src: t - }) : null) : null, s.default.createElement(A, Object.assign({}, eE))), S ? s.default.createElement(c.default, null, s.default.createElement("link", Object.assign({ + src: r + }) : null) : null, s.default.createElement(A, Object.assign({}, eE))), k ? s.default.createElement(c.default, null, s.default.createElement("link", Object.assign({ key: "__nimg-" + ey.src + ey.srcSet + ey.sizes, rel: "preload", as: "image", @@ -17587,10 +17587,10 @@ } function f(e, r, n) { if (e.customInspect && r && x(r.inspect) && r.inspect !== t.inspect && !(r.constructor && r.constructor.prototype === r)) { - var i, o, a, u, l = r.inspect(n, e); - return b(l) || (l = f(e, l, n)), l; + var i, o, a, u, l, s, c = r.inspect(n, e); + return b(c) || (c = f(e, c, n)), c; } - var s = function(e, t) { + var w = function(e, t) { if (m(t)) return e.stylize("undefined", "undefined"); if (b(t)) { var r = "'" + JSON.stringify(t).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; @@ -17598,10 +17598,10 @@ } return v(t) ? e.stylize("" + t, "number") : y(t) ? e.stylize("" + t, "boolean") : g(t) ? e.stylize("null", "null") : void 0; }(e, r); - if (s) return s; - var c, w, S = Object.keys(r), A = (c = S, w = {}, c.forEach(function(e, t) { - w[e] = !0; - }), w); + if (w) return w; + var S = Object.keys(r), A = (u = S, l = {}, u.forEach(function(e, t) { + l[e] = !0; + }), l); if (e.showHidden && (S = Object.getOwnPropertyNames(r)), _(r) && (S.indexOf("message") >= 0 || S.indexOf("description") >= 0)) return d(r); if (0 === S.length) { if (x(r)) { @@ -17619,16 +17619,16 @@ return (h(r) && (C = !0, P = [ "[", "]" - ]), x(r) && (O = " [Function" + (r.name ? ": " + r.name : "") + "]"), D(r) && (O = " " + RegExp.prototype.toString.call(r)), E(r) && (O = " " + Date.prototype.toUTCString.call(r)), _(r) && (O = " " + d(r)), 0 !== S.length || C && 0 != r.length) ? n < 0 ? D(r) ? e.stylize(RegExp.prototype.toString.call(r), "regexp") : e.stylize("[Object]", "special") : (e.seen.push(r), u = C ? function(e, t, r, n, i) { + ]), x(r) && (O = " [Function" + (r.name ? ": " + r.name : "") + "]"), D(r) && (O = " " + RegExp.prototype.toString.call(r)), E(r) && (O = " " + Date.prototype.toUTCString.call(r)), _(r) && (O = " " + d(r)), 0 !== S.length || C && 0 != r.length) ? n < 0 ? D(r) ? e.stylize(RegExp.prototype.toString.call(r), "regexp") : e.stylize("[Object]", "special") : (e.seen.push(r), s = C ? function(e, t, r, n, i) { for(var o = [], a = 0, u = t.length; a < u; ++a)T(t, String(a)) ? o.push(p(e, t, r, n, String(a), !0)) : o.push(""); return i.forEach(function(i) { i.match(/^\d+$/) || o.push(p(e, t, r, n, i, !0)); }), o; }(e, r, n, A, S) : S.map(function(t) { return p(e, r, n, A, t, C); - }), e.seen.pop(), i = O, o = P, a = 0, u.reduce(function(e, t) { + }), e.seen.pop(), i = O, o = P, a = 0, s.reduce(function(e, t) { return a++, t.indexOf("\n") >= 0 && a++, e + t.replace(/\u001b\[\d\d?m/g, "").length + 1; - }, 0) > 60 ? o[0] + ("" === i ? "" : i + "\n ") + " " + u.join(",\n ") + " " + o[1] : o[0] + i + " " + u.join(", ") + " " + o[1]) : P[0] + O + P[1]; + }, 0) > 60 ? o[0] + ("" === i ? "" : i + "\n ") + " " + s.join(",\n ") + " " + o[1] : o[0] + i + " " + s.join(", ") + " " + o[1]) : P[0] + O + P[1]; } function d(e) { return "[" + Error.prototype.toString.call(e) + "]"; @@ -21536,11 +21536,11 @@ }, A.prototype.pipe = function() { _(this, new b()); }, A.prototype.write = function(e, t, r) { - var i, o, a, u, l, s, d, p = this._writableState, h = !1, g = !p.objectMode && (d = e, c.isBuffer(d) || d instanceof f); - return g && !c.isBuffer(e) && (i = e, e = c.from(i)), ("function" == typeof t && (r = t, t = null), g ? t = "buffer" : t || (t = p.defaultEncoding), "function" != typeof r && (r = x), p.ending) ? (o = r, a = new w(), _(this, a), n.nextTick(o, a)) : (g || (u = e, l = r, null === u ? s = new D() : "string" == typeof u || p.objectMode || (s = new y("chunk", [ + var i, o, a, u, l, s, d, p = this._writableState, h = !1, g = !p.objectMode && (i = e, c.isBuffer(i) || i instanceof f); + return g && !c.isBuffer(e) && (o = e, e = c.from(o)), ("function" == typeof t && (r = t, t = null), g ? t = "buffer" : t || (t = p.defaultEncoding), "function" != typeof r && (r = x), p.ending) ? (a = r, u = new w(), _(this, u), n.nextTick(a, u)) : (g || (l = e, s = r, null === l ? d = new D() : "string" == typeof l || p.objectMode || (d = new y("chunk", [ "string", "Buffer" - ], u)), !s || (_(this, s), n.nextTick(l, s), 0))) && (p.pendingcb++, h = function(e, t, r, n, i, o) { + ], l)), !d || (_(this, d), n.nextTick(s, d), 0))) && (p.pendingcb++, h = function(e, t, r, n, i, o) { if (!r) { var a, u, l = (a = n, u = i, t.objectMode || !1 === t.decodeStrings || "string" != typeof a || (a = c.from(a, u)), a); n !== l && (r = !0, i = "buffer", n = l); @@ -22024,32 +22024,32 @@ return e.pipe(t); } e.exports = function() { - for(var e, t = arguments.length, i = Array(t), c = 0; c < t; c++)i[c] = arguments[c]; - var f, d = (f = i).length && "function" == typeof f[f.length - 1] ? f.pop() : u; - if (Array.isArray(i[0]) && (i = i[0]), i.length < 2) throw new o("streams"); - var p = i.map(function(t, o) { - var u, s, c, f, h, y, g = o < i.length - 1; - return u = o > 0, c = s = function(t) { - e || (e = t), t && p.forEach(l), g || (p.forEach(l), d(e)); - }, f = !1, s = function() { - f || (f = !0, c.apply(void 0, arguments)); - }, h = !1, t.on("close", function() { + for(var e, t, i = arguments.length, c = Array(i), f = 0; f < i; f++)c[f] = arguments[f]; + var d = (e = c).length && "function" == typeof e[e.length - 1] ? e.pop() : u; + if (Array.isArray(c[0]) && (c = c[0]), c.length < 2) throw new o("streams"); + var p = c.map(function(e, i) { + var o, u, s, f, h, y, g = i < c.length - 1; + return o = i > 0, s = u = function(e) { + t || (t = e), e && p.forEach(l), g || (p.forEach(l), d(t)); + }, f = !1, u = function() { + f || (f = !0, s.apply(void 0, arguments)); + }, h = !1, e.on("close", function() { h = !0; - }), void 0 === n && (n = r(494)), n(t, { + }), void 0 === n && (n = r(494)), n(e, { readable: g, - writable: u + writable: o }, function(e) { - if (e) return s(e); - h = !0, s(); - }), y = !1, function(e) { + if (e) return u(e); + h = !0, u(); + }), y = !1, function(t) { if (!h && !y) { - if (y = !0, t.setHeader && "function" == typeof t.abort) return t.abort(); - if ("function" == typeof t.destroy) return t.destroy(); - s(e || new a("pipe")); + if (y = !0, e.setHeader && "function" == typeof e.abort) return e.abort(); + if ("function" == typeof e.destroy) return e.destroy(); + u(t || new a("pipe")); } }; }); - return i.reduce(s); + return c.reduce(s); }; }, 322: function(e, t, r) { @@ -23371,10 +23371,10 @@ } function f(e, r, n) { if (e.customInspect && r && x(r.inspect) && r.inspect !== t.inspect && !(r.constructor && r.constructor.prototype === r)) { - var i, o, a, u, l = r.inspect(n, e); - return b(l) || (l = f(e, l, n)), l; + var i, o, a, u, l, s, c = r.inspect(n, e); + return b(c) || (c = f(e, c, n)), c; } - var s = function(e, t) { + var w = function(e, t) { if (m(t)) return e.stylize("undefined", "undefined"); if (b(t)) { var r = "'" + JSON.stringify(t).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; @@ -23382,10 +23382,10 @@ } return v(t) ? e.stylize("" + t, "number") : y(t) ? e.stylize("" + t, "boolean") : g(t) ? e.stylize("null", "null") : void 0; }(e, r); - if (s) return s; - var c, w, S = Object.keys(r), A = (c = S, w = {}, c.forEach(function(e, t) { - w[e] = !0; - }), w); + if (w) return w; + var S = Object.keys(r), A = (u = S, l = {}, u.forEach(function(e, t) { + l[e] = !0; + }), l); if (e.showHidden && (S = Object.getOwnPropertyNames(r)), _(r) && (S.indexOf("message") >= 0 || S.indexOf("description") >= 0)) return d(r); if (0 === S.length) { if (x(r)) { @@ -23403,16 +23403,16 @@ return (h(r) && (C = !0, P = [ "[", "]" - ]), x(r) && (O = " [Function" + (r.name ? ": " + r.name : "") + "]"), D(r) && (O = " " + RegExp.prototype.toString.call(r)), E(r) && (O = " " + Date.prototype.toUTCString.call(r)), _(r) && (O = " " + d(r)), 0 !== S.length || C && 0 != r.length) ? n < 0 ? D(r) ? e.stylize(RegExp.prototype.toString.call(r), "regexp") : e.stylize("[Object]", "special") : (e.seen.push(r), u = C ? function(e, t, r, n, i) { + ]), x(r) && (O = " [Function" + (r.name ? ": " + r.name : "") + "]"), D(r) && (O = " " + RegExp.prototype.toString.call(r)), E(r) && (O = " " + Date.prototype.toUTCString.call(r)), _(r) && (O = " " + d(r)), 0 !== S.length || C && 0 != r.length) ? n < 0 ? D(r) ? e.stylize(RegExp.prototype.toString.call(r), "regexp") : e.stylize("[Object]", "special") : (e.seen.push(r), s = C ? function(e, t, r, n, i) { for(var o = [], a = 0, u = t.length; a < u; ++a)T(t, String(a)) ? o.push(p(e, t, r, n, String(a), !0)) : o.push(""); return i.forEach(function(i) { i.match(/^\d+$/) || o.push(p(e, t, r, n, i, !0)); }), o; }(e, r, n, A, S) : S.map(function(t) { return p(e, r, n, A, t, C); - }), e.seen.pop(), i = O, o = P, a = 0, u.reduce(function(e, t) { + }), e.seen.pop(), i = O, o = P, a = 0, s.reduce(function(e, t) { return a++, t.indexOf("\n") >= 0 && a++, e + t.replace(/\u001b\[\d\d?m/g, "").length + 1; - }, 0) > 60 ? o[0] + ("" === i ? "" : i + "\n ") + " " + u.join(",\n ") + " " + o[1] : o[0] + i + " " + u.join(", ") + " " + o[1]) : P[0] + O + P[1]; + }, 0) > 60 ? o[0] + ("" === i ? "" : i + "\n ") + " " + s.join(",\n ") + " " + o[1] : o[0] + i + " " + s.join(", ") + " " + o[1]) : P[0] + O + P[1]; } function d(e) { return "[" + Error.prototype.toString.call(e) + "]"; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/regression-1/framework-798bab57daac3897/output.js b/crates/swc_ecma_minifier/tests/fixture/next/regression-1/framework-798bab57daac3897/output.js index e4e2f2ef5b0..e5adfbb0908 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/regression-1/framework-798bab57daac3897/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/regression-1/framework-798bab57daac3897/output.js @@ -4755,7 +4755,7 @@ if (null === c) return null; if (a.finishedWork = null, a.finishedLanes = 0, c === a.current) throw Error(p(177)); a.callbackNode = null, a.callbackPriority = 0; - var b1, f = c.lanes | c.childLanes; + var f = c.lanes | c.childLanes; if (function(a, b) { var c = a.pendingLanes & ~b; a.pendingLanes = b, a.suspendedLanes = 0, a.pingedLanes = 0, a.expiredLanes &= b, a.mutableReadLanes &= b, a.entangledLanes &= b, b = a.entanglements; @@ -4764,13 +4764,13 @@ var e = 31 - nc(c), f = 1 << e; b[e] = 0, d[e] = -1, a[e] = -1, c &= ~f; } - }(a, f), a === P && (X = P = null, Y = 0), 0 == (2064 & c.subtreeFlags) && 0 == (2064 & c.flags) || tk || (tk = !0, b1 = function() { + }(a, f), a === P && (X = P = null, Y = 0), 0 == (2064 & c.subtreeFlags) && 0 == (2064 & c.flags) || tk || (tk = !0, a1 = gc, b1 = function() { return Gk(), null; - }, $b(gc, b1)), f = 0 != (15990 & c.flags), 0 != (15990 & c.subtreeFlags) || f) { + }, $b(a1, b1)), f = 0 != (15990 & c.flags), 0 != (15990 & c.subtreeFlags) || f) { f = mk.transition, mk.transition = null; - var g = C; + var a1, b1, a2, b2, g = C; C = 1; - var a1, b2, h = W; + var h = W; W |= 4, lk.current = null, function(a, b) { if (Bf = cd, a = Le(), Me(a)) { if ("selectionStart" in a) var c = { @@ -4876,7 +4876,7 @@ }); for("function" == typeof c.focus && c.focus(), c = 0; c < b.length; c++)(a = b[c]).element.scrollLeft = a.left, a.element.scrollTop = a.top; } - }(Cf), cd = !!Bf, Cf = Bf = null, a.current = c, a1 = c, b2 = a, T = a1, function gk(a, b, c) { + }(Cf), cd = !!Bf, Cf = Bf = null, a.current = c, a2 = c, b2 = a, T = a2, function gk(a, b, c) { for(var d = 0 != (1 & a.mode); null !== T;){ var e = T, f = e.child; if (22 === e.tag && d) { @@ -4892,7 +4892,7 @@ ik(a, b, c); } else 0 != (8772 & e.subtreeFlags) && null !== f ? (f.return = e, T = f) : ik(a, b, c); } - }(a1, b2, e), cc(), W = h, C = g, mk.transition = f; + }(a2, b2, e), cc(), W = h, C = g, mk.transition = f; } else a.current = c; if (tk && (tk = !1, uk = a, vk = e), 0 === (f = a.pendingLanes) && (Oi = null), function(a) { if (kc && "function" == typeof kc.onCommitFiberRoot) try { diff --git a/crates/swc_ecma_minifier/tests/fixture/next/styled-components/1/output.js b/crates/swc_ecma_minifier/tests/fixture/next/styled-components/1/output.js index 0afbb617eae..a4170569522 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/styled-components/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/styled-components/1/output.js @@ -3719,7 +3719,7 @@ return _app; } }); - var styled_system_dist_index_esm_namespaceObject = {}; + var fn, cache, t, styled_system_dist_index_esm_namespaceObject = {}; __webpack_require__.r(styled_system_dist_index_esm_namespaceObject), __webpack_require__.d(styled_system_dist_index_esm_namespaceObject, { alignContent: function() { return alignContent; @@ -3983,7 +3983,7 @@ return zIndex; } }); - var fn, cache, jsx_runtime = __webpack_require__(5893), react_is = __webpack_require__(9864), react = __webpack_require__(7294), shallowequal = __webpack_require__(6774), shallowequal_default = __webpack_require__.n(shallowequal), stylis_browser_esm = function(W) { + var jsx_runtime = __webpack_require__(5893), react_is = __webpack_require__(9864), react = __webpack_require__(7294), shallowequal = __webpack_require__(6774), shallowequal_default = __webpack_require__.n(shallowequal), stylis_browser_esm = function(W) { function M(d, c, e, h, a) { for(var q, g, k, y, C, m = 0, b = 0, v = 0, n = 0, x = 0, K = 0, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, f = "", p = "", F = "", G = ""; l < B;){ if (g = e.charCodeAt(l), l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++), 0 === b + n + v + m) { @@ -4882,11 +4882,11 @@ })); }, s; }(function qe(e, t, n) { - var e1, t1, n1, r, o = N(e), i = !ke(e), a = t.attrs, c = void 0 === a ? w : a, d = t.componentId, h = void 0 === d ? (e1 = t.displayName, t1 = t.parentComponentId, Ye[n1 = "string" != typeof e1 ? "sc" : Te(e1)] = (Ye[n1] || 0) + 1, r = n1 + "-" + xe("5.3.5" + n1 + Ye[n1]), t1 ? t1 + "-" + r : r) : d, p = t.displayName, f = void 0 === p ? ke(e) ? "styled." + e : "Styled(" + _(e) + ")" : p, g = t.displayName && t.componentId ? Te(t.displayName) + "-" + t.componentId : t.componentId || h, S = o && e.attrs ? Array.prototype.concat(e.attrs, c).filter(Boolean) : c, A = t.shouldForwardProp; + var o = N(e), i = !ke(e), a = t.attrs, c = void 0 === a ? w : a, d = t.componentId, h = void 0 === d ? (e1 = t.displayName, t1 = t.parentComponentId, Ye[n1 = "string" != typeof e1 ? "sc" : Te(e1)] = (Ye[n1] || 0) + 1, r = n1 + "-" + xe("5.3.5" + n1 + Ye[n1]), t1 ? t1 + "-" + r : r) : d, p = t.displayName, f = void 0 === p ? (e2 = e, ke(e2) ? "styled." + e2 : "Styled(" + _(e2) + ")") : p, g = t.displayName && t.componentId ? Te(t.displayName) + "-" + t.componentId : t.componentId || h, S = o && e.attrs ? Array.prototype.concat(e.attrs, c).filter(Boolean) : c, A = t.shouldForwardProp; o && e.shouldForwardProp && (A = t.shouldForwardProp ? function(n, r, o) { return e.shouldForwardProp(n, r, o) && t.shouldForwardProp(n, r, o); } : e.shouldForwardProp); - var C, I = new se(n, g, o ? e.componentStyle : void 0), P = I.isStatic && 0 === c.length, O = function(e, t) { + var e1, t1, n1, r, e2, C, I = new se(n, g, o ? e.componentStyle : void 0), P = I.isStatic && 0 === c.length, O = function(e, t) { return function(e, t, n, r) { var e1, r1, o, o1, s, o2 = e.attrs, i = e.componentStyle, a = e.defaultProps, c = e.foldedComponentIds, d = e.shouldForwardProp, h = e.styledComponentId, p = e.target, f = (void 0 === (e1 = Re(t, (0, react.useContext)(Ge), a) || E) && (e1 = E), r1 = v({}, t, { theme: e1 @@ -5075,7 +5075,7 @@ ].forEach(function(e) { He[e] = He(e); }); - var t, $e = function() { + var $e = function() { function e(e, t) { this.rules = e, this.componentId = t, this.isStatic = re(e), Z.registerId(this.componentId + 1); } diff --git a/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js b/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js index fead3f6f1e3..7634f5ebb94 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js @@ -169,7 +169,7 @@ return setValue; } }); - var HijriParser, intl_base_IntlBase, lastPageID, instances = 'ej2_instances', uid = 0; + var HijriParser, dateCorrection, extendStatics, extendStatics1, extendStatics2, extendStatics3, extendStatics4, extendStatics5, HijriParser1, intl_base_IntlBase, lastPageID, instances = 'ej2_instances', uid = 0; function createInstance(classFunction, params) { return params.unshift(void 0), new (Function.prototype.bind.apply(classFunction, params)); } @@ -266,7 +266,7 @@ } return null; } - var HijriParser1, dateCorrection, defaultNumberingSystem = { + var defaultNumberingSystem = { latn: { _digits: '0123456789', _type: 'numeric' @@ -500,7 +500,7 @@ VND: '₫', TWD: 'NT$' }; - HijriParser1 = HijriParser || (HijriParser = {}), dateCorrection = [ + HijriParser = HijriParser1 || (HijriParser1 = {}), dateCorrection = [ 28607, 28636, 28665, @@ -2242,7 +2242,7 @@ 79930, 79960, 79990 - ], HijriParser1.getHijriDate = function(gDate) { + ], HijriParser.getHijriDate = function(gDate) { var day = gDate.getDate(), month = gDate.getMonth(), year = gDate.getFullYear(), tMonth = month + 1, tYear = year; tMonth < 3 && (tYear -= 1, tMonth += 12); var yPrefix = Math.floor(tYear / 100.), julilanOffset = yPrefix - Math.floor(yPrefix / 4.) - 2, julianNumber = Math.floor(365.25 * (tYear + 4716)) + Math.floor(30.6001 * (tMonth + 1)) + day - julilanOffset - 1524; @@ -2258,7 +2258,7 @@ month: hmonth, date: hDate }; - }, HijriParser1.toGregorian = function(year, month, day) { + }, HijriParser.toGregorian = function(year, month, day) { var z = Math.floor(day + dateCorrection[12 * (year - 1) + 1 + (month - 1) - 16260 - 1] - 1 + 2400000 + 0.5), a = Math.floor((z - 1867216.25) / 36524.25), b = (a = z + 1 + a - Math.floor(a / 4)) + 1524, c = Math.floor((b - 122.1) / 365.25), d = Math.floor(365.25 * c), e = Math.floor((b - d) / 30.6001), gMonth = e - (e > 13.5 ? 13 : 1), gYear = c - (gMonth > 2.5 ? 4716 : 4715); return gYear <= 0 && gMonth--, new Date(gYear + '/' + gMonth + '/' + (b - d - Math.floor(30.6001 * e))); }; @@ -2394,7 +2394,7 @@ } return ret; }, DateFormat.getCurrentDateValue = function(value, isIslamic) { - return isIslamic ? HijriParser.getHijriDate(value) : { + return isIslamic ? HijriParser1.getHijriDate(value) : { year: value.getFullYear(), month: value.getMonth() + 1, date: value.getDate() @@ -2584,8 +2584,8 @@ if (util_isNullOrUndefined(parsedDateParts) || !Object.keys(parsedDateParts).length) return null; if (parseOptions.isIslamic) { var dobj = {}, tYear = parsedDateParts.year, tDate = parsedDateParts.day, tMonth = parsedDateParts.month, ystrig = tYear ? tYear + '' : '', is2DigitYear = 2 === ystrig.length; - tYear && tMonth && tDate && !is2DigitYear || (dobj = HijriParser.getHijriDate(new Date())), is2DigitYear && (tYear = parseInt((dobj.year + '').slice(0, 2) + ystrig, 10)); - var dateObject = HijriParser.toGregorian(tYear || dobj.year, tMonth || dobj.month, tDate || dobj.date); + tYear && tMonth && tDate && !is2DigitYear || (dobj = HijriParser1.getHijriDate(new Date())), is2DigitYear && (tYear = parseInt((dobj.year + '').slice(0, 2) + ystrig, 10)); + var dateObject = HijriParser1.toGregorian(tYear || dobj.year, tMonth || dobj.month, tDate || dobj.date); parsedDateParts.year = dateObject.getFullYear(), parsedDateParts.month = dateObject.getMonth() + 1, parsedDateParts.day = dateObject.getDate(); } return _this.getDateObject(parsedDateParts); @@ -4231,7 +4231,7 @@ type: type }), target.propList[propertyType + 'Names'].push(key); } - var extendStatics, __extends = (extendStatics = function(d, b) { + var __extends = (extendStatics = function(d, b) { return (extendStatics = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -4612,7 +4612,7 @@ for(var ret = '', _i = 0; _i < cArr.length; _i++)ret += String.fromCharCode(cArr[_i]); return ret; } - var extendStatics1, extendStatics2, validateLicense = function(key) { + var validateLicense = function(key) { key && (licenseValidator = new LicenseValidator(key)), licenseValidator.validate(); }, component_extends = (extendStatics1 = function(d, b) { return (extendStatics1 = Object.setPrototypeOf || ({ @@ -4768,7 +4768,7 @@ 'undefined' != typeof window && window.addEventListener('popstate', function() { componentCount = 0; }); - var extendStatics3, extendStatics4, draggable_extends = (extendStatics2 = function(d, b) { + var draggable_extends = (extendStatics2 = function(d, b) { return (extendStatics2 = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -5233,7 +5233,7 @@ NotifyPropertyChanges ], Droppable); }(Base); - var extendStatics5, keyboard_extends = (extendStatics4 = function(d, b) { + var keyboard_extends = (extendStatics4 = function(d, b) { return (extendStatics4 = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -7108,7 +7108,7 @@ X: !0, Y: !0 }), target && element && positionX && positionY && (axis.X || axis.Y)) { - var elementRect, tEdge = { + var edge, pos, elementRect, elementRect1, tEdge = { TL: null, TR: null, BL: null, @@ -7121,9 +7121,9 @@ }; if ('none' === window.getComputedStyle(element).display) { var oldVisibility = element.style.visibility; - element.style.visibility = 'hidden', element.style.display = 'block', elementRect = element.getBoundingClientRect(), element.style.removeProperty('display'), element.style.visibility = oldVisibility; - } else elementRect = element.getBoundingClientRect(); - var edge, pos, elementRect1, pos1 = { + element.style.visibility = 'hidden', element.style.display = 'block', elementRect1 = element.getBoundingClientRect(), element.style.removeProperty('display'), element.style.visibility = oldVisibility; + } else elementRect1 = element.getBoundingClientRect(); + var pos1 = { posX: positionX, posY: positionY, offsetX: offsetX, @@ -7133,20 +7133,20 @@ top: 0 } }; - targetContainer = viewPortElement, parentDocument = target.ownerDocument, edge = tEdge, pos = pos1, elementRect1 = elementRect, pos.position = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, pos.posX, pos.posY, fixedParent, elementRect1), edge.TL = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'left', 'top', fixedParent, elementRect1), edge.TR = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'right', 'top', fixedParent, elementRect1), edge.BR = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'left', 'bottom', fixedParent, elementRect1), edge.BL = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'right', 'bottom', fixedParent, elementRect1), setPosition(eEdge, pos1, elementRect), axis.X && function leftFlip(target, edge, tEdge, pos, elementRect, deepCheck) { + targetContainer = viewPortElement, parentDocument = target.ownerDocument, edge = tEdge, pos = pos1, elementRect = elementRect1, pos.position = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, pos.posX, pos.posY, fixedParent, elementRect), edge.TL = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'left', 'top', fixedParent, elementRect), edge.TR = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'right', 'top', fixedParent, elementRect), edge.BR = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'left', 'bottom', fixedParent, elementRect), edge.BL = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, 'right', 'bottom', fixedParent, elementRect), setPosition(eEdge, pos1, elementRect1), axis.X && function leftFlip(target, edge, tEdge, pos, elementRect, deepCheck) { var collideSide = leftCollideCheck(edge.TL.left, edge.TR.left); tEdge.TL.left - getBodyScrollLeft() <= ContainerLeft() && (collideSide.leftSide = !1), tEdge.TR.left > ContainerRight() && (collideSide.rightSide = !1), (collideSide.leftSide && !collideSide.rightSide || !collideSide.leftSide && collideSide.rightSide) && ('right' === pos.posX ? pos.posX = 'left' : pos.posX = 'right', pos.offsetX = pos.offsetX + elementRect.width, pos.offsetX = -1 * pos.offsetX, pos.position = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, pos.posX, pos.posY, !1), setPosition(edge, pos, elementRect), deepCheck && leftFlip(target, edge, tEdge, pos, elementRect, !1)); - }(target, eEdge, tEdge, pos1, elementRect, !0), axis.Y && tEdge.TL.top > -1 && function topFlip(target, edge, tEdge, pos, elementRect, deepCheck) { + }(target, eEdge, tEdge, pos1, elementRect1, !0), axis.Y && tEdge.TL.top > -1 && function topFlip(target, edge, tEdge, pos, elementRect, deepCheck) { var collideSide = topCollideCheck(edge.TL.top, edge.BL.top); tEdge.TL.top - getBodyScrollTop() <= ContainerTop() && (collideSide.topSide = !1), tEdge.BL.top >= ContainerBottom() && target.getBoundingClientRect().bottom < window.innerHeight && (collideSide.bottomSide = !1), (collideSide.topSide && !collideSide.bottomSide || !collideSide.topSide && collideSide.bottomSide) && ('top' === pos.posY ? pos.posY = 'bottom' : pos.posY = 'top', pos.offsetY = pos.offsetY + elementRect.height, pos.offsetY = -1 * pos.offsetY, pos.position = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(target, pos.posX, pos.posY, !1, elementRect), setPosition(edge, pos, elementRect), deepCheck && topFlip(target, edge, tEdge, pos, elementRect, !1)); - }(target, eEdge, tEdge, pos1, elementRect, !0), function(element, pos, elementRect) { + }(target, eEdge, tEdge, pos1, elementRect1, !0), function(element, pos, elementRect) { var left = 0, top1 = 0; if (null != element.offsetParent && ('absolute' === getComputedStyle(element.offsetParent).position || 'relative' === getComputedStyle(element.offsetParent).position)) { var data = (0, _position__WEBPACK_IMPORTED_MODULE_1__.k)(element.offsetParent, 'left', 'top', !1, elementRect); left = data.left, top1 = data.top; } element.style.top = pos.position.top + pos.offsetY - top1 + 'px', element.style.left = pos.position.left + pos.offsetX - left + 'px'; - }(element, pos1, elementRect); + }(element, pos1, elementRect1); } } function setPosition(eStatus, pos, elementRect) { @@ -7706,7 +7706,7 @@ return applyMixins; } }); - var extendStatics, react = __webpack_require__(7294), react_dom = __webpack_require__(3935), ej2_base = __webpack_require__(1807), __extends = (extendStatics = function(d, b) { + var extendStatics, extendStatics1, extendStatics2, react = __webpack_require__(7294), react_dom = __webpack_require__(3935), ej2_base = __webpack_require__(1807), __extends = (extendStatics = function(d, b) { return (extendStatics = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -7984,7 +7984,7 @@ }); }); } - var extendStatics1, extendStatics2, complex_base_extends = (extendStatics1 = function(d, b) { + var complex_base_extends = (extendStatics1 = function(d, b) { return (extendStatics1 = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -8049,7 +8049,7 @@ return RichTextEditorComponent; } }); - var targetElement, selectedHandler, minHeight, maxHeight, minWidth, maxWidth, containerElement, resizeWestWidth, proxy, DialogUtility, extendStatics, extendStatics1, extendStatics2, extendStatics3, extendStatics4, extendStatics5, extendStatics6, extendStatics7, extendStatics8, extendStatics9, extendStatics10, react = __webpack_require__(7294), ej2_base = __webpack_require__(1807), popup = __webpack_require__(9486), constant = __webpack_require__(3386), classes = __webpack_require__(9805), base_enum = __webpack_require__(809), Render = function() { + var extendStatics, extendStatics1, extendStatics2, extendStatics3, extendStatics4, extendStatics5, extendStatics6, extendStatics7, extendStatics8, extendStatics9, extendStatics10, extendStatics11, extendStatics12, extendStatics13, targetElement, selectedHandler, minHeight, maxHeight, minWidth, maxWidth, containerElement, resizeWestWidth, proxy, DialogUtility, react = __webpack_require__(7294), ej2_base = __webpack_require__(1807), popup = __webpack_require__(9486), constant = __webpack_require__(3386), classes = __webpack_require__(9805), base_enum = __webpack_require__(809), Render = function() { function Render(parent, locator) { this.parent = parent, this.locator = locator, this.renderer = this.locator.getService('rendererFactory'), this.addEventListener(); } @@ -9636,7 +9636,7 @@ var borderResizers = targetElement.querySelectorAll('.e-dialog-border-resize'); if (!(0, ej2_base.le)(borderResizers)) for(var i = 0; i < borderResizers.length; i++)(0, ej2_base.og)(borderResizers[i]); } - var extendStatics11, dialog_extends = (extendStatics11 = function(d, b) { + var dialog_extends = (extendStatics11 = function(d, b) { return (extendStatics11 = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -10412,7 +10412,7 @@ return (0, ej2_base.le)(option.text) || (buttonProps.buttonModel.content = option.text), (0, ej2_base.le)(option.icon) || (buttonProps.buttonModel.iconCss = option.icon), (0, ej2_base.le)(option.cssClass) || (buttonProps.buttonModel.cssClass = option.cssClass), (0, ej2_base.le)(option.click) || (buttonProps.click = option.click), buttonProps; } DialogUtility.alert = function(args) { - var alertDialogObj, options, options1, alertButtonModel, dialogElement = (0, ej2_base.az)('div', { + var options, options1, alertButtonModel, alertDialogObj, dialogElement = (0, ej2_base.az)('div', { className: DLG_UTIL_ALERT }); return document.body.appendChild(dialogElement), (alertDialogObj = 'string' == typeof args ? createDialog({ @@ -10448,7 +10448,7 @@ args && args.close && args.close.apply(alertDialogObj), alertDialogObj.destroy(), alertDialogObj.element.classList.contains('e-dlg-modal') ? (alertDialogObj.element.parentElement.remove(), alertDialogObj.target.classList.remove(DLG_UTIL_ROOT)) : alertDialogObj.element.remove(); }, alertDialogObj; }, DialogUtility.confirm = function(args) { - var confirmDialogObj, options, options1, okButtonModel, cancelButtonModel, dialogElement = (0, ej2_base.az)('div', { + var options, options1, okButtonModel, cancelButtonModel, confirmDialogObj, dialogElement = (0, ej2_base.az)('div', { className: DLG_UTIL_CONFIRM }); return document.body.appendChild(dialogElement), (confirmDialogObj = 'string' == typeof args ? createDialog({ @@ -10498,7 +10498,7 @@ }, confirmDialogObj; }; }(DialogUtility || (DialogUtility = {})); - var extendStatics12, extendStatics13, DialogRenderer = function() { + var DialogRenderer = function() { function DialogRenderer(parent) { this.parent = parent, this.addEventListener(); } @@ -15870,7 +15870,7 @@ return PasteCleanup; } }); - var extendStatics, constant = __webpack_require__(3386), popup = __webpack_require__(9486), ej2_base = __webpack_require__(1807), common = __webpack_require__(759), __extends = (extendStatics = function(d, b) { + var extendStatics, extendStatics1, constant = __webpack_require__(3386), popup = __webpack_require__(9486), ej2_base = __webpack_require__(1807), common = __webpack_require__(759), __extends = (extendStatics = function(d, b) { return (extendStatics = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -16333,7 +16333,7 @@ function hideSpinner(container) { showHideSpinner(container, !0), container = null; } - var extendStatics1, uploader_extends = (extendStatics1 = function(d, b) { + var uploader_extends = (extendStatics1 = function(d, b) { return (extendStatics1 = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -18505,7 +18505,7 @@ return toolbar_Toolbar; } }); - var extendStatics, extendStatics1, extendStatics2, extendStatics3, ej2_base = __webpack_require__(1807), constant = __webpack_require__(3386), classes = __webpack_require__(9805), base_enum = __webpack_require__(809), util = __webpack_require__(5932), items = __webpack_require__(3276), popup_popup = __webpack_require__(9486), position = __webpack_require__(6216), button_button = __webpack_require__(78), __extends = (extendStatics = function(d, b) { + var extendStatics, extendStatics1, extendStatics2, extendStatics3, extendStatics4, extendStatics5, extendStatics6, extendStatics7, extendStatics8, ej2_base = __webpack_require__(1807), constant = __webpack_require__(3386), classes = __webpack_require__(9805), base_enum = __webpack_require__(809), util = __webpack_require__(5932), items = __webpack_require__(3276), popup_popup = __webpack_require__(9486), position = __webpack_require__(6216), button_button = __webpack_require__(78), __extends = (extendStatics = function(d, b) { return (extendStatics = Object.setPrototypeOf || ({ __proto__: [] }) instanceof Array && function(d, b) { @@ -19943,7 +19943,7 @@ } return obj; } - var extendStatics4, extendStatics5, extendStatics6, extendStatics7, extendStatics8, common_Item = function(_super) { + var common_Item = function(_super) { function Item() { return null !== _super && _super.apply(this, arguments) || this; } diff --git a/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/config.json b/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/config.json new file mode 100644 index 00000000000..3dbf4551b8e --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/config.json @@ -0,0 +1,5 @@ +{ + "defaults": true, + "toplevel": true, + "ecma": 2015 +} diff --git a/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/input.js b/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/input.js new file mode 100644 index 00000000000..cae14bf0e9c --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/input.js @@ -0,0 +1,5286 @@ +(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[179],{ + +/***/ 932: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = _asyncToGenerator; +function _asyncToGenerator(fn) { + return function() { + var self = this, args = arguments; + return new Promise(function(resolve, reject) { + var gen = fn.apply(self, args); + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + _next(undefined); + }); + }; +} +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + + +/***/ }), + +/***/ 6495: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = _extends; +function _extends() { + return extends_.apply(this, arguments); +} +function extends_() { + extends_ = Object.assign || function(target) { + for(var i = 1; i < arguments.length; i++){ + var source = arguments[i]; + for(var key in source){ + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + return target; + }; + return extends_.apply(this, arguments); +} + + +/***/ }), + +/***/ 2648: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = _interopRequireDefault; +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} + + +/***/ }), + +/***/ 1598: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = _interopRequireWildcard; +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _getRequireWildcardCache(nodeInterop1) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop1); +} + + +/***/ }), + +/***/ 7273: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ + value: true +}); +exports.Z = _objectWithoutPropertiesLoose; +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + for(i = 0; i < sourceKeys.length; i++){ + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + return target; +} + + +/***/ }), + +/***/ 37: +/***/ (function() { + +"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var t=/\((.*)\)/.exec(this.toString());return t?t[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(t,r){return r=this.concat.apply([],this),t>1&&r.some(Array.isArray)?r.flat(t-1):r},Array.prototype.flatMap=function(t,r){return this.map(t,r).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(t){if("function"!=typeof t)return this.then(t,t);var r=this.constructor||Promise;return this.then(function(o){return r.resolve(t()).then(function(){return o})},function(o){return r.resolve(t()).then(function(){throw o})})}),Object.fromEntries||(Object.fromEntries=function(t){return Array.from(t).reduce(function(t,r){return t[r[0]]=r[1],t},{})}); + + +/***/ }), + +/***/ 8684: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addBasePath = addBasePath; +var _addPathPrefix = __webpack_require__(5391); +var _normalizeTrailingSlash = __webpack_require__(2392); +const basePath = false || ""; +function addBasePath(path, required) { + if (false) {} + return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath)); +} +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=add-base-path.js.map + + +/***/ }), + +/***/ 2725: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.addLocale = void 0; +var _normalizeTrailingSlash = __webpack_require__(2392); +const addLocale = function(path) { + for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){ + args[_key - 1] = arguments[_key]; + } + if (false) {} + return path; +}; +exports.addLocale = addLocale; +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=add-locale.js.map + + +/***/ }), + +/***/ 8748: +/***/ (function(module, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.detectDomainLocale = void 0; +const detectDomainLocale = function() { + for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ + args[_key] = arguments[_key]; + } + if (false) {} +}; +exports.detectDomainLocale = detectDomainLocale; +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=detect-domain-locale.js.map + + +/***/ }), + +/***/ 4119: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.hasBasePath = hasBasePath; +var _pathHasPrefix = __webpack_require__(1259); +const basePath = false || ""; +function hasBasePath(path) { + return (0, _pathHasPrefix).pathHasPrefix(path, basePath); +} +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=has-base-path.js.map + + +/***/ }), + +/***/ 6007: +/***/ (function(module, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports["default"] = initHeadManager; +exports.isEqualNode = isEqualNode; +exports.DOMAttributeNames = void 0; +function initHeadManager() { + return { + mountedInstances: new Set(), + updateHead: (head)=>{ + const tags = {}; + head.forEach((h)=>{ + if (// it won't be inlined. In this case revert to the original behavior + h.type === "link" && h.props["data-optimized-fonts"]) { + if (document.querySelector('style[data-href="'.concat(h.props["data-href"], '"]'))) { + return; + } else { + h.props.href = h.props["data-href"]; + h.props["data-href"] = undefined; + } + } + const components = tags[h.type] || []; + components.push(h); + tags[h.type] = components; + }); + const titleComponent = tags.title ? tags.title[0] : null; + let title = ""; + if (titleComponent) { + const { children } = titleComponent.props; + title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; + } + if (title !== document.title) document.title = title; + [ + "meta", + "base", + "link", + "style", + "script" + ].forEach((type)=>{ + updateElements(type, tags[type] || []); + }); + } + }; +} +const DOMAttributeNames = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv", + noModule: "noModule" +}; +exports.DOMAttributeNames = DOMAttributeNames; +function reactElementToDOM(param) { + let { type , props } = param; + const el = document.createElement(type); + for(const p in props){ + if (!props.hasOwnProperty(p)) continue; + if (p === "children" || p === "dangerouslySetInnerHTML") continue; + // we don't render undefined props to the DOM + if (props[p] === undefined) continue; + const attr = DOMAttributeNames[p] || p.toLowerCase(); + if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) { + el[attr] = !!props[p]; + } else { + el.setAttribute(attr, props[p]); + } + } + const { children , dangerouslySetInnerHTML } = props; + if (dangerouslySetInnerHTML) { + el.innerHTML = dangerouslySetInnerHTML.__html || ""; + } else if (children) { + el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; + } + return el; +} +function isEqualNode(oldTag, newTag) { + if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) { + const nonce = newTag.getAttribute("nonce"); + // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not + // be stripped if there is no content security policy response header that includes a nonce. + if (nonce && !oldTag.getAttribute("nonce")) { + const cloneTag = newTag.cloneNode(true); + cloneTag.setAttribute("nonce", ""); + cloneTag.nonce = nonce; + return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag); + } + } + return oldTag.isEqualNode(newTag); +} +function updateElements(type, components) { + const headEl = document.getElementsByTagName("head")[0]; + const headCountEl = headEl.querySelector("meta[name=next-head-count]"); + if (false) {} + const headCount = Number(headCountEl.content); + const oldTags = []; + for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){ + var ref; + if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) { + oldTags.push(j); + } + } + const newTags = components.map(reactElementToDOM).filter((newTag)=>{ + for(let k = 0, len = oldTags.length; k < len; k++){ + const oldTag = oldTags[k]; + if (isEqualNode(oldTag, newTag)) { + oldTags.splice(k, 1); + return false; + } + } + return true; + }); + oldTags.forEach((t)=>{ + var ref; + return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t); + }); + newTags.forEach((t)=>headEl.insertBefore(t, headCountEl)); + headCountEl.content = (headCount - oldTags.length + newTags.length).toString(); +} +if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") { + Object.defineProperty(exports.default, "__esModule", { + value: true + }); + Object.assign(exports.default, exports); + module.exports = exports.default; +} //# sourceMappingURL=head-manager.js.map + + +/***/ }), + +/***/ 7339: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +const _interopRequireWildcard = (__webpack_require__(1598)/* ["default"] */ .Z); +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.initialize = initialize; +exports.hydrate = hydrate; +exports.emitter = exports.router = exports.version = void 0; +var _async_to_generator = (__webpack_require__(932)/* ["default"] */ .Z); +var _extends = (__webpack_require__(6495)/* ["default"] */ .Z); +var _interop_require_default = (__webpack_require__(2648)/* ["default"] */ .Z); +var _interop_require_wildcard = (__webpack_require__(1598)/* ["default"] */ .Z); +__webpack_require__(37); +var _react = _interop_require_default(__webpack_require__(7294)); +var _headManagerContext = __webpack_require__(8404); +var _mitt = _interop_require_default(__webpack_require__(5660)); +var _routerContext = __webpack_require__(3462); +var _isDynamic = __webpack_require__(8689); +var _querystring = __webpack_require__(466); +var _runtimeConfig = __webpack_require__(8027); +var _utils = __webpack_require__(3794); +var _portal = __webpack_require__(2207); +var _headManager = _interop_require_default(__webpack_require__(6007)); +var _pageLoader = _interop_require_default(__webpack_require__(5181)); +var _performanceRelayer = _interop_require_default(__webpack_require__(9302)); +var _routeAnnouncer = __webpack_require__(8982); +var _router = __webpack_require__(387); +var _isError = __webpack_require__(676); +var _imageConfigContext = __webpack_require__(9977); +var _removeBasePath = __webpack_require__(9320); +var _hasBasePath = __webpack_require__(4119); +const ReactDOM = true ? __webpack_require__(745) : 0; +const version = "12.3.2-canary.13"; +exports.version = version; +let router; +exports.router = router; +const emitter = (0, _mitt).default(); +exports.emitter = emitter; +const looseToArray = (input)=>[].slice.call(input); +let initialData; +let defaultLocale = undefined; +let asPath; +let pageLoader; +let appElement; +let headManager; +let initialMatchesMiddleware = false; +let lastAppProps; +let lastRenderReject; +let webpackHMR; +let CachedApp, onPerfEntry; +let CachedComponent; +self.__next_require__ = __webpack_require__; +class Container extends _react.default.Component { + componentDidCatch(componentErr, info) { + this.props.fn(componentErr, info); + } + componentDidMount() { + this.scrollToHash(); + // We need to replace the router state if: + // - the page was (auto) exported and has a query string or search (hash) + // - it was auto exported and is a dynamic route (to provide params) + // - if it is a client-side skeleton (fallback render) + // - if middleware matches the current page (may have rewrite params) + // - if rewrites in next.config.js match (may have rewrite params) + if (router.isSsr && // We don't update for 404 requests as this can modify + // the asPath unexpectedly e.g. adding basePath when + // it wasn't originally present + initialData.page !== "/404" && initialData.page !== "/_error" && (initialData.isFallback || initialData.nextExport && ((0, _isDynamic).isDynamicRoute(router.pathname) || location.search || false || initialMatchesMiddleware) || initialData.props && initialData.props.__N_SSG && (location.search || false || initialMatchesMiddleware))) { + // update query on mount for exported pages + router.replace(router.pathname + "?" + String((0, _querystring).assign((0, _querystring).urlQueryToSearchParams(router.query), new URLSearchParams(location.search))), asPath, { + // @ts-ignore + // WARNING: `_h` is an internal option for handing Next.js + // client-side hydration. Your app should _never_ use this property. + // It may change at any time without notice. + _h: 1, + // Fallback pages must trigger the data fetch, so the transition is + // not shallow. + // Other pages (strictly updating query) happens shallowly, as data + // requirements would already be present. + shallow: !initialData.isFallback && !initialMatchesMiddleware + }).catch((err)=>{ + if (!err.cancelled) throw err; + }); + } + } + componentDidUpdate() { + this.scrollToHash(); + } + scrollToHash() { + let { hash } = location; + hash = hash && hash.substring(1); + if (!hash) return; + const el = document.getElementById(hash); + if (!el) return; + // If we call scrollIntoView() in here without a setTimeout + // it won't scroll properly. + setTimeout(()=>el.scrollIntoView(), 0); + } + render() { + if (true) { + return this.props.children; + } else {} + } +} +function initialize() { + return _initialize.apply(this, arguments); +} +function _initialize() { + _initialize = _async_to_generator(function*() { + let opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + // This makes sure this specific lines are removed in production + if (false) {} + initialData = JSON.parse(document.getElementById("__NEXT_DATA__").textContent); + window.__NEXT_DATA__ = initialData; + defaultLocale = initialData.defaultLocale; + const prefix = initialData.assetPrefix || ""; + // With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time + // So, this is how we do it in the client side at runtime + __webpack_require__.p = "".concat(prefix, "/_next/") //eslint-disable-line + ; + // Initialize next/config with the environment configuration + (0, _runtimeConfig).setConfig({ + serverRuntimeConfig: {}, + publicRuntimeConfig: initialData.runtimeConfig || {} + }); + asPath = (0, _utils).getURL(); + // make sure not to attempt stripping basePath for 404s + if ((0, _hasBasePath).hasBasePath(asPath)) { + asPath = (0, _removeBasePath).removeBasePath(asPath); + } + if (false) {} + if (initialData.scriptLoader) { + const { initScriptLoader } = __webpack_require__(699); + initScriptLoader(initialData.scriptLoader); + } + pageLoader = new _pageLoader.default(initialData.buildId, prefix); + const register = (param)=>{ + let [r, f] = param; + return pageLoader.routeLoader.onEntrypoint(r, f); + }; + if (window.__NEXT_P) { + // Defer page registration for another tick. This will increase the overall + // latency in hydrating the page, but reduce the total blocking time. + window.__NEXT_P.map((p)=>setTimeout(()=>register(p), 0)); + } + window.__NEXT_P = []; + window.__NEXT_P.push = register; + headManager = (0, _headManager).default(); + headManager.getIsSsr = ()=>{ + return router.isSsr; + }; + appElement = document.getElementById("__next"); + return { + assetPrefix: prefix + }; + }); + return _initialize.apply(this, arguments); +} +function renderApp(App, appProps) { + return /*#__PURE__*/ _react.default.createElement(App, Object.assign({}, appProps)); +} +function AppContainer(param) { + let { children } = param; + return /*#__PURE__*/ _react.default.createElement(Container, { + fn: (error)=>// eslint-disable-next-line @typescript-eslint/no-use-before-define + renderError({ + App: CachedApp, + err: error + }).catch((err)=>console.error("Error rendering page: ", err)) + }, /*#__PURE__*/ _react.default.createElement(_routerContext.RouterContext.Provider, { + value: (0, _router).makePublicRouterInstance(router) + }, /*#__PURE__*/ _react.default.createElement(_headManagerContext.HeadManagerContext.Provider, { + value: headManager + }, /*#__PURE__*/ _react.default.createElement(_imageConfigContext.ImageConfigContext.Provider, { + value: {"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","dangerouslyAllowSVG":false,"unoptimized":false} + }, children)))); +} +const wrapApp = (App)=>(wrappedAppProps)=>{ + const appProps = _extends({}, wrappedAppProps, { + Component: CachedComponent, + err: initialData.err, + router + }); + return /*#__PURE__*/ _react.default.createElement(AppContainer, null, renderApp(App, appProps)); + }; +// This method handles all runtime and debug errors. +// 404 and 500 errors are special kind of errors +// and they are still handle via the main render method. +function renderError(renderErrorProps) { + let { App , err } = renderErrorProps; + // In development runtime errors are caught by our overlay + // In production we catch runtime errors using componentDidCatch which will trigger renderError + if (false) {} + // Make sure we log the error to the console, otherwise users can't track down issues. + console.error(err); + console.error("A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred"); + return pageLoader.loadPage("/_error").then((param)=>{ + let { page: ErrorComponent , styleSheets } = param; + return (lastAppProps == null ? void 0 : lastAppProps.Component) === ErrorComponent ? Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(__webpack_require__(9185))).then((errorModule)=>{ + return Promise.resolve().then(()=>/*#__PURE__*/ _interopRequireWildcard(__webpack_require__(6029))).then((appModule)=>{ + App = appModule.default; + renderErrorProps.App = App; + return errorModule; + }); + }).then((m)=>({ + ErrorComponent: m.default, + styleSheets: [] + })) : { + ErrorComponent, + styleSheets + }; + }).then((param)=>{ + let { ErrorComponent , styleSheets } = param; + var ref; + // In production we do a normal render with the `ErrorComponent` as component. + // If we've gotten here upon initial render, we can use the props from the server. + // Otherwise, we need to call `getInitialProps` on `App` before mounting. + const AppTree = wrapApp(App); + const appCtx = { + Component: ErrorComponent, + AppTree, + router, + ctx: { + err, + pathname: initialData.page, + query: initialData.query, + asPath, + AppTree + } + }; + return Promise.resolve(((ref = renderErrorProps.props) == null ? void 0 : ref.err) ? renderErrorProps.props : (0, _utils).loadGetInitialProps(App, appCtx)).then((initProps)=>// eslint-disable-next-line @typescript-eslint/no-use-before-define + doRender(_extends({}, renderErrorProps, { + err, + Component: ErrorComponent, + styleSheets, + props: initProps + }))); + }); +} +// Dummy component that we render as a child of Root so that we can +// toggle the correct styles before the page is rendered. +function Head(param) { + let { callback } = param; + // We use `useLayoutEffect` to guarantee the callback is executed + // as soon as React flushes the update. + _react.default.useLayoutEffect(()=>callback(), [ + callback + ]); + return null; +} +let reactRoot = null; +// On initial render a hydrate should always happen +let shouldHydrate = true; +function clearMarks() { + [ + "beforeRender", + "afterHydrate", + "afterRender", + "routeChange" + ].forEach((mark)=>performance.clearMarks(mark)); +} +function markHydrateComplete() { + if (!_utils.ST) return; + performance.mark("afterHydrate") // mark end of hydration + ; + performance.measure("Next.js-before-hydration", "navigationStart", "beforeRender"); + performance.measure("Next.js-hydration", "beforeRender", "afterHydrate"); + if (onPerfEntry) { + performance.getEntriesByName("Next.js-hydration").forEach(onPerfEntry); + } + clearMarks(); +} +function markRenderComplete() { + if (!_utils.ST) return; + performance.mark("afterRender") // mark end of render + ; + const navStartEntries = performance.getEntriesByName("routeChange", "mark"); + if (!navStartEntries.length) return; + performance.measure("Next.js-route-change-to-render", navStartEntries[0].name, "beforeRender"); + performance.measure("Next.js-render", "beforeRender", "afterRender"); + if (onPerfEntry) { + performance.getEntriesByName("Next.js-render").forEach(onPerfEntry); + performance.getEntriesByName("Next.js-route-change-to-render").forEach(onPerfEntry); + } + clearMarks(); + [ + "Next.js-route-change-to-render", + "Next.js-render" + ].forEach((measure)=>performance.clearMeasures(measure)); +} +function renderReactElement(domEl, fn) { + // mark start of hydrate/render + if (_utils.ST) { + performance.mark("beforeRender"); + } + const reactEl = fn(shouldHydrate ? markHydrateComplete : markRenderComplete); + if (true) { + if (!reactRoot) { + // Unlike with createRoot, you don't need a separate root.render() call here + reactRoot = ReactDOM.hydrateRoot(domEl, reactEl); + // TODO: Remove shouldHydrate variable when React 18 is stable as it can depend on `reactRoot` existing + shouldHydrate = false; + } else { + const startTransition = _react.default.startTransition; + startTransition(()=>{ + reactRoot.render(reactEl); + }); + } + } else {} +} +function Root(param) { + let { callbacks , children } = param; + // We use `useLayoutEffect` to guarantee the callbacks are executed + // as soon as React flushes the update + _react.default.useLayoutEffect(()=>callbacks.forEach((callback)=>callback()), [ + callbacks + ]); + // We should ask to measure the Web Vitals after rendering completes so we + // don't cause any hydration delay: + _react.default.useEffect(()=>{ + (0, _performanceRelayer).default(onPerfEntry); + }, []); + if (false) {} + return children; +} +function doRender(input) { + let { App , Component , props , err } = input; + let styleSheets = "initial" in input ? undefined : input.styleSheets; + Component = Component || lastAppProps.Component; + props = props || lastAppProps.props; + const appProps = _extends({}, props, { + Component, + err, + router + }); + // lastAppProps has to be set before ReactDom.render to account for ReactDom throwing an error. + lastAppProps = appProps; + let canceled = false; + let resolvePromise; + const renderPromise = new Promise((resolve, reject)=>{ + if (lastRenderReject) { + lastRenderReject(); + } + resolvePromise = ()=>{ + lastRenderReject = null; + resolve(); + }; + lastRenderReject = ()=>{ + canceled = true; + lastRenderReject = null; + const error = new Error("Cancel rendering route"); + error.cancelled = true; + reject(error); + }; + }); + // This function has a return type to ensure it doesn't start returning a + // Promise. It should remain synchronous. + function onStart() { + if (!styleSheets || // We use `style-loader` in development, so we don't need to do anything + // unless we're in production: + "production" !== "production") { + return false; + } + const currentStyleTags = looseToArray(document.querySelectorAll("style[data-n-href]")); + const currentHrefs = new Set(currentStyleTags.map((tag)=>tag.getAttribute("data-n-href"))); + const noscript = document.querySelector("noscript[data-n-css]"); + const nonce = noscript == null ? void 0 : noscript.getAttribute("data-n-css"); + styleSheets.forEach((param)=>{ + let { href , text } = param; + if (!currentHrefs.has(href)) { + const styleTag = document.createElement("style"); + styleTag.setAttribute("data-n-href", href); + styleTag.setAttribute("media", "x"); + if (nonce) { + styleTag.setAttribute("nonce", nonce); + } + document.head.appendChild(styleTag); + styleTag.appendChild(document.createTextNode(text)); + } + }); + return true; + } + function onHeadCommit() { + if (// unless we're in production: + true && // We can skip this during hydration. Running it wont cause any harm, but + // we may as well save the CPU cycles: + styleSheets && // Ensure this render was not canceled + !canceled) { + const desiredHrefs = new Set(styleSheets.map((s)=>s.href)); + const currentStyleTags = looseToArray(document.querySelectorAll("style[data-n-href]")); + const currentHrefs = currentStyleTags.map((tag)=>tag.getAttribute("data-n-href")); + // Toggle `