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aAAc,CAAC,gBACpH,EAAK,EAAG,EAAkB,EAAe,EAAK,EAAgB,OAAQ,IAAM,EAC7E,EAAO,EAAgB,IACtB,YAAY,EACrB,CACA,IAAK,IAAI,EAAK,EAAG,EAAiB,EAAc,EAAK,EAAe,OAAQ,IAAM,CAC9E,IAAI,KAAO,EAAe,IACrB,YAAY,EACrB,CACJ,GAGZ,CA/J2B,mBAApB,iBAAiC,gBAkKxC,QAAQ,QAAU","file":"/npm/babel-plugin-transform-import-meta@2.3.3/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/babel-plugin-transform-import-meta@2.3.3/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar template = require('@babel/template');\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n}\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n    var e = new Error(message);\r\n    return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\n/**\n * Rewrites known `import.meta`[1] properties into equivalent non-module node.js\n * expressions. In order to maintain compatibility with plugins transforming\n * non-standard properties, this plugin transforms only known properties and\n * does not touch expressions with unknown or without member property access.\n * Properties known to this plugin:\n *\n * - `url`[2]\n *\n * [1]: https://github.com/tc39/proposal-import-meta\n * [2]: https://html.spec.whatwg.org/#hostgetimportmetaproperties\n */\nfunction index () {\n    return {\n        name: 'transform-import-meta',\n        visitor: {\n            // eslint-disable-next-line complexity -- I don't know how to do it better\n            Program: function (path, state) {\n                var _a;\n                var _b = ((_a = state.opts) !== null && _a !== void 0 ? _a : {}).module, target = _b === void 0 ? 'CommonJS' : _b;\n                // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- user input may not match type\n                if (target !== 'CommonJS' && target !== 'ES6') {\n                    throw new Error('Invalid target, must be one of: \"CommonJS\" or \"ES6\"');\n                }\n                var urlMetas = [];\n                var filenameMetas = [];\n                var dirnameMetas = [];\n                var resolveMetas = [];\n                var urlScopeIdentifiers = new Set();\n                var resolveScopeIdentifiers = new Set();\n                // Gather all of the relevant data for import.meta's that we're going to replace later.\n                path.traverse({\n                    // eslint-disable-next-line complexity -- I don't know how to do it better\n                    MemberExpression: function (memberExpPath) {\n                        var node = memberExpPath.node;\n                        if (node.object.type === 'MetaProperty' &&\n                            node.object.meta.name === 'import' &&\n                            node.object.property.name === 'meta' &&\n                            node.property.type === 'Identifier' &&\n                            node.property.name === 'url') {\n                            urlMetas.push(memberExpPath);\n                            for (var _i = 0, _a = Object.keys(memberExpPath.scope.getAllBindings()); _i < _a.length; _i++) {\n                                var name = _a[_i];\n                                urlScopeIdentifiers.add(name);\n                            }\n                        }\n                        if (node.object.type === 'MetaProperty' &&\n                            node.object.meta.name === 'import' &&\n                            node.object.property.name === 'meta' &&\n                            node.property.type === 'Identifier' &&\n                            node.property.name === 'filename') {\n                            filenameMetas.push(memberExpPath);\n                        }\n                        if (node.object.type === 'MetaProperty' &&\n                            node.object.meta.name === 'import' &&\n                            node.object.property.name === 'meta' &&\n                            node.property.type === 'Identifier' &&\n                            node.property.name === 'dirname') {\n                            dirnameMetas.push(memberExpPath);\n                        }\n                    },\n                    // eslint-disable-next-line complexity -- I don't know how to do it better\n                    CallExpression: function (callExpPath) {\n                        var node = callExpPath.node;\n                        if (node.callee.type === 'MemberExpression' &&\n                            node.callee.object.type === 'MetaProperty' &&\n                            node.callee.object.meta.name === 'import' &&\n                            node.callee.object.property.name === 'meta' &&\n                            node.callee.property.type === 'Identifier' &&\n                            node.callee.property.name === 'resolve') {\n                            resolveMetas.push(callExpPath);\n                            for (var _i = 0, _a = Object.keys(callExpPath.scope.getAllBindings()); _i < _a.length; _i++) {\n                                var name = _a[_i];\n                                resolveScopeIdentifiers.add(name);\n                            }\n                        }\n                    },\n                    // eslint-disable-next-line complexity -- I don't know how to do it better\n                    OptionalCallExpression: function (callExpPath) {\n                        var node = callExpPath.node;\n                        if (node.callee.type === 'MemberExpression' &&\n                            node.callee.object.type === 'MetaProperty' &&\n                            node.callee.object.meta.name === 'import' &&\n                            node.callee.object.property.name === 'meta' &&\n                            node.callee.property.type === 'Identifier' &&\n                            node.callee.property.name === 'resolve') {\n                            resolveMetas.push(callExpPath);\n                            for (var _i = 0, _a = Object.keys(callExpPath.scope.getAllBindings()); _i < _a.length; _i++) {\n                                var name = _a[_i];\n                                resolveScopeIdentifiers.add(name);\n                            }\n                        }\n                    }\n                });\n                // For url and resolve, we'll potentially need to add imports, depending on the target.\n                if ((urlMetas.length !== 0) || (resolveMetas.length !== 0)) {\n                    // eslint-disable-next-line @typescript-eslint/init-declarations -- no obvious default\n                    var metaUrlReplacement = void 0;\n                    // eslint-disable-next-line @typescript-eslint/init-declarations -- no obvious default\n                    var metaResolveReplacement = void 0;\n                    switch (target) {\n                        case 'CommonJS': {\n                            // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                            metaUrlReplacement = template.smart.ast(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"require('url').pathToFileURL(__filename).toString()\"], [\"require('url').pathToFileURL(__filename).toString()\"])));\n                            // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                            metaResolveReplacement = function (args) { return template.smart.ast(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"require('url').pathToFileURL(require.resolve(\", \")).toString()\"], [\"require('url').pathToFileURL(require.resolve(\", \")).toString()\"])), args); };\n                            break;\n                        }\n                        case 'ES6': {\n                            var urlId_1 = 'url';\n                            var createRequireId_1 = 'createRequire';\n                            while (urlScopeIdentifiers.has(urlId_1) || resolveScopeIdentifiers.has(urlId_1)) {\n                                urlId_1 = path.scope.generateUidIdentifier('url').name;\n                            }\n                            while (resolveScopeIdentifiers.has(createRequireId_1)) {\n                                createRequireId_1 = path.scope.generateUidIdentifier('createRequire').name;\n                            }\n                            // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                            path.node.body.unshift(template.smart.ast(templateObject_3 || (templateObject_3 = __makeTemplateObject([\"import \", \" from 'url';\"], [\"import \", \" from 'url';\"])), urlId_1));\n                            if (resolveMetas.length !== 0) {\n                                // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                                path.node.body.unshift(template.smart.ast(templateObject_4 || (templateObject_4 = __makeTemplateObject([\"import { createRequire as \", \" } from 'module';\"], [\"import { createRequire as \", \" } from 'module';\"])), createRequireId_1));\n                            }\n                            // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                            metaUrlReplacement = template.smart.ast(templateObject_5 || (templateObject_5 = __makeTemplateObject([\"\", \".pathToFileURL(__filename).toString()\"], [\"\", \".pathToFileURL(__filename).toString()\"])), urlId_1);\n                            // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                            metaResolveReplacement = function (args) { return template.smart.ast(templateObject_6 || (templateObject_6 = __makeTemplateObject([\"\", \".pathToFileURL(\", \"(\", \".pathToFileURL(__filename).toString()).resolve(\", \")).toString()\"], [\"\", \".pathToFileURL(\", \"(\", \".pathToFileURL(__filename).toString()).resolve(\", \")).toString()\"])), urlId_1, createRequireId_1, urlId_1, args); };\n                            break;\n                        }\n                    }\n                    for (var _i = 0, urlMetas_1 = urlMetas; _i < urlMetas_1.length; _i++) {\n                        var meta = urlMetas_1[_i];\n                        meta.replaceWith(metaUrlReplacement);\n                    }\n                    for (var _c = 0, resolveMetas_1 = resolveMetas; _c < resolveMetas_1.length; _c++) {\n                        var meta = resolveMetas_1[_c];\n                        meta.replaceWith(metaResolveReplacement(meta.node.arguments));\n                    }\n                }\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                var metaFilenameReplacement = template.smart.ast(templateObject_7 || (templateObject_7 = __makeTemplateObject([\"__filename\"], [\"__filename\"])));\n                // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- deterministic casting\n                var metaDirnameReplacement = template.smart.ast(templateObject_8 || (templateObject_8 = __makeTemplateObject([\"__dirname\"], [\"__dirname\"])));\n                for (var _d = 0, filenameMetas_1 = filenameMetas; _d < filenameMetas_1.length; _d++) {\n                    var meta = filenameMetas_1[_d];\n                    meta.replaceWith(metaFilenameReplacement);\n                }\n                for (var _e = 0, dirnameMetas_1 = dirnameMetas; _e < dirnameMetas_1.length; _e++) {\n                    var meta = dirnameMetas_1[_e];\n                    meta.replaceWith(metaDirnameReplacement);\n                }\n            }\n        }\n    };\n}\nvar templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;\n\nexports.default = index;\n"]}