tmagic-editor/docs/assets/chunks/VPLocalSearchBox.ze7qUEL5.js
2026-07-24 09:39:36 +00:00

3 lines
60 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{n as e}from"./theme.DjefmpVa.js";import{$ as t,A as n,D as r,Dt as i,E as a,En as o,Et as s,I as c,Mn as l,On as u,Ot as d,Pt as f,Qt as p,R as m,Sn as h,Tt as g,U as _,Vt as v,W as y,Wt as ee,Xt as b,b as te,bt as ne,cn as x,d as re,fn as S,h as ie,hn as ae,ht as oe,jt as C,k as w,kn as se,ln as ce,mn as le,nt as ue,o as de,p as fe,qt as pe,rt as T,st as me,ut as he,vt as ge,wt as E,x as _e,xt as ve,yn as D}from"./framework.ECw2lWOt.js";var ye={root:()=>de(()=>import(`./@localSearchIndexroot.BAScjDJR.js`),[])},be=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],O=be.join(`,`),k=typeof Element>`u`,A=k?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,j=!k&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},M=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):M(e.parentNode))},xe=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},N=function(e,t,n){if(M(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(O));return t&&A.call(e,O)&&r.unshift(e),r=r.filter(n),r},P=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!M(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=P(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{A.call(a,O)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!M(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=P(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},F=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},I=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||xe(e))&&!F(e)?0:e.tabIndex},L=function(e,t){var n=I(e);return n<0&&t&&!F(e)?0:n},Se=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},R=function(e){return e.tagName===`INPUT`},Ce=function(e){return R(e)&&e.type===`hidden`},we=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Te=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},z=function(e){if(!e.name)return!0;var t=e.form||j(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Te(r,e.form);return!i||i===e},Ee=function(e){return R(e)&&e.type===`radio`},B=function(e){return Ee(e)&&!z(e)},V=function(e){var t=e&&j(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=j(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},H=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},De=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=A.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(A.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=j(e);if(s&&!s.shadowRoot&&r(s)===!0)return H(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(V(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return H(e);return!1},Oe=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return A.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},U=function(e,t){return!(t.disabled||Ce(t)||De(t,e)||we(t)||Oe(t))},W=function(e,t){return!(B(t)||I(t)<0||!U(e,t))},G=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},K=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=L(a,i),s=i?K(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Se).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ke=function(e,t){return t||={},K(t.getShadowRoot?P([e],t.includeContainer,{filter:W.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:G}):N(e,t.includeContainer,W.bind(null,t)))},Ae=function(e,t){return t||={},t.getShadowRoot?P([e],t.includeContainer,{filter:U.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):N(e,t.includeContainer,U.bind(null,t))},q=function(e,t){if(t||={},!e)throw Error(`No node provided`);return A.call(e,O)!==!1&&W(t,e)},je=be.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Me=function(e,t){if(t||={},!e)throw Error(`No node provided`);return A.call(e,je)!==!1&&U(t,e)};function Ne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Pe(e){if(Array.isArray(e))return Ne(e)}function Fe(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=We(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Ie(e,t,n){return(t=Ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Le(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Re(){throw TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ze(Object(n),!0).forEach(function(t){Ie(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ve(e){return Pe(e)||Le(e)||We(e)||Re()}function He(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ue(e){var t=He(e,`string`);return typeof t==`symbol`?t:t+``}function We(e,t){if(e){if(typeof e==`string`)return Ne(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,t):void 0}}var J={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){t!==J.getActiveTrap(e)&&J.pauseTrap(e);var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),J.unpauseTrap(e)},pauseTrap:function(e){J.getActiveTrap(e)?._setPausedState(!0)},unpauseTrap:function(e){var t=J.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},Ge=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},Ke=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},Y=function(e){return e?.key===`Tab`||e?.keyCode===9},qe=function(e){return Y(e)&&!e.shiftKey},Je=function(e){return Y(e)&&e.shiftKey},Ye=function(e){return setTimeout(e,0)},X=function(e){var t=[...arguments].slice(1);return typeof e==`function`?e.apply(void 0,t):e},Xe=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},Ze=[],Qe=function(e,t){var n=t?.document||document,r=t?.trapStack||Ze,i=Be({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,delayReturnFocus:!0,isolateSubtrees:!1,isKeyForward:qe,isKeyBackward:Je},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r!==void 0&&r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,Ve(s))),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(e){var t=e.activeElement;return t?t.shadowRoot&&t.shadowRoot.activeElement!==null?u(t.shadowRoot):t:null},d=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!Me(e,i.tabbableOptions)){var t=u(n);if(c(t)>=0)e=t;else{var r=a.tabbableGroups[0];e=r&&r.firstTabbableNode||l(`fallbackFocus`)}}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},f=function(){if(a.containerGroups=a.containers.map(function(e){var t=ke(e,i.tabbableOptions),n=Ae(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return q(e)}),s=n.slice().reverse().find(function(e){return q(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return I(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return q(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return q(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw 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.`)},p=function(e){if(e!==!1&&e!==u(document)){if(!e||!e.focus){p(d());return}e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,Ge(e)&&e.select()}},m=function(e){var t=l(`setReturnFocus`,{params:[e]});return t||t!==!1&&e},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=r!==void 0&&r;t||=Xe(n),f();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),d=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var p=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(p<0&&(d.container===t||Me(t,i.tabbableOptions)&&!q(t,i.tabbableOptions)&&!d.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=p===0?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];s=I(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else Y(n)||(s=d.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(d.container===t||Me(t,i.tabbableOptions)&&!q(t,i.tabbableOptions)&&!d.nextTabbableNode(t))&&(g=u),g>=0){var _=g===a.tabbableGroups.length-1?0:g+1,v=a.tabbableGroups[_];s=I(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else Y(n)||(s=d.nextTabbableNode(t))}}else s=l(`fallbackFocus`);return s},g=function(e){if(!(c(Xe(e),e)>=0)){if(X(i.clickOutsideDeactivates,e)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}X(i.allowOutsideClick,e)||e.preventDefault()}},_=function(e){var t=Xe(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var r,o=!0;if(a.mostRecentlyFocusedNode)if(I(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var u=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});u>=0&&(i.isKeyForward(a.recentNavEvent)?u+1<l.length&&(r=l[u+1],o=!1):u-1>=0&&(r=l[u-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return I(e)>0})})||(o=!1);else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||d())}a.recentNavEvent=void 0},v=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(Y(e)&&e.preventDefault(),p(n))},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&v(e,i.isKeyBackward(e))},ee=function(e){Ke(e)&&X(i.escapeDeactivates,e)!==!1&&(e.preventDefault(),o.deactivate())},b=function(e){c(Xe(e),e)>=0||X(i.clickOutsideDeactivates,e)||X(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},te=function(){if(a.active){J.activateTrap(r,o);var e;return i.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=Ye(function(){p(d()),e()})}):p(d()),n.addEventListener(`focusin`,_,!0),n.addEventListener(`mousedown`,g,{capture:!0,passive:!1}),n.addEventListener(`touchstart`,g,{capture:!0,passive:!1}),n.addEventListener(`click`,b,{capture:!0,passive:!1}),n.addEventListener(`keydown`,y,{capture:!0,passive:!1}),n.addEventListener(`keydown`,ee),e}},ne=function(e){a.active&&!a.paused&&o._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t=new Set,n=new Set,r=Fe(e),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;t.add(s);for(var c=typeof ShadowRoot<`u`&&s.getRootNode()instanceof ShadowRoot,l=s;l;){t.add(l);var u=l.parentElement,d=[];u?d=u.children:!u&&c&&(d=l.getRootNode().children,u=l.getRootNode().host,c=typeof ShadowRoot<`u`&&u.getRootNode()instanceof ShadowRoot);var f=Fe(d),p;try{for(f.s();!(p=f.n()).done;){var m=p.value;n.add(m)}}catch(e){f.e(e)}finally{f.f()}l=u}}}catch(e){r.e(e)}finally{r.f()}t.forEach(function(e){n.delete(e)}),a.adjacentElements=n},x=function(){if(a.active)return n.removeEventListener(`focusin`,_,!0),n.removeEventListener(`mousedown`,g,!0),n.removeEventListener(`touchstart`,g,!0),n.removeEventListener(`click`,b,!0),n.removeEventListener(`keydown`,y,!0),n.removeEventListener(`keydown`,ee),o},re=typeof window<`u`&&`MutationObserver`in window?new MutationObserver(function(e){var t=a.mostRecentlyFocusedNode;t&&e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===t||typeof e.contains==`function`&&e.contains(t)})})&&a.containers.some(function(e){return e?.isConnected})&&(f(),p(d()))}):void 0,S=function(){re&&(re.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){re.observe(e,{subtree:!0,childList:!0})}))};return o={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,`onActivate`),i=s(e,`onPostActivate`),c=s(e,`checkCanFocusTrap`),l=J.getActiveTrap(r),d=!1;if(l&&!l.paused){var p;(p=l._setSubtreeIsolation)==null||p.call(l,!1),d=!0}try{c||f(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=u(n),t?.({trap:o});var m=function(){c&&f();var e=function(){o._setSubtreeIsolation(!0),S(),i?.({trap:o})},t=te();t?t.then(e):e()};if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){if(l===J.getActiveTrap(r)&&d){var h;(h=l._setSubtreeIsolation)==null||h.call(l,!0)}throw e}return this},deactivate:function(e){if(!a.active)return this;var t=Be({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||o._setSubtreeIsolation(!1),a.alreadySilent.clear(),x(),a.active=!1,a.paused=!1,S(),J.deactivateTrap(r,o);var n=s(t,`onDeactivate`),c=s(t,`onPostDeactivate`),l=s(t,`checkCanReturnFocus`),u=s(t,`delayReturnFocus`),d=s(t,`returnFocus`,`returnFocusOnDeactivate`);n?.({trap:o});var f=function(){d&&p(m(a.nodeFocusedBeforeActivation)),c?.({trap:o})},h=function(){u&&d?Ye(f):f()};return d&&l?(l(m(a.nodeFocusedBeforeActivation)).then(h,h),this):(h(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return!a.active||(a.manuallyPaused=!1,r[r.length-1]!==this)?this:this._setPausedState(!1,e)},updateContainerElements:function(e){return a.containers=[].concat(e).filter(Boolean).map(function(e){return typeof e==`string`?n.querySelector(e):e}),i.isolateSubtrees&&ne(a.containers),a.active&&(f(),a.paused||o._setSubtreeIsolation(!0)),S(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=s(t,`onPause`),r=s(t,`onPostPause`);n?.({trap:o}),x(),o._setSubtreeIsolation(!1),S(),r?.({trap:o})}else{var i=s(t,`onUnpause`),c=s(t,`onPostUnpause`);i?.({trap:o}),(function(){f();var e=function(){o._setSubtreeIsolation(!0),S(),c?.({trap:o})},t=te();t?t.then(e):e()})()}return this}},_setSubtreeIsolation:{value:function(e){i.isolateSubtrees&&a.adjacentElements.forEach(function(t){if(e)switch(i.isolateSubtrees){case`aria-hidden`:(t.ariaHidden===`true`||t.getAttribute(`aria-hidden`)?.toLowerCase()===`true`)&&a.alreadySilent.add(t),t.setAttribute(`aria-hidden`,`true`);break;default:(t.inert||t.hasAttribute(`inert`))&&a.alreadySilent.add(t),t.setAttribute(`inert`,!0);break}else if(!a.alreadySilent.has(t))switch(i.isolateSubtrees){case`aria-hidden`:t.removeAttribute(`aria-hidden`);break;default:t.removeAttribute(`inert`);break}})}}}),o.updateContainerElements(e),o};function $e(e,r={}){let i,{immediate:a,...s}=r,c=h(!1),l=h(!1),u=e=>i&&i.activate(e),d=e=>i&&i.deactivate(e);return x(E(()=>ue(o(e)).map(e=>{let t=o(e);return typeof t==`string`?t:n(t)}).filter(t)),e=>{if(e.length)if(!i)i=Qe(e,{...s,onActivate(e){c.value=!0,r.onActivate&&r.onActivate(e)},onDeactivate(e){c.value=!1,r.onDeactivate&&r.onDeactivate(e)}}),a&&u();else{let t=i?.active;i?.updateContainerElements(e),!t&&a&&u()}},{flush:`post`}),T(()=>d()),{hasFocus:c,isPaused:l,activate:u,deactivate:d,pause:()=>{i&&(i.pause(),l.value=!0)},unpause:()=>{i&&(i.unpause(),l.value=!1)}}}var et=class e{constructor(e,t=!0,n=[],r=5e3){this.ctx=e,this.iframes=t,this.exclude=n,this.iframesTimeout=r}static matches(e,t){let n=typeof t==`string`?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){let t=!1;return n.every(n=>r.call(e,n)?(t=!0,!1):!0),t}else return!1}getContexts(){let e,t=[];return e=this.ctx===void 0||!this.ctx?[]:NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:typeof this.ctx==`string`?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx],e.forEach(e=>{let n=t.filter(t=>t.contains(e)).length>0;t.indexOf(e)===-1&&!n&&t.push(e)}),t}getIframeContents(e,t,n=()=>{}){let r;try{let t=e.contentWindow;if(r=t.document,!t||!r)throw Error(`iframe inaccessible`)}catch{n()}r&&t(r)}isIframeBlank(e){let t=`about:blank`,n=e.getAttribute(`src`).trim();return e.contentWindow.location.href===t&&n!==t&&n}observeIframeLoad(e,t,n){let r=!1,i=null,a=()=>{if(!r){r=!0,clearTimeout(i);try{this.isIframeBlank(e)||(e.removeEventListener(`load`,a),this.getIframeContents(e,t,n))}catch{n()}}};e.addEventListener(`load`,a),i=setTimeout(a,this.iframesTimeout)}onIframeReady(e,t,n){try{e.contentWindow.document.readyState===`complete`?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch{n()}}waitForIframes(e,t){let n=0;this.forEachIframe(e,()=>!0,e=>{n++,this.waitForIframes(e.querySelector(`html`),()=>{--n||t()})},e=>{e||t()})}forEachIframe(t,n,r,i=()=>{}){let a=t.querySelectorAll(`iframe`),o=a.length,s=0;a=Array.prototype.slice.call(a);let c=()=>{--o<=0&&i(s)};o||c(),a.forEach(t=>{e.matches(t,this.exclude)?c():this.onIframeReady(t,e=>{n(t)&&(s++,r(e)),c()},c)})}createIterator(e,t,n){return document.createNodeIterator(e,t,n,!1)}createInstanceOnIframe(t){return new e(t.querySelector(`html`),this.iframes)}compareNodeIframe(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)if(t!==null){if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}else return!0;return!1}getIteratorNode(e){let t=e.previousNode(),n;return n=(t===null||e.nextNode())&&e.nextNode(),{prevNode:t,node:n}}checkIframeFilter(e,t,n,r){let i=!1,a=!1;return r.forEach((e,t)=>{e.val===n&&(i=t,a=e.handled)}),this.compareNodeIframe(e,t,n)?(i===!1&&!a?r.push({val:n,handled:!0}):i!==!1&&!a&&(r[i].handled=!0),!0):(i===!1&&r.push({val:n,handled:!1}),!1)}handleOpenIframes(e,t,n,r){e.forEach(e=>{e.handled||this.getIframeContents(e.val,e=>{this.createInstanceOnIframe(e).forEachNode(t,n,r)})})}iterateThroughNodes(e,t,n,r,i){let a=this.createIterator(t,e,r),o=[],s=[],c,l,u=()=>({prevNode:l,node:c}=this.getIteratorNode(a),c);for(;u();)this.iframes&&this.forEachIframe(t,e=>this.checkIframeFilter(c,l,e,o),t=>{this.createInstanceOnIframe(t).forEachNode(e,e=>s.push(e),r)}),s.push(c);s.forEach(e=>{n(e)}),this.iframes&&this.handleOpenIframes(o,e,n,r),i()}forEachNode(e,t,n,r=()=>{}){let i=this.getContexts(),a=i.length;a||r(),i.forEach(i=>{let o=()=>{this.iterateThroughNodes(e,i,t,n,()=>{--a<=0&&r()})};this.iframes?this.waitForIframes(i,o):o()})}},tt=class{constructor(e){this.ctx=e,this.ie=!1;let 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 et(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t=`debug`){let n=this.opt.log;this.opt.debug&&typeof n==`object`&&typeof n[t]==`function`&&n[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){let t=this.opt.synonyms,n=this.opt.caseSensitive?``:`i`,r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?`\0`:``;for(let i in t)if(t.hasOwnProperty(i)){let a=t[i],o=this.opt.wildcards===`disabled`?this.escapeStr(i):this.setupWildcardsRegExp(i),s=this.opt.wildcards===`disabled`?this.escapeStr(a):this.setupWildcardsRegExp(a);o!==``&&s!==``&&(e=e.replace(RegExp(`(${this.escapeStr(o)}|${this.escapeStr(s)})`,`gm${n}`),r+`(${this.processSynomyms(o)}|${this.processSynomyms(s)})`+r))}return e}processSynomyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return e=e.replace(/(?:\\)*\?/g,e=>e.charAt(0)===`\\`?`?`:``),e.replace(/(?:\\)*\*/g,e=>e.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,(e,t,n)=>{let r=n.charAt(t+1);return/[(|)\\]/.test(r)||r===``?e:e+`\0`})}createJoinersRegExp(e){let t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(``))),this.opt.ignoreJoiners&&t.push(`\\u00ad\\u200b\\u200c\\u200d`),t.length?e.split(/\u0000+/).join(`[${t.join(``)}]*`):e}createDiacriticsRegExp(e){let t=this.opt.caseSensitive?``:`i`,n=this.opt.caseSensitive?`aàáảãạăằắẳẵặâầấẩẫậäåāą.AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ.cçćč.CÇĆČ.dđď.DĐĎ.eèéẻẽẹêềếểễệëěēę.EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ.iìíỉĩịîïī.IÌÍỈĨỊÎÏĪ.lł.LŁ.nñňń.NÑŇŃ.oòóỏõọôồốổỗộơởỡớờợöøō.OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ.rř.RŘ.sšśșş.SŠŚȘŞ.tťțţ.TŤȚŢ.uùúủũụưừứửữựûüůū.UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ.yýỳỷỹỵÿ.YÝỲỶỸỴŸ.zžżź.ZŽŻŹ`.split(`.`):[`aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ`,`cçćčCÇĆČ`,`dđďDĐĎ`,`eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ`,`iìíỉĩịîïīIÌÍỈĨỊÎÏĪ`,`lłLŁ`,`nñňńNÑŇŃ`,`oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ`,`rřRŘ`,`sšśșşSŠŚȘŞ`,`tťțţTŤȚŢ`,`uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ`,`yýỳỷỹỵÿYÝỲỶỸỴŸ`,`zžżźZŽŻŹ`],r=[];return e.split(``).forEach(i=>{n.every(n=>{if(n.indexOf(i)!==-1){if(r.indexOf(n)>-1)return!1;e=e.replace(RegExp(`[${n}]`,`gm${t}`),`[${n}]`),r.push(n)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gim,`[\\s]+`)}createAccuracyRegExp(e){let t=this.opt.accuracy,n=typeof t==`string`?t:t.value,r=typeof t==`string`?[]:t.limiters,i=``;switch(r.forEach(e=>{i+=`|${this.escapeStr(e)}`}),n){case`partially`:default:return`()(${e})`;case`complementary`:return i=`\\s`+(i||this.escapeStr(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~¡¿`)),`()([^${i}]*${e}[^${i}]*)`;case`exactly`:return`(^|\\s${i})(${e})(?=$|\\s${i})`}}getSeparatedKeywords(e){let t=[];return e.forEach(e=>{this.opt.separateWordSearch?e.split(` `).forEach(e=>{e.trim()&&t.indexOf(e)===-1&&t.push(e)}):e.trim()&&t.indexOf(e)===-1&&t.push(e)}),{keywords:t.sort((e,t)=>t.length-e.length),length:t.length}}isNumeric(e){return Number(parseFloat(e))==e}checkRanges(e){if(!Array.isArray(e)||Object.prototype.toString.call(e[0])!==`[object Object]`)return this.log(`markRanges() will only accept an array of objects`),this.opt.noMatch(e),[];let t=[],n=0;return e.sort((e,t)=>e.start-t.start).forEach(e=>{let{start:r,end:i,valid:a}=this.callNoMatchOnInvalidRanges(e,n);a&&(e.start=r,e.length=i-r,t.push(e),n=i)}),t}callNoMatchOnInvalidRanges(e,t){let n,r,i=!1;return e&&e.start!==void 0?(n=parseInt(e.start,10),r=n+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(e)}`),this.opt.noMatch(e))):(this.log(`Ignoring invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)),{start:n,end:r,valid:i}}checkWhitespaceRanges(e,t,n){let r,i=!0,a=n.length,o=t-a,s=parseInt(e.start,10)-o;return s=s>a?a:s,r=s+parseInt(e.length,10),r>a&&(r=a,this.log(`End range automatically set to the max value of ${a}`)),s<0||r-s<0||s>a||r>a?(i=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):n.substring(s,r).replace(/\s+/g,``)===``&&(i=!1,this.log(`Skipping whitespace only range: `+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}getTextNodes(e){let t=``,n=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,e=>{n.push({start:t.length,end:(t+=e.textContent).length,node:e})},e=>this.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:n})})}matchesExclude(e){return et.matches(e,this.opt.exclude.concat([`script`,`style`,`title`,`head`,`html`]))}wrapRangeInTextNode(e,t,n){let r=this.opt.element?this.opt.element:`mark`,i=e.splitText(t),a=i.splitText(n-t),o=document.createElement(r);return o.setAttribute(`data-markjs`,`true`),this.opt.className&&o.setAttribute(`class`,this.opt.className),o.textContent=i.textContent,i.parentNode.replaceChild(o,i),a}wrapRangeInMappedTextNode(e,t,n,r,i){e.nodes.every((a,o)=>{let s=e.nodes[o+1];if(s===void 0||s.start>t){if(!r(a.node))return!1;let s=t-a.start,c=(n>a.end?a.end:n)-a.start,l=e.value.substr(0,a.start),u=e.value.substr(c+a.start);if(a.node=this.wrapRangeInTextNode(a.node,s,c),e.value=l+u,e.nodes.forEach((t,n)=>{n>=o&&(e.nodes[n].start>0&&n!==o&&(e.nodes[n].start-=c),e.nodes[n].end-=c)}),n-=c,i(a.node.previousSibling,a.start),n>a.end)t=a.end;else return!1}return!0})}wrapMatches(e,t,n,r,i){let a=t===0?0:t+1;this.getTextNodes(t=>{t.nodes.forEach(t=>{t=t.node;let i;for(;(i=e.exec(t.textContent))!==null&&i[a]!==``;){if(!n(i[a],t))continue;let o=i.index;if(a!==0)for(let e=1;e<a;e++)o+=i[e].length;t=this.wrapRangeInTextNode(t,o,o+i[a].length),r(t.previousSibling),e.lastIndex=0}}),i()})}wrapMatchesAcrossElements(e,t,n,r,i){let a=t===0?0:t+1;this.getTextNodes(t=>{let o;for(;(o=e.exec(t.value))!==null&&o[a]!==``;){let i=o.index;if(a!==0)for(let e=1;e<a;e++)i+=o[e].length;let s=i+o[a].length;this.wrapRangeInMappedTextNode(t,i,s,e=>n(o[a],e),(t,n)=>{e.lastIndex=n,r(t)})}i()})}wrapRangeFromIndex(e,t,n,r){this.getTextNodes(i=>{let a=i.value.length;e.forEach((e,r)=>{let{start:o,end:s,valid:c}=this.checkWhitespaceRanges(e,a,i.value);c&&this.wrapRangeInMappedTextNode(i,o,s,n=>t(n,e,i.value.substring(o,s),r),t=>{n(t,e)})}),r()})}unwrapMatches(e){let t=e.parentNode,n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.removeChild(e.firstChild));t.replaceChild(n,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 n=0,r=`wrapMatches`;this.opt.acrossElements&&(r=`wrapMatchesAcrossElements`),this[r](e,this.opt.ignoreGroups,(e,t)=>this.opt.filter(t,e,n),e=>{n++,this.opt.each(e)},()=>{n===0&&this.opt.noMatch(e),this.opt.done(n)})}mark(e,t){this.opt=t;let n=0,r=`wrapMatches`,{keywords:i,length:a}=this.getSeparatedKeywords(typeof e==`string`?[e]:e),o=this.opt.caseSensitive?``:`i`,s=e=>{let t=new RegExp(this.createRegExp(e),`gm${o}`),c=0;this.log(`Searching with expression "${t}"`),this[r](t,1,(t,r)=>this.opt.filter(r,e,n,c),e=>{c++,n++,this.opt.each(e)},()=>{c===0&&this.opt.noMatch(e),i[a-1]===e?this.opt.done(n):s(i[i.indexOf(e)+1])})};this.opt.acrossElements&&(r=`wrapMatchesAcrossElements`),a===0?this.opt.done(n):s(i[0])}markRanges(e,t){this.opt=t;let n=0,r=this.checkRanges(e);r&&r.length?(this.log(`Starting to mark with the following ranges: `+JSON.stringify(r)),this.wrapRangeFromIndex(r,(e,t,n,r)=>this.opt.filter(e,t,n,r),(e,t)=>{n++,this.opt.each(e,t)},()=>{this.opt.done(n)})):this.opt.done(n)}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,e=>{this.unwrapMatches(e)},e=>{let n=et.matches(e,t),r=this.matchesExclude(e);return!n||r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function nt(e){let t=new tt(e);return this.mark=(e,n)=>(t.mark(e,n),this),this.markRegExp=(e,n)=>(t.markRegExp(e,n),this),this.markRanges=(e,n)=>(t.markRanges(e,n),this),this.unmark=e=>(t.unmark(e),this),this}var rt=`ENTRIES`,it=`KEYS`,at=`VALUES`,Z=``,ot=class{constructor(e,t){let n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=Q(this._path);if(Q(t)===Z)return{done:!1,value:this.result()};let n=e.get(Q(t));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=Q(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>Q(e)).filter(e=>e!==Z).join(``)}value(){return Q(this._path).node.get(Z)}result(){switch(this._type){case at:return this.value();case it:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},Q=e=>e[e.length-1],st=(e,t,n)=>{let r=new Map;if(t===void 0)return r;let i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1);for(let e=0;e<i;++e)o[e]=e;for(let e=1;e<a;++e)o[e*i]=e;return ct(e,t,n,r,o,1,i,``),r},ct=(e,t,n,r,i,a,o,s)=>{let c=a*o;key:for(let l of e.keys())if(l===Z){let t=i[c-1];t<=n&&r.set(s,[e.get(l),t])}else{let c=a;for(let e=0;e<l.length;++e,++c){let r=l[e],a=o*c,s=a-o,u=i[a],d=Math.max(0,c-n-1),f=Math.min(o-1,c+n);for(let e=d;e<f;++e){let n=r!==t[e],o=i[s+e]+ +n,c=i[s+e+1]+1,l=i[a+e]+1,d=i[a+e+1]=Math.min(o,c,l);d<u&&(u=d)}if(u>n)continue key}ct(e.get(l),t,n,r,i,c,o,s+l)}},lt=class e{constructor(e=new Map,t=``){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(t){if(!t.startsWith(this._prefix))throw Error(`Mismatched prefix`);let[n,r]=ut(this._tree,t.slice(this._prefix.length));if(n===void 0){let[n,i]=gt(r);for(let r of n.keys())if(r!==Z&&r.startsWith(i)){let a=new Map;return a.set(r.slice(i.length),n.get(r)),new e(a,t)}}return new e(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,pt(this._tree,e)}entries(){return new ot(this,rt)}forEach(e){for(let[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return st(this._tree,e,t)}get(e){let t=dt(this._tree,e);return t===void 0?void 0:t.get(Z)}has(e){let t=dt(this._tree,e);return t!==void 0&&t.has(Z)}keys(){return new ot(this,it)}set(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);return this._size=void 0,ft(this._tree,e).set(Z,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=ft(this._tree,e);return n.set(Z,t(n.get(Z))),this}fetch(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=ft(this._tree,e),r=n.get(Z);return r===void 0&&n.set(Z,r=t()),r}values(){return new ot(this,at)}[Symbol.iterator](){return this.entries()}static from(t){let n=new e;for(let[e,r]of t)n.set(e,r);return n}static fromObject(t){return e.from(Object.entries(t))}},ut=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(let r of e.keys())if(r!==Z&&t.startsWith(r))return n.push([e,r]),ut(e.get(r),t.slice(r.length),n);return n.push([e,t]),ut(void 0,``,n)},dt=(e,t)=>{if(t.length===0||e==null)return e;for(let n of e.keys())if(n!==Z&&t.startsWith(n))return dt(e.get(n),t.slice(n.length))},ft=(e,t)=>{let n=t.length;outer:for(let r=0;e&&r<n;){for(let i of e.keys())if(i!==Z&&t[r]===i[0]){let a=Math.min(n-r,i.length),o=1;for(;o<a&&t[r+o]===i[o];)++o;let s=e.get(i);if(o===i.length)e=s;else{let n=new Map;n.set(i.slice(o),s),e.set(t.slice(r,r+o),n),e.delete(i),e=n}r+=o;continue outer}let i=new Map;return e.set(t.slice(r),i),i}return e},pt=(e,t)=>{let[n,r]=ut(e,t);if(n!==void 0){if(n.delete(Z),n.size===0)mt(r);else if(n.size===1){let[e,t]=n.entries().next().value;ht(r,e,t)}}},mt=e=>{if(e.length===0)return;let[t,n]=gt(e);if(t.delete(n),t.size===0)mt(e.slice(0,-1));else if(t.size===1){let[n,r]=t.entries().next().value;n!==Z&&ht(e.slice(0,-1),n,r)}},ht=(e,t,n)=>{if(e.length===0)return;let[r,i]=gt(e);r.set(i+t,n),r.delete(i)},gt=e=>e[e.length-1],_t=`or`,vt=`and`,yt=`and_not`,bt=class e{constructor(e){if(e?.fields==null)throw Error(`MiniSearch: option "fields" must be provided`);let t=e.autoVacuum==null||e.autoVacuum===!0?jt:e.autoVacuum;this._options={...Et,...e,autoVacuum:t,searchOptions:{...Dt,...e.searchOptions||{}},autoSuggestOptions:{...Ot,...e.autoSuggestOptions||{}}},this._index=new lt,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=At,this.addFields(this._options.fields)}add(e){let{extractField:t,stringifyField:n,tokenize:r,processTerm:i,fields:a,idField:o}=this._options,s=t(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(s))throw Error(`MiniSearch: duplicate ID ${s}`);let c=this.addDocumentId(s);this.saveStoredFields(c,e);for(let o of a){let a=t(e,o);if(a==null)continue;let s=r(n(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.addFieldLength(c,l,this._documentCount-1,u);for(let e of s){let t=i(e,o);if(Array.isArray(t))for(let e of t)this.addTerm(l,c,e);else t&&this.addTerm(l,c,t)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:n=10}=t,r={chunk:[],promise:Promise.resolve()},{chunk:i,promise:a}=e.reduce(({chunk:e,promise:t},r,i)=>(e.push(r),(i+1)%n===0?{chunk:[],promise:t.then(()=>new Promise(e=>setTimeout(e,0))).then(()=>this.addAll(e))}:{chunk:e,promise:t}),r);return a.then(()=>this.addAll(i))}remove(e){let{tokenize:t,processTerm:n,extractField:r,stringifyField:i,fields:a,idField:o}=this._options,s=r(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);let c=this._idToShortId.get(s);if(c==null)throw Error(`MiniSearch: cannot remove document with ID ${s}: it is not in the index`);for(let o of a){let a=r(e,o);if(a==null)continue;let s=t(i(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.removeFieldLength(c,l,this._documentCount,u);for(let e of s){let t=n(e,o);if(Array.isArray(t))for(let e of t)this.removeTerm(l,c,e);else t&&this.removeTerm(l,c,t)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(s),this._fieldLength.delete(c),--this._documentCount}removeAll(e){if(e)for(let t of e)this.remove(t);else if(arguments.length>0)throw Error(`Expected documents to be present. Omit the argument to remove all documents.`);else this._index=new lt,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){let t=this._idToShortId.get(e);if(t==null)throw 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((e,n)=>{this.removeFieldLength(t,n,this._documentCount,e)}),this._fieldLength.delete(t),--this._documentCount,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:n,batchWait:r}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:r},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let t of e)this.discard(t)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:n}=this._options,r=n(e,t);this.discard(r),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum??=this._currentVacuum.then(()=>{let t=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=At,this.performVacuuming(e,t)}),this._enqueuedVacuum):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let n=this._dirtCount;if(this.vacuumConditionsMet(t)){let t=e.batchSize||kt.batchSize,r=e.batchWait||kt.batchWait,i=1;for(let[e,n]of this._index){for(let[e,t]of n)for(let[r]of t)this._documentIds.has(r)||(t.size<=1?n.delete(e):t.delete(r));this._index.get(e).size===0&&this._index.delete(e),i%t===0&&await new Promise(e=>setTimeout(e,r)),i+=1}this._dirtCount-=n}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:n}=e;return t||=jt.minDirtCount,n||=jt.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=n}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){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(t,n={}){let{searchOptions:r}=this._options,i={...r,...n},a=this.executeQuery(t,n),o=[];for(let[e,{score:t,terms:n,match:r}]of a){let a=n.length||1,s={id:this._documentIds.get(e),score:t*a,terms:Object.keys(r),queryTerms:n,match:r};Object.assign(s,this._storedFields.get(e)),(i.filter==null||i.filter(s))&&o.push(s)}return t===e.wildcard&&i.boostDocument==null||o.sort(Pt),o}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let n=new Map;for(let{score:r,terms:i}of this.search(e,t)){let e=i.join(` `),t=n.get(e);t==null?n.set(e,{score:r,terms:i,count:1}):(t.score+=r,t.count+=1)}let r=[];for(let[e,{score:t,terms:i,count:a}]of n)r.push({suggestion:e,terms:i,score:t/a});return r.sort(Pt),r}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw 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(Et.hasOwnProperty(e))return xt(Et,e);throw Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=It(r),s._fieldLength=It(i),s._storedFields=It(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);for(let[e,t]of n){let n=new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),It(r))}s._index.set(e,n)}return s}static async loadJSAsync(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=await $(r),s._fieldLength=await $(i),s._storedFields=await $(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);let c=0;for(let[e,t]of n){let n=new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),await $(r))}++c%1e3==0&&await Lt(0),s._index.set(e,n)}return s}static instantiateMiniSearch(t,n){let{documentCount:r,nextId:i,fieldIds:a,averageFieldLength:o,dirtCount:s,serializationVersion:c}=t;if(c!==1&&c!==2)throw Error(`MiniSearch: cannot deserialize an index created with an incompatible version`);let l=new e(n);return l._documentCount=r,l._nextId=i,l._idToShortId=new Map,l._fieldIds=a,l._avgFieldLength=o,l._dirtCount=s||0,l._index=new lt,l}executeQuery(t,n={}){if(t===e.wildcard)return this.executeWildcardQuery(n);if(typeof t!=`string`){let e={...n,...t,queries:void 0},r=t.queries.map(t=>this.executeQuery(t,e));return this.combineResults(r,e.combineWith)}let{tokenize:r,processTerm:i,searchOptions:a}=this._options,o={tokenize:r,processTerm:i,...a,...n},{tokenize:s,processTerm:c}=o,l=s(t).flatMap(e=>c(e)).filter(e=>!!e).map(Tt(o)).map(e=>this.executeQuerySpec(e,o));return this.combineResults(l,o.combineWith)}executeQuerySpec(e,t){let n={...this._options.searchOptions,...t},r=(n.fields||this._options.fields).reduce((e,t)=>({...e,[t]:xt(n.boost,t)||1}),{}),{boostDocument:i,weights:a,maxFuzzy:o,bm25:s}=n,{fuzzy:c,prefix:l}={...Dt.weights,...a},u=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,u,r,i,s),f,p;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let t=e.fuzzy===!0?.2:e.fuzzy,n=t<1?Math.min(o,Math.round(e.term.length*t)):t;n&&(p=this._index.fuzzyGet(e.term,n))}if(f)for(let[t,n]of f){let a=t.length-e.term.length;if(!a)continue;p?.delete(t);let o=l*t.length/(t.length+.3*a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}if(p)for(let t of p.keys()){let[n,a]=p.get(t);if(!a)continue;let o=c*t.length/(t.length+a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}return d}executeWildcardQuery(e){let t=new Map,n={...this._options.searchOptions,...e};for(let[e,r]of this._documentIds){let i=n.boostDocument?n.boostDocument(r,``,this._storedFields.get(e)):1;t.set(e,{score:i,terms:[],match:{}})}return t}combineResults(e,t=_t){if(e.length===0)return new Map;let n=St[t.toLowerCase()];if(!n)throw Error(`Invalid combination operator: ${t}`);return e.reduce(n)||new Map}toJSON(){let e=[];for(let[t,n]of this._index){let r={};for(let[e,t]of n)r[e]=Object.fromEntries(t);e.push([t,r])}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,n,r,i,a,o,s,c=new Map){if(i==null)return c;for(let l of Object.keys(a)){let u=a[l],d=this._fieldIds[l],f=i.get(d);if(f==null)continue;let p=f.size,m=this._avgFieldLength[d];for(let i of f.keys()){if(!this._documentIds.has(i)){this.removeTerm(d,i,t),--p;continue}let a=o?o(this._documentIds.get(i),t,this._storedFields.get(i)):1;if(!a)continue;let h=f.get(i),g=this._fieldLength.get(i)[d],_=wt(h,p,this._documentCount,g,m,s),v=n*r*u*a*_,y=c.get(i);if(y){y.score+=v,Mt(y.terms,e);let n=xt(y.match,t);n?n.push(l):y.match[t]=[l]}else c.set(i,{score:v,terms:[e],match:{[t]:[l]}})}}return c}addTerm(e,t,n){let r=this._index.fetch(n,Ft),i=r.get(e);if(i==null)i=new Map,i.set(t,1),r.set(e,i);else{let e=i.get(t);i.set(t,(e||0)+1)}}removeTerm(e,t,n){if(!this._index.has(n)){this.warnDocumentChanged(t,e,n);return}let r=this._index.fetch(n,Ft),i=r.get(e);i==null||i.get(t)==null?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),this._index.get(n).size===0&&this._index.delete(n)}warnDocumentChanged(e,t,n){for(let r of Object.keys(this._fieldIds))if(this._fieldIds[r]===t){this._options.logger(`warn`,`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${n}" was not present in field "${r}". Removing a document after it has changed can corrupt the index!`,`version_conflict`);return}}addDocumentId(e){let 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;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,n,r){let i=this._fieldLength.get(e);i??this._fieldLength.set(e,i=[]),i[t]=r;let a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)}removeFieldLength(e,t,n,r){if(n===1){this._avgFieldLength[t]=0;return}let i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)}saveStoredFields(e,t){let{storeFields:n,extractField:r}=this._options;if(n==null||n.length===0)return;let i=this._storedFields.get(e);i??this._storedFields.set(e,i={});for(let e of n){let n=r(t,e);n!==void 0&&(i[e]=n)}}};bt.wildcard=Symbol(`*`);var xt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,St={[_t]:(e,t)=>{for(let n of t.keys()){let r=e.get(n);if(r==null)e.set(n,t.get(n));else{let{score:e,terms:i,match:a}=t.get(n);r.score+=e,r.match=Object.assign(r.match,a),Nt(r.terms,i)}}return e},[vt]:(e,t)=>{let n=new Map;for(let r of t.keys()){let i=e.get(r);if(i==null)continue;let{score:a,terms:o,match:s}=t.get(r);Nt(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,s)})}return n},[yt]:(e,t)=>{for(let n of t.keys())e.delete(n);return e}},Ct={k:1.2,b:.7,d:.5},wt=(e,t,n,r,i,a)=>{let{k:o,b:s,d:c}=a;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(o+1)/(e+o*(1-s+s*r/i)))},Tt=e=>(t,n,r)=>({term:t,fuzzy:typeof e.fuzzy==`function`?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:typeof e.prefix==`function`?e.prefix(t,n,r):e.prefix===!0,termBoost:typeof e.boostTerm==`function`?e.boostTerm(t,n,r):1}),Et={idField:`id`,extractField:(e,t)=>e[t],stringifyField:(e,t)=>e.toString(),tokenize:e=>e.split(Rt),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])==`function`&&console[e](t)},autoVacuum:!0},Dt={combineWith:_t,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Ct},Ot={combineWith:vt,prefix:(e,t,n)=>t===n.length-1},kt={batchSize:1e3,batchWait:10},At={minDirtFactor:.1,minDirtCount:20},jt={...kt,...At},Mt=(e,t)=>{e.includes(t)||e.push(t)},Nt=(e,t)=>{for(let n of t)e.includes(n)||e.push(n)},Pt=({score:e},{score:t})=>t-e,Ft=()=>new Map,It=e=>{let t=new Map;for(let n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},$=async e=>{let t=new Map,n=0;for(let r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3==0&&await Lt(0);return t},Lt=e=>new Promise(t=>setTimeout(t,e)),Rt=/[\n\r\p{Z}\p{P}]+/u,zt=class{max;cache;constructor(e=10){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()}};function Bt(t){let{localeIndex:n,theme:r}=e();function i(e){let i=e.split(`.`),a=r.value.search?.options,o=a&&typeof a==`object`,s=o&&a.locales?.[n.value]?.translations||null,c=o&&a.translations||null,l=s,u=c,d=t,f=i.pop();for(let e of i){let t=null,n=d?.[e];n&&(t=d=n);let r=u?.[e];r&&(t=u=r);let i=l?.[e];i&&(t=l=i),n||(d=t),r||(u=t),i||(l=t)}return l?.[f]??u?.[f]??d?.[f]??``}return i}var Vt=[`aria-owns`],Ht={class:`shell`},Ut=[`title`],Wt={class:`search-actions before`},Gt=[`title`],Kt=[`aria-activedescendant`,`aria-controls`,`placeholder`],qt={class:`search-actions`},Jt=[`role`,`aria-label`],Yt=[`title`],Xt=[`disabled`,`title`],Zt=[`id`,`role`,`aria-busy`,`aria-labelledby`],Qt=[`id`,`aria-selected`],$t=[`href`,`aria-label`,`onMouseenter`,`onFocusin`,`data-index`],en={class:`titles`},tn=[`innerHTML`],nn={class:`title main`},rn=[`innerHTML`],an={key:0,class:`excerpt-wrapper`},on={key:0,class:`excerpt`,inert:``},sn=[`innerHTML`],cn={key:0,class:`no-results`},ln={class:`search-keyboard-shortcuts`},un=[`aria-label`],dn=[`aria-label`],fn=[`aria-label`],pn=[`aria-label`],mn=a(f({__name:`VPLocalSearchBox`,emits:[`close`],setup(t,{emit:n}){let a=n,o=h(),f=h(),ue=h(ye),T=e(),{activate:be}=$e(o,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:O,theme:k}=T,A=D(!1),j=D(!1),M=E(()=>A.value||j.value),xe=r(async()=>ae(bt.loadJSON((await ue.value[O.value]?.())?.default,{fields:[`title`,`titles`,`text`],storeFields:[`title`,`titles`],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...k.value.search?.provider===`local`&&k.value.search.options?.miniSearch?.searchOptions},...k.value.search?.provider===`local`&&k.value.search.options?.miniSearch?.options})),void 0,A),N=E(()=>k.value.search?.provider===`local`&&k.value.search.options?.disableQueryPersistence===!0).value?D(``):y(`vitepress:local-search-filter`,``),P=m(`vitepress:local-search-detailed-list`,k.value.search?.provider===`local`&&k.value.search.options?.detailedView===!0),F=E(()=>k.value.search?.provider===`local`&&(k.value.search.options?.disableDetailedView===!0||k.value.search.options?.detailedView===!1));ce(()=>{F.value&&(P.value=!1)});let I=h([]),L=D(!1);x(N,()=>{L.value=!1});let Se=r(async()=>{if(f.value)return ae(new nt(f.value))},null),R=new zt(16);me(()=>[xe.value,N.value,P.value],async([e,t,n],r,i)=>{r?.[0]!==e&&R.clear();let a=!1;if(i(()=>{a=!0,j.value=!1}),!e){I.value=[];return}j.value=!0,I.value=e.search(t).slice(0,16),L.value=!0;let s=n?await Promise.all(I.value.map(e=>Ce(e.id))):[];if(a)return;for(let{id:e,mod:t}of s){let n=e.slice(0,e.indexOf(`#`)),r=R.get(n);if(r)continue;r=new Map,R.set(n,r);let i=t.default??t;if(i?.render||i?.setup){let e=he(i);e.config.warnHandler=()=>{},e.provide(ie,T),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get(){return T.frontmatter.value}},$params:{get(){return T.page.value.params}}});let t=document.createElement(`div`);e.mount(t),t.querySelectorAll(`h1, h2, h3, h4, h5, h6`).forEach(e=>{let t=e.querySelector(`a`)?.getAttribute(`href`),n=t?.startsWith(`#`)&&t.slice(1);if(!n)return;let i=``;for(;(e=e.nextElementSibling)&&!/^h[1-6]$/i.test(e.tagName);)i+=e.outerHTML;r.set(n,i)}),e.unmount()}if(a)return}let c=new Set;if(I.value=I.value.map(e=>{let[t,n]=e.id.split(`#`),r=R.get(t)?.get(n)??``;for(let t in e.match)c.add(t);return{...e,text:r}}),await v(),a)return;await new Promise(e=>{Se.value?.unmark({done:()=>{Se.value?.markRegExp(Ae(c),{done:e})}})});let l=o.value?.querySelectorAll(`.result .excerpt`)??[];for(let e of l)e.querySelector(`mark[data-markjs="true"]`)?.scrollIntoView({block:`center`});f.value?.firstElementChild?.scrollIntoView({block:`start`}),j.value=!1},{debounce:200,immediate:!0});async function Ce(e){let t=fe(e.slice(0,e.indexOf(`#`)));try{if(!t)throw Error(`Cannot find file for id: ${e}`);return{id:e,mod:await de(()=>import(t),[])}}catch(t){return console.error(t),{id:e,mod:{}}}}let we=D(),Te=E(()=>N.value?.length<=0);function z(e=!0){we.value?.focus(),e&&we.value?.select()}pe(()=>{z()});function Ee(e){e.pointerType===`mouse`&&z()}let B=D(-1),V=D(!0);x(I,e=>{B.value=e.length?0:-1,H()});function H(){v(()=>{document.querySelector(`.result.selected`)?.scrollIntoView({block:`nearest`})})}function De(e){e.preventDefault(),B.value--,B.value<0&&(B.value=I.value.length-1),V.value=!0,H()}function Oe(e){e.preventDefault(),B.value++,B.value>=I.value.length&&(B.value=0),V.value=!0,H()}function U(e){return e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.shiftKey&&document.documentElement.classList.contains(`mac`)}w(`ArrowUp`,De),w(`ArrowDown`,Oe),w([`p`,`P`],e=>{U(e)&&De(e)}),w([`n`,`N`],e=>{U(e)&&Oe(e)});let W=re();w(`Enter`,e=>{if(e.isComposing||e.target instanceof HTMLButtonElement&&e.target.type!==`submit`)return;let t=I.value[B.value];if(e.target instanceof HTMLInputElement&&!t){e.preventDefault();return}t&&(W.go(t.id),a(`close`))}),w(`Escape`,()=>{a(`close`)});let G=Bt({button:{buttonText:`Search`},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`}}});pe(()=>{window.history.pushState(null,``,null)}),c(`popstate`,e=>{e.preventDefault(),a(`close`)});let K=_(_e?document.body:null);pe(()=>{v(()=>{K.value=!0,v().then(()=>be())})}),ee(()=>{K.value=!1});function ke(){N.value=``,v().then(()=>z(!1))}function Ae(e){return new RegExp([...e].sort((e,t)=>t.length-e.length).map(e=>`(${te(e)})`).join(`|`),`gi`)}function q(e){if(!V.value)return;let t=e.target?.closest(`.result`),n=Number.parseInt(t?.dataset.index);n>=0&&n!==B.value&&(B.value=n),V.value=!1}return(e,t)=>(b(),s(ve,{to:`body`},[g(`div`,{ref_key:`el`,ref:o,role:`button`,"aria-owns":I.value?.length?`localsearch-list`:void 0,"aria-expanded":`true`,"aria-haspopup":`listbox`,"aria-labelledby":`localsearch-label`,class:`VPLocalSearchBox`},[g(`div`,{class:`backdrop`,onClick:t[0]||=t=>e.$emit(`close`)}),g(`div`,Ht,[g(`form`,{class:`search-bar`,onPointerup:t[4]||=e=>Ee(e),onSubmit:t[5]||=ge(()=>{},[`prevent`])},[g(`label`,{title:u(G)(`button.buttonText`),id:`localsearch-label`,for:`localsearch-input`},[...t[7]||=[g(`span`,{"aria-hidden":`true`,class:`vpi-search search-icon local-search-icon`},null,-1)]],8,Ut),g(`div`,Wt,[g(`button`,{class:`back-button`,title:u(G)(`modal.backButtonTitle`),onClick:t[1]||=t=>e.$emit(`close`)},[...t[8]||=[g(`span`,{class:`vpi-arrow-left local-search-icon`},null,-1)]],8,Gt)]),S(g(`input`,{ref_key:`searchInput`,ref:we,"onUpdate:modelValue":t[2]||=e=>le(N)?N.value=e:null,"aria-activedescendant":B.value>-1?`localsearch-item-`+B.value:void 0,"aria-autocomplete":`both`,"aria-controls":I.value?.length?`localsearch-list`:void 0,"aria-labelledby":`localsearch-label`,autocapitalize:`off`,autocomplete:`off`,autocorrect:`off`,class:`search-input`,id:`localsearch-input`,enterkeyhint:`go`,maxlength:`64`,placeholder:u(G)(`button.buttonText`),spellcheck:`false`,type:`search`},null,8,Kt),[[oe,u(N)]]),g(`div`,qt,[g(`span`,{class:se([`search-loading`,{active:M.value}]),role:M.value?`status`:void 0,"aria-live":`polite`,"aria-label":M.value?`Loading search results`:void 0},null,10,Jt),F.value?i(``,!0):(b(),d(`button`,{key:0,class:se([`toggle-layout-button`,{"detailed-list":u(P)}]),type:`button`,title:u(G)(`modal.displayDetails`),onClick:t[3]||=e=>B.value>-1&&(P.value=!u(P))},[...t[9]||=[g(`span`,{class:`vpi-layout-list local-search-icon`},null,-1)]],10,Yt)),g(`button`,{class:`clear-button`,type:`reset`,disabled:Te.value,title:u(G)(`modal.resetButtonTitle`),onClick:ke},[...t[10]||=[g(`span`,{class:`vpi-delete local-search-icon`},null,-1)]],8,Xt)])],32),g(`ul`,{ref_key:`resultsEl`,ref:f,id:I.value?.length?`localsearch-list`:void 0,role:I.value?.length?`listbox`:void 0,"aria-busy":M.value?`true`:`false`,"aria-labelledby":I.value?.length?`localsearch-label`:void 0,class:`results`,onMousemove:q},[(b(!0),d(ne,null,p(I.value,(n,r)=>(b(),d(`li`,{key:n.id,id:`localsearch-item-`+r,"aria-selected":B.value===r?`true`:`false`,role:`option`},[g(`a`,{href:n.id,class:se([`result`,{selected:B.value===r}]),"aria-label":[...n.titles,n.title].join(` > `),onMouseenter:e=>!V.value&&(B.value=r),onFocusin:e=>B.value=r,onClick:t[6]||=t=>e.$emit(`close`),"data-index":r},[g(`div`,null,[g(`div`,en,[t[12]||=g(`span`,{class:`title-icon`},`#`,-1),(b(!0),d(ne,null,p(n.titles,(e,n)=>(b(),d(`span`,{key:n,class:`title`},[g(`span`,{class:`text`,innerHTML:e},null,8,tn),t[11]||=g(`span`,{class:`vpi-chevron-right local-search-icon`},null,-1)]))),128)),g(`span`,nn,[g(`span`,{class:`text`,innerHTML:n.title},null,8,rn)])]),u(P)?(b(),d(`div`,an,[n.text?(b(),d(`div`,on,[g(`div`,{class:`vp-doc`,innerHTML:n.text},null,8,sn)])):i(``,!0),t[13]||=g(`div`,{class:`excerpt-gradient-bottom`},null,-1),t[14]||=g(`div`,{class:`excerpt-gradient-top`},null,-1)])):i(``,!0)])],42,$t)],8,Qt))),128)),u(N)&&!I.value.length&&L.value?(b(),d(`li`,cn,[C(l(u(G)(`modal.noResultsText`))+` "`,1),g(`strong`,null,l(u(N)),1),t[15]||=C(`" `,-1)])):i(``,!0)],40,Zt),g(`div`,ln,[g(`span`,null,[g(`kbd`,{"aria-label":u(G)(`modal.footer.navigateUpKeyAriaLabel`)},[...t[16]||=[g(`span`,{class:`vpi-arrow-up navigate-icon`},null,-1)]],8,un),g(`kbd`,{"aria-label":u(G)(`modal.footer.navigateDownKeyAriaLabel`)},[...t[17]||=[g(`span`,{class:`vpi-arrow-down navigate-icon`},null,-1)]],8,dn),C(` `+l(u(G)(`modal.footer.navigateText`)),1)]),g(`span`,null,[g(`kbd`,{"aria-label":u(G)(`modal.footer.selectKeyAriaLabel`)},[...t[18]||=[g(`span`,{class:`vpi-corner-down-left navigate-icon`},null,-1)]],8,fn),C(` `+l(u(G)(`modal.footer.selectText`)),1)]),g(`span`,null,[g(`kbd`,{"aria-label":u(G)(`modal.footer.closeKeyAriaLabel`)},`esc`,8,pn),C(` `+l(u(G)(`modal.footer.closeText`)),1)])])])],8,Vt)]))}}),[[`__scopeId`,`data-v-c16ec2b7`]]);export{mn as default};