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,OAAO,EAAQ,EAAK,MAAM,IAG5B,IAAI,EAAO,QAAQ,KAAK,KAAK,EAAK,KAAK,KAAM,IACzC,EAAS,GAEb,EAAO,EAAc,SAAK,EAC1B,EAAO,MAAM,cAAc,GAE3B,EAAO,KAAK,EAAK,KAAK,OAAQ,MAAM,qBAAqB,EAAK,KAE9D,EAAS,EAAO,KAAK,IACjB,EAAK,KAAK,SAAQ,EAAS,MAAM,IAEjC,EAAK,KAAK,QAAO,EAAK,MAAM,GAAY,GAE5C,EAAQ,EACV,GACF,KAGK,CACR,CApDU,GAsDX,KAAK,MAAQ,CAAC,EAEd,OAAO,QAAU,SAAU,GACzB,OAAO,IAAI,KAAK,EAClB","file":"/npm/react-views@1.0.4/build/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-views@1.0.4/build/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","'use strict';\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar path = require('path'),\n    clean = require('js-beautify').html,\n    jsx = require('node-jsx'),\n    React = require('react');\n\nvar View = (function () {\n  function View(options) {\n    _classCallCheck(this, View);\n\n    options = options || {};\n\n    options.cache = options.cache || false;\n    options.markup = options.markup || '<!doctype html>';\n    options.path = options.path || process.cwd();\n    options.pretty = options.pretty || false;\n\n    this.opts = options;\n\n    jsx.install(options.jsx || { extension: '.jsx' });\n  }\n\n  _createClass(View, [{\n    key: 'flush',\n    value: function flush(key) {\n      if (key) return delete View.cache[key];\n      View.cache = {};\n    }\n  }, {\n    key: 'render',\n    value: function render(template, locals) {\n      var self = this;\n      locals = locals || {};\n\n      return new Promise(function (resolve, reject) {\n        if (View.cache[template] && self.opts.cache) {\n          return resolve(View.cache[template]);\n        }\n\n        var view = require(path.join(self.opts.path, template)),\n            output = [];\n\n        view = view['default'] || view;\n        view = React.createFactory(view);\n\n        output.push(self.opts.markup, React.renderToStaticMarkup(view(locals)));\n\n        output = output.join('');\n        if (self.opts.pretty) output = clean(output);\n\n        if (self.opts.cache) View.cache[template] = output;\n\n        resolve(output);\n      });\n    }\n  }]);\n\n  return View;\n})();\n\nView.cache = {};\n\nmodule.exports = function (options) {\n  return new View(options);\n};"]}