{"version":3,"names":["_core","require","_helperFunctionName","_helperSplitExportDeclaration","_semver","_fields","_decorators","_misc","_features","_typescript","versionKey","createClassFeaturePlugin","name","feature","loose","manipulateOptions","api","inherits","_api","assumption","setPublicClassFields","privateFieldsAsSymbols","privateFieldsAsProperties","constantSuper","noDocumentAll","Error","privateFieldsAsSymbolsOrProperties","explicit","undefined","push","length","console","warn","join","pre","file","enableFeature","get","set","semver","lt","visitor","Class","path","_ref","shouldTransform","pathIsClassDeclaration","isClassDeclaration","assertFieldTransformed","isLoose","constructor","isDecorated","hasDecorators","node","props","elements","computedPaths","privateNames","Set","body","isClassProperty","isClassMethod","computed","isPrivate","key","id","getName","setName","isClassPrivateMethod","kind","has","buildCodeFrameError","add","isProperty","isStaticBlock","innerBinding","ref","nameFunction","scope","generateUidIdentifier","classRefForDefine","t","cloneNode","privateNamesMap","buildPrivateNamesMap","privateNamesNodes","buildPrivateNamesNodes","transformPrivateNamesUsage","keysNodes","staticNodes","instanceNodes","pureStaticNodes","classBindingNode","wrapClass","buildDecoratedClass","extractComputedKeys","buildFieldsInitNodes","superClass","injectInitialization","referenceVisitor","state","prop","static","traverse","wrappedPath","insertBefore","insertAfter","find","parent","isStatement","isDeclaration","ExportDefaultDeclaration","decl","splitExportDeclaration","type"],"sources":["../src/index.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport type { PluginAPI, PluginObject } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\n\nimport semver from \"semver\";\n\nimport {\n buildPrivateNamesNodes,\n buildPrivateNamesMap,\n transformPrivateNamesUsage,\n buildFieldsInitNodes,\n buildCheckInRHS,\n} from \"./fields.ts\";\nimport type { PropPath } from \"./fields.ts\";\nimport { buildDecoratedClass, hasDecorators } from \"./decorators.ts\";\nimport { injectInitialization, extractComputedKeys } from \"./misc.ts\";\nimport {\n enableFeature,\n FEATURES,\n isLoose,\n shouldTransform,\n} from \"./features.ts\";\nimport { assertFieldTransformed } from \"./typescript.ts\";\n\nexport { FEATURES, enableFeature, injectInitialization, buildCheckInRHS };\n\nconst versionKey = \"@babel/plugin-class-features/version\";\n\ninterface Options {\n name: string;\n feature: number;\n loose?: boolean;\n inherits?: PluginObject[\"inherits\"];\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n api?: PluginAPI;\n}\n\nexport function createClassFeaturePlugin({\n name,\n feature,\n loose,\n manipulateOptions,\n api,\n inherits,\n}: Options): PluginObject {\n if (!process.env.BABEL_8_BREAKING) {\n api ??= { assumption: () => void 0 as any } as any;\n }\n const setPublicClassFields = api.assumption(\"setPublicClassFields\");\n const privateFieldsAsSymbols = api.assumption(\"privateFieldsAsSymbols\");\n const privateFieldsAsProperties = api.assumption(\"privateFieldsAsProperties\");\n const constantSuper = api.assumption(\"constantSuper\");\n const noDocumentAll = api.assumption(\"noDocumentAll\");\n\n if (privateFieldsAsProperties && privateFieldsAsSymbols) {\n throw new Error(\n `Cannot enable both the \"privateFieldsAsProperties\" and ` +\n `\"privateFieldsAsSymbols\" assumptions as the same time.`,\n );\n }\n const privateFieldsAsSymbolsOrProperties =\n privateFieldsAsProperties || privateFieldsAsSymbols;\n\n if (loose === true) {\n type AssumptionName = Parameters[0];\n const explicit: `\"${AssumptionName}\"`[] = [];\n\n if (setPublicClassFields !== undefined) {\n explicit.push(`\"setPublicClassFields\"`);\n }\n if (privateFieldsAsProperties !== undefined) {\n explicit.push(`\"privateFieldsAsProperties\"`);\n }\n if (privateFieldsAsSymbols !== undefined) {\n explicit.push(`\"privateFieldsAsSymbols\"`);\n }\n if (explicit.length !== 0) {\n console.warn(\n `[${name}]: You are using the \"loose: true\" option and you are` +\n ` explicitly setting a value for the ${explicit.join(\" and \")}` +\n ` assumption${explicit.length > 1 ? \"s\" : \"\"}. The \"loose\" option` +\n ` can cause incompatibilities with the other class features` +\n ` plugins, so it's recommended that you replace it with the` +\n ` following top-level option:\\n` +\n `\\t\"assumptions\": {\\n` +\n `\\t\\t\"setPublicClassFields\": true,\\n` +\n `\\t\\t\"privateFieldsAsSymbols\": true\\n` +\n `\\t}`,\n );\n }\n }\n\n return {\n name,\n manipulateOptions,\n inherits,\n\n pre(file) {\n enableFeature(file, feature, loose);\n\n if (!process.env.BABEL_8_BREAKING) {\n // Until 7.21.4, we used to encode the version as a number.\n // If file.get(versionKey) is a number, it has thus been\n // set by an older version of this plugin.\n if (typeof file.get(versionKey) === \"number\") {\n file.set(versionKey, PACKAGE_JSON.version);\n return;\n }\n }\n if (\n !file.get(versionKey) ||\n semver.lt(file.get(versionKey), PACKAGE_JSON.version)\n ) {\n file.set(versionKey, PACKAGE_JSON.version);\n }\n },\n\n visitor: {\n Class(path, { file }) {\n if (file.get(versionKey) !== PACKAGE_JSON.version) return;\n\n if (!shouldTransform(path, file)) return;\n\n const pathIsClassDeclaration = path.isClassDeclaration();\n\n if (pathIsClassDeclaration) assertFieldTransformed(path);\n\n const loose = isLoose(file, feature);\n\n let constructor: NodePath;\n const isDecorated = hasDecorators(path.node);\n const props: PropPath[] = [];\n const elements = [];\n const computedPaths: NodePath[] = [];\n const privateNames = new Set();\n const body = path.get(\"body\");\n\n for (const path of body.get(\"body\")) {\n if (\n // check path.node.computed is enough, but ts will complain\n (path.isClassProperty() || path.isClassMethod()) &&\n path.node.computed\n ) {\n computedPaths.push(path);\n }\n\n if (path.isPrivate()) {\n const { name } = path.node.key.id;\n const getName = `get ${name}`;\n const setName = `set ${name}`;\n\n if (path.isClassPrivateMethod()) {\n if (path.node.kind === \"get\") {\n if (\n privateNames.has(getName) ||\n (privateNames.has(name) && !privateNames.has(setName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n privateNames.add(getName).add(name);\n } else if (path.node.kind === \"set\") {\n if (\n privateNames.has(setName) ||\n (privateNames.has(name) && !privateNames.has(getName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n privateNames.add(setName).add(name);\n }\n } else {\n if (\n (privateNames.has(name) &&\n !privateNames.has(getName) &&\n !privateNames.has(setName)) ||\n (privateNames.has(name) &&\n (privateNames.has(getName) || privateNames.has(setName)))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(name);\n }\n }\n\n if (path.isClassMethod({ kind: \"constructor\" })) {\n constructor = path;\n } else {\n elements.push(path);\n if (\n path.isProperty() ||\n path.isPrivate() ||\n path.isStaticBlock?.()\n ) {\n props.push(path as PropPath);\n }\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (!props.length) return;\n } else {\n if (!props.length && !isDecorated) return;\n }\n\n const innerBinding = path.node.id;\n let ref: t.Identifier | null;\n if (!innerBinding || !pathIsClassDeclaration) {\n nameFunction(path);\n ref = path.scope.generateUidIdentifier(\"class\");\n }\n const classRefForDefine = ref ?? t.cloneNode(innerBinding);\n\n // NODE: These three functions don't support decorators yet,\n // but verifyUsedFeatures throws if there are both\n // decorators and private fields.\n const privateNamesMap = buildPrivateNamesMap(props);\n const privateNamesNodes = buildPrivateNamesNodes(\n privateNamesMap,\n privateFieldsAsProperties ?? loose,\n privateFieldsAsSymbols ?? false,\n file,\n );\n\n transformPrivateNamesUsage(\n classRefForDefine,\n path,\n privateNamesMap,\n {\n privateFieldsAsProperties:\n privateFieldsAsSymbolsOrProperties ?? loose,\n noDocumentAll,\n innerBinding,\n },\n file,\n );\n\n let keysNodes: t.Statement[],\n staticNodes: t.Statement[],\n instanceNodes: t.Statement[],\n pureStaticNodes: t.FunctionDeclaration[],\n classBindingNode: t.Statement | null,\n wrapClass: (path: NodePath) => NodePath;\n\n if (!process.env.BABEL_8_BREAKING) {\n if (isDecorated) {\n staticNodes = pureStaticNodes = keysNodes = [];\n ({ instanceNodes, wrapClass } = buildDecoratedClass(\n classRefForDefine,\n path,\n elements,\n file,\n ));\n } else {\n keysNodes = extractComputedKeys(path, computedPaths, file);\n ({\n staticNodes,\n pureStaticNodes,\n instanceNodes,\n classBindingNode,\n wrapClass,\n } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n file,\n setPublicClassFields ?? loose,\n privateFieldsAsSymbolsOrProperties ?? loose,\n constantSuper ?? loose,\n innerBinding,\n ));\n }\n } else {\n keysNodes = extractComputedKeys(path, computedPaths, file);\n ({\n staticNodes,\n pureStaticNodes,\n instanceNodes,\n classBindingNode,\n wrapClass,\n } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n file,\n setPublicClassFields ?? loose,\n privateFieldsAsSymbolsOrProperties ?? loose,\n constantSuper ?? loose,\n innerBinding,\n ));\n }\n\n if (instanceNodes.length > 0) {\n injectInitialization(\n path,\n constructor,\n instanceNodes,\n (referenceVisitor, state) => {\n if (!process.env.BABEL_8_BREAKING) {\n if (isDecorated) return;\n }\n for (const prop of props) {\n // @ts-expect-error: TS doesn't infer that prop.node is not a StaticBlock\n if (t.isStaticBlock?.(prop.node) || prop.node.static) continue;\n prop.traverse(referenceVisitor, state);\n }\n },\n );\n }\n\n // rename to make ts happy\n const wrappedPath = wrapClass(path);\n wrappedPath.insertBefore([...privateNamesNodes, ...keysNodes]);\n if (staticNodes.length > 0) {\n wrappedPath.insertAfter(staticNodes);\n }\n if (pureStaticNodes.length > 0) {\n wrappedPath\n .find(parent => parent.isStatement() || parent.isDeclaration())\n .insertAfter(pureStaticNodes);\n }\n if (classBindingNode != null && pathIsClassDeclaration) {\n wrappedPath.insertAfter(classBindingNode);\n }\n },\n\n ExportDefaultDeclaration(path, { file }) {\n if (!process.env.BABEL_8_BREAKING) {\n if (file.get(versionKey) !== PACKAGE_JSON.version) return;\n\n const decl = path.get(\"declaration\");\n\n if (decl.isClassDeclaration() && hasDecorators(decl.node)) {\n if (decl.node.id) {\n // export default class Foo {}\n // -->\n // class Foo {} export { Foo as default }\n splitExportDeclaration(path);\n } else {\n // @ts-expect-error Anonymous class declarations can be\n // transformed as if they were expressions\n decl.node.type = \"ClassExpression\";\n }\n }\n }\n },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