{"version":3,"sources":["node_modules\\react-dom\\lib\\setInnerHTML.js"],"names":["ExecutionEnvironment","require","DOMNamespaces","WHITESPACE_TEST","NONVISIBLE_TEST","createMicrosoftUnsafeLocalFunction","reusableSVGContainer","setInnerHTML","node","html","namespaceURI","svg","document","createElement","innerHTML","svgNode","firstChild","appendChild","canUseDOM","testElement","parentNode","replaceChild","test","String","fromCharCode","textNode","data","length","removeChild","deleteData","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,sBAAuBC,QAAQ,+BAAR,CAA3B;AACA,GAAIC,eAAgBD,QAAQ,iBAAR,CAApB;;AAEA,GAAIE,iBAAkB,cAAtB;AACA,GAAIC,iBAAkB,sDAAtB;;AAEA,GAAIC,oCAAqCJ,QAAQ,sCAAR,CAAzC;;;AAGA,GAAIK,qBAAJ;;;;;;;;;;AAUA,GAAIC,cAAeF,mCAAmC,SAAUG,IAAV,CAAgBC,IAAhB,CAAsB;;;;AAI1E,GAAID,KAAKE,YAAL,GAAsBR,cAAcS,GAApC,EAA2C,EAAE,aAAeH,KAAjB,CAA/C,CAAuE;AACrEF,qBAAuBA,sBAAwBM,SAASC,aAAT,CAAuB,KAAvB,CAA/C;AACAP,qBAAqBQ,SAArB,CAAiC,QAAUL,IAAV,CAAiB,QAAlD;AACA,GAAIM,SAAUT,qBAAqBU,UAAnC;AACA,MAAOD,QAAQC,UAAf,CAA2B;AACzBR,KAAKS,WAAL,CAAiBF,QAAQC,UAAzB;AACD;AACF,CAPD,IAOO;AACLR,KAAKM,SAAL,CAAiBL,IAAjB;AACD;AACF,CAdkB,CAAnB;;AAgBA,GAAIT,qBAAqBkB,SAAzB,CAAoC;;;;;;;AAOlC,GAAIC,aAAcP,SAASC,aAAT,CAAuB,KAAvB,CAAlB;AACAM,YAAYL,SAAZ,CAAwB,GAAxB;AACA,GAAIK,YAAYL,SAAZ,GAA0B,EAA9B,CAAkC;AAChCP,aAAe,sBAAUC,IAAV,CAAgBC,IAAhB,CAAsB;;;;;;AAMnC,GAAID,KAAKY,UAAT,CAAqB;AACnBZ,KAAKY,UAAL,CAAgBC,YAAhB,CAA6Bb,IAA7B,CAAmCA,IAAnC;AACD;;;;;;AAMD,GAAIL,gBAAgBmB,IAAhB,CAAqBb,IAArB,GAA8BA,KAAK,CAAL,IAAY,GAAZ,EAAmBL,gBAAgBkB,IAAhB,CAAqBb,IAArB,CAArD,CAAiF;;;;;;;AAO/ED,KAAKM,SAAL,CAAiBS,OAAOC,YAAP,CAAoB,MAApB,EAA8Bf,IAA/C;;;;AAIA,GAAIgB,UAAWjB,KAAKQ,UAApB;AACA,GAAIS,SAASC,IAAT,CAAcC,MAAd,GAAyB,CAA7B,CAAgC;AAC9BnB,KAAKoB,WAAL,CAAiBH,QAAjB;AACD,CAFD,IAEO;AACLA,SAASI,UAAT,CAAoB,CAApB,CAAuB,CAAvB;AACD;AACF,CAjBD,IAiBO;AACLrB,KAAKM,SAAL,CAAiBL,IAAjB;AACD;AACF,CAlCD;AAmCD;AACDU,YAAc,IAAd;AACD;;AAEDW,OAAOC,OAAP,CAAiBxB,YAAjB","file":"setInnerHTML.js","sourceRoot":"D:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');\nvar DOMNamespaces = require('./DOMNamespaces');\n\nvar WHITESPACE_TEST = /^[ \\r\\n\\t\\f]/;\nvar NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \\r\\n\\t\\f\\/>]/;\n\nvar createMicrosoftUnsafeLocalFunction = require('./createMicrosoftUnsafeLocalFunction');\n\n// SVG temp container for IE lacking innerHTML\nvar reusableSVGContainer;\n\n/**\n * Set the innerHTML property of a node, ensuring that whitespace is preserved\n * even in IE8.\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n  // IE does not have innerHTML for SVG nodes, so instead we inject the\n  // new markup in a temp node and then move the child nodes across into\n  // the target node\n  if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) {\n    reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n    reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';\n    var svgNode = reusableSVGContainer.firstChild;\n    while (svgNode.firstChild) {\n      node.appendChild(svgNode.firstChild);\n    }\n  } else {\n    node.innerHTML = html;\n  }\n});\n\nif (ExecutionEnvironment.canUseDOM) {\n  // IE8: When updating a just created node with innerHTML only leading\n  // whitespace is removed. When updating an existing node with innerHTML\n  // whitespace in root TextNodes is also collapsed.\n  // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html\n\n  // Feature detection; only IE8 is known to behave improperly like this.\n  var testElement = document.createElement('div');\n  testElement.innerHTML = ' ';\n  if (testElement.innerHTML === '') {\n    setInnerHTML = function (node, html) {\n      // Magic theory: IE8 supposedly differentiates between added and updated\n      // nodes when processing innerHTML, innerHTML on updated nodes suffers\n      // from worse whitespace behavior. Re-adding a node like this triggers\n      // the initial and more favorable whitespace behavior.\n      // TODO: What to do on a detached node?\n      if (node.parentNode) {\n        node.parentNode.replaceChild(node, node);\n      }\n\n      // We also implement a workaround for non-visible tags disappearing into\n      // thin air on IE8, this only happens if there is no visible text\n      // in-front of the non-visible tags. Piggyback on the whitespace fix\n      // and simply check if any non-visible tags appear in the source.\n      if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) {\n        // Recover leading whitespace by temporarily prepending any character.\n        // \\uFEFF has the potential advantage of being zero-width/invisible.\n        // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode\n        // in hopes that this is preserved even if \"\\uFEFF\" is transformed to\n        // the actual Unicode character (by Babel, for example).\n        // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216\n        node.innerHTML = String.fromCharCode(0xfeff) + html;\n\n        // deleteData leaves an empty `TextNode` which offsets the index of all\n        // children. Definitely want to avoid this.\n        var textNode = node.firstChild;\n        if (textNode.data.length === 1) {\n          node.removeChild(textNode);\n        } else {\n          textNode.deleteData(0, 1);\n        }\n      } else {\n        node.innerHTML = html;\n      }\n    };\n  }\n  testElement = null;\n}\n\nmodule.exports = setInnerHTML;"]}