@sheetxl/studio-mui 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/browser/cjs/{BiXR_PE14hrnbjxg.cjs → 0lIBM05Oo-mPaz-z.cjs} +1 -1
  2. package/browser/cjs/5JvwHMk_pfEj4cZH.cjs +42 -0
  3. package/browser/cjs/{BdFSVVjjrhlXHPpK.cjs → BOqCECEhgUXx-4kI.cjs} +2 -2
  4. package/browser/cjs/BaMk9jpFcmdBLRiR.cjs +6 -0
  5. package/browser/cjs/CCynZK017xahlNmi.cjs +18 -0
  6. package/browser/cjs/{mocbOdB4d2s-EcmO.cjs → CG7Z-lZAq5czFOc4.cjs} +2 -2
  7. package/browser/cjs/CRAcvjlcqcZK3WEL.cjs +20 -0
  8. package/browser/cjs/{CHMLnYdMrxKoXUT-.cjs → CtkBZTjdHqYp7xft.cjs} +1 -1
  9. package/browser/cjs/{Bkxhpequ7eXKflN2.cjs → DmM-DjGh015RZXzh.cjs} +2 -2
  10. package/browser/cjs/{D3da_TJhCMaA-Jvd.cjs → U3YgQ0fN5bvp9-Kq.cjs} +2 -2
  11. package/browser/cjs/{CZibZcMftaStnfGU.cjs → aiA3IvXgAikOrMwA.cjs} +1 -1
  12. package/browser/cjs/{Cgcw3wtvrTN9St3u.cjs → dW-tltmR8b4Fnr8g.cjs} +1 -1
  13. package/browser/cjs/index.cjs +2 -2
  14. package/browser/esm/{DNCGkZj-AkmOiPjY.mjs → BxFzIKTovnlqjZa-.mjs} +18 -18
  15. package/browser/esm/{BMSwIfNeNw_icSmZ.mjs → C1aztXQ58ekuzis6.mjs} +1 -1
  16. package/browser/esm/{CmyX3-QWO3ckLyv3.mjs → C9vgT92BfuOKSqpB.mjs} +1 -1
  17. package/browser/esm/{ClhYgmXRwTR4BGDR.mjs → COc-f5ehGeQiPNRP.mjs} +183 -183
  18. package/browser/esm/{BM3rF0tr-rYuco_b.mjs → Ck2WRaGuINSXU-Ds.mjs} +2 -2
  19. package/browser/esm/{DrthDGd5PMQYMoAg.mjs → DVbgcz-P2Z8D_yei.mjs} +2 -2
  20. package/browser/esm/{DnGxqCVe_CBDfW9k.mjs → Dcag5-NLJslhyfpE.mjs} +2 -2
  21. package/browser/esm/{BezPorS4-_Cf52pp.mjs → DnJZFwOGICYRq_KW.mjs} +1 -1
  22. package/browser/esm/{DhXNvjm-1jhrLfp9.mjs → EmQd5txQ_ErHLAeT.mjs} +2 -2
  23. package/browser/esm/MgTnV8wS66lhumxT.mjs +4482 -0
  24. package/browser/esm/{1-hjYTXne52O8OX_.mjs → _08whbc3oA7BY_S7.mjs} +1 -1
  25. package/browser/esm/{C79_LGbHVJJOQeTJ.mjs → he9qd0KA2ONjy_rM.mjs} +88 -88
  26. package/browser/esm/index.mjs +53 -52
  27. package/licenses/dependencies.txt +142 -142
  28. package/node/esm/{Diz6_VGLA3UKNUY9.mjs → B5K3cjwd0usYef8w.mjs} +3 -3
  29. package/node/esm/{Bzl7JElFM6-FCHSt.mjs → BAHfO9ALnEUni4Ts.mjs} +1 -1
  30. package/node/esm/{CztOzeLDzog1fyuN.mjs → BfPfvgdZrUoZvEme.mjs} +1 -1
  31. package/node/esm/{DGRe7O8zr5SC-f6x.mjs → BqPC_rbjZN2Jy_y4.mjs} +1 -1
  32. package/node/esm/{6F8OSHeXM9CEkZqx.mjs → CHNFCXGADLFVCwYo.mjs} +1 -1
  33. package/node/esm/{Cnq5yNOuwBbKS_5h.mjs → Cgxo3ZcSke1eBYVG.mjs} +1 -1
  34. package/node/esm/{CIovZ9X_7yBfY6gS.mjs → Ciwkv8DXp86zUjTb.mjs} +1 -1
  35. package/node/esm/{B8vjMUZKgFrmm-ow.mjs → DESr6vZQNH2lHWZ9.mjs} +1 -1
  36. package/node/esm/{Ky0P7yYYcyx15RUV.mjs → DhN2m_4WFHDBADx-.mjs} +1 -1
  37. package/node/esm/{B6FKzcfPmEc-2C3u.mjs → IID7UVIiXTHvqYHK.mjs} +1 -1
  38. package/node/esm/index.mjs +1246 -1170
  39. package/package.json +9 -9
  40. package/types/index.d.ts +30 -11
  41. package/browser/cjs/BMxf7QrY-RKnhIl4.cjs +0 -6
  42. package/browser/cjs/BS2wS_sZa-gKkoFx.cjs +0 -20
  43. package/browser/cjs/BTFMHzaEfycvibMu.cjs +0 -42
  44. package/browser/cjs/CUnh1LhecJpjlHt_.cjs +0 -18
  45. package/browser/esm/BZW3vg34hfduKfB_.mjs +0 -4408
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/studio-mui",
3
3
  "description": "Studio - Spreadsheet UI built with SheetXL SDK using React & MUI.",
4
- "version": "0.6.5",
4
+ "version": "0.6.7",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -36,13 +36,13 @@
36
36
  "charting"
37
37
  ],
38
38
  "dependencies": {
39
- "@sheetxl/grid-react": "^0.6.5",
40
- "@sheetxl/io": "^0.6.5",
41
- "@sheetxl/react": "^0.6.5",
42
- "@sheetxl/utils": "^0.6.5",
43
- "@sheetxl/utils-mui": "^0.6.5",
44
- "@sheetxl/utils-react": "^0.6.5",
45
- "@sheetxl/sdk": "^0.6.5",
39
+ "@sheetxl/grid-react": "^0.6.7",
40
+ "@sheetxl/io": "^0.6.7",
41
+ "@sheetxl/react": "^0.6.7",
42
+ "@sheetxl/sdk": "^0.6.7",
43
+ "@sheetxl/utils": "^0.6.7",
44
+ "@sheetxl/utils-mui": "^0.6.7",
45
+ "@sheetxl/utils-react": "^0.6.7",
46
46
  "clsx": "^2.1.1",
47
47
  "csstype": "^3.1.3",
48
48
  "file-saver": "^2.0.5",
@@ -56,7 +56,7 @@
56
56
  "react-transition-group": "^4.4.5",
57
57
  "react-use": "^17.6.0",
58
58
  "react-virtualized": "^9.22.6",
59
- "rooks": "^8.1.0",
59
+ "rooks": "^9.0.1",
60
60
  "tinycolor2": "^1.6.0"
61
61
  },
62
62
  "peerDependencies": {
package/types/index.d.ts CHANGED
@@ -586,6 +586,32 @@ export declare interface InsertCellsCommandButtonProps extends CommandPopupButto
586
586
  showQuickButton?: boolean;
587
587
  }
588
588
 
589
+ export declare interface InsertFunctionCommandButtonProps extends CommandPopupButtonProps {
590
+ category: string;
591
+ icon?: default_2.ReactNode | ((command: ICommand) => default_2.ReactNode);
592
+ label?: default_2.ReactNode | ((command: ICommand) => default_2.ReactNode);
593
+ /**
594
+ * Allow for listeners against a specific buttons execute rather than the command.
595
+ *
596
+ * @remarks
597
+ * Useful when knowing the specific button that executed a command is required.
598
+ * (For example when closing menus or restoring focus)
599
+ */
600
+ commandHook?: ICommandHook<any, any>;
601
+ }
602
+
603
+ export declare const InsertFunctionCommandPopupButton: default_2.NamedExoticComponent<Omit<InsertFunctionCommandButtonProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
604
+
605
+ /**
606
+ * Menu for quick function sum
607
+ */
608
+ export declare const InsertFunctionSumCommandPopupButton: default_2.NamedExoticComponent<InsertFunctionSumCommandPopupButtonProps & default_2.RefAttributes<HTMLElement>>;
609
+
610
+ export declare interface InsertFunctionSumCommandPopupButtonProps extends CommandButtonOptions {
611
+ parentFloat: FloatReference;
612
+ commands: ICommands.IGroup;
613
+ }
614
+
589
615
  export declare const InsertImageCommandButton: default_2.NamedExoticComponent<Omit<InsertImageCommandButtonProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
590
616
 
591
617
  export declare interface InsertImageCommandButtonProps extends CommandPopupButtonProps {
@@ -790,16 +816,6 @@ export declare interface PresetTableStylesCommandButtonProps extends CommandPopu
790
816
  usePreviewIcon?: boolean;
791
817
  }
792
818
 
793
- /**
794
- * Menu for quick formula sum
795
- */
796
- export declare const QuickFormulaSumCommandPopupButton: default_2.NamedExoticComponent<QuickFormulaSumCommandPopupButtonProps & default_2.RefAttributes<HTMLElement>>;
797
-
798
- export declare interface QuickFormulaSumCommandPopupButtonProps extends CommandButtonOptions {
799
- parentFloat: FloatReference;
800
- commands: ICommands.IGroup;
801
- }
802
-
803
819
  /**
804
820
  * Range input field.
805
821
  */
@@ -1385,13 +1401,16 @@ export declare interface useWorkbookCommandsOptions {
1385
1401
  workbookElement: IWorkbookElement;
1386
1402
  notifier?: Notifier;
1387
1403
  onNewWorkbook?: () => void;
1388
- commandTarget: ICommands.ITarget | (() => ICommands.ITarget);
1404
+ target: ICommands.ITarget | (() => ICommands.ITarget);
1389
1405
  commands: ICommands.IGroup;
1390
1406
  onExecute?: () => void;
1391
1407
  /**
1392
1408
  * When the sidebar is being requested to be shown.
1393
1409
  */
1394
1410
  onShowSidebar?: () => void;
1411
+ /**
1412
+ * Whether dark mode is enabled.
1413
+ */
1395
1414
  darkMode?: boolean;
1396
1415
  }
1397
1416
 
@@ -1,6 +0,0 @@
1
- "use strict";/**
2
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.6.5
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */function I(t){return Array.isArray?Array.isArray(t):ne(t)==="[object Array]"}function v(t){return typeof t=="string"}function te(t){return typeof t=="number"}function ae(t){return t===!0||t===!1||function(e){return ie(e)&&e!==null}(t)&&ne(t)=="[object Boolean]"}function ie(t){return typeof t=="object"}function F(t){return t!=null}function K(t){return!t.trim().length}function ne(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=Object.prototype.hasOwnProperty;class le{constructor(e){this._keys=[],this._keyMap={};let i=0;e.forEach(n=>{let s=se(n);this._keys.push(s),this._keyMap[s.id]=s,i+=s.weight}),this._keys.forEach(n=>{n.weight/=i})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function se(t){let e=null,i=null,n=null,s=1,c=null;if(v(t)||I(t))n=t,e=H(t),i=q(t);else{if(!G.call(t,"name"))throw new Error((o=>`Missing ${o} property in key`)("name"));const u=t.name;if(n=u,G.call(t,"weight")&&(s=t.weight,s<=0))throw new Error((o=>`Property 'weight' in key '${o}' must be a positive integer`)(u));e=H(u),i=q(u),c=t.getFn}return{path:e,id:i,weight:s,src:n,getFn:c}}function H(t){return I(t)?t:t.split(".")}function q(t){return I(t)?t.join("."):t}var l={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(t,e){let i=[],n=!1;const s=(c,u,o)=>{if(F(c))if(u[o]){const r=c[u[o]];if(!F(r))return;if(o===u.length-1&&(v(r)||te(r)||ae(r)))i.push(function(a){return a==null?"":function(h){if(typeof h=="string")return h;let g=h+"";return g=="0"&&1/h==-1/0?"-0":g}(a)}(r));else if(I(r)){n=!0;for(let a=0,h=r.length;a<h;a+=1)s(r[a],u,o+1)}else u.length&&s(r,u,o+1)}else i.push(c)};return s(t,v(e)?e.split("."):e,0),n?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};const de=/[^ ]+/g;class T{constructor({getFn:e=l.getFn,fieldNormWeight:i=l.fieldNormWeight}={}){this.norm=function(n=1,s=3){const c=new Map,u=Math.pow(10,s);return{get(o){const r=o.match(de).length;if(c.has(r))return c.get(r);const a=1/Math.pow(r,.5*n),h=parseFloat(Math.round(a*u)/u);return c.set(r,h),h},clear(){c.clear()}}}(i,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((i,n)=>{this._keysMap[i.id]=n})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,v(this.docs[0])?this.docs.forEach((e,i)=>{this._addString(e,i)}):this.docs.forEach((e,i)=>{this._addObject(e,i)}),this.norm.clear())}add(e){const i=this.size();v(e)?this._addString(e,i):this._addObject(e,i)}removeAt(e){this.records.splice(e,1);for(let i=e,n=this.size();i<n;i+=1)this.records[i].i-=1}getValueForItemAtKeyId(e,i){return e[this._keysMap[i]]}size(){return this.records.length}_addString(e,i){if(!F(e)||K(e))return;let n={v:e,i,n:this.norm.get(e)};this.records.push(n)}_addObject(e,i){let n={i,$:{}};this.keys.forEach((s,c)=>{let u=s.getFn?s.getFn(e):this.getFn(e,s.path);if(F(u)){if(I(u)){let o=[];const r=[{nestedArrIndex:-1,value:u}];for(;r.length;){const{nestedArrIndex:a,value:h}=r.pop();if(F(h))if(v(h)&&!K(h)){let g={v:h,i:a,n:this.norm.get(h)};o.push(g)}else I(h)&&h.forEach((g,d)=>{r.push({nestedArrIndex:d,value:g})})}n.$[c]=o}else if(v(u)&&!K(u)){let o={v:u,n:this.norm.get(u)};n.$[c]=o}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function re(t,e,{getFn:i=l.getFn,fieldNormWeight:n=l.fieldNormWeight}={}){const s=new T({getFn:i,fieldNormWeight:n});return s.setKeys(t.map(se)),s.setSources(e),s.create(),s}function W(t,{errors:e=0,currentLocation:i=0,expectedLocation:n=0,distance:s=l.distance,ignoreLocation:c=l.ignoreLocation}={}){const u=e/t.length;if(c)return u;const o=Math.abs(n-i);return s?u+o/s:o?1:u}const b=32;function ge(t,e,i,{location:n=l.location,distance:s=l.distance,threshold:c=l.threshold,findAllMatches:u=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,includeMatches:r=l.includeMatches,ignoreLocation:a=l.ignoreLocation}={}){if(e.length>b)throw new Error(`Pattern length exceeds max of ${b}.`);const h=e.length,g=t.length,d=Math.max(0,Math.min(n,g));let f=c,A=d;const C=o>1||r,p=C?Array(g):[];let E;for(;(E=t.indexOf(e,A))>-1;){let D=W(e,{currentLocation:E,expectedLocation:d,distance:s,ignoreLocation:a});if(f=Math.min(D,f),A=E+h,C){let B=0;for(;B<h;)p[E+B]=1,B+=1}}A=-1;let y=[],k=1,M=h+g;const $=1<<h-1;for(let D=0;D<h;D+=1){let B=0,L=M;for(;B<L;)W(e,{errors:D,currentLocation:d+L,expectedLocation:d,distance:s,ignoreLocation:a})<=f?B=L:M=L,L=Math.floor((M-B)/2+B);M=L;let N=Math.max(1,d-L+1),x=u?g:Math.min(d+L,g)+h,_=Array(x+2);_[x+1]=(1<<D)-1;for(let m=x;m>=N;m-=1){let R=m-1,j=i[t.charAt(R)];if(C&&(p[R]=+!!j),_[m]=(_[m+1]<<1|1)&j,D&&(_[m]|=(y[m+1]|y[m])<<1|1|y[m+1]),_[m]&$&&(k=W(e,{errors:D,currentLocation:R,expectedLocation:d,distance:s,ignoreLocation:a}),k<=f)){if(f=k,A=R,A<=d)break;N=Math.max(1,2*d-A)}}if(W(e,{errors:D+1,currentLocation:d,expectedLocation:d,distance:s,ignoreLocation:a})>f)break;y=_}const S={isMatch:A>=0,score:Math.max(.001,k)};if(C){const D=function(B=[],L=l.minMatchCharLength){let N=[],x=-1,_=-1,m=0;for(let R=B.length;m<R;m+=1){let j=B[m];j&&x===-1?x=m:j||x===-1||(_=m-1,_-x+1>=L&&N.push([x,_]),x=-1)}return B[m-1]&&m-x>=L&&N.push([x,m-1]),N}(p,o);D.length?r&&(S.indices=D):S.isMatch=!1}return S}function fe(t){let e={};for(let i=0,n=t.length;i<n;i+=1){const s=t.charAt(i);e[s]=(e[s]||0)|1<<n-i-1}return e}const z=String.prototype.normalize?t=>t.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,""):t=>t;class ue{constructor(e,{location:i=l.location,threshold:n=l.threshold,distance:s=l.distance,includeMatches:c=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,isCaseSensitive:r=l.isCaseSensitive,ignoreDiacritics:a=l.ignoreDiacritics,ignoreLocation:h=l.ignoreLocation}={}){if(this.options={location:i,threshold:n,distance:s,includeMatches:c,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:r,ignoreDiacritics:a,ignoreLocation:h},e=r?e:e.toLowerCase(),e=a?z(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(f,A)=>{this.chunks.push({pattern:f,alphabet:fe(f),startIndex:A})},d=this.pattern.length;if(d>b){let f=0;const A=d%b,C=d-A;for(;f<C;)g(this.pattern.substr(f,b),f),f+=b;if(A){const p=d-b;g(this.pattern.substr(p),p)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:i,ignoreDiacritics:n,includeMatches:s}=this.options;if(e=i?e:e.toLowerCase(),e=n?z(e):e,this.pattern===e){let C={isMatch:!0,score:0};return s&&(C.indices=[[0,e.length-1]]),C}const{location:c,distance:u,threshold:o,findAllMatches:r,minMatchCharLength:a,ignoreLocation:h}=this.options;let g=[],d=0,f=!1;this.chunks.forEach(({pattern:C,alphabet:p,startIndex:E})=>{const{isMatch:y,score:k,indices:M}=ge(e,C,p,{location:c+E,distance:u,threshold:o,findAllMatches:r,minMatchCharLength:a,includeMatches:s,ignoreLocation:h});y&&(f=!0),d+=k,y&&M&&(g=[...g,...M])});let A={isMatch:f,score:f?d/this.chunks.length:1};return f&&s&&(A.indices=g),A}}class w{constructor(e){this.pattern=e}static isMultiMatch(e){return X(e,this.multiRegex)}static isSingleMatch(e){return X(e,this.singleRegex)}search(){}}function X(t,e){const i=t.match(e);return i?i[1]:null}class ce extends w{constructor(e,{location:i=l.location,threshold:n=l.threshold,distance:s=l.distance,includeMatches:c=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:o=l.minMatchCharLength,isCaseSensitive:r=l.isCaseSensitive,ignoreDiacritics:a=l.ignoreDiacritics,ignoreLocation:h=l.ignoreLocation}={}){super(e),this._bitapSearch=new ue(e,{location:i,threshold:n,distance:s,includeMatches:c,findAllMatches:u,minMatchCharLength:o,isCaseSensitive:r,ignoreDiacritics:a,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class oe extends w{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let i,n=0;const s=[],c=this.pattern.length;for(;(i=e.indexOf(this.pattern,n))>-1;)n=i+c,s.push([i,n-1]);const u=!!s.length;return{isMatch:u,score:u?0:1,indices:s}}}const J=[class extends w{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]}}},oe,class extends w{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 w{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 w{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 w{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 w{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=t.indexOf(this.pattern)===-1;return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},ce],Y=J.length,Ae=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,pe=new Set([ce.type,oe.type]);class Ce{constructor(e,{isCaseSensitive:i=l.isCaseSensitive,ignoreDiacritics:n=l.ignoreDiacritics,includeMatches:s=l.includeMatches,minMatchCharLength:c=l.minMatchCharLength,ignoreLocation:u=l.ignoreLocation,findAllMatches:o=l.findAllMatches,location:r=l.location,threshold:a=l.threshold,distance:h=l.distance}={}){this.query=null,this.options={isCaseSensitive:i,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:c,findAllMatches:o,ignoreLocation:u,location:r,threshold:a,distance:h},e=i?e:e.toLowerCase(),e=n?z(e):e,this.pattern=e,this.query=function(g,d={}){return g.split("|").map(f=>{let A=f.trim().split(Ae).filter(p=>p&&!!p.trim()),C=[];for(let p=0,E=A.length;p<E;p+=1){const y=A[p];let k=!1,M=-1;for(;!k&&++M<Y;){const $=J[M];let S=$.isMultiMatch(y);S&&(C.push(new $(S,d)),k=!0)}if(!k)for(M=-1;++M<Y;){const $=J[M];let S=$.isSingleMatch(y);if(S){C.push(new $(S,d));break}}}return C})}(this.pattern,this.options)}static condition(e,i){return i.useExtendedSearch}searchIn(e){const i=this.query;if(!i)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:c}=this.options;e=s?e:e.toLowerCase(),e=c?z(e):e;let u=0,o=[],r=0;for(let a=0,h=i.length;a<h;a+=1){const g=i[a];o.length=0,u=0;for(let d=0,f=g.length;d<f;d+=1){const A=g[d],{isMatch:C,indices:p,score:E}=A.search(e);if(!C){r=0,u=0,o.length=0;break}if(u+=1,r+=E,n){const y=A.constructor.type;pe.has(y)?o=[...o,...p]:o.push(p)}}if(u){let d={isMatch:!0,score:r/u};return n&&(d.indices=o),d}}return{isMatch:!1,score:1}}}const V=[];function Q(t,e){for(let i=0,n=V.length;i<n;i+=1){let s=V[i];if(s.condition(t,e))return new s(t,e)}return new ue(t,e)}const U="$and",me="$or",Z="$path",Me="$val",P=t=>!(!t[U]&&!t[me]),ee=t=>({[U]:Object.keys(t).map(e=>({[e]:t[e]}))});function he(t,e,{auto:i=!0}={}){const n=s=>{let c=Object.keys(s);const u=(r=>!!r[Z])(s);if(!u&&c.length>1&&!P(s))return n(ee(s));if((r=>!I(r)&&ie(r)&&!P(r))(s)){const r=u?s[Z]:c[0],a=u?s[Me]:s[r];if(!v(a))throw new Error((g=>`Invalid value for key ${g}`)(r));const h={keyId:q(r),pattern:a};return i&&(h.searcher=Q(a,e)),h}let o={children:[],operator:c[0]};return c.forEach(r=>{const a=s[r];I(a)&&a.forEach(h=>{o.children.push(n(h))})}),o};return P(t)||(t=ee(t)),n(t)}function Fe(t,e){const i=t.matches;e.matches=[],F(i)&&i.forEach(n=>{if(!F(n.indices)||!n.indices.length)return;const{indices:s,value:c}=n;let u={indices:s,value:c};n.key&&(u.key=n.key.src),n.idx>-1&&(u.refIndex=n.idx),e.matches.push(u)})}function Ee(t,e){e.score=t.score}class O{constructor(e,i={},n){this.options={...l,...i},this.options.useExtendedSearch,this._keyStore=new le(this.options.keys),this.setCollection(e,n)}setCollection(e,i){if(this._docs=e,i&&!(i instanceof T))throw new Error("Incorrect 'index' type");this._myIndex=i||re(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){F(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const i=[];for(let n=0,s=this._docs.length;n<s;n+=1){const c=this._docs[n];e(c,n)&&(this.removeAt(n),n-=1,s-=1,i.push(c))}return i}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:i=-1}={}){const{includeMatches:n,includeScore:s,shouldSort:c,sortFn:u,ignoreFieldNorm:o}=this.options;let r=v(e)?v(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(a,{ignoreFieldNorm:h=l.ignoreFieldNorm}){a.forEach(g=>{let d=1;g.matches.forEach(({key:f,norm:A,score:C})=>{const p=f?f.weight:null;d*=Math.pow(C===0&&p?Number.EPSILON:C,(p||1)*(h?1:A))}),g.score=d})}(r,{ignoreFieldNorm:o}),c&&r.sort(u),te(i)&&i>-1&&(r=r.slice(0,i)),function(a,h,{includeMatches:g=l.includeMatches,includeScore:d=l.includeScore}={}){const f=[];return g&&f.push(Fe),d&&f.push(Ee),a.map(A=>{const{idx:C}=A,p={item:h[C],refIndex:C};return f.length&&f.forEach(E=>{E(A,p)}),p})}(r,this._docs,{includeMatches:n,includeScore:s})}_searchStringList(e){const i=Q(e,this.options),{records:n}=this._myIndex,s=[];return n.forEach(({v:c,i:u,n:o})=>{if(!F(c))return;const{isMatch:r,score:a,indices:h}=i.searchIn(c);r&&s.push({item:c,idx:u,matches:[{score:a,value:c,norm:o,indices:h}]})}),s}_searchLogical(e){const i=he(e,this.options),n=(o,r,a)=>{if(!o.children){const{keyId:g,searcher:d}=o,f=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(r,g),searcher:d});return f&&f.length?[{idx:a,item:r,matches:f}]:[]}const h=[];for(let g=0,d=o.children.length;g<d;g+=1){const f=o.children[g],A=n(f,r,a);if(A.length)h.push(...A);else if(o.operator===U)return[]}return h},s=this._myIndex.records,c={},u=[];return s.forEach(({$:o,i:r})=>{if(F(o)){let a=n(i,o,r);a.length&&(c[r]||(c[r]={idx:r,item:o,matches:[]},u.push(c[r])),a.forEach(({matches:h})=>{c[r].matches.push(...h)}))}}),u}_searchObjectList(e){const i=Q(e,this.options),{keys:n,records:s}=this._myIndex,c=[];return s.forEach(({$:u,i:o})=>{if(!F(u))return;let r=[];n.forEach((a,h)=>{r.push(...this._findMatches({key:a,value:u[h],searcher:i}))}),r.length&&c.push({idx:o,item:u,matches:r})}),c}_findMatches({key:e,value:i,searcher:n}){if(!F(i))return[];let s=[];if(I(i))i.forEach(({v:c,i:u,n:o})=>{if(!F(c))return;const{isMatch:r,score:a,indices:h}=n.searchIn(c);r&&s.push({score:a,key:e,value:c,idx:u,norm:o,indices:h})});else{const{v:c,n:u}=i,{isMatch:o,score:r,indices:a}=n.searchIn(c);o&&s.push({score:r,key:e,value:c,norm:u,indices:a})}return s}}O.version="7.1.0",O.createIndex=re,O.parseIndex=function(t,{getFn:e=l.getFn,fieldNormWeight:i=l.fieldNormWeight}={}){const{keys:n,records:s}=t,c=new T({getFn:e,fieldNormWeight:i});return c.setKeys(n),c.setIndexRecords(s),c},O.config=l,O.parseQuery=he,function(...t){V.push(...t)}(Ce),exports.default=O;