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GAE1D,IAAI,GACF,IAAsC,EAAmB,OAEzD,IAAI,EAEJ,EAAK,IAAI,mBAAoB,IAAiB,IAAA,EAa1C,GAZQ,MAAV,OAAe,EAAA,gBAEyB,OAFX,EACjB,MAAV,IACE,EAAK,IAAI,6BAA2B,EACpC,iBACF,EACA,IAOyB,MAApB,EAAK,kBAAL,EAAK,gBAAkB,EAAM,GAChC,MAAa,uBAAT,EAQK,YAAE,wBACP,GACA,YAAE,WAAW,uBAIN,gBAAT,GACS,oBAAT,GACS,qBAAT,GACS,wBAAT,EAIO,YAAE,WAAW,gDAEtB,EASJ,MAAM,EACJ,EAAe,IAAI,MAAU,EAAA,+BAAS,EAAK,MAAQ,OAAI,EAEzD,IAAI,EAAa,GAAG,aAElB,GAC8B,WAA9B,EAAK,KAAK,KAAK,WACX,OAAS,EACT,IAIN,OAFI,IAAiB,GAAa,EAAA,sBAAc,IAOlD,SACE,EACA,EACA,EACA,GAAW,GAKX,MAAM,GAAW,EAAA,+BAAS,EAAK,MACzB,EAAM,GAAG,KAAU,KAAY,GAAY,KAEjD,IAAI,EAAS,EAAM,IAAI,GACnB,EACF,EAAS,YAAE,UAAU,IAErB,GAAS,EAAA,iCAAW,EAAK,KAAM,EAAQ,CACrC,gBAGM,GAAY,EAEd,WACA,aACJ,WACA,eAGF,EAAM,IAAI,EAAK,IAEjB,OAAO,CACT,CApCS,CAAiB,EAAY,EAAM,GAAY,EAAK,IAG7D,MAAM,EAAQ,IAAI,GAkCpB,EACD","file":"/npm/@babel/plugin-transform-runtime@7.29.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@babel/plugin-transform-runtime@7.29.0/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","import { declare } from \"@babel/helper-plugin-utils\";\nimport { addDefault, isModule } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nimport getRuntimePath, { resolveFSPath } from \"./get-runtime-path/index.ts\";\n\n// TODO(Babel 8): Remove this\nimport babel7 from \"./babel-7/index.cjs\" with { if: \"!process.env.BABEL_8_BREAKING\" };\nimport semver from \"semver\" with { if: \"!process.env.BABEL_8_BREAKING\" };\n\nexport interface Options {\n  absoluteRuntime?: boolean;\n  corejs?: string | number | { version: string | number; proposals?: boolean };\n  helpers?: boolean;\n  version?: string;\n  moduleName?: null | string;\n}\n\nexport default declare((api, options: Options, dirname) => {\n  api.assertVersion(REQUIRED_VERSION(7));\n\n  const {\n    version: runtimeVersion = process.env.BABEL_8_BREAKING\n      ? \"8.0.0-beta.0\"\n      : \"7.0.0-beta.0\",\n    absoluteRuntime = false,\n    moduleName = null,\n  } = options;\n\n  if (\n    typeof absoluteRuntime !== \"boolean\" &&\n    typeof absoluteRuntime !== \"string\"\n  ) {\n    throw new Error(\n      \"The 'absoluteRuntime' option must be undefined, a boolean, or a string.\",\n    );\n  }\n\n  if (typeof runtimeVersion !== \"string\") {\n    throw new Error(`The 'version' option must be a version string.`);\n  }\n\n  if (moduleName !== null && typeof moduleName !== \"string\") {\n    throw new Error(\"The 'moduleName' option must be null or a string.\");\n  }\n\n  if (!process.env.BABEL_8_BREAKING) {\n    // In recent @babel/runtime versions, we can use require(\"helper\").default\n    // instead of require(\"helper\") so that it has the same interface as the\n    // ESM helper, and bundlers can better exchange one format for the other.\n\n    // eslint-disable-next-line no-var\n    var supportsCJSDefault: boolean;\n    if (!runtimeVersion) {\n      // If the range is unavailable, we're running the script during Babel's\n      // build process, and we want to assume that all versions are satisfied so\n      // that the built output will include all definitions.\n      supportsCJSDefault = true;\n    } else {\n      // semver.intersects() has some surprising behavior with comparing ranges\n      // with pre-release versions. We add '^' to ensure that we are always\n      // comparing ranges with ranges, which sidesteps this logic.\n      // For example:\n      //\n      //   semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n      //   semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n      //\n      // This is because the first falls back to\n      //\n      //   semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n      //\n      // and this fails because a prerelease version can only satisfy a range\n      // if it is a prerelease within the same major/minor/patch range.\n      //\n      // Note: If this is found to have issues, please also revisit the logic in\n      // babel-core's availableHelper() API.\n      const normalizedRuntimeVersion = semver.valid(runtimeVersion)\n        ? `^${runtimeVersion}`\n        : runtimeVersion;\n\n      supportsCJSDefault =\n        !semver.intersects(`<7.13.0`, normalizedRuntimeVersion) &&\n        !semver.intersects(`>=8.0.0`, normalizedRuntimeVersion);\n    }\n  }\n\n  if (Object.hasOwn(options, \"useBuiltIns\")) {\n    // @ts-expect-error deprecated options\n    if (options.useBuiltIns) {\n      throw new Error(\n        \"The 'useBuiltIns' option has been removed. The @babel/runtime \" +\n          \"module now uses builtins by default.\",\n      );\n    } else {\n      throw new Error(\n        \"The 'useBuiltIns' option has been removed. Use the 'corejs'\" +\n          \"option to polyfill with `core-js` via @babel/runtime.\",\n      );\n    }\n  }\n\n  if (Object.hasOwn(options, \"polyfill\")) {\n    // @ts-expect-error deprecated options\n    if (options.polyfill === false) {\n      throw new Error(\n        \"The 'polyfill' option has been removed. The @babel/runtime \" +\n          \"module now skips polyfilling by default.\",\n      );\n    } else {\n      throw new Error(\n        \"The 'polyfill' option has been removed. Use the 'corejs'\" +\n          \"option to polyfill with `core-js` via @babel/runtime.\",\n      );\n    }\n  }\n\n  if (process.env.BABEL_8_BREAKING) {\n    if (Object.hasOwn(options, \"regenerator\")) {\n      throw new Error(\n        \"The 'regenerator' option has been removed. The generators transform \" +\n          \"no longers relies on a 'regeneratorRuntime' global. \" +\n          \"If you still need to replace imports to the 'regeneratorRuntime' \" +\n          \"global, you can use babel-plugin-polyfill-regenerator.\",\n      );\n    }\n  }\n\n  if (process.env.BABEL_8_BREAKING) {\n    if (Object.hasOwn(options, \"useESModules\")) {\n      throw new Error(\n        \"The 'useESModules' option has been removed. @babel/runtime now uses \" +\n          \"package.json#exports to support both CommonJS and ESM helpers.\",\n      );\n    }\n  } else {\n    // @ts-expect-error(Babel 7 vs Babel 8)\n    const { useESModules = false } = options;\n    if (typeof useESModules !== \"boolean\" && useESModules !== \"auto\") {\n      throw new Error(\n        \"The 'useESModules' option must be undefined, or a boolean, or 'auto'.\",\n      );\n    }\n\n    // eslint-disable-next-line no-var\n    var esModules =\n      useESModules === \"auto\"\n        ? api.caller(caller => !!caller?.supportsStaticESM)\n        : useESModules;\n  }\n\n  if (process.env.BABEL_8_BREAKING) {\n    if (Object.hasOwn(options, \"helpers\")) {\n      throw new Error(\n        \"The 'helpers' option has been removed. \" +\n          \"Remove the plugin from your config if \" +\n          \"you want to disable helpers import injection.\",\n      );\n    }\n  } else {\n    // eslint-disable-next-line no-var\n    var { helpers: useRuntimeHelpers = true } = options;\n\n    if (typeof useRuntimeHelpers !== \"boolean\") {\n      throw new Error(\"The 'helpers' option must be undefined, or a boolean.\");\n    }\n  }\n\n  const HEADER_HELPERS = new Set([\n    \"interopRequireWildcard\",\n    \"interopRequireDefault\",\n  ]);\n\n  return {\n    name: \"transform-runtime\",\n\n    inherits: process.env.BABEL_8_BREAKING\n      ? undefined\n      : babel7.createPolyfillPlugins(options, runtimeVersion, absoluteRuntime),\n\n    pre(file) {\n      if (!process.env.BABEL_8_BREAKING && !useRuntimeHelpers) return;\n\n      let modulePath: string;\n\n      file.set(\"helperGenerator\", (name: string) => {\n        modulePath ??= getRuntimePath(\n          moduleName ??\n            file.get(\"runtimeHelpersModuleName\") ??\n            \"@babel/runtime\",\n          dirname,\n          absoluteRuntime,\n        );\n\n        // If the helper didn't exist yet at the version given, we bail\n        // out and let Babel either insert it directly, or throw an error\n        // so that plugins can handle that case properly.\n        if (!process.env.BABEL_8_BREAKING) {\n          if (!file.availableHelper?.(name, runtimeVersion)) {\n            if (name === \"regeneratorRuntime\") {\n              // For regeneratorRuntime, we can fallback to the old behavior of\n              // relying on the regeneratorRuntime global. If the 'regenerator'\n              // option is not disabled, babel-plugin-polyfill-regenerator will\n              // then replace it with a @babel/helpers/regenerator import.\n              //\n              // We must wrap it in a function, because built-in Babel helpers\n              // are functions.\n              return t.arrowFunctionExpression(\n                [],\n                t.identifier(\"regeneratorRuntime\"),\n              );\n            }\n            if (\n              name === \"regenerator\" ||\n              name === \"regeneratorKeys\" ||\n              name === \"regeneratorAsync\" ||\n              name === \"regeneratorAsyncGen\"\n            ) {\n              // See the `newHelpersAvailable` function in\n              // babel-plugin-transform-regenerator/src/regenerator/util.ts\n              return t.identifier(\"__interal_marker_fallback_regenerator__\");\n            }\n            return;\n          }\n        } else {\n          if (!file.availableHelper(name, runtimeVersion)) return;\n        }\n\n        // Explicitly set the CommonJS interop helpers to their reserve\n        // blockHoist of 4 so they are guaranteed to exist\n        // when other things used them to import.\n        const blockHoist =\n          HEADER_HELPERS.has(name) && !isModule(file.path) ? 4 : undefined;\n\n        let helperPath = `${modulePath}/helpers/${\n          !process.env.BABEL_8_BREAKING &&\n          esModules &&\n          file.path.node.sourceType === \"module\"\n            ? \"esm/\" + name\n            : name\n        }`;\n        if (absoluteRuntime) helperPath = resolveFSPath(helperPath);\n\n        return addDefaultImport(helperPath, name, blockHoist, true);\n      });\n\n      const cache = new Map();\n\n      function addDefaultImport(\n        source: string,\n        nameHint: string,\n        blockHoist: number,\n        isHelper = false,\n      ) {\n        // If something on the page adds a helper when the file is an ES6\n        // file, we can't reused the cached helper name after things have been\n        // transformed because it has almost certainly been renamed.\n        const cacheKey = isModule(file.path);\n        const key = `${source}:${nameHint}:${cacheKey || \"\"}`;\n\n        let cached = cache.get(key);\n        if (cached) {\n          cached = t.cloneNode(cached);\n        } else {\n          cached = addDefault(file.path, source, {\n            importedInterop: (\n              process.env.BABEL_8_BREAKING\n                ? isHelper\n                : isHelper && supportsCJSDefault\n            )\n              ? \"compiled\"\n              : \"uncompiled\",\n            nameHint,\n            blockHoist,\n          });\n\n          cache.set(key, cached);\n        }\n        return cached;\n      }\n    },\n  };\n});\n"]}