{"version":3,"names":["pluginCorejs2","require","default","pluginRegenerator","pluginsCompat","createCorejs2Plugin","options","api","_","filename","createRegeneratorPlugin","useRuntimeRegenerator","corejsPlugin","undefined","Object","assign","inherits","module","exports","createBasePolyfillsPlugin","corejs","regenerator","runtimeVersion","absoluteImports","corejs3Plugin","proposals","rawVersion","version","Boolean","corejsVersion","Number","includes","Error","JSON","stringify","polyfillOpts","method","useBabelRuntime","ext"],"sources":["../../src/babel-7/polyfills.cjs"],"sourcesContent":["// TODO(Babel 8) Remove this file\nif (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Internal Babel error: This file should only be loaded in Babel 7\",\n );\n}\n\nconst pluginCorejs2 = require(\"babel-plugin-polyfill-corejs2\").default;\nconst pluginRegenerator = require(\"babel-plugin-polyfill-regenerator\").default;\n\nconst pluginsCompat = \"#__secret_key__@babel/runtime__compatibility\";\n\nfunction createCorejs2Plugin(options) {\n return (api, _, filename) => pluginCorejs2(api, options, filename);\n}\n\nfunction createRegeneratorPlugin(options, useRuntimeRegenerator, corejsPlugin) {\n if (!useRuntimeRegenerator) return corejsPlugin ?? undefined;\n return (api, _, filename) => {\n return {\n ...pluginRegenerator(api, options, filename),\n inherits: corejsPlugin ?? undefined,\n };\n };\n}\n\nmodule.exports = function createBasePolyfillsPlugin(\n { corejs, regenerator = true },\n runtimeVersion,\n absoluteImports,\n corejs3Plugin,\n) {\n let proposals = false;\n let rawVersion;\n\n if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const corejsVersion = rawVersion ? Number(rawVersion) : false;\n\n if (![false, 2, 3].includes(corejsVersion)) {\n throw new Error(\n `The \\`core-js\\` version must be false, 2 or 3, but got ${JSON.stringify(\n rawVersion,\n )}.`,\n );\n }\n\n if (proposals && (!corejsVersion || corejsVersion < 3)) {\n throw new Error(\n \"The 'proposals' option is only supported when using 'corejs: 3'\",\n );\n }\n\n if (typeof regenerator !== \"boolean\") {\n throw new Error(\n \"The 'regenerator' option must be undefined, or a boolean.\",\n );\n }\n\n const polyfillOpts = {\n method: \"usage-pure\",\n absoluteImports,\n [pluginsCompat]: { useBabelRuntime: true, runtimeVersion, ext: \"\" },\n };\n\n return createRegeneratorPlugin(\n polyfillOpts,\n regenerator,\n corejsVersion === 2\n ? createCorejs2Plugin(polyfillOpts)\n : corejsVersion === 3\n ? corejs3Plugin\n : null,\n );\n};\n"],"mappings":";AAOA,MAAMA,aAAa,GAAGC,OAAO,CAAC,+BAA+B,CAAC,CAACC,OAAO;AACtE,MAAMC,iBAAiB,GAAGF,OAAO,CAAC,mCAAmC,CAAC,CAACC,OAAO;AAE9E,MAAME,aAAa,GAAG,8CAA8C;AAEpE,SAASC,mBAAmBA,CAACC,OAAO,EAAE;EACpC,OAAO,CAACC,GAAG,EAAEC,CAAC,EAAEC,QAAQ,KAAKT,aAAa,CAACO,GAAG,EAAED,OAAO,EAAEG,QAAQ,CAAC;AACpE;AAEA,SAASC,uBAAuBA,CAACJ,OAAO,EAAEK,qBAAqB,EAAEC,YAAY,EAAE;EAC7E,IAAI,CAACD,qBAAqB,EAAE,OAAOC,YAAY,WAAZA,YAAY,GAAIC,SAAS;EAC5D,OAAO,CAACN,GAAG,EAAEC,CAAC,EAAEC,QAAQ,KAAK;IAC3B,OAAAK,MAAA,CAAAC,MAAA,KACKZ,iBAAiB,CAACI,GAAG,EAAED,OAAO,EAAEG,QAAQ,CAAC;MAC5CO,QAAQ,EAAEJ,YAAY,WAAZA,YAAY,GAAIC;IAAS;EAEvC,CAAC;AACH;AAEAI,MAAM,CAACC,OAAO,GAAG,SAASC,yBAAyBA,CACjD;EAAEC,MAAM;EAAEC,WAAW,GAAG;AAAK,CAAC,EAC9BC,cAAc,EACdC,eAAe,EACfC,aAAa,EACb;EACA,IAAIC,SAAS,GAAG,KAAK;EACrB,IAAIC,UAAU;EAEd,IAAI,OAAON,MAAM,KAAK,QAAQ,IAAIA,MAAM,KAAK,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