r = []; return ( e.split('').forEach(function (o) { n.every(function (n) { if (-1 !== n.indexOf(o)) { if (r.indexOf(n) > -1) return !1; (e = e.replace( new RegExp('[' + n + ']', 'gm' + t), '[' + n + ']' )), r.push(n); } return !0; }); }), e ); } }, { key: 'createMergedBlanksRegExp', value: function (e) { return e.replace(/[\\s]+/gim, '[\\\\s]+'); } }, { key: 'createAccuracyRegExp', value: function (e) { var t = this, n = this.opt.accuracy, r = 'string' == typeof n ? n : n.value, o = 'string' == typeof n ? [] : n.limiters, i = ''; switch ( (o.forEach(function (e) { i += '|' + t.escapeStr(e); }), r) ) { case 'partially': default: return '()(' + e + ')'; case 'complementary': return ( '()([^' + (i = '\\\\s' + (i || this.escapeStr( '!"#$%&\\'()*+,-./:;<=>?@[\\\\]^_\`{|}~\xA1\xBF' ))) + ']*' + e + '[^' + i + ']*)' ); case 'exactly': return ( '(^|\\\\s' + i + ')(' + e + ')(?=$|\\\\s' + i + ')' ); } } }, { key: 'getSeparatedKeywords', value: function (e) { var t = this, n = []; return ( e.forEach(function (e) { t.opt.separateWordSearch ? e.split(' ').forEach(function (e) { e.trim() && -1 === n.indexOf(e) && n.push(e); }) : e.trim() && -1 === n.indexOf(e) && n.push(e); }), { keywords: n.sort(function (e, t) { return t.length - e.length; }), length: n.length } ); } }, { key: 'isNumeric', value: function (e) { return Number(parseFloat(e)) == e; } }, { key: 'checkRanges', value: function (e) { var t = this; if ( !Array.isArray(e) || '[object Object]' !== Object.prototype.toString.call(e[0]) ) return ( this.log( 'markRanges() will only accept an array of objects' ), this.opt.noMatch(e), [] ); var n = [], r = 0; return ( e .sort(function (e, t) { return e.start - t.start; }) .forEach(function (e) { var o = t.callNoMatchOnInvalidRanges(e, r), i = o.start, a = o.end; o.valid && ((e.start = i), (e.length = a - i), n.push(e), (r = a)); }), n ); } }, { key: 'callNoMatchOnInvalidRanges', value: function (e, t) { var n = void 0, r = void 0, o = !1; return ( e && void 0 !== e.start ? ((r = (n = parseInt(e.start, 10)) + parseInt(e.length, 10)), this.isNumeric(e.start) && this.isNumeric(e.length) && r - t > 0 && r - n > 0 ? (o = !0) : (this.log( 'Ignoring invalid or overlapping range: ' + JSON.stringify(e) ), this.opt.noMatch(e))) : (this.log( 'Ignoring invalid range: ' + JSON.stringify(e) ), this.opt.noMatch(e)), { start: n, end: r, valid: o } ); } }, { key: 'checkWhitespaceRanges', value: function (e, t, n) { var r = void 0, o = !0, i = n.length, a = t - i, s = parseInt(e.start, 10) - a; return ( (r = (s = s > i ? i : s) + parseInt(e.length, 10)) > i && ((r = i), this.log( 'End range automatically set to the max value of ' + i )), s < 0 || r - s < 0 || s > i || r > i ? ((o = !1), this.log('Invalid range: ' + JSON.stringify(e)), this.opt.noMatch(e)) : '' === n.substring(s, r).replace(/\\s+/g, '') && ((o = !1), this.log( 'Skipping whitespace only range: ' + JSON.stringify(e) ), this.opt.noMatch(e)), { start: s, end: r, valid: o } ); } }, { key: 'getTextNodes', value: function (e) { var t = this, n = '', r = []; this.iterator.forEachNode( NodeFilter.SHOW_TEXT, function (e) { r.push({ start: n.length, end: (n += e.textContent).length, node: e }); }, function (e) { return t.matchesExclude(e.parentNode) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; }, function () { e({ value: n, nodes: r }); } ); } }, { key: 'matchesExclude', value: function (e) { return o.matches( e, this.opt.exclude.concat([ 'script', 'style', 'title', 'head', 'html' ]) ); } }, { key: 'wrapRangeInTextNode', value: function (e, t, n) { var r = this.opt.element ? this.opt.element : 'mark', o = e.splitText(t), i = o.splitText(n - t), a = document.createElement(r); return ( a.setAttribute('data-markjs', 'true'), this.opt.className && a.setAttribute('class', this.opt.className), (a.textContent = o.textContent), o.parentNode.replaceChild(a, o), i ); } }, { key: 'wrapRangeInMappedTextNode', value: function (e, t, n, r, o) { var i = this; e.nodes.every(function (a, s) { var l = e.nodes[s + 1]; if (void 0 === l || l.start > t) { if (!r(a.node)) return !1; var c = t - a.start, u = (n > a.end ? a.end : n) - a.start, p = e.value.substr(0, a.start), d = e.value.substr(u + a.start); if ( ((a.node = i.wrapRangeInTextNode(a.node, c, u)), (e.value = p + d), e.nodes.forEach(function (t, n) { n >= s && (e.nodes[n].start > 0 && n !== s && (e.nodes[n].start -= u), (e.nodes[n].end -= u)); }), (n -= u), o(a.node.previousSibling, a.start), !(n > a.end)) ) return !1; t = a.end; } return !0; }); } }, { key: 'wrapMatches', value: function (e, t, n, r, o) { var i = this, a = 0 === t ? 0 : t + 1; this.getTextNodes(function (t) { t.nodes.forEach(function (t) { t = t.node; for ( var o = void 0; null !== (o = e.exec(t.textContent)) && '' !== o[a]; ) if (n(o[a], t)) { var s = o.index; if (0 !== a) for (var l = 1; l < a; l++) s += o[l].length; (t = i.wrapRangeInTextNode( t, s, s + o[a].length )), r(t.previousSibling), (e.lastIndex = 0); } }), o(); }); } }, { key: 'wrapMatchesAcrossElements', value: function (e, t, n, r, o) { var i = this, a = 0 === t ? 0 : t + 1; this.getTextNodes(function (t) { for ( var s = void 0; null !== (s = e.exec(t.value)) && '' !== s[a]; ) { var l = s.index; if (0 !== a) for (var c = 1; c < a; c++) l += s[c].length; var u = l + s[a].length; i.wrapRangeInMappedTextNode( t, l, u, function (e) { return n(s[a], e); }, function (t, n) { (e.lastIndex = n), r(t); } ); } o(); }); } }, { key: 'wrapRangeFromIndex', value: function (e, t, n, r) { var o = this; this.getTextNodes(function (i) { var a = i.value.length; e.forEach(function (e, r) { var s = o.checkWhitespaceRanges(e, a, i.value), l = s.start, c = s.end; s.valid && o.wrapRangeInMappedTextNode( i, l, c, function (n) { return t(n, e, i.value.substring(l, c), r); }, function (t) { n(t, e); } ); }), r(); }); } }, { key: 'unwrapMatches', value: function (e) { for ( var t = e.parentNode, n = document.createDocumentFragment(); e.firstChild; ) n.appendChild(e.removeChild(e.firstChild)); t.replaceChild(n, e), this.ie ? this.normalizeTextNode(t) : t.normalize(); } }, { key: 'normalizeTextNode', value: function (e) { if (e) { if (3 === e.nodeType) for ( ; e.nextSibling && 3 === e.nextSibling.nodeType; ) (e.nodeValue += e.nextSibling.nodeValue), e.parentNode.removeChild(e.nextSibling); else this.normalizeTextNode(e.firstChild); this.normalizeTextNode(e.nextSibling); } } }, { key: 'markRegExp', value: function (e, t) { var n = this; (this.opt = t), this.log('Searching with expression "' + e + '"'); var r = 0, o = 'wrapMatches'; this.opt.acrossElements && (o = 'wrapMatchesAcrossElements'), this[o]( e, this.opt.ignoreGroups, function (e, t) { return n.opt.filter(t, e, r); }, function (e) { r++, n.opt.each(e); }, function () { 0 === r && n.opt.noMatch(e), n.opt.done(r); } ); } }, { key: 'mark', value: function (e, t) { var n = this; this.opt = t; var r = 0, o = 'wrapMatches', i = this.getSeparatedKeywords( 'string' == typeof e ? [e] : e ), a = i.keywords, s = i.length, l = this.opt.caseSensitive ? '' : 'i'; this.opt.acrossElements && (o = 'wrapMatchesAcrossElements'), 0 === s ? this.opt.done(r) : (function e(t) { var i = new RegExp(n.createRegExp(t), 'gm' + l), c = 0; n.log('Searching with expression "' + i + '"'), n[o]( i, 1, function (e, o) { return n.opt.filter(o, t, r, c); }, function (e) { c++, r++, n.opt.each(e); }, function () { 0 === c && n.opt.noMatch(t), a[s - 1] === t ? n.opt.done(r) : e(a[a.indexOf(t) + 1]); } ); })(a[0]); } }, { key: 'markRanges', value: function (e, t) { var n = this; this.opt = t; var r = 0, o = this.checkRanges(e); o && o.length ? (this.log( 'Starting to mark with the following ranges: ' + JSON.stringify(o) ), this.wrapRangeFromIndex( o, function (e, t, r, o) { return n.opt.filter(e, t, r, o); }, function (e, t) { r++, n.opt.each(e, t); }, function () { n.opt.done(r); } )) : this.opt.done(r); } }, { key: 'unmark', value: function (e) { var t = this; this.opt = e; var n = this.opt.element ? this.opt.element : '*'; (n += '[data-markjs]'), this.opt.className && (n += '.' + this.opt.className), this.log('Removal selector "' + n + '"'), this.iterator.forEachNode( NodeFilter.SHOW_ELEMENT, function (e) { t.unwrapMatches(e); }, function (e) { var r = o.matches(e, n), i = t.matchesExclude(e); return !r || i ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT; }, this.opt.done ); } }, { key: 'opt', set: function (e) { this._opt = r( {}, { element: '', className: '', exclude: [], iframes: !1, iframesTimeout: 5e3, separateWordSearch: !0, diacritics: !0, synonyms: {}, accuracy: 'partially', acrossElements: !1, caseSensitive: !1, ignoreJoiners: !1, ignoreGroups: 0, ignorePunctuation: [], wildcards: 'disabled', each: function () {}, noMatch: function () {}, filter: function () { return !0; }, done: function () {}, debug: !1, log: window.console }, e ); }, get: function () { return this._opt; } }, { key: 'iterator', get: function () { return new o( this.ctx, this.opt.iframes, this.opt.exclude, this.opt.iframesTimeout ); } } ]), i ); })(); return function (e) { var t = this, n = new i(e); return ( (this.mark = function (e, r) { return n.mark(e, r), t; }), (this.markRegExp = function (e, r) { return n.markRegExp(e, r), t; }), (this.markRanges = function (e, r) { return n.markRanges(e, r), t; }), (this.unmark = function (e) { return n.unmark(e), t; }), this ); }; })(); }, 3342: function (e, t, n) { 'use strict'; const r = n(4445), o = {}.NODE_DISABLE_COLORS ? { red: '', yellow: '', green: '', normal: '' } : { red: '