var Nt=Object.defineProperty;var Ct=(o,e,t)=>e in o?Nt(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var ke=(o,e,t)=>(Ct(o,typeof e!="symbol"?e+"":e,t),t);import{X as It,s as ie,v as Be,aO as Dt,aP as kt,d as Ot,G as we,aQ as et,h as xe,aR as Rt,aS as _t,x as Mt,aT as Lt,y as Oe,R as he,Q as Fe,aU as Pt,a3 as zt,Y as Vt,U as Bt,aV as $t,o as X,b as Wt,j as k,a1 as Kt,k as G,aW as Ut,aX as Jt,a4 as jt,c as te,n as tt,e as Ee,E as rt,F as at,a as de,t as ve,aY as Gt,p as Qt,l as Ht,aZ as nt,a_ as qt,aE as Yt,aK as Zt,a$ as Xt,_ as er}from"./framework.VBE0TPts.js";import{u as tr,c as rr}from"./theme.V-cXOrbT.js";const ar={root:()=>It(()=>import("./@localSearchIndexroot.DTRNNqXf.js"),[])};/*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var pt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Te=pt.join(","),yt=typeof Element>"u",se=yt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ne=!yt&&Element.prototype.getRootNode?function(o){var e;return o==null||(e=o.getRootNode)===null||e===void 0?void 0:e.call(o)}:function(o){return o==null?void 0:o.ownerDocument},Ce=function o(e,t){var r;t===void 0&&(t=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=n===""||n==="true",i=a||t&&e&&o(e.parentNode);return i},nr=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},mt=function(e,t,r){if(Ce(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Te));return t&&se.call(e,Te)&&n.unshift(e),n=n.filter(r),n},gt=function o(e,t,r){for(var n=[],a=Array.from(e);a.length;){var i=a.shift();if(!Ce(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),u=s.length?s:i.children,l=o(u,!0,r);r.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var d=se.call(i,Te);d&&r.filter(i)&&(t||!e.includes(i))&&n.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),v=!Ce(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&v){var m=o(h===!0?i.children:h.children,!0,r);r.flatten?n.push.apply(n,m):n.push({scopeParent:i,candidates:m})}else a.unshift.apply(a,i.children)}}return n},bt=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},oe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||nr(e))&&!bt(e)?0:e.tabIndex},ir=function(e,t){var r=oe(e);return r<0&&t&&!bt(e)?0:r},or=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},wt=function(e){return e.tagName==="INPUT"},sr=function(e){return wt(e)&&e.type==="hidden"},ur=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},lr=function(e,t){for(var r=0;rsummary:first-of-type"),i=a?e.parentElement:e;if(se.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof n=="function"){for(var s=e;e;){var u=e.parentElement,l=Ne(e);if(u&&!u.shadowRoot&&n(u)===!0)return it(e);e.assignedSlot?e=e.assignedSlot:!u&&l!==e.ownerDocument?e=l.host:e=u}e=s}if(dr(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return it(e);return!1},pr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},mr=function o(e){var t=[],r=[];return e.forEach(function(n,a){var i=!!n.scopeParent,s=i?n.scopeParent:n,u=ir(s,i),l=i?o(n.candidates):s;u===0?i?t.push.apply(t,l):t.push(s):r.push({documentOrder:a,tabIndex:u,item:n,isScope:i,content:l})}),r.sort(or).reduce(function(n,a){return a.isScope?n.push.apply(n,a.content):n.push(a.content),n},[]).concat(t)},gr=function(e,t){t=t||{};var r;return t.getShadowRoot?r=gt([e],t.includeContainer,{filter:$e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:yr}):r=mt(e,t.includeContainer,$e.bind(null,t)),mr(r)},br=function(e,t){t=t||{};var r;return t.getShadowRoot?r=gt([e],t.includeContainer,{filter:Ie.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=mt(e,t.includeContainer,Ie.bind(null,t)),r},ue=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return se.call(e,Te)===!1?!1:$e(t,e)},wr=pt.concat("iframe").join(","),Re=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return se.call(e,wr)===!1?!1:Ie(t,e)};/*! * focus-trap 7.5.4 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE */function ot(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),t.push.apply(t,r)}return t}function st(o){for(var e=1;e0){var r=e[e.length-1];r!==t&&r.pause()}var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},Sr=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Ar=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},me=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Tr=function(e){return me(e)&&!e.shiftKey},Nr=function(e){return me(e)&&e.shiftKey},lt=function(e){return setTimeout(e,0)},ct=function(e,t){var r=-1;return e.every(function(n,a){return t(n)?(r=a,!1):!0}),r},pe=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1?p-1:0),N=1;N=0)f=r.activeElement;else{var c=i.tabbableGroups[0],p=c&&c.firstTabbableNode;f=p||d("fallbackFocus")}if(!f)throw new Error("Your focus-trap needs to have at least one focusable element");return f},v=function(){if(i.containerGroups=i.containers.map(function(f){var c=gr(f,a.tabbableOptions),p=br(f,a.tabbableOptions),C=c.length>0?c[0]:void 0,N=c.length>0?c[c.length-1]:void 0,M=p.find(function(w){return ue(w)}),z=p.slice().reverse().find(function(w){return ue(w)}),y=!!c.find(function(w){return oe(w)>0});return{container:f,tabbableNodes:c,focusableNodes:p,posTabIndexesFound:y,firstTabbableNode:C,lastTabbableNode:N,firstDomTabbableNode:M,lastDomTabbableNode:z,nextTabbableNode:function(V){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=c.indexOf(V);return K<0?J?p.slice(p.indexOf(V)+1).find(function(U){return ue(U)}):p.slice(0,p.indexOf(V)).reverse().find(function(U){return ue(U)}):c[K+(J?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(f){return f.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!d("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(f){return f.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function F(f){var c=f.activeElement;if(c)return c.shadowRoot&&c.shadowRoot.activeElement!==null?F(c.shadowRoot):c},g=function F(f){if(f!==!1&&f!==m(document)){if(!f||!f.focus){F(h());return}f.focus({preventScroll:!!a.preventScroll}),i.mostRecentlyFocusedNode=f,Sr(f)&&f.select()}},b=function(f){var c=d("setReturnFocus",f);return c||(c===!1?!1:f)},x=function(f){var c=f.target,p=f.event,C=f.isBackward,N=C===void 0?!1:C;c=c||Se(p),v();var M=null;if(i.tabbableGroups.length>0){var z=l(c,p),y=z>=0?i.containerGroups[z]:void 0;if(z<0)N?M=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:M=i.tabbableGroups[0].firstTabbableNode;else if(N){var w=ct(i.tabbableGroups,function(j){var H=j.firstTabbableNode;return c===H});if(w<0&&(y.container===c||Re(c,a.tabbableOptions)&&!ue(c,a.tabbableOptions)&&!y.nextTabbableNode(c,!1))&&(w=z),w>=0){var V=w===0?i.tabbableGroups.length-1:w-1,J=i.tabbableGroups[V];M=oe(c)>=0?J.lastTabbableNode:J.lastDomTabbableNode}else me(p)||(M=y.nextTabbableNode(c,!1))}else{var K=ct(i.tabbableGroups,function(j){var H=j.lastTabbableNode;return c===H});if(K<0&&(y.container===c||Re(c,a.tabbableOptions)&&!ue(c,a.tabbableOptions)&&!y.nextTabbableNode(c))&&(K=z),K>=0){var U=K===i.tabbableGroups.length-1?0:K+1,B=i.tabbableGroups[U];M=oe(c)>=0?B.firstTabbableNode:B.firstDomTabbableNode}else me(p)||(M=y.nextTabbableNode(c))}}else M=d("fallbackFocus");return M},S=function(f){var c=Se(f);if(!(l(c,f)>=0)){if(pe(a.clickOutsideDeactivates,f)){s.deactivate({returnFocus:a.returnFocusOnDeactivate});return}pe(a.allowOutsideClick,f)||f.preventDefault()}},T=function(f){var c=Se(f),p=l(c,f)>=0;if(p||c instanceof Document)p&&(i.mostRecentlyFocusedNode=c);else{f.stopImmediatePropagation();var C,N=!0;if(i.mostRecentlyFocusedNode)if(oe(i.mostRecentlyFocusedNode)>0){var M=l(i.mostRecentlyFocusedNode),z=i.containerGroups[M].tabbableNodes;if(z.length>0){var y=z.findIndex(function(w){return w===i.mostRecentlyFocusedNode});y>=0&&(a.isKeyForward(i.recentNavEvent)?y+1=0&&(C=z[y-1],N=!1))}}else i.containerGroups.some(function(w){return w.tabbableNodes.some(function(V){return oe(V)>0})})||(N=!1);else N=!1;N&&(C=x({target:i.mostRecentlyFocusedNode,isBackward:a.isKeyBackward(i.recentNavEvent)})),g(C||i.mostRecentlyFocusedNode||h())}i.recentNavEvent=void 0},A=function(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=f;var p=x({event:f,isBackward:c});p&&(me(f)&&f.preventDefault(),g(p))},_=function(f){if(Ar(f)&&pe(a.escapeDeactivates,f)!==!1){f.preventDefault(),s.deactivate();return}(a.isKeyForward(f)||a.isKeyBackward(f))&&A(f,a.isKeyBackward(f))},L=function(f){var c=Se(f);l(c,f)>=0||pe(a.clickOutsideDeactivates,f)||pe(a.allowOutsideClick,f)||(f.preventDefault(),f.stopImmediatePropagation())},P=function(){if(i.active)return ut.activateTrap(n,s),i.delayInitialFocusTimer=a.delayInitialFocus?lt(function(){g(h())}):g(h()),r.addEventListener("focusin",T,!0),r.addEventListener("mousedown",S,{capture:!0,passive:!1}),r.addEventListener("touchstart",S,{capture:!0,passive:!1}),r.addEventListener("click",L,{capture:!0,passive:!1}),r.addEventListener("keydown",_,{capture:!0,passive:!1}),s},I=function(){if(i.active)return r.removeEventListener("focusin",T,!0),r.removeEventListener("mousedown",S,!0),r.removeEventListener("touchstart",S,!0),r.removeEventListener("click",L,!0),r.removeEventListener("keydown",_,!0),s},E=function(f){var c=f.some(function(p){var C=Array.from(p.removedNodes);return C.some(function(N){return N===i.mostRecentlyFocusedNode})});c&&g(h())},O=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(E):void 0,R=function(){O&&(O.disconnect(),i.active&&!i.paused&&i.containers.map(function(f){O.observe(f,{subtree:!0,childList:!0})}))};return s={get active(){return i.active},get paused(){return i.paused},activate:function(f){if(i.active)return this;var c=u(f,"onActivate"),p=u(f,"onPostActivate"),C=u(f,"checkCanFocusTrap");C||v(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,c==null||c();var N=function(){C&&v(),P(),R(),p==null||p()};return C?(C(i.containers.concat()).then(N,N),this):(N(),this)},deactivate:function(f){if(!i.active)return this;var c=st({onDeactivate:a.onDeactivate,onPostDeactivate:a.onPostDeactivate,checkCanReturnFocus:a.checkCanReturnFocus},f);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,I(),i.active=!1,i.paused=!1,R(),ut.deactivateTrap(n,s);var p=u(c,"onDeactivate"),C=u(c,"onPostDeactivate"),N=u(c,"checkCanReturnFocus"),M=u(c,"returnFocus","returnFocusOnDeactivate");p==null||p();var z=function(){lt(function(){M&&g(b(i.nodeFocusedBeforeActivation)),C==null||C()})};return M&&N?(N(b(i.nodeFocusedBeforeActivation)).then(z,z),this):(z(),this)},pause:function(f){if(i.paused||!i.active)return this;var c=u(f,"onPause"),p=u(f,"onPostPause");return i.paused=!0,c==null||c(),I(),R(),p==null||p(),this},unpause:function(f){if(!i.paused||!i.active)return this;var c=u(f,"onUnpause"),p=u(f,"onPostUnpause");return i.paused=!1,c==null||c(),v(),P(),R(),p==null||p(),this},updateContainerElements:function(f){var c=[].concat(f).filter(Boolean);return i.containers=c.map(function(p){return typeof p=="string"?r.querySelector(p):p}),i.active&&v(),R(),this}},s.updateContainerElements(e),s};function Dr(o,e={}){let t;const{immediate:r,...n}=e,a=ie(!1),i=ie(!1),s=h=>t&&t.activate(h),u=h=>t&&t.deactivate(h),l=()=>{t&&(t.pause(),i.value=!0)},d=()=>{t&&(t.unpause(),i.value=!1)};return Be(()=>Dt(o),h=>{h&&(t=Ir(h,{...n,onActivate(){a.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){a.value=!1,e.onDeactivate&&e.onDeactivate()}}),r&&s())},{flush:"post"}),kt(()=>u()),{hasFocus:a,isPaused:i,activate:s,deactivate:u,pause:l,unpause:d}}class ce{constructor(e,t=!0,r=[],n=5e3){this.ctx=e,this.iframes=t,this.exclude=r,this.iframesTimeout=n}static matches(e,t){const r=typeof t=="string"?[t]:t,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(n){let a=!1;return r.every(i=>n.call(e,i)?(a=!0,!1):!0),a}else return!1}getContexts(){let e,t=[];return typeof this.ctx>"u"||!this.ctx?e=[]:NodeList.prototype.isPrototypeOf(this.ctx)?e=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?e=this.ctx:typeof this.ctx=="string"?e=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):e=[this.ctx],e.forEach(r=>{const n=t.filter(a=>a.contains(r)).length>0;t.indexOf(r)===-1&&!n&&t.push(r)}),t}getIframeContents(e,t,r=()=>{}){let n;try{const a=e.contentWindow;if(n=a.document,!a||!n)throw new Error("iframe inaccessible")}catch{r()}n&&t(n)}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 n=!1,a=null;const i=()=>{if(!n){n=!0,clearTimeout(a);try{this.isIframeBlank(e)||(e.removeEventListener("load",i),this.getIframeContents(e,t,r))}catch{r()}}};e.addEventListener("load",i),a=setTimeout(i,this.iframesTimeout)}onIframeReady(e,t,r){try{e.contentWindow.document.readyState==="complete"?this.isIframeBlank(e)?this.observeIframeLoad(e,t,r):this.getIframeContents(e,t,r):this.observeIframeLoad(e,t,r)}catch{r()}}waitForIframes(e,t){let r=0;this.forEachIframe(e,()=>!0,n=>{r++,this.waitForIframes(n.querySelector("html"),()=>{--r||t()})},n=>{n||t()})}forEachIframe(e,t,r,n=()=>{}){let a=e.querySelectorAll("iframe"),i=a.length,s=0;a=Array.prototype.slice.call(a);const u=()=>{--i<=0&&n(s)};i||u(),a.forEach(l=>{ce.matches(l,this.exclude)?u():this.onIframeReady(l,d=>{t(l)&&(s++,r(d)),u()},u)})}createIterator(e,t,r){return document.createNodeIterator(e,t,r,!1)}createInstanceOnIframe(e){return new ce(e.querySelector("html"),this.iframes)}compareNodeIframe(e,t,r){const n=e.compareDocumentPosition(r),a=Node.DOCUMENT_POSITION_PRECEDING;if(n&a)if(t!==null){const i=t.compareDocumentPosition(r),s=Node.DOCUMENT_POSITION_FOLLOWING;if(i&s)return!0}else return!0;return!1}getIteratorNode(e){const t=e.previousNode();let r;return t===null?r=e.nextNode():r=e.nextNode()&&e.nextNode(),{prevNode:t,node:r}}checkIframeFilter(e,t,r,n){let a=!1,i=!1;return n.forEach((s,u)=>{s.val===r&&(a=u,i=s.handled)}),this.compareNodeIframe(e,t,r)?(a===!1&&!i?n.push({val:r,handled:!0}):a!==!1&&!i&&(n[a].handled=!0),!0):(a===!1&&n.push({val:r,handled:!1}),!1)}handleOpenIframes(e,t,r,n){e.forEach(a=>{a.handled||this.getIframeContents(a.val,i=>{this.createInstanceOnIframe(i).forEachNode(t,r,n)})})}iterateThroughNodes(e,t,r,n,a){const i=this.createIterator(t,e,n);let s=[],u=[],l,d,h=()=>({prevNode:d,node:l}=this.getIteratorNode(i),l);for(;h();)this.iframes&&this.forEachIframe(t,v=>this.checkIframeFilter(l,d,v,s),v=>{this.createInstanceOnIframe(v).forEachNode(e,m=>u.push(m),n)}),u.push(l);u.forEach(v=>{r(v)}),this.iframes&&this.handleOpenIframes(s,e,r,n),a()}forEachNode(e,t,r,n=()=>{}){const a=this.getContexts();let i=a.length;i||n(),a.forEach(s=>{const u=()=>{this.iterateThroughNodes(e,s,t,r,()=>{--i<=0&&n()})};this.iframes?this.waitForIframes(s,u):u()})}}let kr=class{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,diacritics:!0,synonyms:{},accuracy:"partially",acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:"disabled",each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},e)}get opt(){return this._opt}get iterator(){return new ce(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t="debug"){const r=this.opt.log;this.opt.debug&&typeof r=="object"&&typeof r[t]=="function"&&r[t](`mark.js: ${e}`)}escapeStr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}createRegExp(e){return this.opt.wildcards!=="disabled"&&(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)),this.opt.wildcards!=="disabled"&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),e}createSynonymsRegExp(e){const t=this.opt.synonyms,r=this.opt.caseSensitive?"":"i",n=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let a in t)if(t.hasOwnProperty(a)){const i=t[a],s=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(a):this.escapeStr(a),u=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(i):this.escapeStr(i);s!==""&&u!==""&&(e=e.replace(new RegExp(`(${this.escapeStr(s)}|${this.escapeStr(u)})`,`gm${r}`),n+`(${this.processSynomyms(s)}|${this.processSynomyms(u)})`+n))}return e}processSynomyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return e=e.replace(/(?:\\)*\?/g,t=>t.charAt(0)==="\\"?"?":""),e.replace(/(?:\\)*\*/g,t=>t.charAt(0)==="\\"?"*":"")}createWildcardsRegExp(e){let t=this.opt.wildcards==="withSpaces";return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}setupIgnoreJoinersRegExp(e){return e.replace(/[^(|)\\]/g,(t,r,n)=>{let a=n.charAt(r+1);return/[(|)\\]/.test(a)||a===""?t:t+"\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 n=[];return e.split("").forEach(a=>{r.every(i=>{if(i.indexOf(a)!==-1){if(n.indexOf(i)>-1)return!1;e=e.replace(new RegExp(`[${i}]`,`gm${t}`),`[${i}]`),n.push(i)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gmi,"[\\s]+")}createAccuracyRegExp(e){const t="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";let r=this.opt.accuracy,n=typeof r=="string"?r:r.value,a=typeof r=="string"?[]:r.limiters,i="";switch(a.forEach(s=>{i+=`|${this.escapeStr(s)}`}),n){case"partially":default:return`()(${e})`;case"complementary":return i="\\s"+(i||this.escapeStr(t)),`()([^${i}]*${e}[^${i}]*)`;case"exactly":return`(^|\\s${i})(${e})(?=$|\\s${i})`}}getSeparatedKeywords(e){let t=[];return e.forEach(r=>{this.opt.separateWordSearch?r.split(" ").forEach(n=>{n.trim()&&t.indexOf(n)===-1&&t.push(n)}):r.trim()&&t.indexOf(r)===-1&&t.push(r)}),{keywords:t.sort((r,n)=>n.length-r.length),length:t.length}}isNumeric(e){return Number(parseFloat(e))==e}checkRanges(e){if(!Array.isArray(e)||Object.prototype.toString.call(e[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];const t=[];let r=0;return e.sort((n,a)=>n.start-a.start).forEach(n=>{let{start:a,end:i,valid:s}=this.callNoMatchOnInvalidRanges(n,r);s&&(n.start=a,n.length=i-a,t.push(n),r=i)}),t}callNoMatchOnInvalidRanges(e,t){let r,n,a=!1;return e&&typeof e.start<"u"?(r=parseInt(e.start,10),n=r+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&n-t>0&&n-r>0?a=!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:n,valid:a}}checkWhitespaceRanges(e,t,r){let n,a=!0,i=r.length,s=t-i,u=parseInt(e.start,10)-s;return u=u>i?i:u,n=u+parseInt(e.length,10),n>i&&(n=i,this.log(`End range automatically set to the max value of ${i}`)),u<0||n-u<0||u>i||n>i?(a=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):r.substring(u,n).replace(/\s+/g,"")===""&&(a=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:u,end:n,valid:a}}getTextNodes(e){let t="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,n=>{r.push({start:t.length,end:(t+=n.textContent).length,node:n})},n=>this.matchesExclude(n.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:r})})}matchesExclude(e){return ce.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,r){const n=this.opt.element?this.opt.element:"mark",a=e.splitText(t),i=a.splitText(r-t);let s=document.createElement(n);return s.setAttribute("data-markjs","true"),this.opt.className&&s.setAttribute("class",this.opt.className),s.textContent=a.textContent,a.parentNode.replaceChild(s,a),i}wrapRangeInMappedTextNode(e,t,r,n,a){e.nodes.every((i,s)=>{const u=e.nodes[s+1];if(typeof u>"u"||u.start>t){if(!n(i.node))return!1;const l=t-i.start,d=(r>i.end?i.end:r)-i.start,h=e.value.substr(0,i.start),v=e.value.substr(d+i.start);if(i.node=this.wrapRangeInTextNode(i.node,l,d),e.value=h+v,e.nodes.forEach((m,g)=>{g>=s&&(e.nodes[g].start>0&&g!==s&&(e.nodes[g].start-=d),e.nodes[g].end-=d)}),r-=d,a(i.node.previousSibling,i.start),r>i.end)t=i.end;else return!1}return!0})}wrapMatches(e,t,r,n,a){const i=t===0?0:t+1;this.getTextNodes(s=>{s.nodes.forEach(u=>{u=u.node;let l;for(;(l=e.exec(u.textContent))!==null&&l[i]!=="";){if(!r(l[i],u))continue;let d=l.index;if(i!==0)for(let h=1;h{let u;for(;(u=e.exec(s.value))!==null&&u[i]!=="";){let l=u.index;if(i!==0)for(let h=1;hr(u[i],h),(h,v)=>{e.lastIndex=v,n(h)})}a()})}wrapRangeFromIndex(e,t,r,n){this.getTextNodes(a=>{const i=a.value.length;e.forEach((s,u)=>{let{start:l,end:d,valid:h}=this.checkWhitespaceRanges(s,i,a.value);h&&this.wrapRangeInMappedTextNode(a,l,d,v=>t(v,s,a.value.substring(l,d),u),v=>{r(v,s)})}),n()})}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(e.nodeType===3)for(;e.nextSibling&&e.nextSibling.nodeType===3;)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,this.log(`Searching with expression "${e}"`);let r=0,n="wrapMatches";const a=i=>{r++,this.opt.each(i)};this.opt.acrossElements&&(n="wrapMatchesAcrossElements"),this[n](e,this.opt.ignoreGroups,(i,s)=>this.opt.filter(s,i,r),a,()=>{r===0&&this.opt.noMatch(e),this.opt.done(r)})}mark(e,t){this.opt=t;let r=0,n="wrapMatches";const{keywords:a,length:i}=this.getSeparatedKeywords(typeof e=="string"?[e]:e),s=this.opt.caseSensitive?"":"i",u=l=>{let d=new RegExp(this.createRegExp(l),`gm${s}`),h=0;this.log(`Searching with expression "${d}"`),this[n](d,1,(v,m)=>this.opt.filter(m,l,r,h),v=>{h++,r++,this.opt.each(v)},()=>{h===0&&this.opt.noMatch(l),a[i-1]===l?this.opt.done(r):u(a[a.indexOf(l)+1])})};this.opt.acrossElements&&(n="wrapMatchesAcrossElements"),i===0?this.opt.done(r):u(a[0])}markRanges(e,t){this.opt=t;let r=0,n=this.checkRanges(e);n&&n.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(n)),this.wrapRangeFromIndex(n,(a,i,s,u)=>this.opt.filter(a,i,s,u),(a,i)=>{r++,this.opt.each(a,i)},()=>{this.opt.done(r)})):this.opt.done(r)}unmark(e){this.opt=e;let t=this.opt.element?this.opt.element:"*";t+="[data-markjs]",this.opt.className&&(t+=`.${this.opt.className}`),this.log(`Removal selector "${t}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,r=>{this.unwrapMatches(r)},r=>{const n=ce.matches(r,t),a=this.matchesExclude(r);return!n||a?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function Or(o){const e=new kr(o);return this.mark=(t,r)=>(e.mark(t,r),this),this.markRegExp=(t,r)=>(e.markRegExp(t,r),this),this.markRanges=(t,r)=>(e.markRanges(t,r),this),this.unmark=t=>(e.unmark(t),this),this}var $=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(o,e){var t=typeof Symbol=="function"&&o[Symbol.iterator];if(!t)return o;var r=t.call(o),n,a=[],i;try{for(;(e===void 0||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(i)throw i.error}}return a}var Mr="ENTRIES",xt="KEYS",Ft="VALUES",Q="",_e=function(){function o(e,t){var r=e._tree,n=Array.from(r.keys());this.set=e,this._type=t,this._path=n.length>0?[{node:r,keys:n}]:[]}return o.prototype.next=function(){var e=this.dive();return this.backtrack(),e},o.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=le(this._path),t=e.node,r=e.keys;if(le(r)===Q)return{done:!1,value:this.result()};var n=t.get(le(r));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()},o.prototype.backtrack=function(){if(this._path.length!==0){var e=le(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},o.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return le(t)}).filter(function(e){return e!==Q}).join("")},o.prototype.value=function(){return le(this._path).node.get(Q)},o.prototype.result=function(){switch(this._type){case Ft:return this.value();case xt:return this.key();default:return[this.key(),this.value()]}},o.prototype[Symbol.iterator]=function(){return this},o}(),le=function(o){return o[o.length-1]},Lr=function(o,e,t){var r=new Map;if(e===void 0)return r;for(var n=e.length+1,a=n+t,i=new Uint8Array(a*n).fill(t+1),s=0;st)continue e}Et(o.get(m),e,t,r,n,b,i,s+m)}}}catch(c){u={error:c}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(u)throw u.error}}},Me=function(){function o(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return o.prototype.atPrefix=function(e){var t,r;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var n=W(De(this._tree,e.slice(this._prefix.length)),2),a=n[0],i=n[1];if(a===void 0){var s=W(Je(i),2),u=s[0],l=s[1];try{for(var d=D(u.keys()),h=d.next();!h.done;h=d.next()){var v=h.value;if(v!==Q&&v.startsWith(l)){var m=new Map;return m.set(v.slice(l.length),u.get(v)),new o(m,e)}}}catch(g){t={error:g}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}}return new o(a,e)},o.prototype.clear=function(){this._size=void 0,this._tree.clear()},o.prototype.delete=function(e){return this._size=void 0,Pr(this._tree,e)},o.prototype.entries=function(){return new _e(this,Mr)},o.prototype.forEach=function(e){var t,r;try{for(var n=D(this),a=n.next();!a.done;a=n.next()){var i=W(a.value,2),s=i[0],u=i[1];e(s,u,this)}}catch(l){t={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},o.prototype.fuzzyGet=function(e,t){return Lr(this._tree,e,t)},o.prototype.get=function(e){var t=We(this._tree,e);return t!==void 0?t.get(Q):void 0},o.prototype.has=function(e){var t=We(this._tree,e);return t!==void 0&&t.has(Q)},o.prototype.keys=function(){return new _e(this,xt)},o.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Le(this._tree,e);return r.set(Q,t),this},Object.defineProperty(o.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),o.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Le(this._tree,e);return r.set(Q,t(r.get(Q))),this},o.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var r=Le(this._tree,e),n=r.get(Q);return n===void 0&&r.set(Q,n=t()),n},o.prototype.values=function(){return new _e(this,Ft)},o.prototype[Symbol.iterator]=function(){return this.entries()},o.from=function(e){var t,r,n=new o;try{for(var a=D(e),i=a.next();!i.done;i=a.next()){var s=W(i.value,2),u=s[0],l=s[1];n.set(u,l)}}catch(d){t={error:d}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return n},o.fromObject=function(e){return o.from(Object.entries(e))},o}(),De=function(o,e,t){var r,n;if(t===void 0&&(t=[]),e.length===0||o==null)return[o,t];try{for(var a=D(o.keys()),i=a.next();!i.done;i=a.next()){var s=i.value;if(s!==Q&&e.startsWith(s))return t.push([o,s]),De(o.get(s),e.slice(s.length),t)}}catch(u){r={error:u}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return t.push([o,e]),De(void 0,"",t)},We=function(o,e){var t,r;if(e.length===0||o==null)return o;try{for(var n=D(o.keys()),a=n.next();!a.done;a=n.next()){var i=a.value;if(i!==Q&&e.startsWith(i))return We(o.get(i),e.slice(i.length))}}catch(s){t={error:s}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},Le=function(o,e){var t,r,n=e.length;e:for(var a=0;o&&a0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Me,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},o.prototype.discard=function(e){var t=this,r=this._idToShortId.get(e);if(r==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(r),this._storedFields.delete(r),(this._fieldLength.get(r)||[]).forEach(function(n,a){t.removeFieldLength(r,a,t._documentCount,n)}),this._fieldLength.delete(r),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},o.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,r=e.minDirtCount,n=e.batchSize,a=e.batchWait;this.conditionalVacuum({batchSize:n,batchWait:a},{minDirtCount:r,minDirtFactor:t})}},o.prototype.discardAll=function(e){var t,r,n=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var a=D(e),i=a.next();!i.done;i=a.next()){var s=i.value;this.discard(s)}}catch(u){t={error:u}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()},o.prototype.replace=function(e){var t=this._options,r=t.idField,n=t.extractField,a=n(e,r);this.discard(a),this.add(e)},o.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},o.prototype.conditionalVacuum=function(e,t){var r=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var n=r._enqueuedVacuumConditions;return r._enqueuedVacuumConditions=Ue,r.performVacuuming(e,n)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},o.prototype.performVacuuming=function(e,t){return Rr(this,void 0,void 0,function(){var r,n,a,i,s,u,l,d,h,v,m,g,b,x,S,T,A,_,L,P,I,E,O,R,F;return _r(this,function(f){switch(f.label){case 0:if(r=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];n=e.batchSize||Ke.batchSize,a=e.batchWait||Ke.batchWait,i=1,f.label=1;case 1:f.trys.push([1,7,8,9]),s=D(this._index),u=s.next(),f.label=2;case 2:if(u.done)return[3,6];l=W(u.value,2),d=l[0],h=l[1];try{for(v=(E=void 0,D(h)),m=v.next();!m.done;m=v.next()){g=W(m.value,2),b=g[0],x=g[1];try{for(S=(R=void 0,D(x)),T=S.next();!T.done;T=S.next())A=W(T.value,1),_=A[0],!this._documentIds.has(_)&&(x.size<=1?h.delete(b):x.delete(_))}catch(c){R={error:c}}finally{try{T&&!T.done&&(F=S.return)&&F.call(S)}finally{if(R)throw R.error}}}}catch(c){E={error:c}}finally{try{m&&!m.done&&(O=v.return)&&O.call(v)}finally{if(E)throw E.error}}return this._index.get(d).size===0&&this._index.delete(d),i%n!==0?[3,4]:[4,new Promise(function(c){return setTimeout(c,a)})];case 3:f.sent(),f.label=4;case 4:i+=1,f.label=5;case 5:return u=s.next(),[3,2];case 6:return[3,9];case 7:return L=f.sent(),P={error:L},[3,9];case 8:try{u&&!u.done&&(I=s.return)&&I.call(s)}finally{if(P)throw P.error}return[7];case 9:this._dirtCount-=r,f.label=10;case 10:return[4,null];case 11:return f.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},o.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,r=e.minDirtFactor;return t=t||Ve.minDirtCount,r=r||Ve.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=r},Object.defineProperty(o.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),o.prototype.has=function(e){return this._idToShortId.has(e)},o.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},o.prototype.search=function(e,t){var r,n;t===void 0&&(t={});var a=this.executeQuery(e,t),i=[];try{for(var s=D(a),u=s.next();!u.done;u=s.next()){var l=W(u.value,2),d=l[0],h=l[1],v=h.score,m=h.terms,g=h.match,b=m.length||1,x={id:this._documentIds.get(d),score:v*b,terms:Object.keys(g),queryTerms:m,match:g};Object.assign(x,this._storedFields.get(d)),(t.filter==null||t.filter(x))&&i.push(x)}}catch(S){r={error:S}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e===o.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||i.sort(dt),i},o.prototype.autoSuggest=function(e,t){var r,n,a,i;t===void 0&&(t={}),t=$($({},this._options.autoSuggestOptions),t);var s=new Map;try{for(var u=D(this.search(e,t)),l=u.next();!l.done;l=u.next()){var d=l.value,h=d.score,v=d.terms,m=v.join(" "),g=s.get(m);g!=null?(g.score+=h,g.count+=1):s.set(m,{score:h,terms:v,count:1})}}catch(L){r={error:L}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}var b=[];try{for(var x=D(s),S=x.next();!S.done;S=x.next()){var T=W(S.value,2),g=T[0],A=T[1],h=A.score,v=A.terms,_=A.count;b.push({suggestion:g,terms:v,score:h/_})}}catch(L){a={error:L}}finally{try{S&&!S.done&&(i=x.return)&&i.call(x)}finally{if(a)throw a.error}}return b.sort(dt),b},Object.defineProperty(o.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),o.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},o.getDefault=function(e){if(ze.hasOwnProperty(e))return Pe(ze,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},o.loadJS=function(e,t){var r,n,a,i,s,u,l=e.index,d=e.documentCount,h=e.nextId,v=e.documentIds,m=e.fieldIds,g=e.fieldLength,b=e.averageFieldLength,x=e.storedFields,S=e.dirtCount,T=e.serializationVersion;if(T!==1&&T!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var A=new o(t);A._documentCount=d,A._nextId=h,A._documentIds=Ae(v),A._idToShortId=new Map,A._fieldIds=m,A._fieldLength=Ae(g),A._avgFieldLength=b,A._storedFields=Ae(x),A._dirtCount=S||0,A._index=new Me;try{for(var _=D(A._documentIds),L=_.next();!L.done;L=_.next()){var P=W(L.value,2),I=P[0],E=P[1];A._idToShortId.set(E,I)}}catch(y){r={error:y}}finally{try{L&&!L.done&&(n=_.return)&&n.call(_)}finally{if(r)throw r.error}}try{for(var O=D(l),R=O.next();!R.done;R=O.next()){var F=W(R.value,2),f=F[0],c=F[1],p=new Map;try{for(var C=(s=void 0,D(Object.keys(c))),N=C.next();!N.done;N=C.next()){var M=N.value,z=c[M];T===1&&(z=z.ds),p.set(parseInt(M,10),Ae(z))}}catch(y){s={error:y}}finally{try{N&&!N.done&&(u=C.return)&&u.call(C)}finally{if(s)throw s.error}}A._index.set(f,p)}}catch(y){a={error:y}}finally{try{R&&!R.done&&(i=O.return)&&i.call(O)}finally{if(a)throw a.error}}return A},o.prototype.executeQuery=function(e,t){var r=this;if(t===void 0&&(t={}),e===o.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var n=$($($({},t),e),{queries:void 0}),a=e.queries.map(function(x){return r.executeQuery(x,n)});return this.combineResults(a,n.combineWith)}var i=this._options,s=i.tokenize,u=i.processTerm,l=i.searchOptions,d=$($({tokenize:s,processTerm:u},l),t),h=d.tokenize,v=d.processTerm,m=h(e).flatMap(function(x){return v(x)}).filter(function(x){return!!x}),g=m.map(Kr(d)),b=g.map(function(x){return r.executeQuerySpec(x,d)});return this.combineResults(b,d.combineWith)},o.prototype.executeQuerySpec=function(e,t){var r,n,a,i,s=$($({},this._options.searchOptions),t),u=(s.fields||this._options.fields).reduce(function(M,z){var y;return $($({},M),(y={},y[z]=Pe(s.boost,z)||1,y))},{}),l=s.boostDocument,d=s.weights,h=s.maxFuzzy,v=s.bm25,m=$($({},ft.weights),d),g=m.fuzzy,b=m.prefix,x=this._index.get(e.term),S=this.termResults(e.term,e.term,1,x,u,l,v),T,A;if(e.prefix&&(T=this._index.atPrefix(e.term)),e.fuzzy){var _=e.fuzzy===!0?.2:e.fuzzy,L=_<1?Math.min(h,Math.round(e.term.length*_)):_;L&&(A=this._index.fuzzyGet(e.term,L))}if(T)try{for(var P=D(T),I=P.next();!I.done;I=P.next()){var E=W(I.value,2),O=E[0],R=E[1],F=O.length-e.term.length;if(F){A==null||A.delete(O);var f=b*O.length/(O.length+.3*F);this.termResults(e.term,O,f,R,u,l,v,S)}}}catch(M){r={error:M}}finally{try{I&&!I.done&&(n=P.return)&&n.call(P)}finally{if(r)throw r.error}}if(A)try{for(var c=D(A.keys()),p=c.next();!p.done;p=c.next()){var O=p.value,C=W(A.get(O),2),N=C[0],F=C[1];if(F){var f=g*O.length/(O.length+F);this.termResults(e.term,O,f,N,u,l,v,S)}}}catch(M){a={error:M}}finally{try{p&&!p.done&&(i=c.return)&&i.call(c)}finally{if(a)throw a.error}}return S},o.prototype.executeWildcardQuery=function(e){var t,r,n=new Map,a=$($({},this._options.searchOptions),e);try{for(var i=D(this._documentIds),s=i.next();!s.done;s=i.next()){var u=W(s.value,2),l=u[0],d=u[1],h=a.boostDocument?a.boostDocument(d,"",this._storedFields.get(l)):1;n.set(l,{score:h,terms:[],match:{}})}}catch(v){t={error:v}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},o.prototype.combineResults=function(e,t){if(t===void 0&&(t=je),e.length===0)return new Map;var r=t.toLowerCase();return e.reduce(Br[r])||new Map},o.prototype.toJSON=function(){var e,t,r,n,a=[];try{for(var i=D(this._index),s=i.next();!s.done;s=i.next()){var u=W(s.value,2),l=u[0],d=u[1],h={};try{for(var v=(r=void 0,D(d)),m=v.next();!m.done;m=v.next()){var g=W(m.value,2),b=g[0],x=g[1];h[b]=Object.fromEntries(x)}}catch(S){r={error:S}}finally{try{m&&!m.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}a.push([l,h])}}catch(S){e={error:S}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:a,serializationVersion:2}},o.prototype.termResults=function(e,t,r,n,a,i,s,u){var l,d,h,v,m;if(u===void 0&&(u=new Map),n==null)return u;try{for(var g=D(Object.keys(a)),b=g.next();!b.done;b=g.next()){var x=b.value,S=a[x],T=this._fieldIds[x],A=n.get(T);if(A!=null){var _=A.size,L=this._avgFieldLength[T];try{for(var P=(h=void 0,D(A.keys())),I=P.next();!I.done;I=P.next()){var E=I.value;if(!this._documentIds.has(E)){this.removeTerm(T,E,t),_-=1;continue}var O=i?i(this._documentIds.get(E),t,this._storedFields.get(E)):1;if(O){var R=A.get(E),F=this._fieldLength.get(E)[T],f=Wr(R,_,this._documentCount,F,L,s),c=r*S*O*f,p=u.get(E);if(p){p.score+=c,Jr(p.terms,e);var C=Pe(p.match,t);C?C.push(x):p.match[t]=[x]}else u.set(E,{score:c,terms:[e],match:(m={},m[t]=[x],m)})}}}catch(N){h={error:N}}finally{try{I&&!I.done&&(v=P.return)&&v.call(P)}finally{if(h)throw h.error}}}}}catch(N){l={error:N}}finally{try{b&&!b.done&&(d=g.return)&&d.call(g)}finally{if(l)throw l.error}}return u},o.prototype.addTerm=function(e,t,r){var n=this._index.fetch(r,vt),a=n.get(e);if(a==null)a=new Map,a.set(t,1),n.set(e,a);else{var i=a.get(t);a.set(t,(i||0)+1)}},o.prototype.removeTerm=function(e,t,r){if(!this._index.has(r)){this.warnDocumentChanged(t,e,r);return}var n=this._index.fetch(r,vt),a=n.get(e);a==null||a.get(t)==null?this.warnDocumentChanged(t,e,r):a.get(t)<=1?a.size<=1?n.delete(e):a.delete(t):a.set(t,a.get(t)-1),this._index.get(r).size===0&&this._index.delete(r)},o.prototype.warnDocumentChanged=function(e,t,r){var n,a;try{for(var i=D(Object.keys(this._fieldIds)),s=i.next();!s.done;s=i.next()){var u=s.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(r,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(l){n={error:l}}finally{try{s&&!s.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}},o.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},o.prototype.addFields=function(e){for(var t=0;t(Qt("data-v-639d7ab9"),o=o(),Ht(),o),Qr=["aria-owns"],Hr={class:"shell"},qr=["title"],Yr=Y(()=>k("span",{"aria-hidden":"true",class:"vpi-search search-icon local-search-icon"},null,-1)),Zr=[Yr],Xr={class:"search-actions before"},ea=["title"],ta=Y(()=>k("span",{class:"vpi-arrow-left local-search-icon"},null,-1)),ra=[ta],aa=["placeholder"],na={class:"search-actions"},ia=["title"],oa=Y(()=>k("span",{class:"vpi-layout-list local-search-icon"},null,-1)),sa=[oa],ua=["disabled","title"],la=Y(()=>k("span",{class:"vpi-delete local-search-icon"},null,-1)),ca=[la],fa=["id","role","aria-labelledby"],ha=["aria-selected"],da=["href","aria-label","onMouseenter","onFocusin"],va={class:"titles"},pa=Y(()=>k("span",{class:"title-icon"},"#",-1)),ya=["innerHTML"],ma=Y(()=>k("span",{class:"vpi-chevron-right local-search-icon"},null,-1)),ga={class:"title main"},ba=["innerHTML"],wa={key:0,class:"excerpt-wrapper"},xa={key:0,class:"excerpt",inert:""},Fa=["innerHTML"],Ea=Y(()=>k("div",{class:"excerpt-gradient-bottom"},null,-1)),Sa=Y(()=>k("div",{class:"excerpt-gradient-top"},null,-1)),Aa={key:0,class:"no-results"},Ta={class:"search-keyboard-shortcuts"},Na=["aria-label"],Ca=Y(()=>k("span",{class:"vpi-arrow-up navigate-icon"},null,-1)),Ia=[Ca],Da=["aria-label"],ka=Y(()=>k("span",{class:"vpi-arrow-down navigate-icon"},null,-1)),Oa=[ka],Ra=["aria-label"],_a=Y(()=>k("span",{class:"vpi-corner-down-left navigate-icon"},null,-1)),Ma=[_a],La=["aria-label"],Pa=Ot({__name:"VPLocalSearchBox",emits:["close"],setup(o,{emit:e}){var M,z;const t=we(),r=we(),n=we(ar),a=tr(),{activate:i}=Dr(t,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:s,theme:u}=a,l=et(async()=>{var y,w,V,J,K,U,B,j,H;return nt(Vr.loadJSON((V=await((w=(y=n.value)[s.value])==null?void 0:w.call(y)))==null?void 0:V.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...((J=u.value.search)==null?void 0:J.provider)==="local"&&((U=(K=u.value.search.options)==null?void 0:K.miniSearch)==null?void 0:U.searchOptions)},...((B=u.value.search)==null?void 0:B.provider)==="local"&&((H=(j=u.value.search.options)==null?void 0:j.miniSearch)==null?void 0:H.options)}))}),h=xe(()=>{var y,w;return((y=u.value.search)==null?void 0:y.provider)==="local"&&((w=u.value.search.options)==null?void 0:w.disableQueryPersistence)===!0}).value?ie(""):Rt("vitepress:local-search-filter",""),v=_t("vitepress:local-search-detailed-list",((M=u.value.search)==null?void 0:M.provider)==="local"&&((z=u.value.search.options)==null?void 0:z.detailedView)===!0),m=xe(()=>{var y,w,V;return((y=u.value.search)==null?void 0:y.provider)==="local"&&(((w=u.value.search.options)==null?void 0:w.disableDetailedView)===!0||((V=u.value.search.options)==null?void 0:V.detailedView)===!1)}),g=xe(()=>{var w,V,J,K,U,B,j;const y=((w=u.value.search)==null?void 0:w.options)??u.value.algolia;return((U=(K=(J=(V=y==null?void 0:y.locales)==null?void 0:V[s.value])==null?void 0:J.translations)==null?void 0:K.button)==null?void 0:U.buttonText)||((j=(B=y==null?void 0:y.translations)==null?void 0:B.button)==null?void 0:j.buttonText)||"Search"});Mt(()=>{m.value&&(v.value=!1)});const b=we([]),x=ie(!1);Be(h,()=>{x.value=!1});const S=et(async()=>{if(r.value)return nt(new Or(r.value))},null),T=new Gr(16);Lt(()=>[l.value,h.value,v.value],async([y,w,V],J,K)=>{var ge,Ge,Qe,He;(J==null?void 0:J[0])!==y&&T.clear();let U=!1;if(K(()=>{U=!0}),!y)return;b.value=y.search(w).slice(0,16),x.value=!0;const B=V?await Promise.all(b.value.map(q=>A(q.id))):[];if(U)return;for(const{id:q,mod:re}of B){const ae=q.slice(0,q.indexOf("#"));let ee=T.get(ae);if(ee)continue;ee=new Map,T.set(ae,ee);const Z=re.default??re;if(Z!=null&&Z.render||Z!=null&&Z.setup){const ne=qt(Z);ne.config.warnHandler=()=>{},ne.provide(Yt,a),Object.defineProperties(ne.config.globalProperties,{$frontmatter:{get(){return a.frontmatter.value}},$params:{get(){return a.page.value.params}}});const qe=document.createElement("div");ne.mount(qe),qe.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(fe=>{var Xe;const be=(Xe=fe.querySelector("a"))==null?void 0:Xe.getAttribute("href"),Ye=(be==null?void 0:be.startsWith("#"))&&be.slice(1);if(!Ye)return;let Ze="";for(;(fe=fe.nextElementSibling)&&!/^h[1-6]$/i.test(fe.tagName);)Ze+=fe.outerHTML;ee.set(Ye,Ze)}),ne.unmount()}if(U)return}const j=new Set;if(b.value=b.value.map(q=>{const[re,ae]=q.id.split("#"),ee=T.get(re),Z=(ee==null?void 0:ee.get(ae))??"";for(const ne in q.match)j.add(ne);return{...q,text:Z}}),await he(),U)return;await new Promise(q=>{var re;(re=S.value)==null||re.unmark({done:()=>{var ae;(ae=S.value)==null||ae.markRegExp(N(j),{done:q})}})});const H=((ge=t.value)==null?void 0:ge.querySelectorAll(".result .excerpt"))??[];for(const q of H)(Ge=q.querySelector('mark[data-markjs="true"]'))==null||Ge.scrollIntoView({block:"center"});(He=(Qe=r.value)==null?void 0:Qe.firstElementChild)==null||He.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function A(y){const w=Zt(y.slice(0,y.indexOf("#")));try{if(!w)throw new Error(`Cannot find file for id: ${y}`);return{id:y,mod:await import(w)}}catch(V){return console.error(V),{id:y,mod:{}}}}const _=ie(),L=xe(()=>{var y;return((y=h.value)==null?void 0:y.length)<=0});function P(y=!0){var w,V;(w=_.value)==null||w.focus(),y&&((V=_.value)==null||V.select())}Oe(()=>{P()});function I(y){y.pointerType==="mouse"&&P()}const E=ie(-1),O=ie(!1);Be(b,y=>{E.value=y.length?0:-1,R()});function R(){he(()=>{const y=document.querySelector(".result.selected");y==null||y.scrollIntoView({block:"nearest"})})}Fe("ArrowUp",y=>{y.preventDefault(),E.value--,E.value<0&&(E.value=b.value.length-1),O.value=!0,R()}),Fe("ArrowDown",y=>{y.preventDefault(),E.value++,E.value>=b.value.length&&(E.value=0),O.value=!0,R()});const F=Pt();Fe("Enter",y=>{if(y.isComposing||y.target instanceof HTMLButtonElement&&y.target.type!=="submit")return;const w=b.value[E.value];if(y.target instanceof HTMLInputElement&&!w){y.preventDefault();return}w&&(F.go(w.id),e("close"))}),Fe("Escape",()=>{e("close")});const c=rr({modal:{displayDetails:"Display detailed list",resetButtonTitle:"Reset search",backButtonTitle:"Close search",noResultsText:"No results for",footer:{selectText:"to select",selectKeyAriaLabel:"enter",navigateText:"to navigate",navigateUpKeyAriaLabel:"up arrow",navigateDownKeyAriaLabel:"down arrow",closeText:"to close",closeKeyAriaLabel:"escape"}}});Oe(()=>{window.history.pushState(null,"",null)}),zt("popstate",y=>{y.preventDefault(),e("close")});const p=Vt(Bt?document.body:null);Oe(()=>{he(()=>{p.value=!0,he().then(()=>i())})}),$t(()=>{p.value=!1});function C(){h.value="",he().then(()=>P(!1))}function N(y){return new RegExp([...y].sort((w,V)=>V.length-w.length).map(w=>`(${Xt(w)})`).join("|"),"gi")}return(y,w)=>{var V,J,K,U;return X(),Wt(Gt,{to:"body"},[k("div",{ref_key:"el",ref:t,role:"button","aria-owns":(V=b.value)!=null&&V.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[k("div",{class:"backdrop",onClick:w[0]||(w[0]=B=>y.$emit("close"))}),k("div",Hr,[k("form",{class:"search-bar",onPointerup:w[4]||(w[4]=B=>I(B)),onSubmit:w[5]||(w[5]=Kt(()=>{},["prevent"]))},[k("label",{title:g.value,id:"localsearch-label",for:"localsearch-input"},Zr,8,qr),k("div",Xr,[k("button",{class:"back-button",title:G(c)("modal.backButtonTitle"),onClick:w[1]||(w[1]=B=>y.$emit("close"))},ra,8,ea)]),Ut(k("input",{ref_key:"searchInput",ref:_,"onUpdate:modelValue":w[2]||(w[2]=B=>jt(h)?h.value=B:null),placeholder:g.value,id:"localsearch-input","aria-labelledby":"localsearch-label",class:"search-input"},null,8,aa),[[Jt,G(h)]]),k("div",na,[m.value?Ee("",!0):(X(),te("button",{key:0,class:tt(["toggle-layout-button",{"detailed-list":G(v)}]),type:"button",title:G(c)("modal.displayDetails"),onClick:w[3]||(w[3]=B=>E.value>-1&&(v.value=!G(v)))},sa,10,ia)),k("button",{class:"clear-button",type:"reset",disabled:L.value,title:G(c)("modal.resetButtonTitle"),onClick:C},ca,8,ua)])],32),k("ul",{ref_key:"resultsEl",ref:r,id:(J=b.value)!=null&&J.length?"localsearch-list":void 0,role:(K=b.value)!=null&&K.length?"listbox":void 0,"aria-labelledby":(U=b.value)!=null&&U.length?"localsearch-label":void 0,class:"results",onMousemove:w[7]||(w[7]=B=>O.value=!1)},[(X(!0),te(at,null,rt(b.value,(B,j)=>(X(),te("li",{key:B.id,role:"option","aria-selected":E.value===j?"true":"false"},[k("a",{href:B.id,class:tt(["result",{selected:E.value===j}]),"aria-label":[...B.titles,B.title].join(" > "),onMouseenter:H=>!O.value&&(E.value=j),onFocusin:H=>E.value=j,onClick:w[6]||(w[6]=H=>y.$emit("close"))},[k("div",null,[k("div",va,[pa,(X(!0),te(at,null,rt(B.titles,(H,ge)=>(X(),te("span",{key:ge,class:"title"},[k("span",{class:"text",innerHTML:H},null,8,ya),ma]))),128)),k("span",ga,[k("span",{class:"text",innerHTML:B.title},null,8,ba)])]),G(v)?(X(),te("div",wa,[B.text?(X(),te("div",xa,[k("div",{class:"vp-doc",innerHTML:B.text},null,8,Fa)])):Ee("",!0),Ea,Sa])):Ee("",!0)])],42,da)],8,ha))),128)),G(h)&&!b.value.length&&x.value?(X(),te("li",Aa,[de(ve(G(c)("modal.noResultsText"))+' "',1),k("strong",null,ve(G(h)),1),de('" ')])):Ee("",!0)],40,fa),k("div",Ta,[k("span",null,[k("kbd",{"aria-label":G(c)("modal.footer.navigateUpKeyAriaLabel")},Ia,8,Na),k("kbd",{"aria-label":G(c)("modal.footer.navigateDownKeyAriaLabel")},Oa,8,Da),de(" "+ve(G(c)("modal.footer.navigateText")),1)]),k("span",null,[k("kbd",{"aria-label":G(c)("modal.footer.selectKeyAriaLabel")},Ma,8,Ra),de(" "+ve(G(c)("modal.footer.selectText")),1)]),k("span",null,[k("kbd",{"aria-label":G(c)("modal.footer.closeKeyAriaLabel")},"esc",8,La),de(" "+ve(G(c)("modal.footer.closeText")),1)])])])],8,Qr)])}}}),Ka=er(Pa,[["__scopeId","data-v-639d7ab9"]]);export{Ka as default};