{"version":3,"sources":["jsdelivr-header.js","/npm/component-react@1.0.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACJA,IAAI,MAAQ,QAAQ,SAChB,GAAK,QAAQ,MACb,KAAO,QAAQ,QACf,UAAY,QAAQ,eAAe,UAGvC,OAAO,QAAU,SAAS,EAAS,GACjC,EAAU,GAAW,CAAC,EAEtB,EAAQ,KAAK,kBAAkB,SAAS,EAAS,GAC/C,IAAI,EAAQ,EAAQ,OAAO,MAE3B,IAAK,EAAO,OAAO,IAEd,EAAQ,OAAO,UAClB,EAAQ,OAAO,QAAU,IAE3B,MAAM,KAAK,GAAO,SAAS,EAAM,GAC/B,IAAI,EAAO,KACP,EAAO,EAAQ,KAAK,GAGxB,IACE,EAAO,GAAG,aAAa,EAAM,OAC/B,CAAE,MAAM,GACN,OAAO,EAAK,IAAI,MAAM,uBAAyB,EAAO,IAAM,GAC9D,CAEA,IAAI,EAAU,UAAU,GACpB,EAAU,KAAK,SAAS,EAAM,KAAK,QAAQ,IAAS,MACxD,EAAQ,QAAQ,UAAW,EAAS,GAEpC,GACF,GAAG,EACL,GACF","file":"/npm/component-react@1.0.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/component-react@1.0.0/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","// component-less was used as the base, so will be very similar to that\n\nvar async = require('async')\n  , fs = require('fs')\n  , path = require('path')\n  , transform = require('react-tools').transform\n  ;\n\nmodule.exports = function(builder, options) {\n  options = options || {};\n\n  builder.hook('before scripts', function(builder, callback) {\n    var files = builder.config.react;\n\n    if (!files) return callback();\n\n    if (!builder.config.scripts)\n      builder.config.scripts = [];\n\n    async.each(files, function(file, done) {\n      var data = null\n        , orig = builder.path(file)\n        ;\n \n      try {\n        data = fs.readFileSync(orig, 'utf8');\n      } catch(error) {\n        return done(new Error('Error while reading ' + orig + ':' + error));\n      }\n \n      var newData = transform(data);\n      var newFile = path.basename(file, path.extname(file)) + '.js';\n      builder.addFile('scripts', newFile, newData);\n\n      done();\n    }, callback);\n  });\n}\n"]}