{"version":3,"sources":["jsdelivr-header.js","/npm/@babel/plugin-proposal-class-static-block@7.21.0/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,2FCNA,IAAA,mBAAA,QAAA,8BACA,8BAAA,QAAA,2CAGA,iCAAA,QAAA,8CAYA,SAAS,YAAY,EAAc,GAEjC,IAAI,EACA,EAAI,EACR,GACE,EAAM,EAAM,aAJD,GAIoB,GAC/B,UACO,EAAS,IAAI,IACtB,OAAO,CACT,CAAC,IAAA,UAEc,EAAA,6BAAQ,EAAG,MAAO,EAAG,WAAU,oBAC5C,EAAc,WAEP,CACL,KAAM,8BACN,SAAU,8BAAuB,QAEjC,OAGE,EAAA,gDAAc,KAAK,KAAM,0CAAS,cAA0B,EAC9D,EAEA,QAAS,CAIP,UAAU,GACR,MAAM,MAAE,GAAU,EACZ,EAAe,IAAI,IACnB,EAAO,EAAU,IAAI,QAC3B,IAAK,MAAM,KAAQ,EACb,EAAK,aACP,EAAa,IAAI,EAAK,IAAI,UAAU,KAAK,MAG7C,IAAK,MAAM,KAAQ,EAAM,CACvB,IAAK,EAAK,gBAAiB,SAC3B,MAAM,EAAuB,YAAY,EAAO,GAChD,EAAa,IAAI,GACjB,MAAM,EAAiB,EAAE,YACvB,EAAE,WAAW,IAGf,IAAI,EACJ,MAAM,EAAY,EAAK,KAAK,KAI1B,EADuB,IAArB,EAAU,QAAgB,EAAE,sBAAsB,EAAU,IAChD,EAAE,iBACd,EAAU,GAAG,WACb,EAAU,IAGE,EAAS,WAAW,GAAI,YAAW,SAGnD,EAAK,YACH,EAAE,qBACA,EACA,EACA,IACa,GAGnB,CACF,OAGJ,QAAA,QAAA","file":"/npm/@babel/plugin-proposal-class-static-block@7.21.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@babel/plugin-proposal-class-static-block@7.21.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 syntaxClassStaticBlock from \"@babel/plugin-syntax-class-static-block\";\nimport type { Scope } from \"@babel/traverse\";\n\nimport {\n  enableFeature,\n  FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\n/**\n * Generate a uid that is not in `denyList`\n *\n * @param {Scope} scope\n * @param {Set<string>} denyList a deny list that the generated uid should avoid\n * @returns\n */\nfunction generateUid(scope: Scope, denyList: Set<string>) {\n  const name = \"\";\n  let uid;\n  let i = 1;\n  do {\n    uid = scope._generateUid(name, i);\n    i++;\n  } while (denyList.has(uid));\n  return uid;\n}\n\nexport default declare(({ types: t, template, assertVersion }) => {\n  assertVersion(\"^7.12.0\");\n\n  return {\n    name: \"proposal-class-static-block\",\n    inherits: syntaxClassStaticBlock.default,\n\n    pre() {\n      // Enable this in @babel/helper-create-class-features-plugin, so that it\n      // can be handled by the private fields and methods transform.\n      enableFeature(this.file, FEATURES.staticBlocks, /* loose */ false);\n    },\n\n    visitor: {\n      // Run on ClassBody and not on class so that if @babel/helper-create-class-features-plugin\n      // is enabled it can generate optimized output without passing from the intermediate\n      // private fields representation.\n      ClassBody(classBody) {\n        const { scope } = classBody;\n        const privateNames = new Set<string>();\n        const body = classBody.get(\"body\");\n        for (const path of body) {\n          if (path.isPrivate()) {\n            privateNames.add(path.get(\"key.id\").node.name);\n          }\n        }\n        for (const path of body) {\n          if (!path.isStaticBlock()) continue;\n          const staticBlockPrivateId = generateUid(scope, privateNames);\n          privateNames.add(staticBlockPrivateId);\n          const staticBlockRef = t.privateName(\n            t.identifier(staticBlockPrivateId),\n          );\n\n          let replacement;\n          const blockBody = path.node.body;\n          // We special-case the single expression case to avoid the iife, since\n          // it's common.\n          if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) {\n            replacement = t.inheritsComments(\n              blockBody[0].expression,\n              blockBody[0],\n            );\n          } else {\n            replacement = template.expression.ast`(() => { ${blockBody} })()`;\n          }\n\n          path.replaceWith(\n            t.classPrivateProperty(\n              staticBlockRef,\n              replacement,\n              [],\n              /* static */ true,\n            ),\n          );\n        }\n      },\n    },\n  };\n});\n"]}