!(function (o) { var t = o.util.clone(o.languages.javascript), e = '(?:\\{*\\.{3}(?:[^{}]|)*\\})'; function n(t, n) { return ( (t = t .replace(//g, function () { return '(?:\\s|//.*(?!.)|/\\*(?:[^*]|\\*(?!/))\\*/)'; }) .replace(//g, function () { return '(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})'; }) .replace(//g, function () { return e; })), RegExp(t, n) ); } (e = n(e).source), (o.languages.jsx = o.languages.extend('markup', t)), (o.languages.jsx.tag.pattern = n( '+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[^]|[^\\\\"])*"|\'(?:\\\\[^]|[^\\\\\'])*\'|[^\\s{\'"/>=]+|))?|))**/?)?>' )), (o.languages.jsx.tag.inside.tag.pattern = /^<\/?[^\s>\/]*/), (o.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/), (o.languages.jsx.tag.inside.tag.inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/), (o.languages.jsx.tag.inside.comment = t.comment), o.languages.insertBefore( 'inside', 'attr-name', { spread: { pattern: n(''), inside: o.languages.jsx } }, o.languages.jsx.tag ), o.languages.insertBefore( 'inside', 'special-attr', { script: { pattern: n('='), alias: 'language-javascript', inside: { 'script-punctuation': { pattern: /^=(?=\{)/, alias: 'punctuation' }, rest: o.languages.jsx, }, }, }, o.languages.jsx.tag ); var i = function (t) { return t ? 'string' == typeof t ? t : 'string' == typeof t.content ? t.content : t.content.map(i).join('') : ''; }, r = function (t) { for (var n = [], e = 0; e < t.length; e++) { var a = t[e], s = !1; if ( ('string' != typeof a && ('tag' === a.type && a.content[0] && 'tag' === a.content[0].type ? '' === a.content[a.content.length - 1].content || n.push({ tagName: i(a.content[0].content[1]), openedBraces: 0, }) : 0 < n.length && 'punctuation' === a.type && '{' === a.content ? n[n.length - 1].openedBraces++ : 0 < n.length && 0 < n[n.length - 1].openedBraces && 'punctuation' === a.type && '}' === a.content ? n[n.length - 1].openedBraces-- : (s = !0)), (s || 'string' == typeof a) && 0 < n.length && 0 === n[n.length - 1].openedBraces) ) { var g = i(a); e < t.length - 1 && ('string' == typeof t[e + 1] || 'plain-text' === t[e + 1].type) && ((g += i(t[e + 1])), t.splice(e + 1, 1)), 0 < e && ('string' == typeof t[e - 1] || 'plain-text' === t[e - 1].type) && ((g = i(t[e - 1]) + g), t.splice(e - 1, 1), e--), (t[e] = new o.Token('plain-text', g, null, g)); } a.content && 'string' != typeof a.content && r(a.content); } }; o.hooks.add('after-tokenize', function (t) { ('jsx' !== t.language && 'tsx' !== t.language) || r(t.tokens); }); })(Prism);