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,KAAO,gBAChB,CAMA,SAAS,cAAc,GACnB,MAAM,IAAC,GAAO,EAEd,EAAK,IAAM,GAAO,EAAK,OAAO,IAC9B,EAAK,MAAQ,EAAK,OAAS,CACvB,MAER","file":"/npm/estree-to-babel@12.0.1/lib/estree-to-babel.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/estree-to-babel@12.0.1/lib/estree-to-babel.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import {traverse, types} from '@putout/babel';\nimport traverseObjectExpression from './traverse-object-expression.js';\nimport setClassMethod from './set-class-method.js';\nimport setClassPrivateProperty from './set-class-private-property.js';\nimport setClassPrivateName from './set-class-private-name.js';\nimport setDirectives from './set-directives.js';\nimport convertChainExpression from './convert-chain-expression.js';\nimport convertImportDeclaration from './convert-import-declaration.js';\nimport convertExportDeclaration from './convert-export-declaration.js';\nimport {convertParenthesizedExpression} from './parenthesized-expression.js';\nimport {convertTSParenthesizedType} from './ts-parenthesized-type.js';\nimport {convertNodeComments} from './comments.js';\nimport setLiteral from './set-literal.js';\nimport getAST from './get-ast.js';\nimport {\n    convertTSInterfaceHeritage,\n    convertTSAbstractMethodDefinition,\n    convertPropertyDefinition,\n    convertPrivateIdentifier,\n} from './ts.js';\n\nconst {\n    isObjectExpression,\n    isExportDeclaration,\n} = types;\n\nconst defaultOptions = {\n    convertParens: true,\n};\n\nexport const estreeToBabel = (node, options) => {\n    const ast = getAST(node);\n    \n    const allOptions = {\n        ...defaultOptions,\n        ...options,\n    };\n    \n    traverse(ast, {\n        noScope: true,\n        ParenthesizedExpression: convertParenthesizedExpression(allOptions),\n        TSParenthesizedType: convertTSParenthesizedType(allOptions),\n        enter(path) {\n            const {type, node} = path;\n            \n            if (type.endsWith('Literal')) {\n                setLiteral(node);\n                return setEsprimaRaw(node);\n            }\n            \n            if (type === 'JSXText')\n                return setEsprimaRaw(node);\n            \n            if (type === 'BlockStatement' || type === 'Program')\n                return setDirectives(path);\n            \n            if (type === 'Property')\n                return setObjectProperty(node);\n            \n            if (type === 'MethodDefinition')\n                return setClassMethod(path);\n            \n            if (type === 'FieldDefinition')\n                return setClassPrivateProperty(path);\n            \n            if (type === 'PrivateName')\n                return setClassPrivateName(path);\n            \n            if (type === 'ImportDeclaration')\n                return convertImportDeclaration(path);\n            \n            if (isExportDeclaration(path))\n                return convertExportDeclaration(path);\n            \n            if (type === 'ChainExpression')\n                return convertChainExpression(path);\n            \n            if (type === 'TSAbstractMethodDefinition')\n                return convertTSAbstractMethodDefinition(path);\n            \n            if (type === 'TSInterfaceHeritage')\n                return convertTSInterfaceHeritage(path);\n            \n            if (type === 'PropertyDefinition')\n                return convertPropertyDefinition(path);\n            \n            if (type === 'PrivateIdentifier')\n                return convertPrivateIdentifier(path);\n        },\n        exit(path) {\n            const {node} = path;\n            \n            convertNodeComments(node);\n            \n            if (isObjectExpression(node))\n                return traverseObjectExpression(path.get('properties'));\n        },\n    });\n    return ast;\n};\n\nfunction setObjectProperty(node) {\n    node.type = 'ObjectProperty';\n}\n\n// avoid additional traversing in @putout/engine-parser\n// add \"raw\" field, that exists in all ESTree AST\n// but located in \"extra.raw\" in Babel AST\n// which makes writing transforms more long and error prone\nfunction setEsprimaRaw(node) {\n    const {raw} = node;\n    \n    node.raw = raw || node.extra?.raw;\n    node.extra = node.extra || {\n        raw,\n    };\n}\n"]}