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";class e{constructor(e,t=!0,r=[],s=5e3){this.ctx=e,this.iframes=t,this.exclude=r,this.iframesTimeout=s}static matches(e,t){const r="string"==typeof t?[t]:t,s=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(s){let t=!1;return r.every(r=>!s.call(e,r)||(t=!0,!1)),t}return!1}getContexts(){let e,t=[];return(e=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(e=>{const r=t.filter(t=>t.contains(e)).length>0;-1!==t.indexOf(e)||r||t.push(e)}),t}getIframeContents(e,t,r=(()=>{})){let s;try{const t=e.contentWindow;if(s=t.document,!t||!s)throw new Error("iframe inaccessible")}catch(e){r()}s&&t(s)}isIframeBlank(e){const t="about:blank",r=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&r!==t&&r}observeIframeLoad(e,t,r){let s=!1,i=null;const a=()=>{if(!s){s=!0,clearTimeout(i);try{this.isIframeBlank(e)||(e.removeEventListener("load",a),this.getIframeContents(e,t,r))}catch(e){r()}}};e.addEventListener("load",a),i=setTimeout(a,this.iframesTimeout)}onIframeReady(e,t,r){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,r):this.getIframeContents(e,t,r):this.observeIframeLoad(e,t,r)}catch(e){r()}}waitForIframes(e,t){let r=0;this.forEachIframe(e,()=>!0,e=>{r++,this.waitForIframes(e.querySelector("html"),()=>{--r||t()})},e=>{e||t()})}forEachIframe(t,r,s,i=(()=>{})){let a=t.querySelectorAll("iframe"),n=a.length,o=0;a=Array.prototype.slice.call(a);const h=()=>{--n<=0&&i(o)};n||h(),a.forEach(t=>{e.matches(t,this.exclude)?h():this.onIframeReady(t,e=>{r(t)&&(o++,s(e)),h()},h)})}createIterator(e,t,r){return document.createNodeIterator(e,t,r,!1)}createInstanceOnIframe(t){return new e(t.querySelector("html"),this.iframes)}compareNodeIframe(e,t,r){if(e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}getIteratorNode(e){const t=e.previousNode();let r;return{prevNode:t,node:r=null===t?e.nextNode():e.nextNode()&&e.nextNode()}}checkIframeFilter(e,t,r,s){let i=!1,a=!1;return s.forEach((e,t)=>{e.val===r&&(i=t,a=e.handled)}),this.compareNodeIframe(e,t,r)?(!1!==i||a?!1===i||a||(s[i].handled=!0):s.push({val:r,handled:!0}),!0):(!1===i&&s.push({val:r,handled:!1}),!1)}handleOpenIframes(e,t,r,s){e.forEach(e=>{e.handled||this.getIframeContents(e.val,e=>{this.createInstanceOnIframe(e).forEachNode(t,r,s)})})}iterateThroughNodes(e,t,r,s,i){const a=this.createIterator(t,e,s);let n,o,h=[],c=[],l=()=>(({prevNode:o,node:n}=this.getIteratorNode(a)),n);if(this.iframes)for(;l();)this.forEachIframe(t,e=>this.checkIframeFilter(n,o,e,h),t=>{this.createInstanceOnIframe(t).forEachNode(e,e=>c.push(e),s)}),c.push(n);else for(;n=a.nextNode();)c.push(n);c.forEach(e=>{r(e)}),this.iframes&&this.handleOpenIframes(h,e,r,s),i()}forEachNode(e,t,r,s=(()=>{})){const i=this.getContexts();let a=i.length;a||s(),i.forEach(i=>{const n=()=>{this.iterateThroughNodes(e,i,t,r,()=>{--a<=0&&s()})};this.iframes?this.waitForIframes(i,n):n()})}}class t{constructor(e){this.opt=Object.assign({},{diacritics:!0,synonyms:{},accuracy:"partially",caseSensitive:!1,ignoreJoiners:!1,ignorePunctuation:[],wildcards:"disabled"},e)}create(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${this.opt.caseSensitive?"":"i"}`)}sortByLength(e){return e.sort((e,t)=>e.length===t.length?e>t?1:-1:t.length-e.length)}escapeStr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}createSynonymsRegExp(e){const t=this.opt.synonyms,r=this.opt.caseSensitive?"":"i",s=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let i in t)if(t.hasOwnProperty(i)){let a=Array.isArray(t[i])?t[i]:[t[i]];a.unshift(i),(a=this.sortByLength(a).map(e=>("disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e))).filter(e=>""!==e)).length>1&&(e=e.replace(new RegExp(`(${a.map(e=>this.escapeStr(e)).join("|")})`,`gm${r}`),s+`(${a.map(e=>this.processSynonyms(e)).join("|")})`+s))}return e}processSynonyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return(e=e.replace(/(?:\\)*\?/g,e=>"\\"===e.charAt(0)?"?":"")).replace(/(?:\\)*\*/g,e=>"\\"===e.charAt(0)?"*":"")}createWildcardsRegExp(e){let t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}setupIgnoreJoinersRegExp(e){return e.replace(/[^(|)\\]/g,(e,t,r)=>{let s=r.charAt(t+1);return/[(|)\\]/.test(s)||""===s?e:e+"\0"})}createJoinersRegExp(e){let t=[];const r=this.opt.ignorePunctuation;return Array.isArray(r)&&r.length&&t.push(this.escapeStr(r.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join(`[${t.join("")}]*`):e}createDiacriticsRegExp(e){const t=this.opt.caseSensitive?"":"i",r=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ŽŻŹ"];let s=[];return e.split("").forEach(i=>{r.every(r=>{if(-1!==r.indexOf(i)){if(s.indexOf(r)>-1)return!1;e=e.replace(new RegExp(`[${r}]`,`gm${t}`),`[${r}]`),s.push(r)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gim,"[\\s]+")}createAccuracyRegExp(e){let t=this.opt.accuracy,r="string"==typeof t?t:t.value,s="string"==typeof t?[]:t.limiters,i="";switch(s.forEach(e=>{i+=`|${this.escapeStr(e)}`}),r){case"partially":default:return`()(${e})`;case"complementary":return`()([^${i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿"))}]*${e}[^${i}]*)`;case"exactly":return`(^|\\s${i})(${e})(?=$|\\s${i})`}}}class r{constructor(e){this.ctx=e,this.ie=!1;const t=window.navigator.userAgent;(t.indexOf("MSIE")>-1||t.indexOf("Trident")>-1)&&(this.ie=!0)}set opt(e){this._opt=Object.assign({},{element:"",className:"",exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,acrossElements:!1,ignoreGroups:0,each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},e)}get opt(){return this._opt}get iterator(){return new e(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t="debug"){const r=this.opt.log;this.opt.debug&&"object"==typeof r&&"function"==typeof r[t]&&r[t](`mark.js: ${e}`)}getSeparatedKeywords(e){let t=[];return e.forEach(e=>{this.opt.separateWordSearch?e.split(" ").forEach(e=>{e.trim()&&-1===t.indexOf(e)&&t.push(e)}):e.trim()&&-1===t.indexOf(e)&&t.push(e)}),{keywords:t.sort((e,t)=>t.length-e.length),length:t.length}}isNumeric(e){return Number(parseFloat(e))==e}checkRanges(e){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),[];const t=[];let r=0;return e.sort((e,t)=>e.start-t.start).forEach(e=>{let{start:s,end:i,valid:a}=this.callNoMatchOnInvalidRanges(e,r);a&&(e.start=s,e.length=i-s,t.push(e),r=i)}),t}callNoMatchOnInvalidRanges(e,t){let r,s,i=!1;return e&&void 0!==e.start?(s=(r=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&s-t>0&&s-r>0?i=!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:r,end:s,valid:i}}checkWhitespaceRanges(e,t,r){let s,i=!0,a=r.length,n=t-a,o=parseInt(e.start,10)-n;return(s=(o=o>a?a:o)+parseInt(e.length,10))>a&&(s=a,this.log(`End range automatically set to the max value of ${a}`)),o<0||s-o<0||o>a||s>a?(i=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):""===r.substring(o,s).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:o,end:s,valid:i}}checkParents(e,t){if(e===e.parentNode.lastChild){if(t(e.parentNode))return!0;{let r=e.parentNode;for(;r===r.parentNode.lastChild;){if(t(r.parentNode))return!0;r=r.parentNode}}let r=e.parentNode.nextSibling;if(r){if(1!==r.nodeType)return!0;if(t(r))return!0}}return!1}checkNextSiblings(e,t){if(e&&1===e.nodeType){if(t(e))return;if(e.firstChild){let r,s=e.firstChild;for(;s;){if(1!==s.nodeType)return;if(t(s))return;r=s,s=s.firstChild}this.checkNextSiblings(r.nextSibling,t)}e!==e.parentNode.lastChild?this.checkNextSiblings(e.nextSibling,t):t(e.parentNode)}}prepare(e){let t=" ",r=this.opt.blockElementsBoundary;if(r.tagNames&&r.tagNames.length){let t={};for(let e in r.tagNames)t[r.tagNames[e].toLowerCase()]=1;for(let r in t)e[r]=2}else{for(let t in e)e[t]=2;e.br=1}return r.char&&(t=r.char.charAt(0)+" "),t}getTextNodesAcrossElements(e){let t,r,s,i,a,n,o,h="",c=[],l=this.opt.blockElementsBoundary,p={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};l&&(n=this.prepare(p),o=" "+n),this.iterator.forEachNode(NodeFilter.SHOW_TEXT,e=>{if(a=0,t=h.length,r=e.textContent,s=/\s/.test(r[r.length-1]),l||!s){this.checkParents(e,e=>i=p[e.nodeName.toLowerCase()])||this.checkNextSiblings(e.nextSibling,e=>i=p[e.nodeName.toLowerCase()]),i&&(s?2===i&&(h+=r+n,a=2):1===i?(h+=r+" ",a=1):2===i&&(h+=r+o,a=3))}0===a&&(h+=r),c.push({start:t,end:h.length-a,offset:a,node:e})},e=>this.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:h,nodes:c,lastIndex:0})})}getTextNodes(e){let t="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,e=>{r.push({start:t.length,end:(t+=e.textContent).length,node:e})},e=>this.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:r,lastIndex:0})})}matchesExclude(t){return e.matches(t,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,r){const s=this.opt.element?this.opt.element:"mark",i=e.splitText(t),a=i.splitText(r-t);let n=document.createElement(s);return n.setAttribute("data-markjs","true"),this.opt.className&&n.setAttribute("class",this.opt.className),n.textContent=i.textContent,i.parentNode.replaceChild(n,i),a}wrapRangeInMappedTextNode(e,t,r,s,i){let a=!0;for(let n=e.lastIndex;n<e.nodes.length;n++){const o=e.nodes[n+1];if(void 0===o||o.start>t){let o=e.nodes[n];if(!s(o.node)){n>e.lastIndex&&(e.lastIndex=n);break}const h=t-o.start,c=(r>o.end?o.end:r)-o.start;if(c>h&&(o.node=this.wrapRangeInTextNode(o.node,h,c),o.start+=c,i(o.node.previousSibling,a),a=!1),!(r>o.end)){e.lastIndex=n;break}t=o.end+(o.offset?o.offset:0)}}}wrapGroups(e,t,r,s){return s((e=this.wrapRangeInTextNode(e,t,t+r)).previousSibling),e}separateGroupsD(e,t,r,s,i){let a,n,o,h=0,c=0,l=0,p=!1,d=!0;for(;++l<t.length;)(a=t[l])&&(n=t.indices[l][0])>=h&&s(a,e,l)&&(o=t.indices[l][1],e=this.wrapGroups(e,n-c,o-n,e=>{i(e,d,l),d=!1}),o>h&&(h=o),c=o,p=!0);return p&&(r.regex.lastIndex=0),e}separateGroups(e,t,r,s,i){let a,n,o,h=t.index,c=-1,l=!1,p=!0;for(;++c<r.groups.length;)(n=t[a=r.groups[c]])&&-1!==(o=e.textContent.indexOf(n,h))&&(s(n,e,a)?(e=this.wrapGroups(e,o,n.length,e=>{i(e,p,c),p=!1}),h=0,l=!0):h=o+n.length);return l&&(r.regex.lastIndex=0),e}wrapMatchGroupsD(e,t,r,s,i){let a,n,o,h,c=!0,l=0,p=0;for(;++p<t.length;)(a=t[p])&&(n=t.indices[p][0])>=l&&(o=t.indices[p][1],h=!1,this.wrapRangeInMappedTextNode(e,n,o,e=>s(a,e,p),(e,t)=>{h=!0,i(e,c,t,p),c=!1}),h&&o>l&&(l=o))}wrapMatchGroups(e,t,r,s,i){let a,n,o,h,c=!0,l=0;const p=t.index,d=e.value.substring(p,r.regex.lastIndex);for(let g=0;g<r.groups.length;g++)a=r.groups[g],(n=t[a])&&(h=(o=d.indexOf(n,l))+n.length,-1!==o&&(this.wrapRangeInMappedTextNode(e,p+o,p+h,e=>s(n,e,a),(e,t)=>{i(e,c,t,a),c=!1}),l=h))}collectRegexGroupIndexes(e){let t=[],r=[],s=-1,i=1,a=0,n=!1,o=e.source,h=/^\(\?<(?![=!])|^\((?!\?)/;for(;++s<o.length;)switch(o[s]){case"(":n||(h.test(o.substring(s))?(r.push(1),0===a&&t.push(i),a++,i++):r.push(0));break;case")":n||1!==r.pop()||a--;break;case"\\":s++;break;case"[":n=!0;break;case"]":n=!1}return t}wrapMatches(e,t,r,s,i){const a=this.opt.separateGroups,n=a||0===t?0:t+1,o=e.hasIndices?"separateGroupsD":"separateGroups",h=a?{regex:e,groups:e.hasIndices?{}:this.collectRegexGroupIndexes(e)}:{},c={abort:!1},l={execution:c};let p,d,g=0;this.getTextNodes(t=>{t.nodes.every(t=>{for(t=t.node;null!==(p=e.exec(t.textContent.normalize()))&&""!==p[n];){if(l.match=p,d=!0,a)t=this[o](t,p,h,(e,t,s)=>(l.matchStart=d,l.groupIndex=s,d=!1,r(e,t,l)),(e,t,r)=>{t&&g++,s(e,{match:p,matchStart:t,count:g,groupIndex:r})});else{if(!r(p[n],t,l))continue;let i=p.index;if(0!==n)for(let e=1;e<n;e++)i+=p[e].length;t=this.wrapGroups(t,i,p[n].length,e=>{s(e,{match:p,count:++g})}),e.lastIndex=0}if(c.abort)break}return!c.abort}),i(g)})}wrapMatchesAcrossElements(e,t,r,s,i){const a=this.opt.separateGroups,n=a||0===t?0:t+1,o=e.hasIndices?"wrapMatchGroupsD":"wrapMatchGroups",h=!a||e.hasIndices?{}:{regex:e,groups:this.collectRegexGroupIndexes(e)},c={abort:!1},l={execution:c};let p,d,g=0;this.getTextNodesAcrossElements(t=>{for(;null!==(p=e.exec(t.value.normalize()))&&""!==p[n];){if(l.match=p,d=!0,a)this[o](t,p,h,(e,t,s)=>(l.matchStart=d,l.groupIndex=s,d=!1,r(e,t,l)),(e,t,r,i)=>{t&&g++,s(e,{match:p,matchStart:t,count:g,groupIndex:i,groupStart:r})});else{let e=p.index;if(0!==n)for(let t=1;t<n;t++)e+=p[t].length;const i=e+p[n].length;this.wrapRangeInMappedTextNode(t,e,i,e=>(l.matchStart=d,d=!1,r(p[n],e,l)),(e,t)=>{t&&g++,s(e,{match:p,matchStart:t,count:g})})}if(c.abort)break}i(g)})}wrapRangeFromIndex(e,t,r,s){this.getTextNodes(i=>{const a=i.value.length;e.forEach((e,s)=>{let{start:n,end:o,valid:h}=this.checkWhitespaceRanges(e,a,i.value);h&&this.wrapRangeInMappedTextNode(i,n,o,r=>t(r,e,i.value.substring(n,o),s),t=>{r(t,e)})}),s()})}unwrapMatches(e){const t=e.parentNode;let r=document.createDocumentFragment();for(;e.firstChild;)r.appendChild(e.removeChild(e.firstChild));t.replaceChild(r,e),this.ie?this.normalizeTextNode(t):t.normalize()}normalizeTextNode(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)}}markRegExp(e,t){this.opt=t;let r=0,s="wrapMatches";if(this.opt.acrossElements&&(s="wrapMatchesAcrossElements",!e.global&&!e.sticky)){let t=e.toString().split("/");e=new RegExp(e.source,"g"+t[t.length-1]),this.log("RegExp is recompiled with g flag because it must have g flag")}this.log(`Searching with expression "${e}"`),this[s](e,this.opt.ignoreGroups,(e,t,s)=>this.opt.filter(t,e,r,s),(e,t)=>{r++,this.opt.each(e,t)},t=>{0===t&&this.opt.noMatch(e),this.opt.done(r,t)})}mark(e,r){this.opt=r;let s=0,i=0,a=0;const n=this.opt.acrossElements?"wrapMatchesAcrossElements":"wrapMatches",o={},{keywords:h,length:c}=this.getSeparatedKeywords("string"==typeof e?[e]:e),l=e=>{const r=new t(this.opt).create(e);let p=0;this.log(`Searching with expression "${r}"`),this[n](r,1,(t,r,s)=>this.opt.filter(r,e,i,p,s),(e,t)=>{p++,i++,this.opt.each(e,t)},t=>{a+=t,0===t&&this.opt.noMatch(e),o[e]=t,++s<c?l(h[s]):this.opt.done(i,a,o)})};0===c?this.opt.done(i,0,o):l(h[s])}markRanges(e,t){this.opt=t;let r=0,s=this.checkRanges(e);s&&s.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(s)),this.wrapRangeFromIndex(s,(e,t,r,s)=>this.opt.filter(e,t,r,s),(e,t)=>{r++,this.opt.each(e,t)},()=>{this.opt.done(r)})):this.opt.done(r)}unmark(t){this.opt=t;let r=this.opt.element?this.opt.element:"*";r+="[data-markjs]",this.opt.className&&(r+=`.${this.opt.className}`),this.log(`Removal selector "${r}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,e=>{this.unwrapMatches(e)},t=>{const s=e.matches(t,r),i=this.matchesExclude(t);return!s||i?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}}return function(e){const t=new r(e);return this.mark=((e,r)=>(t.mark(e,r),this)),this.markRegExp=((e,r)=>(t.markRegExp(e,r),this)),this.markRanges=((e,r)=>(t.markRanges(e,r),this)),this.unmark=(e=>(t.unmark(e),this)),this}});
  