mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
3 lines
60 KiB
JavaScript
3 lines
60 KiB
JavaScript
import{It as e,O as t,P as n,R as r,X as i,_ as a,_t as o,a as s,at as c,c as l,d as u,et as d,f,ft as p,g as m,gt as h,i as g,it as _,j as v,k as y,l as b,lt as x,mt as ee,u as te,y as S,zt as C}from"./runtime-core.esm-bundler-CZvn3YaB.js";import{c as w,d as ne}from"./runtime-dom.esm-bundler-DTRCDnrc.js";import{D as re,M as ie,S as ae,b as oe}from"./client-C5e5tgZO.js";import{C as se,E as T,T as ce,_ as le,i as E,l as ue,r as D,t as de,v as fe,w as pe}from"./dist-CMy7OcvW.js";import{t as O}from"./plugin-vue_export-helper-CxTVcLa7.js";import{n as me,t as he}from"./composables-3J5ZwNFM.js";var k=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[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] *)`],A=k.join(`,`),ge=typeof Element>`u`,j=ge?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,M=!ge&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},N=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]`):N(e.parentNode))},P=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},F=function(e,t,n){if(N(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(A));return t&&j.call(e,A)&&r.unshift(e),r=r.filter(n),r},I=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!N(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=I(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{j.call(a,A)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!N(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=I(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},L=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},R=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||P(e))&&!L(e)?0:e.tabIndex},_e=function(e,t){var n=R(e);return n<0&&t&&!L(e)?0:n},z=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return e.tagName===`INPUT`},B=function(e){return ve(e)&&e.type===`hidden`},V=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},H=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},ye=function(e){if(!e.name)return!0;var t=e.form||M(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=H(r,e.form);return!i||i===e},be=function(e){return ve(e)&&e.type===`radio`},xe=function(e){return be(e)&&!ye(e)},Se=function(e){var t=e&&M(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=M(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Ce=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},we=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});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=j.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(j.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=M(e);if(o&&!o.shadowRoot&&r(o)===!0)return Ce(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Se(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Ce(e);return!1},Te=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 j.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},U=function(e,t){return!(t.disabled||B(t)||we(t,e)||V(t)||Te(t))},Ee=function(e,t){return!(xe(t)||R(t)<0||!U(e,t))},De=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Oe=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=_e(a,i),s=i?Oe(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(z).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||={},Oe(t.getShadowRoot?I([e],t.includeContainer,{filter:Ee.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:De}):F(e,t.includeContainer,Ee.bind(null,t)))},Ae=function(e,t){return t||={},t.getShadowRoot?I([e],t.includeContainer,{filter:U.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):F(e,t.includeContainer,U.bind(null,t))},W=function(e,t){if(t||={},!e)throw Error(`No node provided`);return j.call(e,A)===!1?!1:Ee(t,e)},je=k.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),Me=function(e,t){if(t||={},!e)throw Error(`No node provided`);return j.call(e,je)===!1?!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,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Ie(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Fe(a,r,i,o,s,`next`,e)}function s(e){Fe(a,r,i,o,s,`throw`,e)}o(void 0)})}}function Le(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Ke(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 Re(e,t,n){return(t=Ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Be(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ve(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 He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ve(Object(n),!0).forEach(function(t){Re(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function G(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return K(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(K(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,K(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,K(d,`constructor`,l),K(l,`constructor`,c),c.displayName=`GeneratorFunction`,K(l,i,`GeneratorFunction`),K(d),K(d,i,`Generator`),K(d,r,function(){return this}),K(d,`toString`,function(){return`[object Generator]`}),(G=function(){return{w:a,m:f}})()}function K(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}K=function(e,t,n,r){function a(t,n){K(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},K(e,t,n,r)}function Ue(e){return Pe(e)||ze(e)||Ke(e)||Be()}function We(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 Ge(e){var t=We(e,`string`);return typeof t==`symbol`?t:t+``}function Ke(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 q={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){t!==q.getActiveTrap(e)&&q.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),q.unpauseTrap(e)},pauseTrap:function(e){q.getActiveTrap(e)?._setPausedState(!0)},unpauseTrap:function(e){var t=q.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},qe=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},Je=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},J=function(e){return e?.key===`Tab`||e?.keyCode===9},Ye=function(e){return J(e)&&!e.shiftKey},Xe=function(e){return J(e)&&e.shiftKey},Ze=function(e){return setTimeout(e,0)},Y=function(e){var t=[...arguments].slice(1);return typeof e==`function`?e.apply(void 0,t):e},X=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},Qe=[],$e=function(e,t){var n=t?.document||document,r=t?.trapStack||Qe,i=He({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isolateSubtrees:!1,isKeyForward:Ye,isKeyBackward:Xe},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?!1:r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,Ue(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(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!Me(e,i.tabbableOptions))if(c(n.activeElement)>=0)e=n.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.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},d=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 W(e)}),s=n.slice().reverse().find(function(e){return W(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return R(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 W(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return W(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.`)},f=function(e){var t=e.activeElement;if(t)return t.shadowRoot&&t.shadowRoot.activeElement!==null?f(t.shadowRoot):t},p=function(e){if(e!==!1&&e!==f(document)){if(!e||!e.focus){p(u());return}e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,qe(e)&&e.select()}},m=function(e){var t=l(`setReturnFocus`,{params:[e]});return t||(t===!1?!1:e)},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=r===void 0?!1:r;t||=X(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),f=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&&(f.container===t||Me(t,i.tabbableOptions)&&!W(t,i.tabbableOptions)&&!f.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=p===0?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];s=R(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else J(n)||(s=f.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(f.container===t||Me(t,i.tabbableOptions)&&!W(t,i.tabbableOptions)&&!f.nextTabbableNode(t))&&(g=u),g>=0){var _=g===a.tabbableGroups.length-1?0:g+1,v=a.tabbableGroups[_];s=R(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else J(n)||(s=f.nextTabbableNode(t))}}else s=l(`fallbackFocus`);return s},g=function(e){if(!(c(X(e),e)>=0)){if(Y(i.clickOutsideDeactivates,e)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}Y(i.allowOutsideClick,e)||e.preventDefault()}},_=function(e){var t=X(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(R(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return R(e)>0})})||(o=!1);else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},v=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(J(e)&&e.preventDefault(),p(n))},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&v(e,i.isKeyBackward(e))},b=function(e){Je(e)&&Y(i.escapeDeactivates,e)!==!1&&(e.preventDefault(),o.deactivate())},x=function(e){c(X(e),e)>=0||Y(i.clickOutsideDeactivates,e)||Y(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},ee=function(){if(!a.active)return Promise.resolve();q.activateTrap(r,o);var e;return i.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=Ze(function(){p(u()),e()})}):(e=Promise.resolve(),p(u())),n.addEventListener(`focusin`,_,!0),n.addEventListener(`mousedown`,g,{capture:!0,passive:!1}),n.addEventListener(`touchstart`,g,{capture:!0,passive:!1}),n.addEventListener(`click`,x,{capture:!0,passive:!1}),n.addEventListener(`keydown`,y,{capture:!0,passive:!1}),n.addEventListener(`keydown`,b),e},te=function(e){a.active&&!a.paused&&o._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t=new Set,n=new Set,r=Le(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=Le(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},S=function(){if(a.active)return n.removeEventListener(`focusin`,_,!0),n.removeEventListener(`mousedown`,g,!0),n.removeEventListener(`touchstart`,g,!0),n.removeEventListener(`click`,x,!0),n.removeEventListener(`keydown`,y,!0),n.removeEventListener(`keydown`,b),o},C=typeof window<`u`&&`MutationObserver`in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})})&&p(u())}):void 0,w=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){C.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=q.getActiveTrap(r),u=!1;if(l&&!l.paused){var p;(p=l._setSubtreeIsolation)==null||p.call(l,!1),u=!0}try{c||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=f(n),t?.();var m=function(){var e=Ie(G().m(function e(){return G().w(function(e){for(;;)switch(e.n){case 0:return c&&d(),e.n=1,ee();case 1:o._setSubtreeIsolation(!0),w(),i?.();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){if(l===q.getActiveTrap(r)&&u){var h;(h=l._setSubtreeIsolation)==null||h.call(l,!0)}throw e}return this},deactivate:function(e){if(!a.active)return this;var t=He({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(),S(),a.active=!1,a.paused=!1,w(),q.deactivateTrap(r,o);var n=s(t,`onDeactivate`),c=s(t,`onPostDeactivate`),l=s(t,`checkCanReturnFocus`),u=s(t,`returnFocus`,`returnFocusOnDeactivate`);n?.();var d=function(){Ze(function(){u&&p(m(a.nodeFocusedBeforeActivation)),c?.()})};return u&&l?(l(m(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),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&&te(a.containers),a.active&&(d(),a.paused||o._setSubtreeIsolation(!0)),w(),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?.(),S(),o._setSubtreeIsolation(!1),w(),r?.()}else{var i=s(t,`onUnpause`),c=s(t,`onPostUnpause`);i?.(),(function(){var e=Ie(G().m(function e(){return G().w(function(e){for(;;)switch(e.n){case 0:return d(),e.n=1,ee();case 1:o._setSubtreeIsolation(!0),w(),c?.();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}})()()}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 et(e,t={}){let n,{immediate:r,...a}=t,o=p(!1),s=p(!1),c=e=>n&&n.activate(e),u=e=>n&&n.deactivate(e);return i(l(()=>ce(h(e)).map(e=>{let t=h(e);return typeof t==`string`?t:E(t)}).filter(pe)),e=>{if(e.length)if(!n)n=$e(e,{...a,onActivate(){o.value=!0,t.onActivate&&t.onActivate()},onDeactivate(){o.value=!1,t.onDeactivate&&t.onDeactivate()}}),r&&c();else{let t=n?.active;n?.updateContainerElements(e),!t&&r&&c()}},{flush:`post`}),T(()=>u()),{hasFocus:o,isPaused:s,activate:c,deactivate:u,pause:()=>{n&&(n.pause(),s.value=!0)},unpause:()=>{n&&(n.unpause(),s.value=!1)}}}var tt=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()})}},nt=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 tt(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 tt.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=tt.matches(e,t),r=this.matchesExclude(e);return!n||r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function rt(e){let t=new nt(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 it=`ENTRIES`,at=`KEYS`,ot=`VALUES`,Z=``,st=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 ot:return this.value();case at:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},Q=e=>e[e.length-1],ct=(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 lt(e,t,n,r,o,1,i,``),r},lt=(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}lt(e.get(l),t,n,r,i,c,o,s+l)}},ut=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]=dt(this._tree,t.slice(this._prefix.length));if(n===void 0){let[n,i]=_t(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,mt(this._tree,e)}entries(){return new st(this,it)}forEach(e){for(let[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return ct(this._tree,e,t)}get(e){let t=ft(this._tree,e);return t===void 0?void 0:t.get(Z)}has(e){let t=ft(this._tree,e);return t!==void 0&&t.has(Z)}keys(){return new st(this,at)}set(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);return this._size=void 0,pt(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=pt(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=pt(this._tree,e),r=n.get(Z);return r===void 0&&n.set(Z,r=t()),r}values(){return new st(this,ot)}[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))}},dt=(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]),dt(e.get(r),t.slice(r.length),n);return n.push([e,t]),dt(void 0,``,n)},ft=(e,t)=>{if(t.length===0||e==null)return e;for(let n of e.keys())if(n!==Z&&t.startsWith(n))return ft(e.get(n),t.slice(n.length))},pt=(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},mt=(e,t)=>{let[n,r]=dt(e,t);if(n!==void 0){if(n.delete(Z),n.size===0)ht(r);else if(n.size===1){let[e,t]=n.entries().next().value;gt(r,e,t)}}},ht=e=>{if(e.length===0)return;let[t,n]=_t(e);if(t.delete(n),t.size===0)ht(e.slice(0,-1));else if(t.size===1){let[n,r]=t.entries().next().value;n!==Z&>(e.slice(0,-1),n,r)}},gt=(e,t,n)=>{if(e.length===0)return;let[r,i]=_t(e);r.set(i+t,n),r.delete(i)},_t=e=>e[e.length-1],vt=`or`,yt=`and`,bt=`and_not`,xt=class e{constructor(e){if(e?.fields==null)throw Error(`MiniSearch: option "fields" must be provided`);let t=e.autoVacuum==null||e.autoVacuum===!0?Mt:e.autoVacuum;this._options={...Dt,...e,autoVacuum:t,searchOptions:{...Ot,...e.searchOptions||{}},autoSuggestOptions:{...kt,...e.autoSuggestOptions||{}}},this._index=new ut,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=jt,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 ut,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=jt,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||At.batchSize,r=e.batchWait||At.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||=Mt.minDirtCount,n||=Mt.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(Ft),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(Ft),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(Dt.hasOwnProperty(e))return St(Dt,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=Lt(r),s._fieldLength=Lt(i),s._storedFields=Lt(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),Lt(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 Rt(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 ut,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(Et(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]:St(n.boost,t)||1}),{}),{boostDocument:i,weights:a,maxFuzzy:o,bm25:s}=n,{fuzzy:c,prefix:l}={...Ot.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=vt){if(e.length===0)return new Map;let n=Ct[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],_=Tt(h,p,this._documentCount,g,m,s),v=n*r*u*a*_,y=c.get(i);if(y){y.score+=v,Nt(y.terms,e);let n=St(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,It),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,It),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)}}};xt.wildcard=Symbol(`*`);var St=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,Ct={[vt]:(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),Pt(r.terms,i)}}return e},[yt]:(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);Pt(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,s)})}return n},[bt]:(e,t)=>{for(let n of t.keys())e.delete(n);return e}},wt={k:1.2,b:.7,d:.5},Tt=(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)))},Et=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}),Dt={idField:`id`,extractField:(e,t)=>e[t],stringifyField:(e,t)=>e.toString(),tokenize:e=>e.split(zt),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},Ot={combineWith:vt,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:wt},kt={combineWith:yt,prefix:(e,t,n)=>t===n.length-1},At={batchSize:1e3,batchWait:10},jt={minDirtFactor:.1,minDirtCount:20},Mt={...At,...jt},Nt=(e,t)=>{e.includes(t)||e.push(t)},Pt=(e,t)=>{for(let n of t)e.includes(n)||e.push(n)},Ft=({score:e},{score:t})=>t-e,It=()=>new Map,Lt=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 Rt(0);return t},Rt=e=>new Promise(t=>setTimeout(t,e)),zt=/[\n\r\p{Z}\p{P}]+/u,Bt=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()}},Vt={},Ht={width:`18`,height:`18`,viewBox:`0 0 24 24`,"aria-hidden":`true`};function Ut(e,t){return n(),f(`svg`,Ht,[...t[0]||=[b(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 12H5m7 7l-7-7l7-7`},null,-1)]])}var Wt=O(Vt,[[`render`,Ut]]),Gt={},Kt={width:`18`,height:`18`,viewBox:`0 0 24 24`,"aria-hidden":`true`};function qt(e,t){return n(),f(`svg`,Kt,[...t[0]||=[b(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 5H9l-7 7l7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Zm-2 4l-6 6m0-6l6 6`},null,-1)]])}var Jt=O(Gt,[[`render`,qt]]),Yt={},Xt={width:`18`,height:`18`,viewBox:`0 0 24 24`,"aria-hidden":`true`};function Zt(e,t){return n(),f(`svg`,Xt,[...t[0]||=[b(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[b(`circle`,{cx:`11`,cy:`11`,r:`8`}),b(`path`,{d:`m21 21l-4.35-4.35`})],-1)]])}var Qt=O(Yt,[[`render`,Zt]]),$t=[`aria-owns`],en={class:`shell`},tn=[`title`],nn={class:`search-actions before`},rn=[`title`],an=[`placeholder`],on={class:`search-actions`},sn=[`disabled`,`title`],cn=[`id`,`role`,`aria-labelledby`],ln=[`aria-selected`],un=[`href`,`aria-label`,`onMouseenter`,`onFocusin`,`onClick`],dn={class:`titles`},fn=[`innerHTML`],pn={class:`title main`},mn=[`innerHTML`],hn={key:0,class:`no-results`},gn={class:`search-keyboard-shortcuts`},_n=[`aria-label`],vn=[`aria-label`],yn=[`aria-label`],bn=[`aria-label`],xn=O(S({__name:`SearchBox`,props:{locales:{},options:{}},emits:[`close`],setup(h,{emit:S}){let T=S,ce=ae(),E=he(ee(()=>h.locales)),pe=oe(),O=p(),k=p(),A=me(),{activate:ge}=et(O,{immediate:!0}),j=de(async()=>{let e;if(Intl.Segmenter!==void 0){let t=new Intl.Segmenter(pe.value,{granularity:`word`});e=e=>Array.from(t.segment(e)).map(e=>e.segment)}return c(xt.loadJSON((await A.value[ce.value]?.())?.default,{fields:[`title`,`titles`,`text`],storeFields:[`title`,`titles`],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},tokenize:e},...h.options.miniSearch?.searchOptions,...h.options.miniSearch?.options}))}),M=l(()=>h.options?.disableQueryPersistence===!0).value?x(``):fe(`vuepress-plume:mini-search-filter`,``),N=l(()=>E.value.buttonText||E.value.placeholder||`Search`),P=p([]),F=x(!1);i(M,()=>{F.value=!1});let I=de(async()=>{if(k.value)return c(new rt(k.value))},null),L=new Bt(64);se(()=>[j.value,M.value],async([e,n],r,i)=>{r?.[0]!==e&&L.clear();let a=!1;if(i(()=>{a=!0}),!e)return;P.value=e.search(n),F.value=!0;let o=new Set;P.value=P.value.map(e=>{let[t,n]=e.id.split(`#`),r=L.get(t)?.get(n)??``;for(let t in e.match)o.add(t);return{...e,text:r}}),await t(),!a&&await new Promise(e=>{I.value?.unmark({done:()=>{I.value?.markRegExp(Ce(o),{done:e})}})})},{debounce:200,immediate:!0});let R=x(),_e=l(()=>M.value?.length<=0);function z(e=!0){R.value?.focus(),e&&R.value?.select()}v(()=>{z()});function ve(e){e.pointerType===`mouse`&&z()}let B=x(-1),V=x(!1);i(P,e=>{B.value=e.length?0:-1,H()});function H(){t(()=>{let e=document.querySelector(`.result.selected`);e&&e.scrollIntoView({block:`nearest`})})}D(`ArrowUp`,e=>{e.preventDefault(),B.value--,B.value<0&&(B.value=P.value.length-1),V.value=!0,H()}),D(`ArrowDown`,e=>{e.preventDefault(),B.value++,B.value>=P.value.length&&(B.value=0),V.value=!0,H()});let ye=ie();D(`Enter`,e=>{if(e.isComposing||e.target instanceof HTMLButtonElement&&e.target.type!==`submit`)return;let t=P.value[B.value];if(e.target instanceof HTMLInputElement&&!t){e.preventDefault();return}t&&(ye.push(t.id),T(`close`))}),D(`Escape`,()=>{T(`close`)}),v(()=>{window.history.pushState(null,``,null)}),ue(`popstate`,e=>{e.preventDefault(),T(`close`)});let be=le(typeof document<`u`?document.body:null);v(()=>{t(()=>{be.value=!0,t().then(()=>ge())})}),y(()=>{be.value=!1});function xe(){M.value=``,t().then(()=>z(!1))}function Se(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Ce(e){return new RegExp([...e].sort((e,t)=>t.length-e.length).map(e=>`(${Se(e)})`).join(`|`),`gi`)}function we(e,t){e.preventDefault(),ye.push(t.id),T(`close`)}return(t,i)=>(n(),te(s,{to:`body`},[b(`div`,{ref_key:`el`,ref:O,role:`button`,"aria-owns":P.value?.length?`localsearch-list`:void 0,"aria-expanded":`true`,"aria-haspopup":`listbox`,"aria-labelledby":`mini-search-label`,class:`VPLocalSearchBox`},[b(`div`,{class:`backdrop`,onClick:i[0]||=e=>t.$emit(`close`)}),b(`div`,en,[b(`form`,{class:`search-bar`,onPointerup:i[3]||=e=>ve(e),onSubmit:i[4]||=ne(()=>{},[`prevent`])},[b(`label`,{id:`localsearch-label`,title:N.value,for:`localsearch-input`},[a(Qt,{class:`search-icon`})],8,tn),b(`div`,nn,[b(`button`,{class:`back-button`,title:o(E).backButtonTitle,onClick:i[1]||=e=>t.$emit(`close`)},[a(Wt)],8,rn)]),d(b(`input`,{id:`localsearch-input`,ref_key:`searchInput`,ref:R,"onUpdate:modelValue":i[2]||=e=>_(M)?M.value=e:null,placeholder:N.value,"aria-labelledby":`localsearch-label`,class:`search-input`},null,8,an),[[w,o(M)]]),b(`div`,on,[b(`button`,{class:`clear-button`,type:`reset`,disabled:_e.value,title:o(E).resetButtonTitle,onClick:xe},[a(Jt)],8,sn)])],32),b(`ul`,{id:P.value?.length?`localsearch-list`:void 0,ref_key:`resultsEl`,ref:k,role:P.value?.length?`listbox`:void 0,"aria-labelledby":P.value?.length?`localsearch-label`:void 0,class:`results`,onMousemove:i[5]||=e=>V.value=!1},[(n(!0),f(g,null,r(P.value,(t,a)=>(n(),f(`li`,{key:t.id,role:`option`,"aria-selected":B.value===a?`true`:`false`},[b(`a`,{href:o(re)(t.id),class:e([`result`,{selected:B.value===a}]),"aria-label":[...t.titles,t.title].join(` > `),onMouseenter:e=>!V.value&&(B.value=a),onFocusin:e=>B.value=a,onClick:e=>we(e,t)},[b(`div`,null,[b(`div`,dn,[i[7]||=b(`span`,{class:`title-icon`},`#`,-1),(n(!0),f(g,null,r(t.titles,(e,t)=>(n(),f(`span`,{key:t,class:`title`},[b(`span`,{class:`text`,innerHTML:e},null,8,fn),i[6]||=b(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`},[b(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m9 18l6-6l-6-6`})],-1)]))),128)),b(`span`,pn,[b(`span`,{class:`text`,innerHTML:t.title},null,8,mn)])])])],42,un)],8,ln))),128)),o(M)&&!P.value.length&&F.value?(n(),f(`li`,hn,[m(C(o(E).noResultsText)+` "`,1),b(`strong`,null,C(o(M)),1),i[8]||=m(`" `,-1)])):u(``,!0)],40,cn),b(`div`,gn,[b(`span`,null,[b(`kbd`,{"aria-label":o(E).footer?.navigateUpKeyAriaLabel??``},[...i[9]||=[b(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`},[b(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 19V5m-7 7l7-7l7 7`})],-1)]],8,_n),b(`kbd`,{"aria-label":o(E).footer?.navigateDownKeyAriaLabel??``},[...i[10]||=[b(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`},[b(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 5v14m7-7l-7 7l-7-7`})],-1)]],8,vn),m(` `+C(o(E).footer?.navigateText??``),1)]),b(`span`,null,[b(`kbd`,{"aria-label":o(E).footer?.selectKeyAriaLabel??``},[...i[11]||=[b(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`},[b(`g`,{fill:`none`,stroke:`currentcolor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[b(`path`,{d:`m9 10l-5 5l5 5`}),b(`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`})])],-1)]],8,yn),m(` `+C(o(E).footer?.selectText??``),1)]),b(`span`,null,[b(`kbd`,{"aria-label":o(E).footer?.closeKeyAriaLabel??``},`esc`,8,bn),m(` `+C(o(E).footer?.closeText??``),1)])])])],8,$t)]))}}),[[`__scopeId`,`data-v-80cf07af`]]);export{xn as default}; |