text: /*!***************************************************
  * mark.js v9.0.0
  * https://markjs.io/
  * Copyright (c) 2014–2022, Julian Kühnel
  * Released under the MIT license https://git.io/vwTVl
  *****************************************************/
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Mark=t()}(this,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=/* */function(){function e(n){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=o,this.iframesTimeout=a}return r(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};try{var o=e.contentWindow;if(n=o.document,!o||!n)throw new Error("iframe inaccessible")}catch(e){r()}n&&t(n)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,o=!1,a=null,i=function i(){if(!o){o=!0,clearTimeout(a);try{r.isIframeBlank(e)||(e.removeEventListener("load",i),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",i),a=setTimeout(i,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},i=t.querySelectorAll("iframe"),s=i.length,c=0;i=Array.prototype.slice.call(i);var u=function(){--s<=0&&a(c)};s||u(),i.forEach(function(t){e.matches(t,o.exclude)?u():o.onIframeReady(t,function(e){n(t)&&(c++,r(e)),u()},u)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:null===t?e.nextNode():e.nextNode()&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var o=!1,a=!1;return r.forEach(function(e,t){e.val===n&&(o=t,a=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==o||a?!1===o||a||(r[o].handled=!0):r.push({val:n,handled:!0}),!0):(!1===o&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var o=this;e.forEach(function(e){e.handled||o.getIframeContents(e.val,function(e){o.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,o){var a,i,s,c=this,u=this.createIterator(t,e,r),l=[],h=[];if(this.iframes)for(;s=void 0,s=c.getIteratorNode(u),i=s.prevNode,a=s.node;)this.forEachIframe(t,function(e){return c.checkIframeFilter(a,i,e,l)},function(t){c.createInstanceOnIframe(t).forEachNode(e,function(e){return h.push(e)},r)}),h.push(a);else for(;a=u.nextNode();)h.push(a);h.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(l,e,n,r),o()}},{key:"forEachNode",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=this.getContexts(),i=a.length;i||o(),a.forEach(function(a){var s=function(){r.iterateThroughNodes(e,a,t,n,function(){--i<=0&&o()})};r.iframes?r.waitForIframes(a,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var o=!1;return n.every(function(t){return!r.call(e,t)||(o=!0,!1)}),o}return!1}}]),e}(),i=/* */function(){function e(n){t(this,e),this.opt=o({},{diacritics:!0,synonyms:{},accuracy:"partially",caseSensitive:!1,ignoreJoiners:!1,ignorePunctuation:[],wildcards:"disabled"},n)}return r(e,[{key:"create",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),new RegExp(e,"gm".concat(this.opt.caseSensitive?"":"i"))}},{key:"sortByLength",value:function(e){return e.sort(function(e,t){return e.length===t.length?e>t?1:-1:t.length-e.length})}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createSynonymsRegExp",value:function(e){var t=this,n=this.opt.synonyms,r=this.opt.caseSensitive?"":"i",o=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var a in n)if(n.hasOwnProperty(a)){var i=Array.isArray(n[a])?n[a]:[n[a]];i.unshift(a),(i=this.sortByLength(i).map(function(e){return"disabled"!==t.opt.wildcards&&(e=t.setupWildcardsRegExp(e)),e=t.escapeStr(e)}).filter(function(e){return""!==e})).length>1&&(e=e.replace(new RegExp("(".concat(i.map(function(e){return t.escapeStr(e)}).join("|"),")"),"gm".concat(r)),o+"(".concat(i.map(function(e){return t.processSynonyms(e)}).join("|"),")")+o))}return e}},{key:"processSynonyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,function(e){return"\\"===e.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(e){return"\\"===e.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"})}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("[".concat(t.join(""),"]*")):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],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("[".concat(n,"]"),"gm".concat(t)),"[".concat(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,a="";switch(o.forEach(function(e){a+="|".concat(t.escapeStr(e))}),r){case"partially":default:return"()(".concat(e,")");case"complementary":return a="\\s"+(a||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")),"()([^".concat(a,"]*").concat(e,"[^").concat(a,"]*)");case"exactly":return"(^|\\s".concat(a,")(").concat(e,")(?=$|\\s").concat(a,")")}}}]),e}(),s=/* */function(){function n(e){t(this,n),this.ctx=e,this.ie=!1;var r=window.navigator.userAgent;(r.indexOf("MSIE")>-1||r.indexOf("Trident")>-1)&&(this.ie=!0)}return r(n,[{key:"opt",get:function(){return this._opt},set:function(e){this._opt=o({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,acrossElements:!1,ignoreGroups:0,each:function(){},noMatch:function(){},filter:function(){return!0},done:function(){},debug:!1,log:window.console},e)}},{key:"iterator",get:function(){return new a(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}},{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===e(r)&&"function"==typeof r[n]&&r[n]("mark.js: ".concat(t))}},{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),a=o.start,i=o.end;o.valid&&(e.start=a,e.length=i-a,n.push(e),r=i)}),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n,r,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: "+"".concat(JSON.stringify(e))),this.opt.noMatch(e))):(this.log("Ignoring invalid range: ".concat(JSON.stringify(e))),this.opt.noMatch(e)),{start:n,end:r,valid:o}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r,o=!0,a=n.length,i=t-a,s=parseInt(e.start,10)-i;return(r=(s=s>a?a:s)+parseInt(e.length,10))>a&&(r=a,this.log("End range automatically set to the max value of ".concat(a))),s<0||r-s<0||s>a||r>a?(o=!1,this.log("Invalid range: ".concat(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:"checkParents",value:function(e,t){if(e===e.parentNode.lastChild){if(t(e.parentNode))return!0;for(var n=e.parentNode;n===n.parentNode.lastChild;){if(t(n.parentNode))return!0;n=n.parentNode}var r=e.parentNode.nextSibling;if(r){if(1!==r.nodeType)return!0;if(t(r))return!0}}return!1}},{key:"checkNextSiblings",value:function(e,t){if(e&&1===e.nodeType){if(t(e))return;if(e.firstChild){for(var n,r=e.firstChild;r;){if(1!==r.nodeType)return;if(t(r))return;n=r,r=r.firstChild}this.checkNextSiblings(n.nextSibling,t)}e!==e.parentNode.lastChild?this.checkNextSiblings(e.nextSibling,t):t(e.parentNode)}}},{key:"prepare",value:function(e){var t=" ",n=this.opt.blockElementsBoundary;if(n.tagNames&&n.tagNames.length){var r={};for(var o in n.tagNames)r[n.tagNames[o].toLowerCase()]=1;for(var a in r)e[a]=2}else{for(var i in e)e[i]=2;e.br=1}return n.char&&(t=n.char.charAt(0)+" "),t}},{key:"getTextNodesAcrossElements",value:function(e){var t,n,r,o,a,i,s,c=this,u="",l=[],h=this.opt.blockElementsBoundary,f={div:1,p:1,li:1,td:1,tr:1,th:1,ul:1,ol:1,br:1,dd:1,dl:1,dt:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,blockquote:1,figcaption:1,figure:1,pre:1,table:1,thead:1,tbody:1,tfoot:1,input:1,img:1,nav:1,details:1,label:1,form:1,select:1,menu:1,menuitem:1,main:1,section:1,article:1,aside:1,picture:1,output:1,button:1,header:1,footer:1,address:1,area:1,canvas:1,map:1,fieldset:1,textarea:1,track:1,video:1,audio:1,body:1,iframe:1,meter:1,object:1,svg:1};h&&(i=this.prepare(f),s=" "+i),this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(e){(a=0,t=u.length,n=e.textContent,r=/\s/.test(n[n.length-1]),h||!r)&&(c.checkParents(e,function(e){return o=f[e.nodeName.toLowerCase()]})||c.checkNextSiblings(e.nextSibling,function(e){return o=f[e.nodeName.toLowerCase()]}),o&&(r?2===o&&(u+=n+i,a=2):1===o?(u+=n+" ",a=1):2===o&&(u+=n+s,a=3)));0===a&&(u+=n),l.push({start:t,end:u.length-a,offset:a,node:e})},function(e){return c.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){e({value:u,nodes:l,lastIndex:0})})}},{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,lastIndex:0})})}},{key:"matchesExclude",value:function(e){return a.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),a=o.splitText(n-t),i=document.createElement(r);return i.setAttribute("data-markjs","true"),this.opt.className&&i.setAttribute("class",this.opt.className),i.textContent=o.textContent,o.parentNode.replaceChild(i,o),a}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,o){for(var a=!0,i=e.lastIndex;i<e.nodes.length;i++){var s=e.nodes[i+1];if(void 0===s||s.start>t){var c=e.nodes[i];if(!r(c.node)){i>e.lastIndex&&(e.lastIndex=i);break}var u=t-c.start,l=(n>c.end?c.end:n)-c.start;if(l>u&&(c.node=this.wrapRangeInTextNode(c.node,u,l),c.start+=l,o(c.node.previousSibling,a),a=!1),!(n>c.end)){e.lastIndex=i;break}t=c.end+(c.offset?c.offset:0)}}}},{key:"wrapGroups",value:function(e,t,n,r){return r((e=this.wrapRangeInTextNode(e,t,t+n)).previousSibling),e}},{key:"separateGroupsD",value:function(e,t,n,r,o){for(var a,i,s,c=0,u=0,l=0,h=!1,f=!0;++l<t.length;)(a=t[l])&&(i=t.indices[l][0])>=c&&r(a,e,l)&&(s=t.indices[l][1],e=this.wrapGroups(e,i-u,s-i,function(e){o(e,f,l),f=!1}),s>c&&(c=s),u=s,h=!0);return h&&(n.regex.lastIndex=0),e}},{key:"separateGroups",value:function(e,t,n,r,o){for(var a,i,s,c=t.index,u=-1,l=!1,h=!0;++u<n.groups.length;)(i=t[a=n.groups[u]])&&-1!==(s=e.textContent.indexOf(i,c))&&(r(i,e,a)?(e=this.wrapGroups(e,s,i.length,function(e){o(e,h,u),h=!1}),c=0,l=!0):c=s+i.length);return l&&(n.regex.lastIndex=0),e}},{key:"wrapMatchGroupsD",value:function(e,t,n,r,o){for(var a,i,s,c,u=!0,l=0,h=0;++h<t.length;)(a=t[h])&&(i=t.indices[h][0])>=l&&(s=t.indices[h][1],c=!1,this.wrapRangeInMappedTextNode(e,i,s,function(e){return r(a,e,h)},function(e,t){c=!0,o(e,u,t,h),u=!1}),c&&s>l&&(l=s))}},{key:"wrapMatchGroups",value:function(e,t,n,r,o){for(var a,i,s,c,u=!0,l=0,h=t.index,f=e.value.substring(h,n.regex.lastIndex),p=0;p<n.groups.length;p++)a=n.groups[p],(i=t[a])&&(c=(s=f.indexOf(i,l))+i.length,-1!==s&&(this.wrapRangeInMappedTextNode(e,h+s,h+c,function(e){return r(i,e,a)},function(e,t){o(e,u,t,a),u=!1}),l=c))}},{key:"collectRegexGroupIndexes",value:function(e){for(var t=[],n=[],r=-1,o=1,a=0,i=!1,s=e.source,c=/^\(\?<(?![=!])|^\((?!\?)/;++r<s.length;)switch(s[r]){case"(":i||(c.test(s.substring(r))?(n.push(1),0===a&&t.push(o),a++,o++):n.push(0));break;case")":i||1!==n.pop()||a--;break;case"\\":r++;break;case"[":i=!0;break;case"]":i=!1}return t}},{key:"wrapMatches",value:function(e,t,n,r,o){var a,i,s=this,c=this.opt.separateGroups,u=c||0===t?0:t+1,l=e.hasIndices?"separateGroupsD":"separateGroups",h=c?{regex:e,groups:e.hasIndices?{}:this.collectRegexGroupIndexes(e)}:{},f={abort:!1},p={execution:f},d=0;this.getTextNodes(function(t){t.nodes.every(function(t){for(t=t.node;null!==(a=e.exec(t.textContent.normalize()))&&""!==a[u];){if(p.match=a,i=!0,c)t=s[l](t,a,h,function(e,t,r){return p.matchStart=i,p.groupIndex=r,i=!1,n(e,t,p)},function(e,t,n){t&&d++,r(e,{match:a,matchStart:t,count:d,groupIndex:n})});else{if(!n(a[u],t,p))continue;var o=a.index;if(0!==u)for(var g=1;g<u;g++)o+=a[g].length;t=s.wrapGroups(t,o,a[u].length,function(e){r(e,{match:a,count:++d})}),e.lastIndex=0}if(f.abort)break}return!f.abort}),o(d)})}},{key:"wrapMatchesAcrossElements",value:function(e,t,n,r,o){var a,i,s=this,c=this.opt.separateGroups,u=c||0===t?0:t+1,l=e.hasIndices?"wrapMatchGroupsD":"wrapMatchGroups",h=!c||e.hasIndices?{}:{regex:e,groups:this.collectRegexGroupIndexes(e)},f={abort:!1},p={execution:f},d=0;this.getTextNodesAcrossElements(function(t){for(;null!==(a=e.exec(t.value.normalize()))&&""!==a[u];){if(p.match=a,i=!0,c)s[l](t,a,h,function(e,t,r){return p.matchStart=i,p.groupIndex=r,i=!1,n(e,t,p)},function(e,t,n,o){t&&d++,r(e,{match:a,matchStart:t,count:d,groupIndex:o,groupStart:n})});else{var g=a.index;if(0!==u)for(var v=1;v<u;v++)g+=a[v].length;var m=g+a[u].length;s.wrapRangeInMappedTextNode(t,g,m,function(e){return p.matchStart=i,i=!1,n(a[u],e,p)},function(e,t){t&&d++,r(e,{match:a,matchStart:t,count:d})})}if(f.abort)break}o(d)})}},{key:"wrapRangeFromIndex",value:function(e,t,n,r){var o=this;this.getTextNodes(function(a){var i=a.value.length;e.forEach(function(e,r){var s=o.checkWhitespaceRanges(e,i,a.value),c=s.start,u=s.end;s.valid&&o.wrapRangeInMappedTextNode(a,c,u,function(n){return t(n,e,a.value.substring(c,u),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;var r=0,o="wrapMatches";if(this.opt.acrossElements&&(o="wrapMatchesAcrossElements",!e.global&&!e.sticky)){var a=e.toString().split("/");e=new RegExp(e.source,"g"+a[a.length-1]),this.log("RegExp is recompiled with g flag because it must have g flag")}this.log('Searching with expression "'.concat(e,'"')),this[o](e,this.opt.ignoreGroups,function(e,t,o){return n.opt.filter(t,e,r,o)},function(e,t){r++,n.opt.each(e,t)},function(t){0===t&&n.opt.noMatch(e),n.opt.done(r,t)})}},{key:"mark",value:function(e,t){var n=this;this.opt=t;var r=0,o=0,a=0,s=this.opt.acrossElements?"wrapMatchesAcrossElements":"wrapMatches",c={},u=this.getSeparatedKeywords("string"==typeof e?[e]:e),l=u.keywords,h=u.length;0===h?this.opt.done(o,0,c):function e(t){var u=new i(n.opt).create(t),f=0;n.log('Searching with expression "'.concat(u,'"')),n[s](u,1,function(e,r,a){return n.opt.filter(r,t,o,f,a)},function(e,t){f++,o++,n.opt.each(e,t)},function(i){a+=i,0===i&&n.opt.noMatch(t),c[t]=i,++r<h?e(l[r]):n.opt.done(o,a,c)})}(l[r])}},{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+=".".concat(this.opt.className)),this.log('Removal selector "'.concat(n,'"')),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,function(e){t.unwrapMatches(e)},function(e){var r=a.matches(e,n),o=t.matchesExclude(e);return!r||o?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}}]),n}();return function(e){var t=this,n=new s(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}});
  