{"version":3,"sources":["webpack:///./node_modules/html-to-react/index.js","webpack:///./node_modules/html-to-react/lib/processing-instructions.js","webpack:///./node_modules/html-to-react/lib/process-node-definitions.js","webpack:///./node_modules/html-to-react/lib/utils.js","webpack:///./node_modules/html-to-react/lib/is-valid-node-definitions.js","webpack:///./node_modules/html-to-react/lib/parser.js","webpack:///./node_modules/html-to-react/lib/should-process-node-definitions.js","webpack:///./node_modules/html-to-react/lib/camel-case-attribute-names.js"],"names":["parser","processingInstructions","isValidNodeDefinitions","processNodeDefinitions","module","exports","Parser","ProcessingInstructions","IsValidNodeDefinitions","ProcessNodeDefinitions","ShouldProcessNodeDefinitions","defaultProcessingInstructions","shouldProcessNode","shouldProcessEveryNode","processNode","processDefaultNode","ent","utils","voidElementTags","node","children","index","type","decode","data","indexOf","name","createElement","camelize","toPairs","reduce","React","camelCaseAttrMap","elementProps","key","attribs","result","keyAndValue","value","replace","createStyleJsonFromString","styleString","singleStyle","styles","split","jsonStyles","i","length","allChildren","concat","apply","alwaysValid","find","reject","addIndex","map","htmlParser","Html2ReactParser","options","parseWithInstructions","html","isValidNode","domTree","parseHtmlToTree","handler","DomHandler","parseComplete","dom","Error","traverseDom","processingInstruction","childrenPromise","x","child","Promise","all","then","parse","camelCaseMap","soFar","attr","lower","toLowerCase"],"mappings":"4FAEA,IAAIA,EAAS,EAAQ,KACjBC,EAAyB,EAAQ,KACjCC,EAAyB,EAAQ,KACjCC,EAAyB,EAAQ,KAErCC,EAAOC,QAAU,CACfC,OAAQN,EACRO,uBAAwBN,EACxBO,uBAAwBN,EACxBO,uBAAwBN,I,iCCV1B,IAAIO,EAA+B,EAAQ,KACvCD,EAAyB,EAAQ,KAarCL,EAAOC,QAXP,SAASE,yBACP,IAAIJ,EAAyB,IAAIM,EAEjC,MAAO,CACLE,8BAA+B,CAAC,CAC9BC,kBAAmBF,EAA6BG,uBAChDC,YAAaX,EAAuBY,wB,iCCT1C,IAAIC,EAAM,EAAQ,KACdC,EAAQ,EAAQ,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,KAAM,KAAM,oBAAqB,qBAAsB,UAAW,cAClE,eAAgB,aAAc,cAAe,WAAY,eAAgB,gBACzE,SAAU,eAAgB,UAAW,WAAY,cAAe,cAAe,UAC/E,aAAc,aAAc,SAAU,cAAe,cAAe,IAAK,KAAM,KAC/E,mBAAoB,UAAW,eAAgB,eAAgB,YAAa,YAC5E,YAAa,aAAc,YAAa,UAAW,UAAW,WAAY,IAAK,KAAM,KACrF,mBAAoB,IAAK,eAMxBnB,QAAO,SAAUiD,EAAOC,GACvB,IAAIC,EAAQD,EAAKE,cAIjB,OAHID,IAAUD,IACZD,EAAME,GAASD,GAEVD,IACN,IAEL3E,EAAOC,QAAUyE","file":"npm.html-to-react-bc18f86490a5e6719edb.js","sourcesContent":["'use strict';\n\nvar parser = require('./lib/parser');\nvar processingInstructions = require('./lib/processing-instructions');\nvar isValidNodeDefinitions = require('./lib/is-valid-node-definitions');\nvar processNodeDefinitions = require('./lib/process-node-definitions');\n\nmodule.exports = {\n Parser: parser,\n ProcessingInstructions: processingInstructions,\n IsValidNodeDefinitions: isValidNodeDefinitions,\n ProcessNodeDefinitions: processNodeDefinitions,\n};\n","'use strict';\nvar ShouldProcessNodeDefinitions = require('./should-process-node-definitions');\nvar ProcessNodeDefinitions = require('./process-node-definitions');\n\nfunction ProcessingInstructions() {\n var processNodeDefinitions = new ProcessNodeDefinitions();\n\n return {\n defaultProcessingInstructions: [{\n shouldProcessNode: ShouldProcessNodeDefinitions.shouldProcessEveryNode,\n processNode: processNodeDefinitions.processDefaultNode,\n },],\n };\n};\n\nmodule.exports = ProcessingInstructions;\n","'use strict';\nvar ent = require('ent');\nvar utils = require('./utils');\n\n// https://github.com/facebook/react/blob/15.0-stable/src/renderers/dom/shared/ReactDOMComponent.js#L457\nvar voidElementTags = [\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param',\n 'source', 'track', 'wbr', 'menuitem', 'textarea',\n];\n\nfunction ProcessNodeDefinitions() {\n function processDefaultNode(node, children, index) {\n if (node.type === 'text') {\n return ent.decode(node.data);\n } else if (node.type === 'comment') {\n // FIXME: The following doesn't work as the generated HTML results in\n // \"<!-- This is a comment -->\"\n // return '';\n return false;\n }\n\n if (voidElementTags.indexOf(node.name) > -1) {\n return utils.createElement(node, index);\n } else {\n return utils.createElement(node, index, node.data, children);\n }\n }\n\n return {\n processDefaultNode: processDefaultNode,\n };\n}\n\nmodule.exports = ProcessNodeDefinitions;\n","'use strict';\nvar camelize = require('underscore.string.fp/camelize');\nvar toPairs = require('ramda/src/toPairs');\nvar reduce = require('ramda/src/reduce');\nvar React = require('react');\nvar camelCaseAttrMap = require('./camel-case-attribute-names');\n\nfunction createStyleJsonFromString(styleString) {\n if (!styleString) {\n return {};\n }\n var styles = styleString.split(';');\n var singleStyle, key, value, jsonStyles = {};\n for (var i = 0; i < styles.length; i++) {\n singleStyle = styles[i].split(':');\n key = camelize(singleStyle[0]);\n value = singleStyle[1];\n if (key.length > 0 && value.length > 0) {\n jsonStyles[key] = value;\n }\n }\n return jsonStyles;\n}\n\nfunction createElement(node, index, data, children) {\n var elementProps = {\n key: index,\n };\n if (node.attribs) {\n elementProps = reduce(function(result, keyAndValue) {\n var key = keyAndValue[0];\n var value = keyAndValue[1];\n key = camelCaseAttrMap[key.replace(/-/, '')] || key;\n if (key === 'style') {\n value = createStyleJsonFromString(value);\n } else if (key === 'class') {\n key = 'className';\n }\n result[key] = value || key;\n return result;\n }, elementProps, toPairs(node.attribs));\n }\n\n children = children || [];\n var allChildren = data != null ? [data,].concat(children) : children;\n return React.createElement.apply(\n null, [node.name, elementProps,].concat(allChildren)\n );\n}\n\nmodule.exports = {\n createElement: createElement,\n};\n","'use strict';\nfunction alwaysValid() {\n return true;\n}\n\nmodule.exports = {\n alwaysValid: alwaysValid,\n};\n","'use strict';\nvar find = require('ramda/src/find');\nvar reject = require('ramda/src/reject');\nvar addIndex = require('ramda/src/addIndex');\nvar map = require('ramda/src/map');\nvar htmlParser = require('htmlparser2');\nvar ProcessingInstructions = require('./processing-instructions');\nvar IsValidNodeDefinitions = require('./is-valid-node-definitions');\nvar utils = require('./utils');\n\nfunction Html2ReactParser(options) {\n function parseHtmlToTree(html) {\n var handler = new htmlParser.DomHandler();\n var parser = new htmlParser.Parser(handler, options);\n parser.parseComplete(html);\n return handler.dom;\n };\n\n function traverseDom(node, isValidNode, processingInstructions, index) {\n if (isValidNode(node)) {\n var processingInstruction = find(function (processingInstruction) {\n return processingInstruction.shouldProcessNode(node);\n }, processingInstructions);\n if (processingInstruction != null) {\n var childrenPromise = reject(function (x) {return x == null || x === false;},\n addIndex(map)(function (child, i) {\n return traverseDom(child, isValidNode, processingInstructions, i);\n }, node.children || []));\n return Promise.all(childrenPromise).then(\n function(children) {\n return processingInstruction.processNode(node, children, index);\n }\n );\n } else {\n return false;\n }\n } else {\n return false;\n }\n };\n\n function parseWithInstructions(html, isValidNode, processingInstructions) {\n var domTree = parseHtmlToTree(html);\n // TODO: Deal with HTML that contains more than one root level node\n if (domTree && domTree.length !== 1) {\n throw new Error(\n 'html-to-react currently only supports HTML with one single root element. ' +\n 'The HTML provided contains ' + domTree.length +\n ' root elements. You can fix that by simply wrapping your HTML ' +\n 'in a