{"version":3,"file":"html-react-parser-BDC-zofm.js","sources":["../../node_modules/html-react-parser/lib/utilities.js","../../node_modules/html-react-parser/lib/attributes-to-props.js","../../node_modules/html-react-parser/lib/dom-to-react.js","../../node_modules/html-react-parser/index.js","../../node_modules/html-react-parser/index.mjs"],"sourcesContent":["var React = require('react');\nvar styleToJS = require('style-to-js').default;\n\n/**\n * Swap key with value in an object.\n *\n * @param {object} obj - The object.\n * @param {Function} [override] - The override method.\n * @returns - The inverted object.\n */\nfunction invertObject(obj, override) {\n  if (!obj || typeof obj !== 'object') {\n    throw new TypeError('First argument must be an object');\n  }\n\n  var key;\n  var value;\n  var isOverridePresent = typeof override === 'function';\n  var overrides = {};\n  var result = {};\n\n  for (key in obj) {\n    value = obj[key];\n\n    if (isOverridePresent) {\n      overrides = override(key, value);\n      if (overrides && overrides.length === 2) {\n        result[overrides[0]] = overrides[1];\n        continue;\n      }\n    }\n\n    if (typeof value === 'string') {\n      result[value] = key;\n    }\n  }\n\n  return result;\n}\n\n/**\n * Check if a given tag is a custom component.\n *\n * @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}\n *\n * @param {string} tagName - The name of the html tag.\n * @param {object} props - The props being passed to the element.\n * @returns - Whether tag is custom component.\n */\nfunction isCustomComponent(tagName, props) {\n  if (tagName.indexOf('-') === -1) {\n    return props && typeof props.is === 'string';\n  }\n\n  switch (tagName) {\n    // These are reserved SVG and MathML elements.\n    // We don't mind this whitelist too much because we expect it to never grow.\n    // The alternative is to track the namespace in a few places which is convoluted.\n    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n    case 'annotation-xml':\n    case 'color-profile':\n    case 'font-face':\n    case 'font-face-src':\n    case 'font-face-uri':\n    case 'font-face-format':\n    case 'font-face-name':\n    case 'missing-glyph':\n      return false;\n    default:\n      return true;\n  }\n}\n\nvar styleToJSOptions = { reactCompat: true };\n\n/**\n * Sets style prop.\n *\n * @param {null|undefined|string} style\n * @param {object} props\n */\nfunction setStyleProp(style, props) {\n  if (style === null || style === undefined) {\n    return;\n  }\n  try {\n    props.style = styleToJS(style, styleToJSOptions);\n  } catch (err) {\n    props.style = {};\n  }\n}\n\n/**\n * @constant {boolean}\n * @see {@link https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html}\n */\nvar PRESERVE_CUSTOM_ATTRIBUTES = React.version.split('.')[0] >= 16;\n\n// Taken from\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-dom/src/client/validateDOMNesting.js#L213\nvar elementsWithNoTextChildren = new Set([\n  'tr',\n  'tbody',\n  'thead',\n  'tfoot',\n  'colgroup',\n  'table',\n  'head',\n  'html',\n  'frameset'\n]);\n\n/**\n * Checks if the given node can contain text nodes\n *\n * @param {DomElement} node - Node.\n * @returns - Whether node can contain text nodes.\n */\nfunction canTextBeChildOfNode(node) {\n  return !elementsWithNoTextChildren.has(node.name);\n}\n\nmodule.exports = {\n  PRESERVE_CUSTOM_ATTRIBUTES: PRESERVE_CUSTOM_ATTRIBUTES,\n  invertObject: invertObject,\n  isCustomComponent: isCustomComponent,\n  setStyleProp: setStyleProp,\n  canTextBeChildOfNode: canTextBeChildOfNode,\n  elementsWithNoTextChildren: elementsWithNoTextChildren\n};\n","var reactProperty = require('react-property');\nvar utilities = require('./utilities');\n\n// https://reactjs.org/docs/uncontrolled-components.html\n// https://developer.mozilla.org/docs/Web/HTML/Attributes\nvar UNCONTROLLED_COMPONENT_ATTRIBUTES = ['checked', 'value'];\nvar UNCONTROLLED_COMPONENT_NAMES = ['input', 'select', 'textarea'];\n\nvar VALUE_ONLY_INPUTS = {\n  reset: true,\n  submit: true\n};\n\n/**\n * Converts HTML/SVG DOM attributes to React props.\n *\n * @param {object} [attributes={}] - HTML/SVG DOM attributes.\n * @param {string} [nodeName] - DOM node name.\n * @returns - React props.\n */\nmodule.exports = function attributesToProps(attributes, nodeName) {\n  attributes = attributes || {};\n\n  var attributeName;\n  var attributeNameLowerCased;\n  var attributeValue;\n  var propName;\n  var propertyInfo;\n  var props = {};\n  var inputIsValueOnly = attributes.type && VALUE_ONLY_INPUTS[attributes.type];\n\n  for (attributeName in attributes) {\n    attributeValue = attributes[attributeName];\n\n    // ARIA (aria-*) or custom data (data-*) attribute\n    if (reactProperty.isCustomAttribute(attributeName)) {\n      props[attributeName] = attributeValue;\n      continue;\n    }\n\n    // convert HTML/SVG attribute to React prop\n    attributeNameLowerCased = attributeName.toLowerCase();\n    propName = getPropName(attributeNameLowerCased);\n\n    if (propName) {\n      propertyInfo = reactProperty.getPropertyInfo(propName);\n\n      // convert attribute to uncontrolled component prop (e.g., `value` to `defaultValue`)\n      if (\n        UNCONTROLLED_COMPONENT_ATTRIBUTES.indexOf(propName) !== -1 &&\n        UNCONTROLLED_COMPONENT_NAMES.indexOf(nodeName) !== -1 &&\n        !inputIsValueOnly\n      ) {\n        propName = getPropName('default' + attributeNameLowerCased);\n      }\n\n      props[propName] = attributeValue;\n\n      switch (propertyInfo && propertyInfo.type) {\n        case reactProperty.BOOLEAN:\n          props[propName] = true;\n          break;\n        case reactProperty.OVERLOADED_BOOLEAN:\n          if (attributeValue === '') {\n            props[propName] = true;\n          }\n          break;\n      }\n      continue;\n    }\n\n    // preserve custom attribute if React >=16\n    if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {\n      props[attributeName] = attributeValue;\n    }\n  }\n\n  // transform inline style to object\n  utilities.setStyleProp(attributes.style, props);\n\n  return props;\n};\n\n/**\n * Gets prop name from lowercased attribute name.\n *\n * @param {string} attributeName - Lowercased attribute name.\n * @returns - Prop name.\n */\nfunction getPropName(attributeName) {\n  return reactProperty.possibleStandardNames[attributeName];\n}\n","var React = require('react');\nvar attributesToProps = require('./attributes-to-props');\nvar utilities = require('./utilities');\n\nvar setStyleProp = utilities.setStyleProp;\nvar canTextBeChildOfNode = utilities.canTextBeChildOfNode;\n\n/**\n * Converts DOM nodes to JSX element(s).\n *\n * @param {DomElement[]} nodes - DOM nodes.\n * @param {object} [options={}] - Options.\n * @param {Function} [options.replace] - Replacer.\n * @param {object} [options.library] - Library (React, Preact, etc.).\n * @returns - String or JSX element(s).\n */\nfunction domToReact(nodes, options) {\n  options = options || {};\n\n  var library = options.library || React;\n  var cloneElement = library.cloneElement;\n  var createElement = library.createElement;\n  var isValidElement = library.isValidElement;\n\n  var result = [];\n  var node;\n  var isWhitespace;\n  var hasReplace = typeof options.replace === 'function';\n  var replaceElement;\n  var props;\n  var children;\n  var trim = options.trim;\n\n  for (var i = 0, len = nodes.length; i < len; i++) {\n    node = nodes[i];\n\n    // replace with custom React element (if present)\n    if (hasReplace) {\n      replaceElement = options.replace(node);\n\n      if (isValidElement(replaceElement)) {\n        // set \"key\" prop for sibling elements\n        // https://fb.me/react-warning-keys\n        if (len > 1) {\n          replaceElement = cloneElement(replaceElement, {\n            key: replaceElement.key || i\n          });\n        }\n        result.push(replaceElement);\n        continue;\n      }\n    }\n\n    if (node.type === 'text') {\n      isWhitespace = !node.data.trim().length;\n\n      if (isWhitespace && node.parent && !canTextBeChildOfNode(node.parent)) {\n        // We have a whitespace node that can't be nested in its parent\n        // so skip it\n        continue;\n      }\n\n      if (trim && isWhitespace) {\n        // Trim is enabled and we have a whitespace node\n        // so skip it\n        continue;\n      }\n\n      // We have a text node that's not whitespace and it can be nested\n      // in its parent so add it to the results\n      result.push(node.data);\n      continue;\n    }\n\n    props = node.attribs;\n    if (skipAttributesToProps(node)) {\n      setStyleProp(props.style, props);\n    } else if (props) {\n      props = attributesToProps(props, node.name);\n    }\n\n    children = null;\n\n    switch (node.type) {\n      case 'script':\n      case 'style':\n        // prevent text in <script> or <style> from being escaped\n        // https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml\n        if (node.children[0]) {\n          props.dangerouslySetInnerHTML = {\n            __html: node.children[0].data\n          };\n        }\n        break;\n\n      case 'tag':\n        // setting textarea value in children is an antipattern in React\n        // https://reactjs.org/docs/forms.html#the-textarea-tag\n        if (node.name === 'textarea' && node.children[0]) {\n          props.defaultValue = node.children[0].data;\n        } else if (node.children && node.children.length) {\n          // continue recursion of creating React elements (if applicable)\n          children = domToReact(node.children, options);\n        }\n        break;\n\n      // skip all other cases (e.g., comment)\n      default:\n        continue;\n    }\n\n    // set \"key\" prop for sibling elements\n    // https://fb.me/react-warning-keys\n    if (len > 1) {\n      props.key = i;\n    }\n\n    result.push(createElement(node.name, props, children));\n  }\n\n  return result.length === 1 ? result[0] : result;\n}\n\n/**\n * Determines whether DOM element attributes should be transformed to props.\n * Web Components should not have their attributes transformed except for `style`.\n *\n * @param {DomElement} node\n * @returns - Whether node attributes should be converted to props.\n */\nfunction skipAttributesToProps(node) {\n  return (\n    utilities.PRESERVE_CUSTOM_ATTRIBUTES &&\n    node.type === 'tag' &&\n    utilities.isCustomComponent(node.name, node.attribs)\n  );\n}\n\nmodule.exports = domToReact;\n","var domhandler = require('domhandler');\nvar htmlToDOM = require('html-dom-parser');\n\nvar attributesToProps = require('./lib/attributes-to-props');\nvar domToReact = require('./lib/dom-to-react');\n\n// support backwards compatibility for ES Module\nhtmlToDOM =\n  /* istanbul ignore next */\n  typeof htmlToDOM.default === 'function' ? htmlToDOM.default : htmlToDOM;\n\nvar domParserOptions = { lowerCaseAttributeNames: false };\n\n/**\n * Converts HTML string to React elements.\n *\n * @param {string} html - HTML string.\n * @param {object} [options] - Parser options.\n * @param {object} [options.htmlparser2] - htmlparser2 options.\n * @param {object} [options.library] - Library for React, Preact, etc.\n * @param {Function} [options.replace] - Replace method.\n * @returns {JSX.Element|JSX.Element[]|string} - React element(s), empty array, or string.\n */\nfunction HTMLReactParser(html, options) {\n  if (typeof html !== 'string') {\n    throw new TypeError('First argument must be a string');\n  }\n  if (html === '') {\n    return [];\n  }\n  options = options || {};\n  return domToReact(\n    htmlToDOM(html, options.htmlparser2 || domParserOptions),\n    options\n  );\n}\n\nHTMLReactParser.domToReact = domToReact;\nHTMLReactParser.htmlToDOM = htmlToDOM;\nHTMLReactParser.attributesToProps = attributesToProps;\n\n// domhandler\nHTMLReactParser.Comment = domhandler.Comment;\nHTMLReactParser.Element = domhandler.Element;\nHTMLReactParser.ProcessingInstruction = domhandler.ProcessingInstruction;\nHTMLReactParser.Text = domhandler.Text;\n\n// support CommonJS and ES Modules\nmodule.exports = HTMLReactParser;\nHTMLReactParser.default = HTMLReactParser;\n","import HTMLReactParser from './index.js';\n\nexport var domToReact = HTMLReactParser.domToReact;\nexport var htmlToDOM = HTMLReactParser.htmlToDOM;\nexport var attributesToProps = HTMLReactParser.attributesToProps;\n\n// domhandler\nexport var Comment = HTMLReactParser.Comment;\nexport var Element = HTMLReactParser.Element;\nexport var ProcessingInstruction = HTMLReactParser.ProcessingInstruction;\nexport var Text = HTMLReactParser.Text;\n\nexport default HTMLReactParser;\n"],"names":["React","require$$0","styleToJS","require$$1","invertObject","obj","override","key","value","isOverridePresent","overrides","result","isCustomComponent","tagName","props","styleToJSOptions","setStyleProp","style","PRESERVE_CUSTOM_ATTRIBUTES","elementsWithNoTextChildren","canTextBeChildOfNode","node","utilities","reactProperty","UNCONTROLLED_COMPONENT_ATTRIBUTES","UNCONTROLLED_COMPONENT_NAMES","VALUE_ONLY_INPUTS","attributesToProps","attributes","nodeName","attributeName","attributeNameLowerCased","attributeValue","propName","propertyInfo","inputIsValueOnly","getPropName","require$$2","domToReact","nodes","options","library","cloneElement","createElement","isValidElement","isWhitespace","hasReplace","replaceElement","children","trim","i","len","skipAttributesToProps","domToReact_1","domhandler","htmlToDOM","require$$3","domParserOptions","HTMLReactParser","html","htmlReactParser"],"mappings":"wlBAAA,IAAIA,EAAQC,EACRC,EAAYC,EAAuB,QASvC,SAASC,EAAaC,EAAKC,EAAU,CACnC,GAAI,CAACD,GAAO,OAAOA,GAAQ,SACzB,MAAM,IAAI,UAAU,kCAAkC,EAGxD,IAAIE,EACAC,EACAC,EAAoB,OAAOH,GAAa,WACxCI,EAAY,CAAE,EACdC,EAAS,CAAE,EAEf,IAAKJ,KAAOF,EAAK,CAGf,GAFAG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