diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 96463b1b78..9363d915c6 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1,4 +1,4 @@ -/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */ /*! Blowfish | MIT License | https://github.com/nunocoracao/blowfish */ @layer properties; @layer theme, base, components, utilities; @@ -207,6 +207,9 @@ } } @layer utilities { + .\@container { + container-type: inline-size; + } .pointer-events-auto { pointer-events: auto; } @@ -263,15 +266,9 @@ .-start-6 { inset-inline-start: calc(var(--spacing) * -6); } - .start { - inset-inline-start: var(--spacing); - } .start-\[calc\(max\(-50vw\,-800px\)\+50\%\)\] { inset-inline-start: calc(max(-50vw, -800px) + 50%); } - .end { - inset-inline-end: var(--spacing); - } .end-6 { inset-inline-end: calc(var(--spacing) * 6); } @@ -4812,8 +4809,20 @@ pre { width: 8px; height: 8px; } + scrollbar-width: thin; + --tw-scrollbar-thumb: rgba(var(--color-neutral-400), 1); + --tw-scrollbar-track: rgba(var(--color-neutral-200), 1); + scrollbar-color: var(--tw-scrollbar-thumb) var(--tw-scrollbar-track); --scrollbar-thumb: oklch(70.8% 0 0); --scrollbar-track: oklch(92.2% 0 0); + &:is(.dark *) { + --tw-scrollbar-thumb: rgba(var(--color-neutral-600), 1); + scrollbar-color: var(--tw-scrollbar-thumb) var(--tw-scrollbar-track); + } + &:is(.dark *) { + --tw-scrollbar-track: rgba(var(--color-neutral-800), 1); + scrollbar-color: var(--tw-scrollbar-thumb) var(--tw-scrollbar-track); + } &:is(.dark *) { --scrollbar-thumb: oklch(43.9% 0 0); } @@ -5333,6 +5342,16 @@ body:has(#mobile-menu-toggle:checked) { initial-value: ""; inherits: false; } +@property --tw-scrollbar-thumb { + syntax: ""; + inherits: false; + initial-value: #0000; +} +@property --tw-scrollbar-track { + syntax: ""; + inherits: false; + initial-value: #0000; +} @keyframes pulse { 50% { opacity: 0.5; @@ -5415,6 +5434,8 @@ body:has(#mobile-menu-toggle:checked) { --tw-duration: initial; --tw-ease: initial; --tw-content: ""; + --tw-scrollbar-thumb: #0000; + --tw-scrollbar-track: #0000; } } } diff --git a/assets/lib/fuse/fuse.min.cjs b/assets/lib/fuse/fuse.min.cjs index bddddb4b26..3501300736 100644 --- a/assets/lib/fuse/fuse.min.cjs +++ b/assets/lib/fuse/fuse.min.cjs @@ -1,9 +1,9 @@ /** - * Fuse.js v7.3.0 - Lightweight fuzzy-search (http://fusejs.io) + * Fuse.js v7.4.1 - Lightweight fuzzy-search (http://fusejs.io) * * Copyright (c) 2026 Kiro Risk (http://kiro.me) * All Rights Reserved. Apache Software License 2.0 * * http://www.apache.org/licenses/LICENSE-2.0 */ -"use strict";function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===u(t)}function e(t){return null==t?"":function(t){if("string"==typeof t)return t;if("bigint"==typeof t)return t.toString();const e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}function s(t){return"string"==typeof t}function i(t){return"number"==typeof t}function n(t){return!0===t||!1===t||function(t){return r(t)&&null!==t}(t)&&"[object Boolean]"==u(t)}function r(t){return"object"==typeof t}function c(t){return null!=t}function o(t){return!t.trim().length}function u(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const h=Object.prototype.hasOwnProperty;class a{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(t=>{const s=l(t);this._keys.push(s),this._keyMap[s.id]=s,e+=s.weight}),this._keys.forEach(t=>{t.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function l(e){let i=null,n=null,r=null,c=1,o=null;if(s(e)||t(e))r=e,i=d(e),n=g(e);else{if(!h.call(e,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=e.name;if(r=t,h.call(e,"weight")&&(c=e.weight,c<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));i=d(t),n=g(t),o=e.getFn}return{path:i,id:n,weight:c,src:r,getFn:o}}function d(e){return t(e)?e:e.split(".")}function g(e){return t(e)?e.join("."):e}const f={useExtendedSearch:!1,useTokenSearch:!1,getFn:function(r,o){const u=[];let h=!1;const a=(r,o,l,d)=>{if(c(r))if(o[l]){const g=r[o[l]];if(!c(g))return;if(l===o.length-1&&(s(g)||i(g)||n(g)||"bigint"==typeof g))u.push(void 0!==d?{v:e(g),i:d}:e(g));else if(t(g)){h=!0;for(let t=0,e=g.length;tt.score===e.score?t.idx{this._keysMap[t.id]=e})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,s(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();s(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,s=this.size();e=0;e-=1)this.records.splice(t[e],1);for(let t=0,e=this.records.length;t{const h=n.getFn?n.getFn(i):this.getFn(i,n.path);if(c(h))if(t(h)){const t=[];for(let i=0,n=h.length;ie),records:this.records}}}function C(t,e,{getFn:s=p.getFn,fieldNormWeight:i=p.fieldNormWeight}={}){const n=new m({getFn:s,fieldNormWeight:i});return n.setKeys(t.map(l)),n.setSources(e),n.create(),n}const M=32;function y(t,e,s,{location:i=p.location,distance:n=p.distance,threshold:r=p.threshold,findAllMatches:c=p.findAllMatches,minMatchCharLength:o=p.minMatchCharLength,includeMatches:u=p.includeMatches,ignoreLocation:h=p.ignoreLocation}={}){if(e.length>M)throw new Error(`Pattern length exceeds max of ${M}.`);const a=e.length,l=t.length,d=Math.max(0,Math.min(i,l));let g=r,f=d;const A=(t,e)=>{const s=t/a;if(h)return s;const i=Math.abs(d-e);return n?s+i/n:i?1:s},m=o>1||u,C=m?Array(l):[];let y;for(;(y=t.indexOf(e,f))>-1;){const t=A(0,y);if(g=Math.min(t,g),f=y+a,m){let t=0;for(;t=r;i-=1){const n=i-1,c=s[t[n]];if(m&&(C[n]=+!!c),u[i]=(u[i+1]<<1|1)&c,e&&(u[i]|=(x[i+1]|x[i])<<1|1|x[i+1]),u[i]&E&&(F=A(e,n),F<=g)){if(g=F,f=n,f<=d)break;r=Math.max(1,2*d-f)}}if(A(e+1,d)>g)break;x=u}const _={isMatch:f>=0,score:Math.max(.001,F)};if(m){const t=function(t=[],e=p.minMatchCharLength){const s=[];let i=-1,n=-1,r=0;for(let c=t.length;r=e&&s.push([i,n]),i=-1)}return t[r-1]&&r-i>=e&&s.push([i,r-1]),s}(C,o);t.length?u&&(_.indices=t):_.isMatch=!1}return _}function x(t){const e={};for(let s=0,i=t.length;st[0]-e[0]||t[1]-e[1]);const e=[t[0]];for(let s=1,i=t.length;st.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(E,t=>D[t]):t=>t;class v{constructor(t,{location:e=p.location,threshold:s=p.threshold,distance:i=p.distance,includeMatches:n=p.includeMatches,findAllMatches:r=p.findAllMatches,minMatchCharLength:c=p.minMatchCharLength,isCaseSensitive:o=p.isCaseSensitive,ignoreDiacritics:u=p.ignoreDiacritics,ignoreLocation:h=p.ignoreLocation}={}){if(this.options={location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreDiacritics:u,ignoreLocation:h},t=o?t:t.toLowerCase(),t=u?_(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:x(t),startIndex:e})},l=this.pattern.length;if(l>M){let t=0;const e=l%M,s=l-e;for(;t{const{isMatch:f,score:p,indices:A}=y(t,e,s,{location:n+g,distance:r,threshold:c,findAllMatches:o,minMatchCharLength:u,includeMatches:i,ignoreLocation:h});f&&(d=!0),l+=p,f&&A&&a.push(...A)});const g={isMatch:d,score:d?l/this.chunks.length:1};return d&&i&&(g.indices=F(a)),g}}class B{constructor(t){this.pattern=t}static isMultiMatch(t){return I(t,this.multiRegex)}static isSingleMatch(t){return I(t,this.singleRegex)}search(t){return{isMatch:!1,score:1}}}function I(t,e){const s=t.match(e);return s?s[1]:null}class k extends B{constructor(t,{location:e=p.location,threshold:s=p.threshold,distance:i=p.distance,includeMatches:n=p.includeMatches,findAllMatches:r=p.findAllMatches,minMatchCharLength:c=p.minMatchCharLength,isCaseSensitive:o=p.isCaseSensitive,ignoreDiacritics:u=p.ignoreDiacritics,ignoreLocation:h=p.ignoreLocation}={}){super(t),this._bitapSearch=new v(t,{location:e,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreDiacritics:u,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class S extends B{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,s=0;const i=[],n=this.pattern.length;for(;(e=t.indexOf(this.pattern,s))>-1;)s=e+n,i.push([e,s-1]);const r=!!i.length;return{isMatch:r,score:r?0:1,indices:i}}}const b=[class extends B{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},S,class extends B{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends B{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends B{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends B{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends B{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},k],w=b.length;const L=new Set([k.type,S.type]);class ${constructor(t,{isCaseSensitive:e=p.isCaseSensitive,ignoreDiacritics:s=p.ignoreDiacritics,includeMatches:i=p.includeMatches,minMatchCharLength:n=p.minMatchCharLength,ignoreLocation:r=p.ignoreLocation,findAllMatches:c=p.findAllMatches,location:o=p.location,threshold:u=p.threshold,distance:h=p.distance}={}){this.query=null,this.options={isCaseSensitive:e,ignoreDiacritics:s,includeMatches:i,minMatchCharLength:n,findAllMatches:c,ignoreLocation:r,location:o,threshold:u,distance:h},t=e?t:t.toLowerCase(),t=s?_(t):t,this.pattern=t,this.query=function(t,e={}){return t.replace(/\\\|/g,"\0").split("|").map(t=>{const s=function(t){const e=[],s=t.length;let i=0;for(;i=s)break;let n=i;for(;n=s||" "===t[e]){n++;break}if("$"===t[e]&&(e+1>=s||" "===t[e+1])){n+=2;break}}n++}e.push(t.substring(i,n)),i=n}else{for(;nt&&!!t.trim()),i=[];for(let t=0,n=s.length;t!(!t[j]&&!t[W]),P=t=>({[j]:Object.keys(t).map(e=>({[e]:t[e]}))});function q(e,i,{auto:n=!0}={}){const c=e=>{if(s(e)){const t={keyId:null,pattern:e};return n&&(t.searcher=O(e,i)),t}const o=Object.keys(e),u=(t=>!!t[z])(e);if(!u&&o.length>1&&!T(e))return c(P(e));if((e=>!t(e)&&r(e)&&!T(e))(e)){const t=u?e[z]:o[0],r=u?e[K]:e[t];if(!s(r))throw new Error((t=>`Invalid value for key ${t}`)(t));const c={keyId:g(t),pattern:r};return n&&(c.searcher=O(r,i)),c}const h={children:[],operator:o[0]};return o.forEach(s=>{const i=e[s];t(i)&&i.forEach(t=>{h.children.push(c(t))})}),h};return T(e)||(e=P(e)),c(e)}function J(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){let s=1;return t.forEach(({key:t,norm:i,score:n})=>{const r=t?t.weight:null;s*=Math.pow(0===n&&r?Number.EPSILON:n,(r||1)*(e?1:i))}),s}class Q{constructor(t){this.limit=t,this.heap=[]}get size(){return this.heap.length}shouldInsert(t){return this.size0;){const s=t-1>>1;if(e[t].score<=e[s].score)break;const i=e[t];e[t]=e[s],e[s]=i,t=s}}_sinkDown(t){const e=this.heap,s=e.length;let i=t;do{const n=2*(t=i)+1,r=2*t+2;if(ne[i].score&&(i=n),re[i].score&&(i=r),i!==t){const s=e[t];e[t]=e[i],e[i]=s}}while(i!==t)}}function U(t,e){const s=t.matches;e.matches=[],c(s)&&s.forEach(t=>{if(!c(t.indices)||!t.indices.length)return;const{indices:s,value:i}=t,n={indices:s,value:i};t.key&&(n.key=t.key.src),t.idx>-1&&(n.refIndex=t.idx),e.matches.push(n)})}function V(t,e){e.score=t.score}const H=/\b\w+\b/g;function G({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize:s=>(t||(s=s.toLowerCase()),e&&(s=_(s)),s.match(H)||[])}}function X(t,e){for(const[s,i]of t.terms){const n=i.filter(t=>t.docIdx!==e),r=i.length-n.length;r>0&&(t.fieldCount-=r,t.df.set(s,(t.df.get(s)||0)-r),0===n.length?(t.terms.delete(s),t.df.delete(s)):t.terms.set(s,n))}}class Y{constructor(t,e,s){this.options={...p,...e},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new a(this.options.keys),this._docs=t,this._myIndex=null,this._invertedIndex=null,this.setCollection(t,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const e=O(t,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=t,this._lastSearcher=e,e}setCollection(t,e){if(this._docs=t,e&&!(e instanceof m))throw new Error("Incorrect 'index' type");if(this._myIndex=e||C(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const t=G({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(t,e,s){const i=new Map,n=new Map;let r=0;function c(t,e,c,o){const u=s.tokenize(t);if(!u.length)return;r++;const h=new Map;for(const t of u)h.set(t,(h.get(t)||0)+1);for(const[t,s]of h){const r={docIdx:e,keyIdx:c,subIdx:o,tf:s};let u=i.get(t);u||(u=[],i.set(t,u)),u.push(r),n.set(t,(n.get(t)||0)+1)}}for(const s of t){const{i:t,v:i,$:n}=s;if(void 0===i){if(n)for(let s=0;s!1){const e=[],s=[];for(let i=0,n=this._docs.length;i=0;t-=1)this._docs.splice(s[t],1);this._myIndex.removeAll(s)}return e}removeAt(t){this._invertedIndex&&X(this._invertedIndex,t);const e=this._docs.splice(t,1)[0];return this._myIndex.removeAt(t),e}getIndex(){return this._myIndex}search(t,e){const{limit:n=-1}=e||{},{includeMatches:r,includeScore:c,shouldSort:o,sortFn:u,ignoreFieldNorm:h}=this.options;if(s(t)&&!t.trim()){let t=this._docs.map((t,e)=>({item:t,refIndex:e}));return i(n)&&n>-1&&(t=t.slice(0,n)),t}let a;if(i(n)&&n>0&&s(t)){const e=new Q(n);s(this._docs[0])?this._searchStringList(t,{heap:e,ignoreFieldNorm:h}):this._searchObjectList(t,{heap:e,ignoreFieldNorm:h}),a=e.extractSorted(u)}else a=s(t)?s(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),function(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){t.forEach(t=>{t.score=J(t.matches,{ignoreFieldNorm:e})})}(a,{ignoreFieldNorm:h}),o&&a.sort(u),i(n)&&n>-1&&(a=a.slice(0,n));return function(t,e,{includeMatches:s=p.includeMatches,includeScore:i=p.includeScore}={}){const n=[];return s&&n.push(U),i&&n.push(V),t.map(t=>{const{idx:s}=t,i={item:e[s],refIndex:s};return n.length&&n.forEach(e=>{e(t,i)}),i})}(a,this._docs,{includeMatches:r,includeScore:c})}_searchStringList(t,{heap:e,ignoreFieldNorm:s}={}){const i=this._getSearcher(t),{records:n}=this._myIndex,r=e?null:[];return n.forEach(({v:t,i:n,n:o})=>{if(!c(t))return;const{isMatch:u,score:h,indices:a}=i.searchIn(t);if(u){const i={item:t,idx:n,matches:[{score:h,value:t,norm:o,indices:a}]};e?(i.score=J(i.matches,{ignoreFieldNorm:s}),e.shouldInsert(i.score)&&e.insert(i)):r.push(i)}}),r}_searchLogical(t){const e=q(t,this.options),s=(t,e,i)=>{if(!("children"in t)){const{keyId:s,searcher:n}=t;let r;return null===s?(r=[],this._myIndex.keys.forEach((t,s)=>{r.push(...this._findMatches({key:t,value:e[s],searcher:n}))})):r=this._findMatches({key:this._keyStore.get(s),value:this._myIndex.getValueForItemAtKeyId(e,s),searcher:n}),r&&r.length?[{idx:i,item:e,matches:r}]:[]}const{children:n,operator:r}=t,c=[];for(let t=0,o=n.length;t{if(c(t)){const c=s(e,t,i);c.length&&(n.has(i)||(n.set(i,{idx:i,item:t,matches:[]}),r.push(n.get(i))),c.forEach(({matches:t})=>{n.get(i).matches.push(...t)}))}}),r}_searchObjectList(t,{heap:e,ignoreFieldNorm:s}={}){const i=this._getSearcher(t),{keys:n,records:r}=this._myIndex,o=e?null:[];return r.forEach(({$:t,i:r})=>{if(!c(t))return;const u=[];let h=!1,a=!1;if(n.forEach((e,s)=>{const n=this._findMatches({key:e,value:t[s],searcher:i});n.length?(u.push(...n),n[0].hasInverse&&(a=!0)):h=!0}),(!a||!h)&&u.length){const i={idx:r,item:t,matches:u};e?(i.score=J(i.matches,{ignoreFieldNorm:s}),e.shouldInsert(i.score)&&e.insert(i)):o.push(i)}}),o}_findMatches({key:e,value:s,searcher:i}){if(!c(s))return[];const n=[];if(t(s))s.forEach(({v:t,i:s,n:r})=>{if(!c(t))return;const{isMatch:o,score:u,indices:h,hasInverse:a}=i.searchIn(t);o&&n.push({score:u,key:e,value:t,idx:s,norm:r,indices:h,hasInverse:a})});else{const{v:t,n:r}=s,{isMatch:c,score:o,indices:u,hasInverse:h}=i.searchIn(t);c&&n.push({score:o,key:e,value:t,norm:r,indices:u,hasInverse:h})}return n}}class Z{static condition(t,e){return e.useTokenSearch}constructor(t,e){this.options=e,this.analyzer=G({isCaseSensitive:e.isCaseSensitive,ignoreDiacritics:e.ignoreDiacritics});const s=this.analyzer.tokenize(t),i=e._invertedIndex,{df:n,fieldCount:r}=i;this.termSearchers=[],this.idfWeights=[];for(const t of s){this.termSearchers.push(new v(t,{location:e.location,threshold:e.threshold,distance:e.distance,includeMatches:e.includeMatches,findAllMatches:e.findAllMatches,minMatchCharLength:e.minMatchCharLength,isCaseSensitive:e.isCaseSensitive,ignoreDiacritics:e.ignoreDiacritics,ignoreLocation:!0}));const s=n.get(t)||0,i=Math.log(1+(r-s+.5)/(s+.5));this.idfWeights.push(i)}}searchIn(t){if(!this.termSearchers.length)return{isMatch:!1,score:1};const e=[];let s=0,i=0,n=0;for(let r=0;r0?1-s/i:0,c={isMatch:!0,score:Math.max(.001,r)};return this.options.includeMatches&&e.length&&(c.indices=F(e)),c}}Y.version="7.3.0",Y.createIndex=C,Y.parseIndex=function(t,{getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){const{keys:i,records:n}=t,r=new m({getFn:e,fieldNormWeight:s});return r.setKeys(i),r.setIndexRecords(n),r},Y.config=p,Y.match=function(t,e,s){return O(t,{...p,...s}).searchIn(e)},R($),R(Z),Y.use=function(...t){t.forEach(t=>R(t))},module.exports=Y; \ No newline at end of file +"use strict";function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===u(e)}function t(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();const t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function s(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return!0===e||!1===e||function(e){return r(e)&&null!==e}(e)&&"[object Boolean]"==u(e)}function r(e){return"object"==typeof e}function o(e){return null!=e}function c(e){return!e.trim().length}function u(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const h="Invalid doc index: must be a non-negative integer within the bounds of the docs array",a=Object.prototype.hasOwnProperty;class l{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{const s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(t){let i=null,n=null,r=null,o=1,c=null;if(s(t)||e(t))r=t,i=f(t),n=g(t);else{if(!a.call(t,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const e=t.name;if(r=e,a.call(t,"weight")&&void 0!==t.weight&&(o=t.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(g(e)));i=f(e),n=g(e),c=t.getFn??null}return{path:i,id:n,weight:o,src:r,getFn:c}}function f(t){return e(t)?t:t.split(".")}function g(t){return e(t)?t.join("."):t}const m={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:function(r,c){const u=[];let h=!1;const a=(r,c,l,d)=>{if(o(r))if(c[l]){const f=r[c[l]];if(!o(f))return;if(l===c.length-1&&(s(f)||i(f)||n(f)||"bigint"==typeof f))u.push(void 0!==d?{v:t(f),i:d}:t(f));else if(e(f)){h=!0;for(let e=0,t=f.length;ee.score===t.score?e.idx{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(s(this.docs[0]))for(let s=0;se&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const s of e)Number.isInteger(s)&&s>=0&&t.add(s);if(0===t.size)return;this.records=this.records.filter(e=>!t.has(e.i));const s=Array.from(t).sort((e,t)=>e-t);for(const e of this.records){let t=0,i=s.length;for(;t>>1;s[n]t),records:this.records}}}function C(e,t,{getFn:s=p.getFn,fieldNormWeight:i=p.fieldNormWeight}={}){const n=new A({getFn:s,fieldNormWeight:i});return n.setKeys(e.map(d)),n.setSources(t),n.create(),n}const M=32;function y(e,t,s,{location:i=p.location,distance:n=p.distance,threshold:r=p.threshold,findAllMatches:o=p.findAllMatches,minMatchCharLength:c=p.minMatchCharLength,includeMatches:u=p.includeMatches,ignoreLocation:h=p.ignoreLocation}={}){if(t.length>M)throw new Error(`Pattern length exceeds max of ${M}.`);const a=t.length,l=e.length,d=Math.max(0,Math.min(i,l));let f=r,g=d;const m=(e,t)=>{const s=e/a;if(h)return s;const i=Math.abs(d-t);return n?s+i/n:i?1:s},A=c>1||u,C=A?Array(l):[];let y;for(;(y=e.indexOf(t,g))>-1;){const e=m(0,y);if(f=Math.min(e,f),g=y+a,A){let e=0;for(;e=r;i-=1){const n=i-1,o=s[e[n]];if(u[i]=(u[i+1]<<1|1)&o,t&&(u[i]|=(F[i+1]|F[i])<<1|1|F[i+1]),u[i]&D&&(x=m(t,n),x<=f)){if(f=x,g=n,v=t,g<=d)break;r=Math.max(1,2*d-g)}}if(m(t+1,d)>f)break;F=u}if(A&&g>=0){const t=Math.min(l-1,g+a-1+v);for(let i=g;i<=t;i+=1)s[e[i]]&&(C[i]=1)}const _={isMatch:g>=0,score:Math.max(.001,x)};if(A){const e=function(e=[],t=p.minMatchCharLength){const s=[];let i=-1,n=-1,r=0;for(let o=e.length;r=t&&s.push([i,n]),i=-1)}return e[r-1]&&r-i>=t&&s.push([i,r-1]),s}(C,c);e.length?u&&(_.indices=e):_.isMatch=!1}return _}function F(e){const t={};for(let s=0,i=e.length;se[0]-t[0]||e[1]-t[1]);const t=[e[0]];for(let s=1,i=e.length;se.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(k,e=>v[e]):e=>e;class _{constructor(e,{location:t=p.location,threshold:s=p.threshold,distance:i=p.distance,includeMatches:n=p.includeMatches,findAllMatches:r=p.findAllMatches,minMatchCharLength:o=p.minMatchCharLength,isCaseSensitive:c=p.isCaseSensitive,ignoreDiacritics:u=p.ignoreDiacritics,ignoreLocation:h=p.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:i,includeMatches:n,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:h},e=c?e:e.toLowerCase(),e=u?D(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const a=(e,t)=>{this.chunks.push({pattern:e,alphabet:F(e),startIndex:t})},l=this.pattern.length;if(l>M){let e=0;const t=l%M,s=l-t;for(;e{const{isMatch:g,score:m,indices:p}=y(e,t,s,{location:n+f,distance:r,threshold:o,findAllMatches:c,minMatchCharLength:u,includeMatches:i,ignoreLocation:h});g&&(d=!0),l+=m,g&&p&&a.push(...p)});const f={isMatch:d,score:d?l/this.chunks.length:1};return d&&i&&(f.indices=x(a)),f}}const E=new Set(["fuzzy","include"]);function B(e){return e.startsWith("inverse")}const S=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const s=t===e;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let s,i=0;const n=[],r=e.length;for(;(s=t.indexOf(e,i))>-1;)i=s+r,n.push([s,i-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const s=t.startsWith(e);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const s=!t.startsWith(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const s=!t.endsWith(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const s=t.endsWith(e);return{isMatch:s,score:s?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const s=-1===t.indexOf(e);return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const s=new _(e,{location:t.location??p.location,threshold:t.threshold??p.threshold,distance:t.distance??p.distance,includeMatches:t.includeMatches??p.includeMatches,findAllMatches:t.findAllMatches??p.findAllMatches,minMatchCharLength:t.minMatchCharLength??p.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??p.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??p.ignoreDiacritics,ignoreLocation:t.ignoreLocation??p.ignoreLocation});return{type:"fuzzy",search:e=>s.searchIn(e)}}}],I=S.length;function w(e,t){const s=e.match(t);return s?s[1]:null}class b{constructor(e,{isCaseSensitive:t=p.isCaseSensitive,ignoreDiacritics:s=p.ignoreDiacritics,includeMatches:i=p.includeMatches,minMatchCharLength:n=p.minMatchCharLength,ignoreLocation:r=p.ignoreLocation,findAllMatches:o=p.findAllMatches,location:c=p.location,threshold:u=p.threshold,distance:h=p.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:i,minMatchCharLength:n,findAllMatches:o,ignoreLocation:r,location:c,threshold:u,distance:h},e=t?e:e.toLowerCase(),e=s?D(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{const s=function(e){const t=[],s=e.length;let i=0;for(;i=s)break;let n=i;for(;n=s||" "===e[t]){n++;break}if("$"===e[t]&&(t+1>=s||" "===e[t+1])){n+=2;break}}n++}t.push(e.substring(i,n)),i=n}else{for(;ne&&!!e.trim()),i=[];for(let e=0,n=s.length;e!(!e[T]&&!e[z]),W=e=>({[T]:Object.keys(e).map(t=>({[t]:e[t]}))});function H(t,i,{auto:n=!0}={}){const o=t=>{if(s(t)){const e={keyId:null,pattern:t};return n&&(e.searcher=$(t,i)),e}const c=Object.keys(t),u=(e=>!!e[R])(t);if(!u&&c.length>1&&!j(t))return o(W(t));if((t=>!e(t)&&r(t)&&!j(t))(t)){const e=u?t[R]:c[0],r=u?t[O]:t[e];if(!s(r))throw new Error((e=>`Invalid value for key ${e}`)(e));const o={keyId:g(e),pattern:r};return n&&(o.searcher=$(r,i)),o}const h={children:[],operator:c[0]};return c.forEach(s=>{const i=t[s];e(i)&&i.forEach(e=>{h.children.push(o(e))})}),h};return j(t)||(t=W(t)),o(t)}function K(e,{ignoreFieldNorm:t=p.ignoreFieldNorm}){let s=1;return e.forEach(({key:e,norm:i,score:n})=>{const r=e?e.weight:null;s*=Math.pow(0===n&&r?Number.EPSILON:n,(r||1)*(t?1:i))}),s}class q{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size0;){const s=e-1>>1;if(t[e].score<=t[s].score)break;const i=t[e];t[e]=t[s],t[s]=i,e=s}}_sinkDown(e){const t=this.heap,s=t.length;let i=e;do{const n=2*(e=i)+1,r=2*e+2;if(nt[i].score&&(i=n),rt[i].score&&(i=r),i!==e){const s=t[e];t[e]=t[i],t[i]=s}}while(i!==e)}}function P(e,t,{includeMatches:s=p.includeMatches,includeScore:i=p.includeScore}={}){return e.map(e=>{const{idx:n}=e,r={item:t[n],refIndex:n};return s&&(r.matches=function(e){const t=[];return e.matches.forEach(e=>{if(!o(e.indices)||!e.indices.length)return;const s={indices:e.indices,value:e.value};e.key&&(s.key=e.key.id),e.idx>-1&&(s.refIndex=e.idx),t.push(s)}),t}(e)),i&&(r.score=e.score),r})}const Q=/[\p{L}\p{M}\p{N}_]+/gu;function U({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:s}={}){const i=function(e){return"function"==typeof e?t=>e(t):e instanceof RegExp?(e.global,t=>t.match(e)||[]):e=>e.match(Q)||[]}(s);return{tokenize:s=>(e||(s=s.toLowerCase()),t&&(s=D(s)),i(s))}}class J{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=U({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const s=this.analyzer.tokenize(e),i=t._invertedIndex,{df:n,fieldCount:r}=i;this.termSearchers=[],this.idfWeights=[];for(const e of s){this.termSearchers.push(new _(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const s=n.get(e)||0,i=Math.log(1+(r-s+.5)/(s+.5));this.idfWeights.push(i)}this.combineAll="all"===t.tokenMatch,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let s=0,i=0,n=0,r=0;const o=this.combineAll&&!this.useMask?new Set:null;for(let c=0;c0?1-s/i:0,u={isMatch:!0,score:Math.max(.001,c)};return this.options.includeMatches&&t.length&&(u.indices=x(t)),this.combineAll&&(this.useMask?u.matchedMask=r:u.matchedTerms=o,u.termCount=this.numTerms),u}}function V(e,t,s,i){const n=i.tokenize(t);if(!n.length)return;e.fieldCount++,e.docFieldCount.set(s,(e.docFieldCount.get(s)||0)+1);const r=new Set(n);let o=e.docTermFieldHits.get(s);o||(o=new Map,e.docTermFieldHits.set(s,o));for(const t of r)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function G(e,t,s,i){const{i:n,v:r,$:o}=t;if(void 0===r){if(o)for(let t=0;te-t);for(const t of s)X(e,t);const i=e=>{let t=0,i=s.length;for(;t>>1;s[n]n?i(t):t,s);e.docFieldCount=r;const o=new Map;for(const[t,s]of e.docTermFieldHits)o.set(t>n?i(t):t,s);e.docTermFieldHits=o}class Z{constructor(e,t,s){this.options={...p,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new l(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=$(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof A))throw new Error("Incorrect 'index' type");if(this._myIndex=t||C(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const e=U({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=function(e,t,s){const i={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const n of e)G(i,n,t,s);return i}(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!o(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const e=U({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});!function(e,t,s,i){G(e,t,s,i)}(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],s=[];for(let i=0,n=this._docs.length;i!e.has(s)),this._myIndex.removeAll(s),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(h);this._invertedIndex&&Y(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(e,t){const{limit:n=-1}=t||{},{includeMatches:r,includeScore:o,shouldSort:c,sortFn:u,ignoreFieldNorm:h}=this.options;if(s(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(n)&&n>-1&&(e=e.slice(0,n)),e}let a;if(i(n)&&n>0&&s(e)){const t=new q(n);s(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:h}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:h}),a=t.extractSorted(u)}else a=s(e)?s(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),function(e,{ignoreFieldNorm:t=p.ignoreFieldNorm}){e.forEach(e=>{e.score=K(e.matches,{ignoreFieldNorm:t})})}(a,{ignoreFieldNorm:h}),c&&a.sort(u),i(n)&&n>-1&&(a=a.slice(0,n));return P(a,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:s}={}){const i=this._getSearcher(e),n=this.options.useTokenSearch&&"all"===this.options.tokenMatch,{records:r}=this._myIndex,c=t?null:[];return r.forEach(({v:e,i:r,n:u})=>{if(!o(e))return;const h=i.searchIn(e);if(h.isMatch){const i={score:h.score,value:e,norm:u,indices:h.indices};n&&(i.matchedMask=h.matchedMask,i.matchedTerms=h.matchedTerms,i.termCount=h.termCount);const o=[i];if(!n||this._coversAllTokens(o)){const i={item:e,idx:r,matches:o};t?(i.score=K(i.matches,{ignoreFieldNorm:s}),t.shouldInsert(i.score)&&t.insert(i)):c.push(i)}}}),c}_searchLogical(e){const t=H(e,this.options),s=(e,t,i)=>{if(!("children"in e)){const{keyId:s,searcher:n}=e;let r;return null===s?(r=[],this._myIndex.keys.forEach((e,s)=>{r.push(...this._findMatches({key:e,value:t[s],searcher:n}))})):r=this._findMatches({key:this._keyStore.get(s),value:this._myIndex.getValueForItemAtKeyId(t,s),searcher:n}),r&&r.length?[{idx:i,item:t,matches:r}]:[]}const{children:n,operator:r}=e,o=[];for(let e=0,c=n.length;e{if(o(e)){const o=s(t,e,i);o.length&&(n.has(i)||(n.set(i,{idx:i,item:e,matches:[]}),r.push(n.get(i))),o.forEach(({matches:e})=>{n.get(i).matches.push(...e)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:s}={}){const i=this._getSearcher(e),n=this.options.useTokenSearch&&"all"===this.options.tokenMatch,{keys:r,records:c}=this._myIndex,u=t?null:[];return c.forEach(({$:e,i:c})=>{if(!o(e))return;const h=[];let a=!1,l=!1;if(r.forEach((t,s)=>{const n=this._findMatches({key:t,value:e[s],searcher:i});n.length?(h.push(...n),n[0].hasInverse&&(l=!0)):a=!0}),(!l||!a)&&h.length&&(!n||this._coversAllTokens(h))){const i={idx:c,item:e,matches:h};t?(i.score=K(i.matches,{ignoreFieldNorm:s}),t.shouldInsert(i.score)&&t.insert(i)):u.push(i)}}),u}_findMatches({key:t,value:s,searcher:i}){if(!o(s))return[];const n=[];if(e(s))s.forEach(({v:e,i:s,n:r})=>{if(!o(e))return;const c=i.searchIn(e);if(c.isMatch){const i={score:c.score,key:t,value:e,idx:s,norm:r,indices:c.indices,hasInverse:c.hasInverse};void 0!==c.termCount&&(i.matchedMask=c.matchedMask,i.matchedTerms=c.matchedTerms,i.termCount=c.termCount),n.push(i)}});else{const{v:e,n:r}=s,o=i.searchIn(e);if(o.isMatch){const s={score:o.score,key:t,value:e,norm:r,indices:o.indices,hasInverse:o.hasInverse};void 0!==o.termCount&&(s.matchedMask=o.matchedMask,s.matchedTerms=o.matchedTerms,s.termCount=o.termCount),n.push(s)}}return n}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(void 0===t)return!0;if(t<=31){let s=0;for(let t=0;tN(e))},module.exports=Z; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 36a216c141..83830050fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@tailwindcss/cli": "^4.3.0", "@tailwindcss/typography": "^0.5.19", "chart.js": "^4.5.1", - "fuse.js": "~7.3.0", + "fuse.js": "~7.4.1", "katex": "^0.16.45", "lite-youtube-embed": "^0.3.4", "medium-zoom": "^1.1.0", @@ -100,17 +100,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@floating-ui/core": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.3.tgz", @@ -974,6 +963,27 @@ "node": ">=14.0.0" } }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.10.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.10.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { "version": "1.2.1", "dev": true, @@ -1858,7 +1868,6 @@ "integrity": "sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10" } @@ -2297,7 +2306,6 @@ "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "dev": true, "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -2483,8 +2491,7 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1595872.tgz", "integrity": "sha512-kRfgp8vWVjBu/fbYCiVFiOqsCk3CrMKEo3WbgGT2NXK2dG7vawWPBljixajVgGK9II8rDO9G0oD0zLt3I1daRg==", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/dompurify": { "version": "3.4.3", @@ -2708,9 +2715,9 @@ } }, "node_modules/fuse.js": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.3.0.tgz", - "integrity": "sha512-plz8RVjfcDedTGfVngWH1jmJvBvAwi1v2jecfDerbEnMcmOYUEEwKFTHbNoCiYyzaK2Ws8lABkTCcRSqCY1q4w==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.4.1.tgz", + "integrity": "sha512-AY7lKAXK71hi3WgUvDy6oZL67UEHOOtvCAwVdOXHyJd6ZzftBy7QqxuXt4HxmmAhYjmp/YCuOELZtIvAdlZ+fw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -3318,6 +3325,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "peer": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -3723,7 +3731,6 @@ "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -3964,6 +3971,7 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" } @@ -4127,8 +4135,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz", "integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/tapable": { "version": "2.3.3", diff --git a/package.json b/package.json index d888e7f42a..56180b9123 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@tailwindcss/cli": "^4.3.0", "@tailwindcss/typography": "^0.5.19", "chart.js": "^4.5.1", - "fuse.js": "~7.3.0", + "fuse.js": "~7.4.1", "katex": "^0.16.45", "lite-youtube-embed": "^0.3.4", "medium-zoom": "^1.1.0",