{"version":3,"sources":["jsdelivr-header.js","/npm/@babel/plugin-transform-react-jsx-source@7.27.1/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,2FCQA,IAAA,mBAAA,QAAA,8BACA,MAAA,QAAA,eAEA,MAAM,SAAW,WACX,cAAgB,eAEhB,sBAAwB,CAC5B,EACA,IAC8B,MAAP,EAAc,YAAE,cAAgB,EAAG,GAAM,IAAA,SAAA,QAAA,SAKnD,EAAA,6BAAe,IAC5B,EAAI,cAA+B,GAmBnC,MAAM,EAAgB,GACpB,YAAE,eAAe,IAAS,EAAK,KAAK,OAAS,SAE/C,MAAO,CACL,KAAM,6BACN,QAAS,CACP,kBAAkB,EAAM,GACtB,MAAM,KAAE,GAAS,EACjB,GAEG,EAAK,MAEN,EAAK,KAAK,WAAW,KAAK,GAJ5B,CASA,IAAK,EAAM,mBAAoB,CAC7B,MAAM,EAAa,EAAK,MAAM,sBAAsB,eACpD,EAAM,mBAAqB,EAE3B,EAAK,MAAM,mBAAmB,KAAK,CACjC,GAAI,EACJ,KAAM,YAAE,cAAc,EAAM,UAAY,KAE5C,CAEA,EAAK,WAAW,KACd,YAAE,aACA,YAAE,cAAc,UAChB,YAAE,uBA/CZ,SACE,GACA,KAAE,EAAI,OAAE,IAER,MAAM,EAAkB,sBAAsB,EAAM,YAAE,gBAChD,EAAoB,sBAAsB,GAAQ,GAEtD,YAAE,eAAe,EAAI,KAGvB,OAAO,eAAS,WAAW,GAAG;kBAChB;oBACE;sBACE;MAEpB,CAiCY,CAAU,YAAE,UAAU,EAAM,oBAAqB,EAAK,IAAI,SAhBhE,CAoBF,GAEH","file":"/npm/@babel/plugin-transform-react-jsx-source@7.27.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@babel/plugin-transform-react-jsx-source@7.27.1/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","/**\n * This adds {fileName, lineNumber, columnNumber} annotations to JSX tags.\n *\n * NOTE: lineNumber and columnNumber are both 1-based.\n *\n * == JSX Literals ==\n *\n * <sometag />\n *\n * becomes:\n *\n * var __jsxFileName = 'this/file.js';\n * <sometag __source={{fileName: __jsxFileName, lineNumber: 10, columnNumber: 1}}/>\n */\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t, template } from \"@babel/core\";\n\nconst TRACE_ID = \"__source\";\nconst FILE_NAME_VAR = \"_jsxFileName\";\n\nconst createNodeFromNullish = <T, N extends t.Node>(\n  val: T | null,\n  fn: (val: T) => N,\n): N | t.NullLiteral => (val == null ? t.nullLiteral() : fn(val));\n\ntype State = {\n  fileNameIdentifier: t.Identifier;\n};\nexport default declare<State>(api => {\n  api.assertVersion(REQUIRED_VERSION(7));\n\n  function makeTrace(\n    fileNameIdentifier: t.Identifier,\n    { line, column }: { line: number; column: number },\n  ) {\n    const fileLineLiteral = createNodeFromNullish(line, t.numericLiteral);\n    const fileColumnLiteral = createNodeFromNullish(column, c =>\n      // c + 1 to make it 1-based instead of 0-based.\n      t.numericLiteral(c + 1),\n    );\n\n    return template.expression.ast`{\n      fileName: ${fileNameIdentifier},\n      lineNumber: ${fileLineLiteral},\n      columnNumber: ${fileColumnLiteral},\n    }`;\n  }\n\n  const isSourceAttr = (attr: t.Node) =>\n    t.isJSXAttribute(attr) && attr.name.name === TRACE_ID;\n\n  return {\n    name: \"transform-react-jsx-source\",\n    visitor: {\n      JSXOpeningElement(path, state) {\n        const { node } = path;\n        if (\n          // the element was generated and doesn't have location information\n          !node.loc ||\n          // Already has __source\n          path.node.attributes.some(isSourceAttr)\n        ) {\n          return;\n        }\n\n        if (!state.fileNameIdentifier) {\n          const fileNameId = path.scope.generateUidIdentifier(FILE_NAME_VAR);\n          state.fileNameIdentifier = fileNameId;\n\n          path.scope.getProgramParent().push({\n            id: fileNameId,\n            init: t.stringLiteral(state.filename || \"\"),\n          });\n        }\n\n        node.attributes.push(\n          t.jsxAttribute(\n            t.jsxIdentifier(TRACE_ID),\n            t.jsxExpressionContainer(\n              makeTrace(t.cloneNode(state.fileNameIdentifier), node.loc.start),\n            ),\n          ),\n        );\n      },\n    },\n  };\n});\n"]}