var Ot=Object.defineProperty;var Rt=(a,e,t)=>e in a?Ot(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var Ce=(a,e,t)=>Rt(a,typeof e!="symbol"?e+"":e,t);import{X as et,s as ne,h as ve,ao as tt,ap as Ct,aq as Mt,v as je,ar as At,d as Lt,G as ye,as as st,at as Dt,au as zt,x as Pt,av as Vt,y as Me,R as de,Q as we,aw as jt,ax as $t,Y as Bt,U as Wt,a1 as Kt,o as Q,b as Jt,j as x,a2 as Ut,k as D,a6 as qt,a7 as Gt,a8 as Qt,c as Z,n as nt,e as _e,E as it,F as rt,a as he,t as fe,ay as Ht,p as Yt,l as Zt,az as at,aA as Xt,ad as es,aj as ts,aB as ss,_ as ns}from"./framework.C4_mTacX.js";import{u as is,c as rs}from"./theme.BWcG15Yb.js";const as={en:()=>et(()=>import("./@localSearchIndexen.uFEj0oeZ.js"),[]),root:()=>et(()=>import("./@localSearchIndexroot.DzXBdwwZ.js"),[])};/*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var gt=["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])"],Ie=gt.join(","),bt=typeof Element>"u",re=bt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ne=!bt&&Element.prototype.getRootNode?function(a){var e;return a==null||(e=a.getRootNode)===null||e===void 0?void 0:e.call(a)}:function(a){return a==null?void 0:a.ownerDocument},ke=function a(e,t){var s;t===void 0&&(t=!0);var n=e==null||(s=e.getAttribute)===null||s===void 0?void 0:s.call(e,"inert"),r=n===""||n==="true",i=r||t&&e&&a(e.parentNode);return i},os=function(e){var t,s=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return s===""||s==="true"},yt=function(e,t,s){if(ke(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ie));return t&&re.call(e,Ie)&&n.unshift(e),n=n.filter(s),n},wt=function a(e,t,s){for(var n=[],r=Array.from(e);r.length;){var i=r.shift();if(!ke(i,!1))if(i.tagName==="SLOT"){var o=i.assignedElements(),c=o.length?o:i.children,l=a(c,!0,s);s.flatten?n.push.apply(n,l):n.push({scopeParent:i,candidates:l})}else{var h=re.call(i,Ie);h&&s.filter(i)&&(t||!e.includes(i))&&n.push(i);var v=i.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(i),f=!ke(v,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(i));if(v&&f){var b=a(v===!0?i.children:v.children,!0,s);s.flatten?n.push.apply(n,b):n.push({scopeParent:i,candidates:b})}else r.unshift.apply(r,i.children)}}return n},_t=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ie=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||os(e))&&!_t(e)?0:e.tabIndex},cs=function(e,t){var s=ie(e);return s<0&&t&&!_t(e)?0:s},ls=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xt=function(e){return e.tagName==="INPUT"},us=function(e){return xt(e)&&e.type==="hidden"},ds=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(s){return s.tagName==="SUMMARY"});return t},hs=function(e,t){for(var s=0;ssummary:first-of-type"),i=r?e.parentElement:e;if(re.call(i,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof n=="function"){for(var o=e;e;){var c=e.parentElement,l=Ne(e);if(c&&!c.shadowRoot&&n(c)===!0)return ot(e);e.assignedSlot?e=e.assignedSlot:!c&&l!==e.ownerDocument?e=l.host:e=c}e=o}if(ms(e))return!e.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return ot(e);return!1},bs=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var s=0;s=0)},ws=function a(e){var t=[],s=[];return e.forEach(function(n,r){var i=!!n.scopeParent,o=i?n.scopeParent:n,c=cs(o,i),l=i?a(n.candidates):o;c===0?i?t.push.apply(t,l):t.push(o):s.push({documentOrder:r,tabIndex:c,item:n,isScope:i,content:l})}),s.sort(ls).reduce(function(n,r){return r.isScope?n.push.apply(n,r.content):n.push(r.content),n},[]).concat(t)},_s=function(e,t){t=t||{};var s;return t.getShadowRoot?s=wt([e],t.includeContainer,{filter:$e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ys}):s=yt(e,t.includeContainer,$e.bind(null,t)),ws(s)},xs=function(e,t){t=t||{};var s;return t.getShadowRoot?s=wt([e],t.includeContainer,{filter:Fe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):s=yt(e,t.includeContainer,Fe.bind(null,t)),s},ae=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return re.call(e,Ie)===!1?!1:$e(t,e)},Ss=gt.concat("iframe").join(","),Ae=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return re.call(e,Ss)===!1?!1:Fe(t,e)};/*! * focus-trap 7.5.4 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE */function ct(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);e&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),t.push.apply(t,s)}return t}function lt(a){for(var e=1;e0){var s=e[e.length-1];s!==t&&s.pause()}var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var s=e.indexOf(t);s!==-1&&e.splice(s,1),e.length>0&&e[e.length-1].unpause()}},Ns=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},ks=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},Fs=function(e){return me(e)&&!e.shiftKey},Os=function(e){return me(e)&&e.shiftKey},dt=function(e){return setTimeout(e,0)},ht=function(e,t){var s=-1;return e.every(function(n,r){return t(n)?(s=r,!1):!0}),s},pe=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n1?m-1:0),E=1;E=0)u=s.activeElement;else{var d=i.tabbableGroups[0],m=d&&d.firstTabbableNode;u=m||h("fallbackFocus")}if(!u)throw new Error("Your focus-trap needs to have at least one focusable element");return u},f=function(){if(i.containerGroups=i.containers.map(function(u){var d=_s(u,r.tabbableOptions),m=xs(u,r.tabbableOptions),S=d.length>0?d[0]:void 0,E=d.length>0?d[d.length-1]:void 0,k=m.find(function(p){return ae(p)}),F=m.slice().reverse().find(function(p){return ae(p)}),M=!!d.find(function(p){return ie(p)>0});return{container:u,tabbableNodes:d,focusableNodes:m,posTabIndexesFound:M,firstTabbableNode:S,lastTabbableNode:E,firstDomTabbableNode:k,lastDomTabbableNode:F,nextTabbableNode:function(g){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=d.indexOf(g);return O<0?N?m.slice(m.indexOf(g)+1).find(function(P){return ae(P)}):m.slice(0,m.indexOf(g)).reverse().find(function(P){return ae(P)}):d[O+(N?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(u){return u.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!h("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(u){return u.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.")},b=function T(u){var d=u.activeElement;if(d)return d.shadowRoot&&d.shadowRoot.activeElement!==null?T(d.shadowRoot):d},y=function T(u){if(u!==!1&&u!==b(document)){if(!u||!u.focus){T(v());return}u.focus({preventScroll:!!r.preventScroll}),i.mostRecentlyFocusedNode=u,Ns(u)&&u.select()}},_=function(u){var d=h("setReturnFocus",u);return d||(d===!1?!1:u)},w=function(u){var d=u.target,m=u.event,S=u.isBackward,E=S===void 0?!1:S;d=d||xe(m),f();var k=null;if(i.tabbableGroups.length>0){var F=l(d,m),M=F>=0?i.containerGroups[F]:void 0;if(F<0)E?k=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:k=i.tabbableGroups[0].firstTabbableNode;else if(E){var p=ht(i.tabbableGroups,function(I){var L=I.firstTabbableNode;return d===L});if(p<0&&(M.container===d||Ae(d,r.tabbableOptions)&&!ae(d,r.tabbableOptions)&&!M.nextTabbableNode(d,!1))&&(p=F),p>=0){var g=p===0?i.tabbableGroups.length-1:p-1,N=i.tabbableGroups[g];k=ie(d)>=0?N.lastTabbableNode:N.lastDomTabbableNode}else me(m)||(k=M.nextTabbableNode(d,!1))}else{var O=ht(i.tabbableGroups,function(I){var L=I.lastTabbableNode;return d===L});if(O<0&&(M.container===d||Ae(d,r.tabbableOptions)&&!ae(d,r.tabbableOptions)&&!M.nextTabbableNode(d))&&(O=F),O>=0){var P=O===i.tabbableGroups.length-1?0:O+1,V=i.tabbableGroups[P];k=ie(d)>=0?V.firstTabbableNode:V.firstDomTabbableNode}else me(m)||(k=M.nextTabbableNode(d))}}else k=h("fallbackFocus");return k},R=function(u){var d=xe(u);if(!(l(d,u)>=0)){if(pe(r.clickOutsideDeactivates,u)){o.deactivate({returnFocus:r.returnFocusOnDeactivate});return}pe(r.allowOutsideClick,u)||u.preventDefault()}},C=function(u){var d=xe(u),m=l(d,u)>=0;if(m||d instanceof Document)m&&(i.mostRecentlyFocusedNode=d);else{u.stopImmediatePropagation();var S,E=!0;if(i.mostRecentlyFocusedNode)if(ie(i.mostRecentlyFocusedNode)>0){var k=l(i.mostRecentlyFocusedNode),F=i.containerGroups[k].tabbableNodes;if(F.length>0){var M=F.findIndex(function(p){return p===i.mostRecentlyFocusedNode});M>=0&&(r.isKeyForward(i.recentNavEvent)?M+1=0&&(S=F[M-1],E=!1))}}else i.containerGroups.some(function(p){return p.tabbableNodes.some(function(g){return ie(g)>0})})||(E=!1);else E=!1;E&&(S=w({target:i.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(i.recentNavEvent)})),y(S||i.mostRecentlyFocusedNode||v())}i.recentNavEvent=void 0},J=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=u;var m=w({event:u,isBackward:d});m&&(me(u)&&u.preventDefault(),y(m))},H=function(u){if(ks(u)&&pe(r.escapeDeactivates,u)!==!1){u.preventDefault(),o.deactivate();return}(r.isKeyForward(u)||r.isKeyBackward(u))&&J(u,r.isKeyBackward(u))},W=function(u){var d=xe(u);l(d,u)>=0||pe(r.clickOutsideDeactivates,u)||pe(r.allowOutsideClick,u)||(u.preventDefault(),u.stopImmediatePropagation())},j=function(){if(i.active)return ut.activateTrap(n,o),i.delayInitialFocusTimer=r.delayInitialFocus?dt(function(){y(v())}):y(v()),s.addEventListener("focusin",C,!0),s.addEventListener("mousedown",R,{capture:!0,passive:!1}),s.addEventListener("touchstart",R,{capture:!0,passive:!1}),s.addEventListener("click",W,{capture:!0,passive:!1}),s.addEventListener("keydown",H,{capture:!0,passive:!1}),o},$=function(){if(i.active)return s.removeEventListener("focusin",C,!0),s.removeEventListener("mousedown",R,!0),s.removeEventListener("touchstart",R,!0),s.removeEventListener("click",W,!0),s.removeEventListener("keydown",H,!0),o},Re=function(u){var d=u.some(function(m){var S=Array.from(m.removedNodes);return S.some(function(E){return E===i.mostRecentlyFocusedNode})});d&&y(v())},A=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Re):void 0,U=function(){A&&(A.disconnect(),i.active&&!i.paused&&i.containers.map(function(u){A.observe(u,{subtree:!0,childList:!0})}))};return o={get active(){return i.active},get paused(){return i.paused},activate:function(u){if(i.active)return this;var d=c(u,"onActivate"),m=c(u,"onPostActivate"),S=c(u,"checkCanFocusTrap");S||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=s.activeElement,d==null||d();var E=function(){S&&f(),j(),U(),m==null||m()};return S?(S(i.containers.concat()).then(E,E),this):(E(),this)},deactivate:function(u){if(!i.active)return this;var d=lt({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},u);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,$(),i.active=!1,i.paused=!1,U(),ut.deactivateTrap(n,o);var m=c(d,"onDeactivate"),S=c(d,"onPostDeactivate"),E=c(d,"checkCanReturnFocus"),k=c(d,"returnFocus","returnFocusOnDeactivate");m==null||m();var F=function(){dt(function(){k&&y(_(i.nodeFocusedBeforeActivation)),S==null||S()})};return k&&E?(E(_(i.nodeFocusedBeforeActivation)).then(F,F),this):(F(),this)},pause:function(u){if(i.paused||!i.active)return this;var d=c(u,"onPause"),m=c(u,"onPostPause");return i.paused=!0,d==null||d(),$(),U(),m==null||m(),this},unpause:function(u){if(!i.paused||!i.active)return this;var d=c(u,"onUnpause"),m=c(u,"onPostUnpause");return i.paused=!1,d==null||d(),f(),j(),U(),m==null||m(),this},updateContainerElements:function(u){var d=[].concat(u).filter(Boolean);return i.containers=d.map(function(m){return typeof m=="string"?s.querySelector(m):m}),i.active&&f(),U(),this}},o.updateContainerElements(e),o};function Ms(a,e={}){let t;const{immediate:s,...n}=e,r=ne(!1),i=ne(!1),o=f=>t&&t.activate(f),c=f=>t&&t.deactivate(f),l=()=>{t&&(t.pause(),i.value=!0)},h=()=>{t&&(t.unpause(),i.value=!1)},v=ve(()=>{const f=tt(a);return(Array.isArray(f)?f:[f]).map(b=>{const y=tt(b);return typeof y=="string"?y:Ct(y)}).filter(Mt)});return je(v,f=>{f.length&&(t=Cs(f,{...n,onActivate(){r.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){r.value=!1,e.onDeactivate&&e.onDeactivate()}}),s&&o())},{flush:"post"}),At(()=>c()),{hasFocus:r,isPaused:i,activate:o,deactivate:c,pause:l,unpause:h}}class ce{constructor(e,t=!0,s=[],n=5e3){this.ctx=e,this.iframes=t,this.exclude=s,this.iframesTimeout=n}static matches(e,t){const s=typeof t=="string"?[t]:t,n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(n){let r=!1;return s.every(i=>n.call(e,i)?(r=!0,!1):!0),r}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(s=>{const n=t.filter(r=>r.contains(s)).length>0;t.indexOf(s)===-1&&!n&&t.push(s)}),t}getIframeContents(e,t,s=()=>{}){let n;try{const r=e.contentWindow;if(n=r.document,!r||!n)throw new Error("iframe inaccessible")}catch{s()}n&&t(n)}isIframeBlank(e){const t="about:blank",s=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&s!==t&&s}observeIframeLoad(e,t,s){let n=!1,r=null;const i=()=>{if(!n){n=!0,clearTimeout(r);try{this.isIframeBlank(e)||(e.removeEventListener("load",i),this.getIframeContents(e,t,s))}catch{s()}}};e.addEventListener("load",i),r=setTimeout(i,this.iframesTimeout)}onIframeReady(e,t,s){try{e.contentWindow.document.readyState==="complete"?this.isIframeBlank(e)?this.observeIframeLoad(e,t,s):this.getIframeContents(e,t,s):this.observeIframeLoad(e,t,s)}catch{s()}}waitForIframes(e,t){let s=0;this.forEachIframe(e,()=>!0,n=>{s++,this.waitForIframes(n.querySelector("html"),()=>{--s||t()})},n=>{n||t()})}forEachIframe(e,t,s,n=()=>{}){let r=e.querySelectorAll("iframe"),i=r.length,o=0;r=Array.prototype.slice.call(r);const c=()=>{--i<=0&&n(o)};i||c(),r.forEach(l=>{ce.matches(l,this.exclude)?c():this.onIframeReady(l,h=>{t(l)&&(o++,s(h)),c()},c)})}createIterator(e,t,s){return document.createNodeIterator(e,t,s,!1)}createInstanceOnIframe(e){return new ce(e.querySelector("html"),this.iframes)}compareNodeIframe(e,t,s){const n=e.compareDocumentPosition(s),r=Node.DOCUMENT_POSITION_PRECEDING;if(n&r)if(t!==null){const i=t.compareDocumentPosition(s),o=Node.DOCUMENT_POSITION_FOLLOWING;if(i&o)return!0}else return!0;return!1}getIteratorNode(e){const t=e.previousNode();let s;return t===null?s=e.nextNode():s=e.nextNode()&&e.nextNode(),{prevNode:t,node:s}}checkIframeFilter(e,t,s,n){let r=!1,i=!1;return n.forEach((o,c)=>{o.val===s&&(r=c,i=o.handled)}),this.compareNodeIframe(e,t,s)?(r===!1&&!i?n.push({val:s,handled:!0}):r!==!1&&!i&&(n[r].handled=!0),!0):(r===!1&&n.push({val:s,handled:!1}),!1)}handleOpenIframes(e,t,s,n){e.forEach(r=>{r.handled||this.getIframeContents(r.val,i=>{this.createInstanceOnIframe(i).forEachNode(t,s,n)})})}iterateThroughNodes(e,t,s,n,r){const i=this.createIterator(t,e,n);let o=[],c=[],l,h,v=()=>({prevNode:h,node:l}=this.getIteratorNode(i),l);for(;v();)this.iframes&&this.forEachIframe(t,f=>this.checkIframeFilter(l,h,f,o),f=>{this.createInstanceOnIframe(f).forEachNode(e,b=>c.push(b),n)}),c.push(l);c.forEach(f=>{s(f)}),this.iframes&&this.handleOpenIframes(o,e,s,n),r()}forEachNode(e,t,s,n=()=>{}){const r=this.getContexts();let i=r.length;i||n(),r.forEach(o=>{const c=()=>{this.iterateThroughNodes(e,o,t,s,()=>{--i<=0&&n()})};this.iframes?this.waitForIframes(o,c):c()})}}let As=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 s=this.opt.log;this.opt.debug&&typeof s=="object"&&typeof s[t]=="function"&&s[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,s=this.opt.caseSensitive?"":"i",n=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let r in t)if(t.hasOwnProperty(r)){const i=t[r],o=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(r):this.escapeStr(r),c=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(i):this.escapeStr(i);o!==""&&c!==""&&(e=e.replace(new RegExp(`(${this.escapeStr(o)}|${this.escapeStr(c)})`,`gm${s}`),n+`(${this.processSynomyms(o)}|${this.processSynomyms(c)})`+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,s,n)=>{let r=n.charAt(s+1);return/[(|)\\]/.test(r)||r===""?t:t+"\0"})}createJoinersRegExp(e){let t=[];const s=this.opt.ignorePunctuation;return Array.isArray(s)&&s.length&&t.push(this.escapeStr(s.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",s=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(r=>{s.every(i=>{if(i.indexOf(r)!==-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 s=this.opt.accuracy,n=typeof s=="string"?s:s.value,r=typeof s=="string"?[]:s.limiters,i="";switch(r.forEach(o=>{i+=`|${this.escapeStr(o)}`}),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(s=>{this.opt.separateWordSearch?s.split(" ").forEach(n=>{n.trim()&&t.indexOf(n)===-1&&t.push(n)}):s.trim()&&t.indexOf(s)===-1&&t.push(s)}),{keywords:t.sort((s,n)=>n.length-s.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 s=0;return e.sort((n,r)=>n.start-r.start).forEach(n=>{let{start:r,end:i,valid:o}=this.callNoMatchOnInvalidRanges(n,s);o&&(n.start=r,n.length=i-r,t.push(n),s=i)}),t}callNoMatchOnInvalidRanges(e,t){let s,n,r=!1;return e&&typeof e.start<"u"?(s=parseInt(e.start,10),n=s+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&n-t>0&&n-s>0?r=!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:s,end:n,valid:r}}checkWhitespaceRanges(e,t,s){let n,r=!0,i=s.length,o=t-i,c=parseInt(e.start,10)-o;return c=c>i?i:c,n=c+parseInt(e.length,10),n>i&&(n=i,this.log(`End range automatically set to the max value of ${i}`)),c<0||n-c<0||c>i||n>i?(r=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):s.substring(c,n).replace(/\s+/g,"")===""&&(r=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:c,end:n,valid:r}}getTextNodes(e){let t="",s=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,n=>{s.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:s})})}matchesExclude(e){return ce.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,s){const n=this.opt.element?this.opt.element:"mark",r=e.splitText(t),i=r.splitText(s-t);let o=document.createElement(n);return o.setAttribute("data-markjs","true"),this.opt.className&&o.setAttribute("class",this.opt.className),o.textContent=r.textContent,r.parentNode.replaceChild(o,r),i}wrapRangeInMappedTextNode(e,t,s,n,r){e.nodes.every((i,o)=>{const c=e.nodes[o+1];if(typeof c>"u"||c.start>t){if(!n(i.node))return!1;const l=t-i.start,h=(s>i.end?i.end:s)-i.start,v=e.value.substr(0,i.start),f=e.value.substr(h+i.start);if(i.node=this.wrapRangeInTextNode(i.node,l,h),e.value=v+f,e.nodes.forEach((b,y)=>{y>=o&&(e.nodes[y].start>0&&y!==o&&(e.nodes[y].start-=h),e.nodes[y].end-=h)}),s-=h,r(i.node.previousSibling,i.start),s>i.end)t=i.end;else return!1}return!0})}wrapMatches(e,t,s,n,r){const i=t===0?0:t+1;this.getTextNodes(o=>{o.nodes.forEach(c=>{c=c.node;let l;for(;(l=e.exec(c.textContent))!==null&&l[i]!=="";){if(!s(l[i],c))continue;let h=l.index;if(i!==0)for(let v=1;v{let c;for(;(c=e.exec(o.value))!==null&&c[i]!=="";){let l=c.index;if(i!==0)for(let v=1;vs(c[i],v),(v,f)=>{e.lastIndex=f,n(v)})}r()})}wrapRangeFromIndex(e,t,s,n){this.getTextNodes(r=>{const i=r.value.length;e.forEach((o,c)=>{let{start:l,end:h,valid:v}=this.checkWhitespaceRanges(o,i,r.value);v&&this.wrapRangeInMappedTextNode(r,l,h,f=>t(f,o,r.value.substring(l,h),c),f=>{s(f,o)})}),n()})}unwrapMatches(e){const t=e.parentNode;let s=document.createDocumentFragment();for(;e.firstChild;)s.appendChild(e.removeChild(e.firstChild));t.replaceChild(s,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 s=0,n="wrapMatches";const r=i=>{s++,this.opt.each(i)};this.opt.acrossElements&&(n="wrapMatchesAcrossElements"),this[n](e,this.opt.ignoreGroups,(i,o)=>this.opt.filter(o,i,s),r,()=>{s===0&&this.opt.noMatch(e),this.opt.done(s)})}mark(e,t){this.opt=t;let s=0,n="wrapMatches";const{keywords:r,length:i}=this.getSeparatedKeywords(typeof e=="string"?[e]:e),o=this.opt.caseSensitive?"":"i",c=l=>{let h=new RegExp(this.createRegExp(l),`gm${o}`),v=0;this.log(`Searching with expression "${h}"`),this[n](h,1,(f,b)=>this.opt.filter(b,l,s,v),f=>{v++,s++,this.opt.each(f)},()=>{v===0&&this.opt.noMatch(l),r[i-1]===l?this.opt.done(s):c(r[r.indexOf(l)+1])})};this.opt.acrossElements&&(n="wrapMatchesAcrossElements"),i===0?this.opt.done(s):c(r[0])}markRanges(e,t){this.opt=t;let s=0,n=this.checkRanges(e);n&&n.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(n)),this.wrapRangeFromIndex(n,(r,i,o,c)=>this.opt.filter(r,i,o,c),(r,i)=>{s++,this.opt.each(r,i)},()=>{this.opt.done(s)})):this.opt.done(s)}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,s=>{this.unwrapMatches(s)},s=>{const n=ce.matches(s,t),r=this.matchesExclude(s);return!n||r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function Ls(a){const e=new As(a);return this.mark=(t,s)=>(e.mark(t,s),this),this.markRegExp=(t,s)=>(e.markRegExp(t,s),this),this.markRanges=(t,s)=>(e.markRanges(t,s),this),this.unmark=t=>(e.unmark(t),this),this}function Te(a,e,t,s){function n(r){return r instanceof t?r:new t(function(i){i(r)})}return new(t||(t=Promise))(function(r,i){function o(h){try{l(s.next(h))}catch(v){i(v)}}function c(h){try{l(s.throw(h))}catch(v){i(v)}}function l(h){h.done?r(h.value):n(h.value).then(o,c)}l((s=s.apply(a,[])).next())})}const Ds="ENTRIES",St="KEYS",Et="VALUES",z="";class Le{constructor(e,t){const s=e._tree,n=Array.from(s.keys());this.set=e,this._type=t,this._path=n.length>0?[{node:s,keys:n}]:[]}next(){const e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:e,keys:t}=oe(this._path);if(oe(t)===z)return{done:!1,value:this.result()};const s=e.get(oe(t));return this._path.push({node:s,keys:Array.from(s.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const e=oe(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>oe(e)).filter(e=>e!==z).join("")}value(){return oe(this._path).node.get(z)}result(){switch(this._type){case Et:return this.value();case St:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const oe=a=>a[a.length-1],zs=(a,e,t)=>{const s=new Map;if(e===void 0)return s;const n=e.length+1,r=n+t,i=new Uint8Array(r*n).fill(t+1);for(let o=0;o{const c=r*i;e:for(const l of a.keys())if(l===z){const h=n[c-1];h<=t&&s.set(o,[a.get(l),h])}else{let h=r;for(let v=0;vt)continue e}Tt(a.get(l),e,t,s,n,h,i,o+l)}};class X{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");const[t,s]=Oe(this._tree,e.slice(this._prefix.length));if(t===void 0){const[n,r]=Je(s);for(const i of n.keys())if(i!==z&&i.startsWith(r)){const o=new Map;return o.set(i.slice(r.length),n.get(i)),new X(o,e)}}return new X(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,Ps(this._tree,e)}entries(){return new Le(this,Ds)}forEach(e){for(const[t,s]of this)e(t,s,this)}fuzzyGet(e,t){return zs(this._tree,e,t)}get(e){const t=Be(this._tree,e);return t!==void 0?t.get(z):void 0}has(e){const t=Be(this._tree,e);return t!==void 0&&t.has(z)}keys(){return new Le(this,St)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,De(this._tree,e).set(z,t),this}get size(){if(this._size)return this._size;this._size=0;const e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const s=De(this._tree,e);return s.set(z,t(s.get(z))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const s=De(this._tree,e);let n=s.get(z);return n===void 0&&s.set(z,n=t()),n}values(){return new Le(this,Et)}[Symbol.iterator](){return this.entries()}static from(e){const t=new X;for(const[s,n]of e)t.set(s,n);return t}static fromObject(e){return X.from(Object.entries(e))}}const Oe=(a,e,t=[])=>{if(e.length===0||a==null)return[a,t];for(const s of a.keys())if(s!==z&&e.startsWith(s))return t.push([a,s]),Oe(a.get(s),e.slice(s.length),t);return t.push([a,e]),Oe(void 0,"",t)},Be=(a,e)=>{if(e.length===0||a==null)return a;for(const t of a.keys())if(t!==z&&e.startsWith(t))return Be(a.get(t),e.slice(t.length))},De=(a,e)=>{const t=e.length;e:for(let s=0;a&&s{const[t,s]=Oe(a,e);if(t!==void 0){if(t.delete(z),t.size===0)It(s);else if(t.size===1){const[n,r]=t.entries().next().value;Nt(s,n,r)}}},It=a=>{if(a.length===0)return;const[e,t]=Je(a);if(e.delete(t),e.size===0)It(a.slice(0,-1));else if(e.size===1){const[s,n]=e.entries().next().value;s!==z&&Nt(a.slice(0,-1),s,n)}},Nt=(a,e,t)=>{if(a.length===0)return;const[s,n]=Je(a);s.set(n+e,t),s.delete(n)},Je=a=>a[a.length-1],Ue="or",kt="and",Vs="and_not";class le{constructor(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const t=e.autoVacuum==null||e.autoVacuum===!0?Ve:e.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Pe),e),{autoVacuum:t,searchOptions:Object.assign(Object.assign({},ft),e.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},Ks),e.autoSuggestOptions||{})}),this._index=new X,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Ke,this.addFields(this._options.fields)}add(e){const{extractField:t,tokenize:s,processTerm:n,fields:r,idField:i}=this._options,o=t(e,i);if(o==null)throw new Error(`MiniSearch: document does not have ID field "${i}"`);if(this._idToShortId.has(o))throw new Error(`MiniSearch: duplicate ID ${o}`);const c=this.addDocumentId(o);this.saveStoredFields(c,e);for(const l of r){const h=t(e,l);if(h==null)continue;const v=s(h.toString(),l),f=this._fieldIds[l],b=new Set(v).size;this.addFieldLength(c,f,this._documentCount-1,b);for(const y of v){const _=n(y,l);if(Array.isArray(_))for(const w of _)this.addTerm(f,c,w);else _&&this.addTerm(f,c,_)}}}addAll(e){for(const t of e)this.add(t)}addAllAsync(e,t={}){const{chunkSize:s=10}=t,n={chunk:[],promise:Promise.resolve()},{chunk:r,promise:i}=e.reduce(({chunk:o,promise:c},l,h)=>(o.push(l),(h+1)%s===0?{chunk:[],promise:c.then(()=>new Promise(v=>setTimeout(v,0))).then(()=>this.addAll(o))}:{chunk:o,promise:c}),n);return i.then(()=>this.addAll(r))}remove(e){const{tokenize:t,processTerm:s,extractField:n,fields:r,idField:i}=this._options,o=n(e,i);if(o==null)throw new Error(`MiniSearch: document does not have ID field "${i}"`);const c=this._idToShortId.get(o);if(c==null)throw new Error(`MiniSearch: cannot remove document with ID ${o}: it is not in the index`);for(const l of r){const h=n(e,l);if(h==null)continue;const v=t(h.toString(),l),f=this._fieldIds[l],b=new Set(v).size;this.removeFieldLength(c,f,this._documentCount,b);for(const y of v){const _=s(y,l);if(Array.isArray(_))for(const w of _)this.removeTerm(f,c,w);else _&&this.removeTerm(f,c,_)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(o),this._fieldLength.delete(c),this._documentCount-=1}removeAll(e){if(e)for(const t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new X,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){const t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((s,n)=>{this.removeFieldLength(t,n,this._documentCount,s)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:e,minDirtCount:t,batchSize:s,batchWait:n}=this._options.autoVacuum;this.conditionalVacuum({batchSize:s,batchWait:n},{minDirtCount:t,minDirtFactor:e})}discardAll(e){const t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const s of e)this.discard(s)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){const{idField:t,extractField:s}=this._options,n=s(e,t);this.discard(n),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const s=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=Ke,this.performVacuuming(e,s)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}performVacuuming(e,t){return Te(this,void 0,void 0,function*(){const s=this._dirtCount;if(this.vacuumConditionsMet(t)){const n=e.batchSize||We.batchSize,r=e.batchWait||We.batchWait;let i=1;for(const[o,c]of this._index){for(const[l,h]of c)for(const[v]of h)this._documentIds.has(v)||(h.size<=1?c.delete(l):h.delete(v));this._index.get(o).size===0&&this._index.delete(o),i%n===0&&(yield new Promise(l=>setTimeout(l,r))),i+=1}this._dirtCount-=s}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:s}=e;return t=t||Ve.minDirtCount,s=s||Ve.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=s}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){const t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){const s=this.executeQuery(e,t),n=[];for(const[r,{score:i,terms:o,match:c}]of s){const l=o.length||1,h={id:this._documentIds.get(r),score:i*l,terms:Object.keys(c),queryTerms:o,match:c};Object.assign(h,this._storedFields.get(r)),(t.filter==null||t.filter(h))&&n.push(h)}return e===le.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||n.sort(vt),n}autoSuggest(e,t={}){t=Object.assign(Object.assign({},this._options.autoSuggestOptions),t);const s=new Map;for(const{score:r,terms:i}of this.search(e,t)){const o=i.join(" "),c=s.get(o);c!=null?(c.score+=r,c.count+=1):s.set(o,{score:r,terms:i,count:1})}const n=[];for(const[r,{score:i,terms:o,count:c}]of s)n.push({suggestion:r,terms:o,score:i/c});return n.sort(vt),n}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(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)}static loadJSONAsync(e,t){return Te(this,void 0,void 0,function*(){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)})}static getDefault(e){if(Pe.hasOwnProperty(e))return ze(Pe,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){const{index:s,documentIds:n,fieldLength:r,storedFields:i,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,t);c._documentIds=Se(n),c._fieldLength=Se(r),c._storedFields=Se(i);for(const[l,h]of c._documentIds)c._idToShortId.set(h,l);for(const[l,h]of s){const v=new Map;for(const f of Object.keys(h)){let b=h[f];o===1&&(b=b.ds),v.set(parseInt(f,10),Se(b))}c._index.set(l,v)}return c}static loadJSAsync(e,t){return Te(this,void 0,void 0,function*(){const{index:s,documentIds:n,fieldLength:r,storedFields:i,serializationVersion:o}=e,c=this.instantiateMiniSearch(e,t);c._documentIds=yield Ee(n),c._fieldLength=yield Ee(r),c._storedFields=yield Ee(i);for(const[h,v]of c._documentIds)c._idToShortId.set(v,h);let l=0;for(const[h,v]of s){const f=new Map;for(const b of Object.keys(v)){let y=v[b];o===1&&(y=y.ds),f.set(parseInt(b,10),yield Ee(y))}++l%1e3===0&&(yield Ft(0)),c._index.set(h,f)}return c})}static instantiateMiniSearch(e,t){const{documentCount:s,nextId:n,fieldIds:r,averageFieldLength:i,dirtCount:o,serializationVersion:c}=e;if(c!==1&&c!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const l=new le(t);return l._documentCount=s,l._nextId=n,l._idToShortId=new Map,l._fieldIds=r,l._avgFieldLength=i,l._dirtCount=o||0,l._index=new X,l}executeQuery(e,t={}){if(e===le.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){const f=Object.assign(Object.assign(Object.assign({},t),e),{queries:void 0}),b=e.queries.map(y=>this.executeQuery(y,f));return this.combineResults(b,f.combineWith)}const{tokenize:s,processTerm:n,searchOptions:r}=this._options,i=Object.assign(Object.assign({tokenize:s,processTerm:n},r),t),{tokenize:o,processTerm:c}=i,v=o(e).flatMap(f=>c(f)).filter(f=>!!f).map(Ws(i)).map(f=>this.executeQuerySpec(f,i));return this.combineResults(v,i.combineWith)}executeQuerySpec(e,t){const s=Object.assign(Object.assign({},this._options.searchOptions),t),n=(s.fields||this._options.fields).reduce((_,w)=>Object.assign(Object.assign({},_),{[w]:ze(s.boost,w)||1}),{}),{boostDocument:r,weights:i,maxFuzzy:o,bm25:c}=s,{fuzzy:l,prefix:h}=Object.assign(Object.assign({},ft.weights),i),v=this._index.get(e.term),f=this.termResults(e.term,e.term,1,e.termBoost,v,n,r,c);let b,y;if(e.prefix&&(b=this._index.atPrefix(e.term)),e.fuzzy){const _=e.fuzzy===!0?.2:e.fuzzy,w=_<1?Math.min(o,Math.round(e.term.length*_)):_;w&&(y=this._index.fuzzyGet(e.term,w))}if(b)for(const[_,w]of b){const R=_.length-e.term.length;if(!R)continue;y==null||y.delete(_);const C=h*_.length/(_.length+.3*R);this.termResults(e.term,_,C,e.termBoost,w,n,r,c,f)}if(y)for(const _ of y.keys()){const[w,R]=y.get(_);if(!R)continue;const C=l*_.length/(_.length+R);this.termResults(e.term,_,C,e.termBoost,w,n,r,c,f)}return f}executeWildcardQuery(e){const t=new Map,s=Object.assign(Object.assign({},this._options.searchOptions),e);for(const[n,r]of this._documentIds){const i=s.boostDocument?s.boostDocument(r,"",this._storedFields.get(n)):1;t.set(n,{score:i,terms:[],match:{}})}return t}combineResults(e,t=Ue){if(e.length===0)return new Map;const s=t.toLowerCase(),n=js[s];if(!n)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(n)||new Map}toJSON(){const e=[];for(const[t,s]of this._index){const n={};for(const[r,i]of s)n[r]=Object.fromEntries(i);e.push([t,n])}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:e,serializationVersion:2}}termResults(e,t,s,n,r,i,o,c,l=new Map){if(r==null)return l;for(const h of Object.keys(i)){const v=i[h],f=this._fieldIds[h],b=r.get(f);if(b==null)continue;let y=b.size;const _=this._avgFieldLength[f];for(const w of b.keys()){if(!this._documentIds.has(w)){this.removeTerm(f,w,t),y-=1;continue}const R=o?o(this._documentIds.get(w),t,this._storedFields.get(w)):1;if(!R)continue;const C=b.get(w),J=this._fieldLength.get(w)[f],H=Bs(C,y,this._documentCount,J,_,c),W=s*n*v*R*H,j=l.get(w);if(j){j.score+=W,Js(j.terms,e);const $=ze(j.match,t);$?$.push(h):j.match[t]=[h]}else l.set(w,{score:W,terms:[e],match:{[t]:[h]}})}}return l}addTerm(e,t,s){const n=this._index.fetch(s,mt);let r=n.get(e);if(r==null)r=new Map,r.set(t,1),n.set(e,r);else{const i=r.get(t);r.set(t,(i||0)+1)}}removeTerm(e,t,s){if(!this._index.has(s)){this.warnDocumentChanged(t,e,s);return}const n=this._index.fetch(s,mt),r=n.get(e);r==null||r.get(t)==null?this.warnDocumentChanged(t,e,s):r.get(t)<=1?r.size<=1?n.delete(e):r.delete(t):r.set(t,r.get(t)-1),this._index.get(s).size===0&&this._index.delete(s)}warnDocumentChanged(e,t,s){for(const n of Object.keys(this._fieldIds))if(this._fieldIds[n]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${s}" was not present in field "${n}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){const t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;tObject.prototype.hasOwnProperty.call(a,e)?a[e]:void 0,js={[Ue]:(a,e)=>{for(const t of e.keys()){const s=a.get(t);if(s==null)a.set(t,e.get(t));else{const{score:n,terms:r,match:i}=e.get(t);s.score=s.score+n,s.match=Object.assign(s.match,i),pt(s.terms,r)}}return a},[kt]:(a,e)=>{const t=new Map;for(const s of e.keys()){const n=a.get(s);if(n==null)continue;const{score:r,terms:i,match:o}=e.get(s);pt(n.terms,i),t.set(s,{score:n.score+r,terms:n.terms,match:Object.assign(n.match,o)})}return t},[Vs]:(a,e)=>{for(const t of e.keys())a.delete(t);return a}},$s={k:1.2,b:.7,d:.5},Bs=(a,e,t,s,n,r)=>{const{k:i,b:o,d:c}=r;return Math.log(1+(t-e+.5)/(e+.5))*(c+a*(i+1)/(a+i*(1-o+o*s/n)))},Ws=a=>(e,t,s)=>{const n=typeof a.fuzzy=="function"?a.fuzzy(e,t,s):a.fuzzy||!1,r=typeof a.prefix=="function"?a.prefix(e,t,s):a.prefix===!0,i=typeof a.boostTerm=="function"?a.boostTerm(e,t,s):1;return{term:e,fuzzy:n,prefix:r,termBoost:i}},Pe={idField:"id",extractField:(a,e)=>a[e],tokenize:a=>a.split(Us),processTerm:a=>a.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(a,e)=>{typeof(console==null?void 0:console[a])=="function"&&console[a](e)},autoVacuum:!0},ft={combineWith:Ue,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:$s},Ks={combineWith:kt,prefix:(a,e,t)=>e===t.length-1},We={batchSize:1e3,batchWait:10},Ke={minDirtFactor:.1,minDirtCount:20},Ve=Object.assign(Object.assign({},We),Ke),Js=(a,e)=>{a.includes(e)||a.push(e)},pt=(a,e)=>{for(const t of e)a.includes(t)||a.push(t)},vt=({score:a},{score:e})=>e-a,mt=()=>new Map,Se=a=>{const e=new Map;for(const t of Object.keys(a))e.set(parseInt(t,10),a[t]);return e},Ee=a=>Te(void 0,void 0,void 0,function*(){const e=new Map;let t=0;for(const s of Object.keys(a))e.set(parseInt(s,10),a[s]),++t%1e3===0&&(yield Ft(0));return e}),Ft=a=>new Promise(e=>setTimeout(e,a)),Us=/[\n\r\p{Z}\p{P}]+/u;class qs{constructor(e=10){Ce(this,"max");Ce(this,"cache");this.max=e,this.cache=new Map}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.max&&this.cache.delete(this.first()),this.cache.set(e,t)}first(){return this.cache.keys().next().value}clear(){this.cache.clear()}}const K=a=>(Yt("data-v-a5632211"),a=a(),Zt(),a),Gs=["aria-owns"],Qs={class:"shell"},Hs=["title"],Ys=K(()=>x("span",{"aria-hidden":"true",class:"vpi-search search-icon local-search-icon"},null,-1)),Zs=[Ys],Xs={class:"search-actions before"},en=["title"],tn=K(()=>x("span",{class:"vpi-arrow-left local-search-icon"},null,-1)),sn=[tn],nn=["placeholder"],rn={class:"search-actions"},an=["title"],on=K(()=>x("span",{class:"vpi-layout-list local-search-icon"},null,-1)),cn=[on],ln=["disabled","title"],un=K(()=>x("span",{class:"vpi-delete local-search-icon"},null,-1)),dn=[un],hn=["id","role","aria-labelledby"],fn=["aria-selected"],pn=["href","aria-label","onMouseenter","onFocusin"],vn={class:"titles"},mn=K(()=>x("span",{class:"title-icon"},"#",-1)),gn=["innerHTML"],bn=K(()=>x("span",{class:"vpi-chevron-right local-search-icon"},null,-1)),yn={class:"title main"},wn=["innerHTML"],_n={key:0,class:"excerpt-wrapper"},xn={key:0,class:"excerpt",inert:""},Sn=["innerHTML"],En=K(()=>x("div",{class:"excerpt-gradient-bottom"},null,-1)),Tn=K(()=>x("div",{class:"excerpt-gradient-top"},null,-1)),In={key:0,class:"no-results"},Nn={class:"search-keyboard-shortcuts"},kn=["aria-label"],Fn=K(()=>x("span",{class:"vpi-arrow-up navigate-icon"},null,-1)),On=[Fn],Rn=["aria-label"],Cn=K(()=>x("span",{class:"vpi-arrow-down navigate-icon"},null,-1)),Mn=[Cn],An=["aria-label"],Ln=K(()=>x("span",{class:"vpi-corner-down-left navigate-icon"},null,-1)),Dn=[Ln],zn=["aria-label"],Pn=Lt({__name:"VPLocalSearchBox",emits:["close"],setup(a,{emit:e}){var F,M;const t=e,s=ye(),n=ye(),r=ye(as),i=is(),{activate:o}=Ms(s,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:c,theme:l}=i,h=st(async()=>{var p,g,N,O,P,V,I,L,q;return at(le.loadJSON((N=await((g=(p=r.value)[c.value])==null?void 0:g.call(p)))==null?void 0:N.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...((O=l.value.search)==null?void 0:O.provider)==="local"&&((V=(P=l.value.search.options)==null?void 0:P.miniSearch)==null?void 0:V.searchOptions)},...((I=l.value.search)==null?void 0:I.provider)==="local"&&((q=(L=l.value.search.options)==null?void 0:L.miniSearch)==null?void 0:q.options)}))}),f=ve(()=>{var p,g;return((p=l.value.search)==null?void 0:p.provider)==="local"&&((g=l.value.search.options)==null?void 0:g.disableQueryPersistence)===!0}).value?ne(""):Dt("vitepress:local-search-filter",""),b=zt("vitepress:local-search-detailed-list",((F=l.value.search)==null?void 0:F.provider)==="local"&&((M=l.value.search.options)==null?void 0:M.detailedView)===!0),y=ve(()=>{var p,g,N;return((p=l.value.search)==null?void 0:p.provider)==="local"&&(((g=l.value.search.options)==null?void 0:g.disableDetailedView)===!0||((N=l.value.search.options)==null?void 0:N.detailedView)===!1)}),_=ve(()=>{var g,N,O,P,V,I,L;const p=((g=l.value.search)==null?void 0:g.options)??l.value.algolia;return((V=(P=(O=(N=p==null?void 0:p.locales)==null?void 0:N[c.value])==null?void 0:O.translations)==null?void 0:P.button)==null?void 0:V.buttonText)||((L=(I=p==null?void 0:p.translations)==null?void 0:I.button)==null?void 0:L.buttonText)||"Search"});Pt(()=>{y.value&&(b.value=!1)});const w=ye([]),R=ne(!1);je(f,()=>{R.value=!1});const C=st(async()=>{if(n.value)return at(new Ls(n.value))},null),J=new qs(16);Vt(()=>[h.value,f.value,b.value],async([p,g,N],O,P)=>{var ge,qe,Ge,Qe;(O==null?void 0:O[0])!==p&&J.clear();let V=!1;if(P(()=>{V=!0}),!p)return;w.value=p.search(g).slice(0,16),R.value=!0;const I=N?await Promise.all(w.value.map(B=>H(B.id))):[];if(V)return;for(const{id:B,mod:ee}of I){const te=B.slice(0,B.indexOf("#"));let Y=J.get(te);if(Y)continue;Y=new Map,J.set(te,Y);const G=ee.default??ee;if(G!=null&&G.render||G!=null&&G.setup){const se=Xt(G);se.config.warnHandler=()=>{},se.provide(es,i),Object.defineProperties(se.config.globalProperties,{$frontmatter:{get(){return i.frontmatter.value}},$params:{get(){return i.page.value.params}}});const He=document.createElement("div");se.mount(He),He.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(ue=>{var Xe;const be=(Xe=ue.querySelector("a"))==null?void 0:Xe.getAttribute("href"),Ye=(be==null?void 0:be.startsWith("#"))&&be.slice(1);if(!Ye)return;let Ze="";for(;(ue=ue.nextElementSibling)&&!/^h[1-6]$/i.test(ue.tagName);)Ze+=ue.outerHTML;Y.set(Ye,Ze)}),se.unmount()}if(V)return}const L=new Set;if(w.value=w.value.map(B=>{const[ee,te]=B.id.split("#"),Y=J.get(ee),G=(Y==null?void 0:Y.get(te))??"";for(const se in B.match)L.add(se);return{...B,text:G}}),await de(),V)return;await new Promise(B=>{var ee;(ee=C.value)==null||ee.unmark({done:()=>{var te;(te=C.value)==null||te.markRegExp(k(L),{done:B})}})});const q=((ge=s.value)==null?void 0:ge.querySelectorAll(".result .excerpt"))??[];for(const B of q)(qe=B.querySelector('mark[data-markjs="true"]'))==null||qe.scrollIntoView({block:"center"});(Qe=(Ge=n.value)==null?void 0:Ge.firstElementChild)==null||Qe.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function H(p){const g=ts(p.slice(0,p.indexOf("#")));try{if(!g)throw new Error(`Cannot find file for id: ${p}`);return{id:p,mod:await import(g)}}catch(N){return console.error(N),{id:p,mod:{}}}}const W=ne(),j=ve(()=>{var p;return((p=f.value)==null?void 0:p.length)<=0});function $(p=!0){var g,N;(g=W.value)==null||g.focus(),p&&((N=W.value)==null||N.select())}Me(()=>{$()});function Re(p){p.pointerType==="mouse"&&$()}const A=ne(-1),U=ne(!1);je(w,p=>{A.value=p.length?0:-1,T()});function T(){de(()=>{const p=document.querySelector(".result.selected");p==null||p.scrollIntoView({block:"nearest"})})}we("ArrowUp",p=>{p.preventDefault(),A.value--,A.value<0&&(A.value=w.value.length-1),U.value=!0,T()}),we("ArrowDown",p=>{p.preventDefault(),A.value++,A.value>=w.value.length&&(A.value=0),U.value=!0,T()});const u=jt();we("Enter",p=>{if(p.isComposing||p.target instanceof HTMLButtonElement&&p.target.type!=="submit")return;const g=w.value[A.value];if(p.target instanceof HTMLInputElement&&!g){p.preventDefault();return}g&&(u.go(g.id),t("close"))}),we("Escape",()=>{t("close")});const m=rs({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"}}});Me(()=>{window.history.pushState(null,"",null)}),$t("popstate",p=>{p.preventDefault(),t("close")});const S=Bt(Wt?document.body:null);Me(()=>{de(()=>{S.value=!0,de().then(()=>o())})}),Kt(()=>{S.value=!1});function E(){f.value="",de().then(()=>$(!1))}function k(p){return new RegExp([...p].sort((g,N)=>N.length-g.length).map(g=>`(${ss(g)})`).join("|"),"gi")}return(p,g)=>{var N,O,P,V;return Q(),Jt(Ht,{to:"body"},[x("div",{ref_key:"el",ref:s,role:"button","aria-owns":(N=w.value)!=null&&N.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[x("div",{class:"backdrop",onClick:g[0]||(g[0]=I=>p.$emit("close"))}),x("div",Qs,[x("form",{class:"search-bar",onPointerup:g[4]||(g[4]=I=>Re(I)),onSubmit:g[5]||(g[5]=Ut(()=>{},["prevent"]))},[x("label",{title:_.value,id:"localsearch-label",for:"localsearch-input"},Zs,8,Hs),x("div",Xs,[x("button",{class:"back-button",title:D(m)("modal.backButtonTitle"),onClick:g[1]||(g[1]=I=>p.$emit("close"))},sn,8,en)]),qt(x("input",{ref_key:"searchInput",ref:W,"onUpdate:modelValue":g[2]||(g[2]=I=>Qt(f)?f.value=I:null),placeholder:_.value,id:"localsearch-input","aria-labelledby":"localsearch-label",class:"search-input"},null,8,nn),[[Gt,D(f)]]),x("div",rn,[y.value?_e("",!0):(Q(),Z("button",{key:0,class:nt(["toggle-layout-button",{"detailed-list":D(b)}]),type:"button",title:D(m)("modal.displayDetails"),onClick:g[3]||(g[3]=I=>A.value>-1&&(b.value=!D(b)))},cn,10,an)),x("button",{class:"clear-button",type:"reset",disabled:j.value,title:D(m)("modal.resetButtonTitle"),onClick:E},dn,8,ln)])],32),x("ul",{ref_key:"resultsEl",ref:n,id:(O=w.value)!=null&&O.length?"localsearch-list":void 0,role:(P=w.value)!=null&&P.length?"listbox":void 0,"aria-labelledby":(V=w.value)!=null&&V.length?"localsearch-label":void 0,class:"results",onMousemove:g[7]||(g[7]=I=>U.value=!1)},[(Q(!0),Z(rt,null,it(w.value,(I,L)=>(Q(),Z("li",{key:I.id,role:"option","aria-selected":A.value===L?"true":"false"},[x("a",{href:I.id,class:nt(["result",{selected:A.value===L}]),"aria-label":[...I.titles,I.title].join(" > "),onMouseenter:q=>!U.value&&(A.value=L),onFocusin:q=>A.value=L,onClick:g[6]||(g[6]=q=>p.$emit("close"))},[x("div",null,[x("div",vn,[mn,(Q(!0),Z(rt,null,it(I.titles,(q,ge)=>(Q(),Z("span",{key:ge,class:"title"},[x("span",{class:"text",innerHTML:q},null,8,gn),bn]))),128)),x("span",yn,[x("span",{class:"text",innerHTML:I.title},null,8,wn)])]),D(b)?(Q(),Z("div",_n,[I.text?(Q(),Z("div",xn,[x("div",{class:"vp-doc",innerHTML:I.text},null,8,Sn)])):_e("",!0),En,Tn])):_e("",!0)])],42,pn)],8,fn))),128)),D(f)&&!w.value.length&&R.value?(Q(),Z("li",In,[he(fe(D(m)("modal.noResultsText"))+' "',1),x("strong",null,fe(D(f)),1),he('" ')])):_e("",!0)],40,hn),x("div",Nn,[x("span",null,[x("kbd",{"aria-label":D(m)("modal.footer.navigateUpKeyAriaLabel")},On,8,kn),x("kbd",{"aria-label":D(m)("modal.footer.navigateDownKeyAriaLabel")},Mn,8,Rn),he(" "+fe(D(m)("modal.footer.navigateText")),1)]),x("span",null,[x("kbd",{"aria-label":D(m)("modal.footer.selectKeyAriaLabel")},Dn,8,An),he(" "+fe(D(m)("modal.footer.selectText")),1)]),x("span",null,[x("kbd",{"aria-label":D(m)("modal.footer.closeKeyAriaLabel")},"esc",8,zn),he(" "+fe(D(m)("modal.footer.closeText")),1)])])])],8,Gs)])}}}),Kn=ns(Pn,[["__scopeId","data-v-a5632211"]]);export{Kn as default};