@hollware/admin 1.0.0-rc.0 → 1.0.0-rc.2

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 (49) hide show
  1. package/dist/client/admin/assets/{Account-OgCmRh3p.js → Account-CiJITAlT.js} +1 -1
  2. package/dist/client/admin/assets/Activity-DRDoLqUV.js +1 -0
  3. package/dist/client/admin/assets/{Callback-Bd_E2MOu.js → Callback-BJRdaaQa.js} +1 -1
  4. package/dist/client/admin/assets/Checkbox-DUg9FPdC.js +1 -0
  5. package/dist/client/admin/assets/Collection-CC_Uh8q2.js +55 -0
  6. package/dist/client/admin/assets/{Collections-CIQEDb4n.js → Collections-DslaBu2p.js} +1 -1
  7. package/dist/client/admin/assets/{CommandPalette-CaudxyDO.js → CommandPalette-BxEaCJDK.js} +1 -1
  8. package/dist/client/admin/assets/{DataTable-C8PKpqDk.js → DataTable-C8krQDTd.js} +1 -1
  9. package/dist/client/admin/assets/{Drawer-QZ2e5Qu-.js → Drawer-MI4zdILP.js} +1 -1
  10. package/dist/client/admin/assets/{Entries-sKXmTRAY.js → Entries-FOcOVxle.js} +1 -1
  11. package/dist/client/admin/assets/{Entry-IEK4600_.js → Entry-Dmn-Lliv.js} +1 -1
  12. package/dist/client/admin/assets/FieldRoot-5SlIM98s.js +1 -0
  13. package/dist/client/admin/assets/{FormField-CJVUVtJp.js → FormField-BmR-cUOa.js} +1 -1
  14. package/dist/client/admin/assets/{Home-x722ZbaS.js → Home-JCaxrHqe.js} +1 -1
  15. package/dist/client/admin/assets/Images-Dzz9eAnU.js +1 -0
  16. package/dist/client/admin/assets/{InputNumber-vGsLft_d.js → InputNumber-CLOtxewW.js} +1 -1
  17. package/dist/client/admin/assets/{InputTags-uNIV-i75.js → InputTags-DJoPCsnn.js} +1 -1
  18. package/dist/client/admin/assets/Label-DHBau-RI.js +1 -0
  19. package/dist/client/admin/assets/{Modal-xlafxc7H.js → Modal-C0EA1HG6.js} +1 -1
  20. package/dist/client/admin/assets/{NewEntry-7yN63Li5.js → NewEntry-B1U3WdnS.js} +1 -1
  21. package/dist/client/admin/assets/{Page-Df9k6j3N.js → Page-1xWzfUvl.js} +1 -1
  22. package/dist/client/admin/assets/{People-DFve2iFx.js → People-dK5flLPn.js} +1 -1
  23. package/dist/client/admin/assets/{Reviews-DcdEUKKq.js → Reviews-Ca4l8GJQ.js} +1 -1
  24. package/dist/client/admin/assets/{RovingFocusItem-CBC6orXI.js → RovingFocusItem-BWPNQ59P.js} +1 -1
  25. package/dist/client/admin/assets/Select-Cjes__1K.js +1 -0
  26. package/dist/client/admin/assets/{Site-uqRpNNzC.js → Site-DT2lAMva.js} +1 -1
  27. package/dist/client/admin/assets/{Slideover-DHJp1Wu-.js → Slideover-C5d40TEM.js} +1 -1
  28. package/dist/client/admin/assets/{StructureDialogs-C8A5_Uip.js → StructureDialogs-CWTsipn1.js} +1 -1
  29. package/dist/client/admin/assets/{Toast-CLwIR0jw.js → Toast-CPF48ZLP.js} +1 -1
  30. package/dist/client/admin/assets/{Tokens-CR-FpiFx.js → Tokens-YNRr4T4b.js} +1 -1
  31. package/dist/client/admin/assets/{VerdictList-CdJJwTAW.js → VerdictList--jLMVZXL.js} +1 -1
  32. package/dist/client/admin/assets/{VisuallyHiddenInput-BcwRP4QN.js → VisuallyHiddenInput-enxnDtd6.js} +1 -1
  33. package/dist/client/admin/assets/{bulk-report-DtFEguVY.js → bulk-report-LKHOVvNG.js} +1 -1
  34. package/dist/client/admin/assets/{columns-C2eOHLOF.js → columns-BI-jAZXT.js} +1 -1
  35. package/dist/client/admin/assets/index-B1aUX4Ji.css +2 -0
  36. package/dist/client/admin/assets/{index-CU4FewUB.js → index-DCfU2aBq.js} +3 -3
  37. package/dist/client/admin/assets/{me-BI4DxQI4.js → me-BEcP7hja.js} +1 -1
  38. package/dist/client/admin/assets/{presets-DKXSNivp.js → presets-CIuP8waC.js} +1 -1
  39. package/dist/client/admin/assets/session-CVs7LrtN.js +1 -0
  40. package/dist/client/admin/assets/{virtualizer-T_z5T3jP.js → virtualizer-j1ISV2Og.js} +1 -1
  41. package/dist/client/admin/index.html +4 -4
  42. package/package.json +2 -2
  43. package/dist/client/admin/assets/Activity-DnrBfUzH.js +0 -1
  44. package/dist/client/admin/assets/Checkbox-CpedbrFs.js +0 -1
  45. package/dist/client/admin/assets/Collection-C_M05-IT.js +0 -55
  46. package/dist/client/admin/assets/Label-CLk3TC5c.js +0 -1
  47. package/dist/client/admin/assets/Select-BEIL7CCt.js +0 -1
  48. package/dist/client/admin/assets/index-CETy3pwO.css +0 -2
  49. package/dist/client/admin/assets/session-DxiGrAK0.js +0 -1
@@ -1 +1 @@
1
- import{$r as e,A as t,Ei as n,En as r,Gn as i,Gt as a,Ht as o,Kn as s,Kr as c,N as l,Qr as u,Qt as d,R as f,Si as p,Tn as m,U as h,Ur as g,Ut as _,Vt as v,W as y,Wt as b,Yr as ee,Yt as x,Zr as S,Zt as C,_ as te,a as ne,cr as re,dt as ie,en as ae,ft as oe,g as se,i as ce,jt as w,lr as le,lt as ue,n as de,o as T,or as fe,pr as pe,r as me,s as he,t as ge,v as _e,vr as E,wn as D,y as O,zn as k}from"./Button-CLo6xV_j.js";import{i as ve,z as ye}from"./Presence-CNRQpqMN.js";import{n as be,t as xe}from"./Input-ziwF3Rrc.js";import{a as Se,c as Ce,i as we,l as Te,n as Ee,o as A,r as De,s as Oe,t as ke}from"./virtualizer-T_z5T3jP.js";var Ae=ae({__name:`ListboxGroupLabel`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(t){let n=t,r=A({id:``});return(t,i)=>(k(),_(e(O),m(n,{id:e(r).id}),{default:E(()=>[s(t.$slots,`default`)]),_:3},16,[`id`]))}});function j(e){return Array.isArray?Array.isArray(e):B(e)===`[object Array]`}function M(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function N(e){return e==null?``:M(e)}function P(e){return typeof e==`string`}function F(e){return typeof e==`number`}function je(e){return e===!0||e===!1||L(e)&&B(e)==`[object Boolean]`}function I(e){return typeof e==`object`}function L(e){return I(e)&&e!==null}function R(e){return e!=null}function z(e){return!e.trim().length}function B(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Me=`Incorrect 'index' type`,V=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,Ne=e=>`Invalid value for key ${e}`,Pe=e=>`Pattern length exceeds max of ${e}.`,H=e=>`Missing ${e} property in key`,U=e=>`Property 'weight' in key '${e}' must be a positive integer`,Fe=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,W=Object.prototype.hasOwnProperty,Ie=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=G(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.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 G(e){let t=null,n=null,r=null,i=1,a=null;if(P(e)||j(e))r=e,t=K(e),n=q(e);else{if(!W.call(e,`name`))throw Error(H(`name`));let o=e.name;if(r=o,W.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(U(q(o)));t=K(o),n=q(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function K(e){return j(e)?e:e.split(`.`)}function q(e){return j(e)?e.join(`.`):e}function Le(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(R(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!R(s))return;if(a===t.length-1&&(P(s)||F(s)||je(s)||typeof s==`bigint`))n.push(o===void 0?N(s):{v:N(s),i:o});else if(j(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}}};return i(e,P(t)?t.split(`.`):t,0),r?n:n[0]}var Re={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ze={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Be={location:0,threshold:.6,distance:100},Ve={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:Le,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},J=Object.freeze({...ze,...Re,...Be,...Ve});function He(e){return e>=9&&e<=13||e===32||e===160}function Ue(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e<t.length;e++)He(t.charCodeAt(e))?a=!1:a||=(i++,!0);if(i===0&&(i=1),n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}var Y=class{constructor({getFn:e=J.getFn,fieldNormWeight:t=J.fieldNormWeight}={}){this.norm=Ue(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(P(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(V);if(P(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(V);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!R(e)||z(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(R(i)){if(j(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(R(n)){if(P(n)){if(!z(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(R(n.v)){let t=P(n.v)?n.v:N(n.v);if(!z(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(P(i)&&!z(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function We(e,t,{getFn:n=J.getFn,fieldNormWeight:r=J.fieldNormWeight}={}){let i=new Y({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(G)),i.setSources(t),i.create(),i}function Ge(e,{getFn:t=J.getFn,fieldNormWeight:n=J.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new Y({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function Ke(e=[],t=J.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function qe(e,t,n,{location:r=J.location,distance:i=J.distance,threshold:a=J.threshold,findAllMatches:o=J.findAllMatches,minMatchCharLength:s=J.minMatchCharLength,includeMatches:c=J.includeMatches,ignoreLocation:l=J.ignoreLocation}={}){if(t.length>32)throw Error(Pe(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,ee=0,x=u+d,S=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=x;for(;r<i;)h(t,f+i)<=p?r=i:x=i,i=Math.floor((x-r)/2+r);x=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&S&&(b=h(t,i),b<=p)){if(p=b,m=i,ee=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+ee);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let C={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=Ke(_,s);e.length?c&&(C.indices=e):C.isMatch=!1}return C}function Je(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function Ye(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}var Xe={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},Ze=RegExp(`[`+Object.keys(Xe).join(``)+`]`,`g`),X=typeof String.prototype.normalize==`function`?e=>e.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(Ze,e=>Xe[e]):e=>e,Qe=class{constructor(e,{location:t=J.location,threshold:n=J.threshold,distance:r=J.distance,includeMatches:i=J.includeMatches,findAllMatches:a=J.findAllMatches,minMatchCharLength:o=J.minMatchCharLength,isCaseSensitive:s=J.isCaseSensitive,ignoreDiacritics:c=J.ignoreDiacritics,ignoreLocation:l=J.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?X(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:Je(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?X(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=qe(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=Ye(u)),p}},$e=new Set([`fuzzy`,`include`]);function et(e){return e.startsWith(`inverse`)}var tt=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new Qe(e,{location:t.location??J.location,threshold:t.threshold??J.threshold,distance:t.distance??J.distance,includeMatches:t.includeMatches??J.includeMatches,findAllMatches:t.findAllMatches??J.findAllMatches,minMatchCharLength:t.minMatchCharLength??J.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??J.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??J.ignoreDiacritics,ignoreLocation:t.ignoreLocation??J.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],nt=tt.length,rt=`\0`,it=`|`;function at(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function ot(e,t){let n=e.match(t);return n?n[1]:null}function st(e,t={}){return e.replace(/\\\|/g,rt).split(it).map(e=>{let n=at(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<nt;){let e=tt[o],n=ot(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<nt;){let e=tt[o],n=ot(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var ct=class{constructor(e,{isCaseSensitive:t=J.isCaseSensitive,ignoreDiacritics:n=J.ignoreDiacritics,includeMatches:r=J.includeMatches,minMatchCharLength:i=J.minMatchCharLength,ignoreLocation:a=J.ignoreLocation,findAllMatches:o=J.findAllMatches,location:s=J.location,threshold:c=J.threshold,distance:l=J.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?X(e):e,this.pattern=e,this.query=st(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?X(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,et(r.type)&&(c=!0),n&&($e.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=Ye(o)),e}}return{isMatch:!1,score:1}}},lt=[];function ut(...e){lt.push(...e)}function Z(e,t){for(let n=0,r=lt.length;n<r;n+=1){let r=lt[n];if(r.condition(e,t))return new r(e,t)}return new Qe(e,t)}var Q={AND:`$and`,OR:`$or`},dt={PATH:`$path`,PATTERN:`$val`},ft=e=>!!(e[Q.AND]||e[Q.OR]),pt=e=>!!e[dt.PATH],mt=e=>!j(e)&&I(e)&&!ft(e),ht=e=>({[Q.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function gt(e,t,{auto:n=!0}={}){let r=e=>{if(P(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=Z(e,t)),r}let i=Object.keys(e),a=pt(e);if(!a&&i.length>1&&!ft(e))return r(ht(e));if(mt(e)){let r=a?e[dt.PATH]:i[0],o=a?e[dt.PATTERN]:e[r];if(!P(o))throw Error(Ne(r));let s={keyId:q(r),pattern:o};return n&&(s.searcher=Z(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];j(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return ft(e)||(e=ht(e)),r(e)}function _t(e,{ignoreFieldNorm:t=J.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function vt(e,{ignoreFieldNorm:t=J.ignoreFieldNorm}){e.forEach(e=>{e.score=_t(e.matches,{ignoreFieldNorm:t})})}var yt=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[r])>0&&(r=i),a<n&&this.comparator(t[a],t[r])>0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function bt(e){let t=[];return e.matches.forEach(e=>{if(!R(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function xt(e,t,{includeMatches:n=J.includeMatches,includeScore:r=J.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=bt(e)),r&&(a.score=e.score),a})}var St=/[\p{L}\p{M}\p{N}_]+/gu,Ct=new WeakSet;function wt(e){Ct.has(e)||(Ct.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Tt(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||wt(e),t=>t.match(e)||[]):e=>e.match(St)||[]}function Et({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=Tt(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=X(n)),r(n)}}}var Dt=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Et({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new Qe(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}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=Ye(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function Ot(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function kt(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0)Ot(e,a,i,r);else if(o)for(let t=0;t<n;t++){let n=o[t];if(n){if(Array.isArray(n))for(let t of n)Ot(e,t.v,i,r);else Ot(e,n.v,i,r)}}}function At(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)kt(r,i,t,n);return r}function jt(e,t,n,r){kt(e,t,n,r)}function Mt(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function Nt(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Mt(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var $=class{constructor(e,t,n){this.options={...J,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Ie(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=Z(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 Y))throw Error(Me);if(this._myIndex=t||We(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=Et({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=At(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!R(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=Et({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});jt(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Nt(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(V);this._invertedIndex&&Nt(this._invertedIndex,[e]);let 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}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(P(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return F(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&F(n)&&n>0&&P(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new yt(n,u);P(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=P(e)?P(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),vt(d,{ignoreFieldNorm:s}),a&&d.sort(P(e)?u:l),F(n)&&n>-1&&(d=d.slice(0,n));return xt(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!R(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=_t(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=gt(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e<n;e+=1){let n=a[e],c=r(n,t,i);if(c.length)s.push(...c);else if(o===Q.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(R(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!R(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=_t(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!R(t))return[];let r=[];if(j(t))t.forEach(({v:t,i,n:a})=>{if(!R(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}};$.version=`7.5.0`,$.createIndex=We,$.parseIndex=Ge,$.config=J,$.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(Fe);return Z(e,{...J,...n}).searchIn(t)},$.parseQuery=gt,ut(ct),ut(Dt),$.use=function(...e){e.forEach(e=>ut(e))};var Pt=$;function Ft(e,t,n){let r=()=>new Pt(S(t)??[],S(n)?.fuseOptions),i=c(r());return pe(()=>S(n)?.fuseOptions,()=>{i.value=r()},{deep:!0}),pe(()=>S(t),e=>{i.value.setCollection(e),u(i)},{deep:!0}),{fuse:i,results:v(()=>{let r=S(n);if(r?.matchAllWhenSearchEmpty&&!S(e))return S(t).map((e,t)=>({item:e,refIndex:t}));let a=r?.resultLimit;return i.value.search(S(e),a?{limit:a}:void 0)})}}var It={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Lt(e){return e.replace(/[&<>"']/g,e=>It[e])}function Rt(e,t){let n=``,r=0,i=!1,a=Array.from(e);for(let e=a.length-1;e>=0;e--){let o=a[e];if(o===`>`)i=!0;else if(o===`<`){i=!1,n=o+n;continue}if(i||r++,r<=t)n=o+n;else{n=`...`+n;break}}return n}function zt(e,t,n,r,i){let a=i&&t.match(/[\p{L}\p{M}\p{N}_]+/gu)||[],o=a.length>0?Math.min(...a.map(e=>e.length)):t.length;function s(e,t=[]){e||=``;let n=``,r=0;t.forEach(t=>{if(t.length===2&&t[0]===t[1])return;let i=t[1]+1,a=i-t[0]>=o;n+=[Lt(e.substring(r,t[0])),a&&`<mark>`,Lt(e.substring(t[0],i)),a&&`</mark>`].filter(Boolean).join(``),r=i}),n+=Lt(e.substring(r));let i=n.indexOf(`<mark>`);return i!==-1&&(n=Rt(n,Array.from(n.slice(i)).length)),n}if(e.matches?.length){for(let t of e.matches)if(!(n&&t.key!==n)&&!r?.includes(t.key))return s(t.value,t.indices)}}var Bt={slots:{root:`flex flex-col min-h-0 min-w-0 divide-y divide-default`,input:``,close:``,back:`p-0`,content:`relative overflow-hidden flex flex-col`,footer:`p-1`,viewport:`relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,item:`group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75`,itemLeadingIcon:`shrink-0`,itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex items-center`,itemTrailingIcon:`shrink-0`,itemTrailingHighlightedIcon:`shrink-0 text-dimmed hidden group-data-highlighted:inline-flex`,itemTrailingKbds:`hidden lg:inline-flex items-center shrink-0`,itemTrailingKbdsSize:``,itemWrapper:`flex-1 flex flex-col text-start min-w-0`,itemLabel:`truncate space-x-1 text-dimmed`,itemLabelBase:`text-highlighted [&>mark]:text-primary [&>mark]:bg-primary/15`,itemLabelPrefix:`text-default`,itemLabelSuffix:`text-dimmed [&>mark]:text-primary [&>mark]:bg-primary/15`,itemDescription:`truncate text-muted [&>mark]:text-primary [&>mark]:bg-primary/15`},variants:{virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},size:{xs:{input:`[&>input]:h-10`,empty:`py-3 text-xs`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailing:`gap-1`,itemTrailingIcon:`size-4`,itemTrailingHighlightedIcon:`size-4`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`sm`},sm:{input:`[&>input]:h-11`,empty:`py-4 text-xs`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailing:`gap-1.5`,itemTrailingIcon:`size-4`,itemTrailingHighlightedIcon:`size-4`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`sm`},md:{input:`[&>input]:h-12`,empty:`py-6 text-sm`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailing:`gap-1.5`,itemTrailingIcon:`size-5`,itemTrailingHighlightedIcon:`size-5`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`md`},lg:{input:`[&>input]:h-13`,empty:`py-7 text-sm`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailing:`gap-2`,itemTrailingIcon:`size-5`,itemTrailingHighlightedIcon:`size-5`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`md`},xl:{input:`[&>input]:h-14`,empty:`py-8 text-base`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailing:`gap-2`,itemTrailingIcon:`size-6`,itemTrailingHighlightedIcon:`size-6`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`lg`}},active:{true:{item:`text-highlighted before:bg-elevated`,itemLeadingIcon:`text-default`},false:{item:[`text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`]}},loading:{true:{itemLeadingIcon:`animate-spin`}}},defaultVariants:{size:`md`}},Vt=[`innerHTML`],Ht=[`innerHTML`],Ut=[`innerHTML`],Wt=Object.assign({inheritAttrs:!1},{__name:`CommandPalette`,props:D({as:{type:null,required:!1},size:{type:null,required:!1},icon:{type:[String,Boolean],required:!1,skipCheck:!0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1,default:!0},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1,default:!0},backIcon:{type:null,required:!1},input:{type:[Boolean,Object],required:!1,default:!0},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},preserveGroupOrder:{type:Boolean,required:!1,default:!1},searchDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1},multiple:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},loop:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1},by:{type:[String,Function],required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:D([`update:modelValue`,`highlight`,`entryFocus`,`leave`,`update:open`],[`update:searchTerm`]),setup(c,{emit:u}){let S=c,ae=u,D=re(),O=_e(`commandPalette`,S),A=fe(c,`searchTerm`,{type:String,default:``}),{t:j}=t(),M=y(),N=te(ue(O,`as`,`disabled`,`multiple`,`modelValue`,`defaultValue`,`highlightOnHover`,`loop`,`by`),ae),P=ee(()=>O.virtualize?h(typeof O.virtualize==`boolean`?{}:O.virtualize,{estimateSize:ke(Fe.value,`md`,O.descriptionKey,!!D[`item-description`])}):!1),[F,je]=ve({props:{item:{type:Object,required:!0},group:{type:Object,required:!1},index:{type:Number,required:!1}}}),I=v(()=>se({extend:Bt,...M.ui?.commandPalette||{}})({size:O.size,virtualize:!!O.virtualize})),L=v(()=>h({},O.fuse,{fuseOptions:{ignoreLocation:!0,threshold:.1,keys:[O.labelKey,O.descriptionKey,`suffix`]},resultLimit:12,matchAllWhenSearchEmpty:!0})),R=g([]),z=v(()=>R.value[R.value.length-1]?.placeholder||O.placeholder||j(`commandPalette.placeholder`)),B=v(()=>R.value?.length?[R.value[R.value.length-1]]:O.groups),Me=v(()=>B.value?.filter(e=>e.id?!e.ignoreFilter:(console.warn("[@nuxt/ui] CommandPalette group is missing an `id` property"),!1))?.flatMap(e=>e.items?.map(t=>({...t,group:e.id}))||[])||[]),V=ie(A,()=>O.searchDelay),{results:Ne}=Ft(V,Me,L),Pe=oe(Ne,16,!0);function H(e,t){let n=t;return e?.postFilter&&typeof e.postFilter==`function`&&(n=e.postFilter(V.value,n)),{...e,items:n.slice(0,L.value.resultLimit).map(e=>({...e,labelHtml:e.labelHtml??zt(e,V.value,O.labelKey,void 0,L.value.fuseOptions?.useTokenSearch),suffixHtml:e.suffixHtml??zt(e,V.value,`suffix`,[O.labelKey],L.value.fuseOptions?.useTokenSearch),descriptionHtml:e.descriptionHtml??zt(e,V.value,O.descriptionKey,[O.labelKey,`suffix`],L.value.fuseOptions?.useTokenSearch)}))}}let U=v(()=>{let e=B.value,t=Pe.value.reduce((e,t)=>{let{item:n,matches:r}=t;return n.group&&(e[n.group]||=[],e[n.group]?.push({...n,matches:r})),e},{});if(O.preserveGroupOrder){let n=[];for(let r of e||[]){if(!r.items?.length)continue;let e=r.ignoreFilter?r.items:t[r.id];if(!e?.length)continue;let i=H(r,e);i.items?.length&&n.push(i)}return n}let n=[...Object.entries(t).map(([t,n])=>{let r=e?.find(e=>e.id===t);if(!r)return;let i=H(r,n);return i.items?.length?i:void 0}).filter(e=>!!e)];for(let t of e||[]){if(!t.ignoreFilter||!t.items?.length)continue;let r=H(t,t.items);if(!r.items?.length)continue;let i=e.indexOf(t),a=new Set;for(let t=0;t<i;t++)a.add(e[t].id);let o=-1;for(let e=0;e<n.length;e++)a.has(n[e].id)&&(o=e);n.splice(o+1,0,r)}return n}),Fe=v(()=>U.value.flatMap(e=>e.items||[])),W=le(`rootRef`);pe(U,()=>{r(()=>{let e=W.value;(e?.$el)?.contains(document.activeElement)?e?.highlightFirstItem():e?.highlightSelected(void 0,!1)})});function Ie(e){e.children?.length&&(R.value.push({id:`history-${R.value.length}`,label:e.label,slot:e.slot,placeholder:e.placeholder,items:e.children}),A.value=``,W.value?.highlightFirstItem())}function G(){R.value.length&&(R.value.pop(),A.value=``,W.value?.highlightFirstItem())}function K(){A.value||G()}function q(e,t){t.children?.length?(e.preventDefault(),Ie(t)):t.onSelect?.(e)}return(t,r)=>(k(),a(w,null,[d(e(F),null,{default:E(({item:r,index:c,group:u})=>[d(de,m(e(he)(r),{custom:``}),{default:E(({active:h,...g})=>[d(e(we),{value:e(O).valueKey?e(l)(r,e(O).valueKey):e(f)(r,[`matches`,`group`,`onSelect`,`labelHtml`,`suffixHtml`,`descriptionHtml`,`children`]),disabled:r.disabled,"as-child":``,onSelect:e=>q(e,r)},{default:E(()=>[d(me,m(g,{"data-slot":`item`,class:I.value.item({class:[e(O).ui?.item,r.ui?.item,r.class],active:h||r.active})}),{default:E(()=>[s(t.$slots,r.slot||u?.slot||`item`,{item:r,index:c,ui:I.value},()=>[s(t.$slots,r.slot?`${r.slot}-leading`:u?.slot?`${u.slot}-leading`:`item-leading`,{item:r,index:c,ui:I.value},()=>[r.loading?(k(),_(T,{key:0,name:e(O).loadingIcon||e(M).ui.icons.loading,"data-slot":`itemLeadingIcon`,class:p(I.value.itemLeadingIcon({class:[e(O).ui?.itemLeadingIcon,r.ui?.itemLeadingIcon],loading:!0}))},null,8,[`name`,`class`])):r.icon?(k(),_(T,{key:1,name:r.icon,"data-slot":`itemLeadingIcon`,class:p(I.value.itemLeadingIcon({class:[e(O).ui?.itemLeadingIcon,r.ui?.itemLeadingIcon],active:h||r.active}))},null,8,[`name`,`class`])):r.avatar?(k(),_(ce,m({key:2,size:r.ui?.itemLeadingAvatarSize||e(O).ui?.itemLeadingAvatarSize||I.value.itemLeadingAvatarSize()},r.avatar,{"data-slot":`itemLeadingAvatar`,class:I.value.itemLeadingAvatar({class:[e(O).ui?.itemLeadingAvatar,r.ui?.itemLeadingAvatar],active:h||r.active})}),null,16,[`size`,`class`])):r.chip?(k(),_(ne,m({key:3,size:r.ui?.itemLeadingChipSize||e(O).ui?.itemLeadingChipSize||I.value.itemLeadingChipSize(),inset:``,standalone:``},r.chip,{"data-slot":`itemLeadingChip`,class:I.value.itemLeadingChip({class:[e(O).ui?.itemLeadingChip,r.ui?.itemLeadingChip],active:h||r.active})}),null,16,[`size`,`class`])):b(``,!0)]),r.prefix||r.labelHtml||e(l)(r,e(O).labelKey)||r.suffixHtml||r.suffix||D[r.slot?`${r.slot}-label`:u?.slot?`${u.slot}-label`:`item-label`]||e(l)(r,e(O).descriptionKey)||D[r.slot?`${r.slot}-description`:u?.slot?`${u.slot}-description`:`item-description`]?(k(),a(`span`,{key:0,"data-slot":`itemWrapper`,class:p(I.value.itemWrapper({class:[e(O).ui?.itemWrapper,r.ui?.itemWrapper]}))},[o(`span`,{"data-slot":`itemLabel`,class:p(I.value.itemLabel({class:[e(O).ui?.itemLabel,r.ui?.itemLabel],active:h||r.active}))},[s(t.$slots,r.slot?`${r.slot}-label`:u?.slot?`${u.slot}-label`:`item-label`,{item:r,index:c,ui:I.value},()=>[r.prefix?(k(),a(`span`,{key:0,"data-slot":`itemLabelPrefix`,class:p(I.value.itemLabelPrefix({class:[e(O).ui?.itemLabelPrefix,r.ui?.itemLabelPrefix]}))},n(r.prefix),3)):b(``,!0),r.labelHtml?(k(),a(`span`,{key:1,"data-slot":`itemLabelBase`,class:p(I.value.itemLabelBase({class:[e(O).ui?.itemLabelBase,r.ui?.itemLabelBase],active:h||r.active})),innerHTML:r.labelHtml},null,10,Vt)):(k(),a(`span`,{key:2,"data-slot":`itemLabelBase`,class:p(I.value.itemLabelBase({class:[e(O).ui?.itemLabelBase,r.ui?.itemLabelBase],active:h||r.active}))},n(e(l)(r,e(O).labelKey)),3)),r.suffixHtml?(k(),a(`span`,{key:3,"data-slot":`itemLabelSuffix`,class:p(I.value.itemLabelSuffix({class:[e(O).ui?.itemLabelSuffix,r.ui?.itemLabelSuffix],active:h||r.active})),innerHTML:r.suffixHtml},null,10,Ht)):r.suffix?(k(),a(`span`,{key:4,"data-slot":`itemLabelSuffix`,class:p(I.value.itemLabelSuffix({class:[e(O).ui?.itemLabelSuffix,r.ui?.itemLabelSuffix],active:h||r.active}))},n(r.suffix),3)):b(``,!0)])],2),r.descriptionHtml?(k(),a(`span`,{key:0,"data-slot":`itemDescription`,class:p(I.value.itemDescription({class:[e(O).ui?.itemDescription,r.ui?.itemDescription]})),innerHTML:r.descriptionHtml},null,10,Ut)):e(l)(r,e(O).descriptionKey)||D[r.slot?`${r.slot}-description`:u?.slot?`${u.slot}-description`:`item-description`]?(k(),a(`span`,{key:1,"data-slot":`itemDescription`,class:p(I.value.itemDescription({class:[e(O).ui?.itemDescription,r.ui?.itemDescription]}))},[s(t.$slots,r.slot?`${r.slot}-description`:u?.slot?`${u.slot}-description`:`item-description`,{item:r,index:c,ui:I.value},()=>[C(n(e(l)(r,e(O).descriptionKey)),1)])],2)):b(``,!0)],2)):b(``,!0),o(`span`,{"data-slot":`itemTrailing`,class:p(I.value.itemTrailing({class:[e(O).ui?.itemTrailing,r.ui?.itemTrailing]}))},[s(t.$slots,r.slot?`${r.slot}-trailing`:u?.slot?`${u.slot}-trailing`:`item-trailing`,{item:r,index:c,ui:I.value},()=>[r.children&&r.children.length>0?(k(),_(T,{key:0,name:e(O).childrenIcon||e(M).ui.icons.chevronRight,"data-slot":`itemTrailingIcon`,class:p(I.value.itemTrailingIcon({class:[e(O).ui?.itemTrailingIcon,r.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])):r.kbds?.length?(k(),a(`span`,{key:1,"data-slot":`itemTrailingKbds`,class:p(I.value.itemTrailingKbds({class:[e(O).ui?.itemTrailingKbds,r.ui?.itemTrailingKbds]}))},[(k(!0),a(w,null,i(r.kbds,(t,n)=>(k(),_(be,m({key:n,size:r.ui?.itemTrailingKbdsSize||e(O).ui?.itemTrailingKbdsSize||I.value.itemTrailingKbdsSize()},{ref_for:!0},typeof t==`string`?{value:t}:t),null,16,[`size`]))),128))],2)):u?.highlightedIcon?(k(),_(T,{key:2,name:u.highlightedIcon,"data-slot":`itemTrailingHighlightedIcon`,class:p(I.value.itemTrailingHighlightedIcon({class:[e(O).ui?.itemTrailingHighlightedIcon,r.ui?.itemTrailingHighlightedIcon]}))},null,8,[`name`,`class`])):b(``,!0)]),r.children?.length?b(``,!0):(k(),_(e(De),{key:0,"as-child":``},{default:E(()=>[d(T,{name:e(O).selectedIcon||e(M).ui.icons.check,"data-slot":`itemTrailingIcon`,class:p(I.value.itemTrailingIcon({class:[e(O).ui?.itemTrailingIcon,r.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1040,[`class`])]),_:2},1032,[`value`,`disabled`,`onSelect`])]),_:2},1040)]),_:3}),d(e(Te),m({ref_key:`rootRef`,ref:W,"data-slot":`root`},{...e(N),...t.$attrs},{"selection-behavior":e(O).selectionBehavior,class:I.value.root({class:[e(O).ui?.root,e(O).class]})}),{default:E(()=>[e(O).input?(k(),_(e(Oe),{key:0,modelValue:A.value,"onUpdate:modelValue":r[1]||=e=>A.value=e,"as-child":``},{default:E(()=>[d(xe,m({variant:`none`,size:e(O).size,placeholder:z.value,autofocus:e(O).autofocus,loading:e(O).loading,"loading-icon":e(O).loadingIcon,"trailing-icon":e(O).trailingIcon,icon:e(O).icon===!1?void 0:e(O).icon??e(M).ui.icons.search},typeof e(O).input==`object`?e(O).input:{},{"data-slot":`input`,class:I.value.input({class:e(O).ui?.input}),onKeydown:ye(K,[`backspace`])}),x({_:2},[R.value?.length&&(e(O).back||D.back)?{name:`leading`,fn:E(()=>[s(t.$slots,`back`,{ui:I.value},()=>[d(ge,m({size:e(O).size,icon:e(O).backIcon||e(M).ui.icons.arrowLeft,color:`neutral`,variant:`link`,"aria-label":e(j)(`commandPalette.back`)},typeof e(O).back==`object`?e(O).back:{},{"data-slot":`back`,class:I.value.back({class:e(O).ui?.back}),onClick:G}),null,16,[`size`,`icon`,`aria-label`,`class`])])]),key:`0`}:void 0,e(O).close||D.close?{name:`trailing`,fn:E(()=>[s(t.$slots,`close`,{ui:I.value},()=>[e(O).close?(k(),_(ge,m({key:0,size:e(O).size,icon:e(O).closeIcon||e(M).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":e(j)(`commandPalette.close`)},typeof e(O).close==`object`?e(O).close:{},{"data-slot":`close`,class:I.value.close({class:e(O).ui?.close}),onClick:r[0]||=e=>ae(`update:open`,!1)}),null,16,[`size`,`icon`,`aria-label`,`class`])):b(``,!0)])]),key:`1`}:void 0]),1040,[`size`,`placeholder`,`autofocus`,`loading`,`loading-icon`,`trailing-icon`,`icon`,`class`])]),_:3},8,[`modelValue`])):b(``,!0),d(e(Ce),{"data-slot":`content`,"aria-label":e(j)(`commandPalette.results`),class:p(I.value.content({class:e(O).ui?.content}))},{default:E(()=>[U.value?.length?(k(),a(`div`,{key:0,role:`presentation`,"data-slot":`viewport`,class:p(I.value.viewport({class:e(O).ui?.viewport}))},[e(O).virtualize?(k(),_(e(Ee),m({key:0,options:Fe.value,"text-content":t=>e(l)(t,e(O).labelKey)},P.value),{default:E(({option:t,virtualItem:n})=>[d(e(je),{item:t,index:n.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`])):(k(!0),a(w,{key:1},i(U.value,r=>(k(),_(e(Se),{key:`group-${r.id}`,"data-slot":`group`,class:p(I.value.group({class:e(O).ui?.group}))},{default:E(()=>[e(l)(r,e(O).labelKey)||D[r.slot?`${r.slot}-group-label`:`group-label`]?(k(),_(e(Ae),{key:0,"data-slot":`label`,class:p(I.value.label({class:e(O).ui?.label}))},{default:E(()=>[s(t.$slots,r.slot?`${r.slot}-group-label`:`group-label`,{group:r,label:e(l)(r,e(O).labelKey),ui:I.value},()=>[C(n(e(l)(r,e(O).labelKey)),1)])]),_:2},1032,[`class`])):b(``,!0),(k(!0),a(w,null,i(r.items,(t,n)=>(k(),_(e(je),{key:`group-${r.id}-${n}`,item:t,index:n,group:r},null,8,[`item`,`index`,`group`]))),128))]),_:2},1032,[`class`]))),128))],2)):(k(),a(`div`,{key:1,"data-slot":`empty`,class:p(I.value.empty({class:e(O).ui?.empty}))},[s(t.$slots,`empty`,{searchTerm:A.value},()=>[C(n(A.value?e(j)(`commandPalette.noMatch`,{searchTerm:A.value}):e(j)(`commandPalette.noData`)),1)])],2))]),_:3},8,[`aria-label`,`class`]),D.footer?(k(),a(`div`,{key:1,"data-slot":`footer`,class:p(I.value.footer({class:e(O).ui?.footer}))},[s(t.$slots,`footer`,{ui:I.value})],2)):b(``,!0)]),_:3},16,[`selection-behavior`,`class`])],64))}});export{Wt as default};
1
+ import{$r as e,A as t,Ei as n,En as r,Gn as i,Gt as a,Ht as o,Kn as s,Kr as c,N as l,Qr as u,Qt as d,R as f,Si as p,Tn as m,U as h,Ur as g,Ut as _,Vt as v,W as y,Wt as b,Yr as ee,Yt as x,Zr as S,Zt as C,_ as te,a as ne,cr as re,dt as ie,en as ae,ft as oe,g as se,i as ce,jt as w,lr as le,lt as ue,n as de,o as T,or as fe,pr as pe,r as me,s as he,t as ge,v as _e,vr as E,wn as D,y as O,zn as k}from"./Button-CLo6xV_j.js";import{i as ve,z as ye}from"./Presence-CNRQpqMN.js";import{n as be,t as xe}from"./Input-ziwF3Rrc.js";import{a as Se,c as Ce,i as we,l as Te,n as Ee,o as A,r as De,s as Oe,t as ke}from"./virtualizer-j1ISV2Og.js";var Ae=ae({__name:`ListboxGroupLabel`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(t){let n=t,r=A({id:``});return(t,i)=>(k(),_(e(O),m(n,{id:e(r).id}),{default:E(()=>[s(t.$slots,`default`)]),_:3},16,[`id`]))}});function j(e){return Array.isArray?Array.isArray(e):B(e)===`[object Array]`}function M(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function N(e){return e==null?``:M(e)}function P(e){return typeof e==`string`}function F(e){return typeof e==`number`}function je(e){return e===!0||e===!1||L(e)&&B(e)==`[object Boolean]`}function I(e){return typeof e==`object`}function L(e){return I(e)&&e!==null}function R(e){return e!=null}function z(e){return!e.trim().length}function B(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Me=`Incorrect 'index' type`,V=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,Ne=e=>`Invalid value for key ${e}`,Pe=e=>`Pattern length exceeds max of ${e}.`,H=e=>`Missing ${e} property in key`,U=e=>`Property 'weight' in key '${e}' must be a positive integer`,Fe=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,W=Object.prototype.hasOwnProperty,Ie=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=G(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.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 G(e){let t=null,n=null,r=null,i=1,a=null;if(P(e)||j(e))r=e,t=K(e),n=q(e);else{if(!W.call(e,`name`))throw Error(H(`name`));let o=e.name;if(r=o,W.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(U(q(o)));t=K(o),n=q(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function K(e){return j(e)?e:e.split(`.`)}function q(e){return j(e)?e.join(`.`):e}function Le(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(R(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!R(s))return;if(a===t.length-1&&(P(s)||F(s)||je(s)||typeof s==`bigint`))n.push(o===void 0?N(s):{v:N(s),i:o});else if(j(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}}};return i(e,P(t)?t.split(`.`):t,0),r?n:n[0]}var Re={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ze={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Be={location:0,threshold:.6,distance:100},Ve={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:Le,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},J=Object.freeze({...ze,...Re,...Be,...Ve});function He(e){return e>=9&&e<=13||e===32||e===160}function Ue(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e<t.length;e++)He(t.charCodeAt(e))?a=!1:a||=(i++,!0);if(i===0&&(i=1),n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}var Y=class{constructor({getFn:e=J.getFn,fieldNormWeight:t=J.fieldNormWeight}={}){this.norm=Ue(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(P(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(V);if(P(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(V);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!R(e)||z(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(R(i)){if(j(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(R(n)){if(P(n)){if(!z(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(R(n.v)){let t=P(n.v)?n.v:N(n.v);if(!z(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(P(i)&&!z(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function We(e,t,{getFn:n=J.getFn,fieldNormWeight:r=J.fieldNormWeight}={}){let i=new Y({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(G)),i.setSources(t),i.create(),i}function Ge(e,{getFn:t=J.getFn,fieldNormWeight:n=J.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new Y({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function Ke(e=[],t=J.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function qe(e,t,n,{location:r=J.location,distance:i=J.distance,threshold:a=J.threshold,findAllMatches:o=J.findAllMatches,minMatchCharLength:s=J.minMatchCharLength,includeMatches:c=J.includeMatches,ignoreLocation:l=J.ignoreLocation}={}){if(t.length>32)throw Error(Pe(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,ee=0,x=u+d,S=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=x;for(;r<i;)h(t,f+i)<=p?r=i:x=i,i=Math.floor((x-r)/2+r);x=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&S&&(b=h(t,i),b<=p)){if(p=b,m=i,ee=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+ee);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let C={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=Ke(_,s);e.length?c&&(C.indices=e):C.isMatch=!1}return C}function Je(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function Ye(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}var Xe={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},Ze=RegExp(`[`+Object.keys(Xe).join(``)+`]`,`g`),X=typeof String.prototype.normalize==`function`?e=>e.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(Ze,e=>Xe[e]):e=>e,Qe=class{constructor(e,{location:t=J.location,threshold:n=J.threshold,distance:r=J.distance,includeMatches:i=J.includeMatches,findAllMatches:a=J.findAllMatches,minMatchCharLength:o=J.minMatchCharLength,isCaseSensitive:s=J.isCaseSensitive,ignoreDiacritics:c=J.ignoreDiacritics,ignoreLocation:l=J.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?X(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:Je(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?X(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=qe(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=Ye(u)),p}},$e=new Set([`fuzzy`,`include`]);function et(e){return e.startsWith(`inverse`)}var tt=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new Qe(e,{location:t.location??J.location,threshold:t.threshold??J.threshold,distance:t.distance??J.distance,includeMatches:t.includeMatches??J.includeMatches,findAllMatches:t.findAllMatches??J.findAllMatches,minMatchCharLength:t.minMatchCharLength??J.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??J.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??J.ignoreDiacritics,ignoreLocation:t.ignoreLocation??J.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],nt=tt.length,rt=`\0`,it=`|`;function at(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function ot(e,t){let n=e.match(t);return n?n[1]:null}function st(e,t={}){return e.replace(/\\\|/g,rt).split(it).map(e=>{let n=at(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<nt;){let e=tt[o],n=ot(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<nt;){let e=tt[o],n=ot(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var ct=class{constructor(e,{isCaseSensitive:t=J.isCaseSensitive,ignoreDiacritics:n=J.ignoreDiacritics,includeMatches:r=J.includeMatches,minMatchCharLength:i=J.minMatchCharLength,ignoreLocation:a=J.ignoreLocation,findAllMatches:o=J.findAllMatches,location:s=J.location,threshold:c=J.threshold,distance:l=J.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?X(e):e,this.pattern=e,this.query=st(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?X(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,et(r.type)&&(c=!0),n&&($e.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=Ye(o)),e}}return{isMatch:!1,score:1}}},lt=[];function ut(...e){lt.push(...e)}function Z(e,t){for(let n=0,r=lt.length;n<r;n+=1){let r=lt[n];if(r.condition(e,t))return new r(e,t)}return new Qe(e,t)}var Q={AND:`$and`,OR:`$or`},dt={PATH:`$path`,PATTERN:`$val`},ft=e=>!!(e[Q.AND]||e[Q.OR]),pt=e=>!!e[dt.PATH],mt=e=>!j(e)&&I(e)&&!ft(e),ht=e=>({[Q.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function gt(e,t,{auto:n=!0}={}){let r=e=>{if(P(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=Z(e,t)),r}let i=Object.keys(e),a=pt(e);if(!a&&i.length>1&&!ft(e))return r(ht(e));if(mt(e)){let r=a?e[dt.PATH]:i[0],o=a?e[dt.PATTERN]:e[r];if(!P(o))throw Error(Ne(r));let s={keyId:q(r),pattern:o};return n&&(s.searcher=Z(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];j(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return ft(e)||(e=ht(e)),r(e)}function _t(e,{ignoreFieldNorm:t=J.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function vt(e,{ignoreFieldNorm:t=J.ignoreFieldNorm}){e.forEach(e=>{e.score=_t(e.matches,{ignoreFieldNorm:t})})}var yt=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[r])>0&&(r=i),a<n&&this.comparator(t[a],t[r])>0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function bt(e){let t=[];return e.matches.forEach(e=>{if(!R(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function xt(e,t,{includeMatches:n=J.includeMatches,includeScore:r=J.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=bt(e)),r&&(a.score=e.score),a})}var St=/[\p{L}\p{M}\p{N}_]+/gu,Ct=new WeakSet;function wt(e){Ct.has(e)||(Ct.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Tt(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||wt(e),t=>t.match(e)||[]):e=>e.match(St)||[]}function Et({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=Tt(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=X(n)),r(n)}}}var Dt=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Et({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new Qe(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}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=Ye(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function Ot(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function kt(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0)Ot(e,a,i,r);else if(o)for(let t=0;t<n;t++){let n=o[t];if(n){if(Array.isArray(n))for(let t of n)Ot(e,t.v,i,r);else Ot(e,n.v,i,r)}}}function At(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)kt(r,i,t,n);return r}function jt(e,t,n,r){kt(e,t,n,r)}function Mt(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function Nt(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Mt(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var $=class{constructor(e,t,n){this.options={...J,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Ie(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=Z(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 Y))throw Error(Me);if(this._myIndex=t||We(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=Et({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=At(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!R(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=Et({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});jt(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Nt(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(V);this._invertedIndex&&Nt(this._invertedIndex,[e]);let 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}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(P(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return F(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&F(n)&&n>0&&P(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new yt(n,u);P(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=P(e)?P(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),vt(d,{ignoreFieldNorm:s}),a&&d.sort(P(e)?u:l),F(n)&&n>-1&&(d=d.slice(0,n));return xt(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!R(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=_t(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=gt(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e<n;e+=1){let n=a[e],c=r(n,t,i);if(c.length)s.push(...c);else if(o===Q.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(R(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!R(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=_t(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!R(t))return[];let r=[];if(j(t))t.forEach(({v:t,i,n:a})=>{if(!R(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}};$.version=`7.5.0`,$.createIndex=We,$.parseIndex=Ge,$.config=J,$.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(Fe);return Z(e,{...J,...n}).searchIn(t)},$.parseQuery=gt,ut(ct),ut(Dt),$.use=function(...e){e.forEach(e=>ut(e))};var Pt=$;function Ft(e,t,n){let r=()=>new Pt(S(t)??[],S(n)?.fuseOptions),i=c(r());return pe(()=>S(n)?.fuseOptions,()=>{i.value=r()},{deep:!0}),pe(()=>S(t),e=>{i.value.setCollection(e),u(i)},{deep:!0}),{fuse:i,results:v(()=>{let r=S(n);if(r?.matchAllWhenSearchEmpty&&!S(e))return S(t).map((e,t)=>({item:e,refIndex:t}));let a=r?.resultLimit;return i.value.search(S(e),a?{limit:a}:void 0)})}}var It={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`};function Lt(e){return e.replace(/[&<>"']/g,e=>It[e])}function Rt(e,t){let n=``,r=0,i=!1,a=Array.from(e);for(let e=a.length-1;e>=0;e--){let o=a[e];if(o===`>`)i=!0;else if(o===`<`){i=!1,n=o+n;continue}if(i||r++,r<=t)n=o+n;else{n=`...`+n;break}}return n}function zt(e,t,n,r,i){let a=i&&t.match(/[\p{L}\p{M}\p{N}_]+/gu)||[],o=a.length>0?Math.min(...a.map(e=>e.length)):t.length;function s(e,t=[]){e||=``;let n=``,r=0;t.forEach(t=>{if(t.length===2&&t[0]===t[1])return;let i=t[1]+1,a=i-t[0]>=o;n+=[Lt(e.substring(r,t[0])),a&&`<mark>`,Lt(e.substring(t[0],i)),a&&`</mark>`].filter(Boolean).join(``),r=i}),n+=Lt(e.substring(r));let i=n.indexOf(`<mark>`);return i!==-1&&(n=Rt(n,Array.from(n.slice(i)).length)),n}if(e.matches?.length){for(let t of e.matches)if(!(n&&t.key!==n)&&!r?.includes(t.key))return s(t.value,t.indices)}}var Bt={slots:{root:`flex flex-col min-h-0 min-w-0 divide-y divide-default`,input:``,close:``,back:`p-0`,content:`relative overflow-hidden flex flex-col`,footer:`p-1`,viewport:`relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none`,group:`p-1 isolate`,empty:`text-center text-muted`,label:`font-semibold text-highlighted`,item:`group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75`,itemLeadingIcon:`shrink-0`,itemLeadingAvatar:`shrink-0`,itemLeadingAvatarSize:``,itemLeadingChip:`shrink-0`,itemLeadingChipSize:``,itemTrailing:`ms-auto inline-flex items-center`,itemTrailingIcon:`shrink-0`,itemTrailingHighlightedIcon:`shrink-0 text-dimmed hidden group-data-highlighted:inline-flex`,itemTrailingKbds:`hidden lg:inline-flex items-center shrink-0`,itemTrailingKbdsSize:``,itemWrapper:`flex-1 flex flex-col text-start min-w-0`,itemLabel:`truncate space-x-1 text-dimmed`,itemLabelBase:`text-highlighted [&>mark]:text-primary [&>mark]:bg-primary/15`,itemLabelPrefix:`text-default`,itemLabelSuffix:`text-dimmed [&>mark]:text-primary [&>mark]:bg-primary/15`,itemDescription:`truncate text-muted [&>mark]:text-primary [&>mark]:bg-primary/15`},variants:{virtualize:{true:{viewport:`p-1 isolate`},false:{viewport:`divide-y divide-default`}},size:{xs:{input:`[&>input]:h-10`,empty:`py-3 text-xs`,label:`p-1 text-[10px]/3 gap-1`,item:`p-1 text-xs gap-1`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailing:`gap-1`,itemTrailingIcon:`size-4`,itemTrailingHighlightedIcon:`size-4`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`sm`},sm:{input:`[&>input]:h-11`,empty:`py-4 text-xs`,label:`p-1.5 text-[10px]/3 gap-1.5`,item:`p-1.5 text-xs gap-1.5`,itemLeadingIcon:`size-4`,itemLeadingAvatarSize:`3xs`,itemLeadingChip:`size-4`,itemLeadingChipSize:`sm`,itemTrailing:`gap-1.5`,itemTrailingIcon:`size-4`,itemTrailingHighlightedIcon:`size-4`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`sm`},md:{input:`[&>input]:h-12`,empty:`py-6 text-sm`,label:`p-1.5 text-xs gap-1.5`,item:`p-1.5 text-sm gap-1.5`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailing:`gap-1.5`,itemTrailingIcon:`size-5`,itemTrailingHighlightedIcon:`size-5`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`md`},lg:{input:`[&>input]:h-13`,empty:`py-7 text-sm`,label:`p-2 text-xs gap-2`,item:`p-2 text-sm gap-2`,itemLeadingIcon:`size-5`,itemLeadingAvatarSize:`2xs`,itemLeadingChip:`size-5`,itemLeadingChipSize:`md`,itemTrailing:`gap-2`,itemTrailingIcon:`size-5`,itemTrailingHighlightedIcon:`size-5`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`md`},xl:{input:`[&>input]:h-14`,empty:`py-8 text-base`,label:`p-2 text-sm gap-2`,item:`p-2 text-base gap-2`,itemLeadingIcon:`size-6`,itemLeadingAvatarSize:`xs`,itemLeadingChip:`size-6`,itemLeadingChipSize:`lg`,itemTrailing:`gap-2`,itemTrailingIcon:`size-6`,itemTrailingHighlightedIcon:`size-6`,itemTrailingKbds:`gap-0.5`,itemTrailingKbdsSize:`lg`}},active:{true:{item:`text-highlighted before:bg-elevated`,itemLeadingIcon:`text-default`},false:{item:[`text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50`,`transition-colors before:transition-colors`],itemLeadingIcon:[`text-dimmed group-data-highlighted:not-group-data-disabled:text-default`,`transition-colors`]}},loading:{true:{itemLeadingIcon:`animate-spin`}}},defaultVariants:{size:`md`}},Vt=[`innerHTML`],Ht=[`innerHTML`],Ut=[`innerHTML`],Wt=Object.assign({inheritAttrs:!1},{__name:`CommandPalette`,props:D({as:{type:null,required:!1},size:{type:null,required:!1},icon:{type:[String,Boolean],required:!1,skipCheck:!0},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},childrenIcon:{type:null,required:!1},placeholder:{type:String,required:!1},autofocus:{type:Boolean,required:!1,default:!0},close:{type:[Boolean,Object],required:!1},closeIcon:{type:null,required:!1},back:{type:[Boolean,Object],required:!1,default:!0},backIcon:{type:null,required:!1},input:{type:[Boolean,Object],required:!1,default:!0},groups:{type:Array,required:!1},fuse:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:`label`},descriptionKey:{type:null,required:!1,default:`description`},preserveGroupOrder:{type:Boolean,required:!1,default:!1},searchDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:Object,required:!1},multiple:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},loop:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1},by:{type:[String,Function],required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:``},searchTermModifiers:{}}),emits:D([`update:modelValue`,`highlight`,`entryFocus`,`leave`,`update:open`],[`update:searchTerm`]),setup(c,{emit:u}){let S=c,ae=u,D=re(),O=_e(`commandPalette`,S),A=fe(c,`searchTerm`,{type:String,default:``}),{t:j}=t(),M=y(),N=te(ue(O,`as`,`disabled`,`multiple`,`modelValue`,`defaultValue`,`highlightOnHover`,`loop`,`by`),ae),P=ee(()=>O.virtualize?h(typeof O.virtualize==`boolean`?{}:O.virtualize,{estimateSize:ke(Fe.value,`md`,O.descriptionKey,!!D[`item-description`])}):!1),[F,je]=ve({props:{item:{type:Object,required:!0},group:{type:Object,required:!1},index:{type:Number,required:!1}}}),I=v(()=>se({extend:Bt,...M.ui?.commandPalette||{}})({size:O.size,virtualize:!!O.virtualize})),L=v(()=>h({},O.fuse,{fuseOptions:{ignoreLocation:!0,threshold:.1,keys:[O.labelKey,O.descriptionKey,`suffix`]},resultLimit:12,matchAllWhenSearchEmpty:!0})),R=g([]),z=v(()=>R.value[R.value.length-1]?.placeholder||O.placeholder||j(`commandPalette.placeholder`)),B=v(()=>R.value?.length?[R.value[R.value.length-1]]:O.groups),Me=v(()=>B.value?.filter(e=>e.id?!e.ignoreFilter:(console.warn("[@nuxt/ui] CommandPalette group is missing an `id` property"),!1))?.flatMap(e=>e.items?.map(t=>({...t,group:e.id}))||[])||[]),V=ie(A,()=>O.searchDelay),{results:Ne}=Ft(V,Me,L),Pe=oe(Ne,16,!0);function H(e,t){let n=t;return e?.postFilter&&typeof e.postFilter==`function`&&(n=e.postFilter(V.value,n)),{...e,items:n.slice(0,L.value.resultLimit).map(e=>({...e,labelHtml:e.labelHtml??zt(e,V.value,O.labelKey,void 0,L.value.fuseOptions?.useTokenSearch),suffixHtml:e.suffixHtml??zt(e,V.value,`suffix`,[O.labelKey],L.value.fuseOptions?.useTokenSearch),descriptionHtml:e.descriptionHtml??zt(e,V.value,O.descriptionKey,[O.labelKey,`suffix`],L.value.fuseOptions?.useTokenSearch)}))}}let U=v(()=>{let e=B.value,t=Pe.value.reduce((e,t)=>{let{item:n,matches:r}=t;return n.group&&(e[n.group]||=[],e[n.group]?.push({...n,matches:r})),e},{});if(O.preserveGroupOrder){let n=[];for(let r of e||[]){if(!r.items?.length)continue;let e=r.ignoreFilter?r.items:t[r.id];if(!e?.length)continue;let i=H(r,e);i.items?.length&&n.push(i)}return n}let n=[...Object.entries(t).map(([t,n])=>{let r=e?.find(e=>e.id===t);if(!r)return;let i=H(r,n);return i.items?.length?i:void 0}).filter(e=>!!e)];for(let t of e||[]){if(!t.ignoreFilter||!t.items?.length)continue;let r=H(t,t.items);if(!r.items?.length)continue;let i=e.indexOf(t),a=new Set;for(let t=0;t<i;t++)a.add(e[t].id);let o=-1;for(let e=0;e<n.length;e++)a.has(n[e].id)&&(o=e);n.splice(o+1,0,r)}return n}),Fe=v(()=>U.value.flatMap(e=>e.items||[])),W=le(`rootRef`);pe(U,()=>{r(()=>{let e=W.value;(e?.$el)?.contains(document.activeElement)?e?.highlightFirstItem():e?.highlightSelected(void 0,!1)})});function Ie(e){e.children?.length&&(R.value.push({id:`history-${R.value.length}`,label:e.label,slot:e.slot,placeholder:e.placeholder,items:e.children}),A.value=``,W.value?.highlightFirstItem())}function G(){R.value.length&&(R.value.pop(),A.value=``,W.value?.highlightFirstItem())}function K(){A.value||G()}function q(e,t){t.children?.length?(e.preventDefault(),Ie(t)):t.onSelect?.(e)}return(t,r)=>(k(),a(w,null,[d(e(F),null,{default:E(({item:r,index:c,group:u})=>[d(de,m(e(he)(r),{custom:``}),{default:E(({active:h,...g})=>[d(e(we),{value:e(O).valueKey?e(l)(r,e(O).valueKey):e(f)(r,[`matches`,`group`,`onSelect`,`labelHtml`,`suffixHtml`,`descriptionHtml`,`children`]),disabled:r.disabled,"as-child":``,onSelect:e=>q(e,r)},{default:E(()=>[d(me,m(g,{"data-slot":`item`,class:I.value.item({class:[e(O).ui?.item,r.ui?.item,r.class],active:h||r.active})}),{default:E(()=>[s(t.$slots,r.slot||u?.slot||`item`,{item:r,index:c,ui:I.value},()=>[s(t.$slots,r.slot?`${r.slot}-leading`:u?.slot?`${u.slot}-leading`:`item-leading`,{item:r,index:c,ui:I.value},()=>[r.loading?(k(),_(T,{key:0,name:e(O).loadingIcon||e(M).ui.icons.loading,"data-slot":`itemLeadingIcon`,class:p(I.value.itemLeadingIcon({class:[e(O).ui?.itemLeadingIcon,r.ui?.itemLeadingIcon],loading:!0}))},null,8,[`name`,`class`])):r.icon?(k(),_(T,{key:1,name:r.icon,"data-slot":`itemLeadingIcon`,class:p(I.value.itemLeadingIcon({class:[e(O).ui?.itemLeadingIcon,r.ui?.itemLeadingIcon],active:h||r.active}))},null,8,[`name`,`class`])):r.avatar?(k(),_(ce,m({key:2,size:r.ui?.itemLeadingAvatarSize||e(O).ui?.itemLeadingAvatarSize||I.value.itemLeadingAvatarSize()},r.avatar,{"data-slot":`itemLeadingAvatar`,class:I.value.itemLeadingAvatar({class:[e(O).ui?.itemLeadingAvatar,r.ui?.itemLeadingAvatar],active:h||r.active})}),null,16,[`size`,`class`])):r.chip?(k(),_(ne,m({key:3,size:r.ui?.itemLeadingChipSize||e(O).ui?.itemLeadingChipSize||I.value.itemLeadingChipSize(),inset:``,standalone:``},r.chip,{"data-slot":`itemLeadingChip`,class:I.value.itemLeadingChip({class:[e(O).ui?.itemLeadingChip,r.ui?.itemLeadingChip],active:h||r.active})}),null,16,[`size`,`class`])):b(``,!0)]),r.prefix||r.labelHtml||e(l)(r,e(O).labelKey)||r.suffixHtml||r.suffix||D[r.slot?`${r.slot}-label`:u?.slot?`${u.slot}-label`:`item-label`]||e(l)(r,e(O).descriptionKey)||D[r.slot?`${r.slot}-description`:u?.slot?`${u.slot}-description`:`item-description`]?(k(),a(`span`,{key:0,"data-slot":`itemWrapper`,class:p(I.value.itemWrapper({class:[e(O).ui?.itemWrapper,r.ui?.itemWrapper]}))},[o(`span`,{"data-slot":`itemLabel`,class:p(I.value.itemLabel({class:[e(O).ui?.itemLabel,r.ui?.itemLabel],active:h||r.active}))},[s(t.$slots,r.slot?`${r.slot}-label`:u?.slot?`${u.slot}-label`:`item-label`,{item:r,index:c,ui:I.value},()=>[r.prefix?(k(),a(`span`,{key:0,"data-slot":`itemLabelPrefix`,class:p(I.value.itemLabelPrefix({class:[e(O).ui?.itemLabelPrefix,r.ui?.itemLabelPrefix]}))},n(r.prefix),3)):b(``,!0),r.labelHtml?(k(),a(`span`,{key:1,"data-slot":`itemLabelBase`,class:p(I.value.itemLabelBase({class:[e(O).ui?.itemLabelBase,r.ui?.itemLabelBase],active:h||r.active})),innerHTML:r.labelHtml},null,10,Vt)):(k(),a(`span`,{key:2,"data-slot":`itemLabelBase`,class:p(I.value.itemLabelBase({class:[e(O).ui?.itemLabelBase,r.ui?.itemLabelBase],active:h||r.active}))},n(e(l)(r,e(O).labelKey)),3)),r.suffixHtml?(k(),a(`span`,{key:3,"data-slot":`itemLabelSuffix`,class:p(I.value.itemLabelSuffix({class:[e(O).ui?.itemLabelSuffix,r.ui?.itemLabelSuffix],active:h||r.active})),innerHTML:r.suffixHtml},null,10,Ht)):r.suffix?(k(),a(`span`,{key:4,"data-slot":`itemLabelSuffix`,class:p(I.value.itemLabelSuffix({class:[e(O).ui?.itemLabelSuffix,r.ui?.itemLabelSuffix],active:h||r.active}))},n(r.suffix),3)):b(``,!0)])],2),r.descriptionHtml?(k(),a(`span`,{key:0,"data-slot":`itemDescription`,class:p(I.value.itemDescription({class:[e(O).ui?.itemDescription,r.ui?.itemDescription]})),innerHTML:r.descriptionHtml},null,10,Ut)):e(l)(r,e(O).descriptionKey)||D[r.slot?`${r.slot}-description`:u?.slot?`${u.slot}-description`:`item-description`]?(k(),a(`span`,{key:1,"data-slot":`itemDescription`,class:p(I.value.itemDescription({class:[e(O).ui?.itemDescription,r.ui?.itemDescription]}))},[s(t.$slots,r.slot?`${r.slot}-description`:u?.slot?`${u.slot}-description`:`item-description`,{item:r,index:c,ui:I.value},()=>[C(n(e(l)(r,e(O).descriptionKey)),1)])],2)):b(``,!0)],2)):b(``,!0),o(`span`,{"data-slot":`itemTrailing`,class:p(I.value.itemTrailing({class:[e(O).ui?.itemTrailing,r.ui?.itemTrailing]}))},[s(t.$slots,r.slot?`${r.slot}-trailing`:u?.slot?`${u.slot}-trailing`:`item-trailing`,{item:r,index:c,ui:I.value},()=>[r.children&&r.children.length>0?(k(),_(T,{key:0,name:e(O).childrenIcon||e(M).ui.icons.chevronRight,"data-slot":`itemTrailingIcon`,class:p(I.value.itemTrailingIcon({class:[e(O).ui?.itemTrailingIcon,r.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])):r.kbds?.length?(k(),a(`span`,{key:1,"data-slot":`itemTrailingKbds`,class:p(I.value.itemTrailingKbds({class:[e(O).ui?.itemTrailingKbds,r.ui?.itemTrailingKbds]}))},[(k(!0),a(w,null,i(r.kbds,(t,n)=>(k(),_(be,m({key:n,size:r.ui?.itemTrailingKbdsSize||e(O).ui?.itemTrailingKbdsSize||I.value.itemTrailingKbdsSize()},{ref_for:!0},typeof t==`string`?{value:t}:t),null,16,[`size`]))),128))],2)):u?.highlightedIcon?(k(),_(T,{key:2,name:u.highlightedIcon,"data-slot":`itemTrailingHighlightedIcon`,class:p(I.value.itemTrailingHighlightedIcon({class:[e(O).ui?.itemTrailingHighlightedIcon,r.ui?.itemTrailingHighlightedIcon]}))},null,8,[`name`,`class`])):b(``,!0)]),r.children?.length?b(``,!0):(k(),_(e(De),{key:0,"as-child":``},{default:E(()=>[d(T,{name:e(O).selectedIcon||e(M).ui.icons.check,"data-slot":`itemTrailingIcon`,class:p(I.value.itemTrailingIcon({class:[e(O).ui?.itemTrailingIcon,r.ui?.itemTrailingIcon]}))},null,8,[`name`,`class`])]),_:2},1024))],2)])]),_:2},1040,[`class`])]),_:2},1032,[`value`,`disabled`,`onSelect`])]),_:2},1040)]),_:3}),d(e(Te),m({ref_key:`rootRef`,ref:W,"data-slot":`root`},{...e(N),...t.$attrs},{"selection-behavior":e(O).selectionBehavior,class:I.value.root({class:[e(O).ui?.root,e(O).class]})}),{default:E(()=>[e(O).input?(k(),_(e(Oe),{key:0,modelValue:A.value,"onUpdate:modelValue":r[1]||=e=>A.value=e,"as-child":``},{default:E(()=>[d(xe,m({variant:`none`,size:e(O).size,placeholder:z.value,autofocus:e(O).autofocus,loading:e(O).loading,"loading-icon":e(O).loadingIcon,"trailing-icon":e(O).trailingIcon,icon:e(O).icon===!1?void 0:e(O).icon??e(M).ui.icons.search},typeof e(O).input==`object`?e(O).input:{},{"data-slot":`input`,class:I.value.input({class:e(O).ui?.input}),onKeydown:ye(K,[`backspace`])}),x({_:2},[R.value?.length&&(e(O).back||D.back)?{name:`leading`,fn:E(()=>[s(t.$slots,`back`,{ui:I.value},()=>[d(ge,m({size:e(O).size,icon:e(O).backIcon||e(M).ui.icons.arrowLeft,color:`neutral`,variant:`link`,"aria-label":e(j)(`commandPalette.back`)},typeof e(O).back==`object`?e(O).back:{},{"data-slot":`back`,class:I.value.back({class:e(O).ui?.back}),onClick:G}),null,16,[`size`,`icon`,`aria-label`,`class`])])]),key:`0`}:void 0,e(O).close||D.close?{name:`trailing`,fn:E(()=>[s(t.$slots,`close`,{ui:I.value},()=>[e(O).close?(k(),_(ge,m({key:0,size:e(O).size,icon:e(O).closeIcon||e(M).ui.icons.close,color:`neutral`,variant:`ghost`,"aria-label":e(j)(`commandPalette.close`)},typeof e(O).close==`object`?e(O).close:{},{"data-slot":`close`,class:I.value.close({class:e(O).ui?.close}),onClick:r[0]||=e=>ae(`update:open`,!1)}),null,16,[`size`,`icon`,`aria-label`,`class`])):b(``,!0)])]),key:`1`}:void 0]),1040,[`size`,`placeholder`,`autofocus`,`loading`,`loading-icon`,`trailing-icon`,`icon`,`class`])]),_:3},8,[`modelValue`])):b(``,!0),d(e(Ce),{"data-slot":`content`,"aria-label":e(j)(`commandPalette.results`),class:p(I.value.content({class:e(O).ui?.content}))},{default:E(()=>[U.value?.length?(k(),a(`div`,{key:0,role:`presentation`,"data-slot":`viewport`,class:p(I.value.viewport({class:e(O).ui?.viewport}))},[e(O).virtualize?(k(),_(e(Ee),m({key:0,options:Fe.value,"text-content":t=>e(l)(t,e(O).labelKey)},P.value),{default:E(({option:t,virtualItem:n})=>[d(e(je),{item:t,index:n.index},null,8,[`item`,`index`])]),_:1},16,[`options`,`text-content`])):(k(!0),a(w,{key:1},i(U.value,r=>(k(),_(e(Se),{key:`group-${r.id}`,"data-slot":`group`,class:p(I.value.group({class:e(O).ui?.group}))},{default:E(()=>[e(l)(r,e(O).labelKey)||D[r.slot?`${r.slot}-group-label`:`group-label`]?(k(),_(e(Ae),{key:0,"data-slot":`label`,class:p(I.value.label({class:e(O).ui?.label}))},{default:E(()=>[s(t.$slots,r.slot?`${r.slot}-group-label`:`group-label`,{group:r,label:e(l)(r,e(O).labelKey),ui:I.value},()=>[C(n(e(l)(r,e(O).labelKey)),1)])]),_:2},1032,[`class`])):b(``,!0),(k(!0),a(w,null,i(r.items,(t,n)=>(k(),_(e(je),{key:`group-${r.id}-${n}`,item:t,index:n,group:r},null,8,[`item`,`index`,`group`]))),128))]),_:2},1032,[`class`]))),128))],2)):(k(),a(`div`,{key:1,"data-slot":`empty`,class:p(I.value.empty({class:e(O).ui?.empty}))},[s(t.$slots,`empty`,{searchTerm:A.value},()=>[C(n(A.value?e(j)(`commandPalette.noMatch`,{searchTerm:A.value}):e(j)(`commandPalette.noData`)),1)])],2))]),_:3},8,[`aria-label`,`class`]),D.footer?(k(),a(`div`,{key:1,"data-slot":`footer`,class:p(I.value.footer({class:e(O).ui?.footer}))},[s(t.$slots,`footer`,{ui:I.value})],2)):b(``,!0)]),_:3},16,[`selection-behavior`,`class`])],64))}});export{Wt as default};
@@ -1,4 +1,4 @@
1
- import{$r as e,A as t,Ei as n,Fr as r,Gn as i,Gt as a,Ht as o,Kn as s,Kr as c,Qt as l,Si as u,Ti as d,Tn as f,U as p,Ur as m,Ut as h,Vt as g,W as _,Wt as v,X as y,Xr as b,Yr as x,Yt as S,Zt as C,_ as w,cr as ee,dn as T,en as E,g as te,i as D,jt as O,kn as ne,lr as re,lt as ie,mr as ae,o as oe,or as k,pr as se,t as A,un as ce,v as le,vr as j,w as M,wi as ue,wn as de,y as N,zn as P}from"./Button-CLo6xV_j.js";import{B as fe,g as pe,i as me,n as F,z as he}from"./Presence-CNRQpqMN.js";import{t as ge}from"./Input-ziwF3Rrc.js";import{t as _e}from"./esm-CUWdxPuC.js";import{t as ve}from"./Checkbox-CpedbrFs.js";import{d as ye}from"./session-DxiGrAK0.js";var be=E({__name:`PaginationEllipsis`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){let n=t;return F(),(t,r)=>(P(),h(e(N),f(n,{"data-type":`ellipsis`}),{default:j(()=>[s(t.$slots,`default`,{},()=>[r[0]||=C(`…`,-1)])]),_:3},16))}}),[I,xe]=M(`PaginationRoot`),Se=E({__name:`PaginationRoot`,props:{page:{type:Number,required:!1},defaultPage:{type:Number,required:!1,default:1},itemsPerPage:{type:Number,required:!0},total:{type:Number,required:!1,default:0},siblingCount:{type:Number,required:!1,default:2},disabled:{type:Boolean,required:!1},showEdges:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`nav`}},emits:[`update:page`],setup(t,{emit:n}){let r=t,i=n,{siblingCount:a,disabled:o,showEdges:c}=b(r);F();let l=pe(r,`page`,i,{defaultValue:r.defaultPage,passive:r.page===void 0}),u=g(()=>Math.max(1,Math.ceil(r.total/(r.itemsPerPage||1))));return xe({page:l,onPageChange(e){l.value=e},pageCount:u,siblingCount:a,disabled:o,showEdges:c}),(n,r)=>(P(),h(e(N),{as:t.as,"as-child":t.asChild},{default:j(()=>[s(n.$slots,`default`,{page:e(l),pageCount:u.value})]),_:3},8,[`as`,`as-child`]))}}),Ce=E({__name:`PaginationFirst`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=I();F();let i=g(()=>r.page.value===1||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`First Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(1)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`First page`,-1)])]),_:3},16,[`type`,`disabled`]))}}),we=E({__name:`PaginationLast`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=I();F();let i=g(()=>r.page.value===r.pageCount.value||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`Last Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(e(r).pageCount.value)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`Last page`,-1)])]),_:3},16,[`type`,`disabled`]))}});function L(e,t){let n=t-e+1;return Array.from({length:n},(t,n)=>n+e)}function Te(e){return e.map(e=>typeof e==`number`?{type:`page`,value:e}:{type:`ellipsis`})}var R=`ellipsis`;function Ee(e,t,n,r){let i=t,a=Math.max(e-n,1),o=Math.min(e+n,i);if(r){let e=Math.min(2*n+5,t)-2,r=a>3&&Math.abs(i-e-1+1)>2&&Math.abs(a-1)>2,s=o<i-2&&Math.abs(i-e)>2&&Math.abs(i-o)>2;return!r&&s?[...L(1,e),R,i]:r&&!s?[1,R,...L(i-e+1,i)]:r&&s?[1,R,...L(a,o),R,i]:L(1,i)}{let r=n*2+1;return t<r?L(1,i):e<=n+1?L(1,r):t-e<=n?L(t-r+1,i):L(a,o)}}var De=E({__name:`PaginationList`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){let n=t;F();let r=I(),i=g(()=>Te(Ee(r.page.value,r.pageCount.value,r.siblingCount.value,r.showEdges.value)));return(t,r)=>(P(),h(e(N),ue(ce(n)),{default:j(()=>[s(t.$slots,`default`,{items:i.value})]),_:3},16))}}),Oe=E({__name:`PaginationListItem`,props:{value:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let r=t;F();let i=I(),a=g(()=>i.page.value===r.value),o=g(()=>i.disabled.value);return(c,l)=>(P(),h(e(N),f(r,{"data-type":`page`,"aria-label":`Page ${t.value}`,"aria-current":a.value?`page`:void 0,"data-selected":a.value?`true`:void 0,disabled:o.value,type:t.as===`button`?`button`:void 0,onClick:l[0]||=n=>!o.value&&e(i).onPageChange(t.value)}),{default:j(()=>[s(c.$slots,`default`,{},()=>[C(n(t.value),1)])]),_:3},16,[`aria-label`,`aria-current`,`data-selected`,`disabled`,`type`]))}}),ke=E({__name:`PaginationNext`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t;F();let r=I(),i=g(()=>r.page.value===r.pageCount.value||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`Next Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(e(r).page.value+1)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`Next page`,-1)])]),_:3},16,[`type`,`disabled`]))}}),Ae=E({__name:`PaginationPrev`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t;F();let r=I(),i=g(()=>r.page.value===1||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`Previous Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(e(r).page.value-1)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`Prev page`,-1)])]),_:3},16,[`type`,`disabled`]))}}),z=E({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){let n=t,r=[`horizontal`,`vertical`];function i(e){return r.includes(e)}let a=g(()=>i(n.orientation)?n.orientation:`horizontal`),o=g(()=>a.value===`vertical`?n.orientation:void 0),c=g(()=>n.decorative?{role:`none`}:{"aria-orientation":o.value,role:`separator`});return(n,r)=>(P(),h(e(N),f({as:t.as,"as-child":t.asChild,"data-orientation":a.value},c.value),{default:j(()=>[s(n.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),je=E({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(P(),h(z,ue(ce(t)),{default:j(()=>[s(e.$slots,`default`)]),_:3},16))}}),Me={slots:{root:``,list:`flex items-center gap-1`,ellipsis:`pointer-events-none`,label:`min-w-5 text-center`,first:``,prev:``,item:``,next:``,last:``}},Ne={__name:`Pagination`,props:{as:{type:null,required:!1},firstIcon:{type:null,required:!1},prevIcon:{type:null,required:!1},nextIcon:{type:null,required:!1},lastIcon:{type:null,required:!1},ellipsisIcon:{type:null,required:!1},color:{type:null,required:!1,default:`neutral`},variant:{type:null,required:!1,default:`outline`},activeColor:{type:null,required:!1,default:`primary`},activeVariant:{type:null,required:!1,default:`solid`},showControls:{type:Boolean,required:!1,default:!0},size:{type:null,required:!1},to:{type:Function,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultPage:{type:Number,required:!1},disabled:{type:Boolean,required:!1},itemsPerPage:{type:Number,required:!1,default:10},page:{type:Number,required:!1},showEdges:{type:Boolean,required:!1,default:!1},siblingCount:{type:Number,required:!1,default:2},total:{type:Number,required:!1,default:0}},emits:[`update:page`],setup(n,{emit:r}){let o=n,c=r,d=ee(),p=le(`pagination`,o),{dir:m,t:y}=t(),b=_(),x=w(ie(p,`as`,`defaultPage`,`disabled`,`itemsPerPage`,`page`,`showEdges`,`siblingCount`,`total`),c),S=g(()=>p.firstIcon||(m.value===`rtl`?b.ui.icons.chevronDoubleRight:b.ui.icons.chevronDoubleLeft)),C=g(()=>p.prevIcon||(m.value===`rtl`?b.ui.icons.chevronRight:b.ui.icons.chevronLeft)),T=g(()=>p.nextIcon||(m.value===`rtl`?b.ui.icons.chevronLeft:b.ui.icons.chevronRight)),E=g(()=>p.lastIcon||(m.value===`rtl`?b.ui.icons.chevronDoubleLeft:b.ui.icons.chevronDoubleRight)),D=g(()=>te({extend:Me,...b.ui?.pagination||{}})());return(t,n)=>(P(),h(e(Se),f(e(x),{"data-slot":`root`,class:D.value.root({class:[e(p).ui?.root,e(p).class]})}),{default:j(({page:n,pageCount:r})=>[l(e(De),{"data-slot":`list`,class:u(D.value.list({class:e(p).ui?.list}))},{default:j(({items:o})=>[e(p).showControls||d.first?(P(),h(e(Ce),{key:0,"as-child":``,"aria-label":e(y)(`pagination.first`),"data-slot":`first`,class:u(D.value.first({class:e(p).ui?.first}))},{default:j(()=>[s(t.$slots,`first`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:S.value,to:e(p).to?.(1)},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:3},8,[`aria-label`,`class`])):v(``,!0),e(p).showControls||d.prev?(P(),h(e(Ae),{key:1,"as-child":``,"aria-label":e(y)(`pagination.prev`),"data-slot":`prev`,class:u(D.value.prev({class:e(p).ui?.prev}))},{default:j(()=>[s(t.$slots,`prev`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:C.value,to:n>1?e(p).to?.(n-1):void 0},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:2},1032,[`aria-label`,`class`])):v(``,!0),(P(!0),a(O,null,i(o,(i,o)=>(P(),a(O,{key:o},[i.type===`page`?(P(),h(e(Oe),{key:0,"as-child":``,value:i.value,"aria-label":e(y)(`pagination.page`,{page:i.value}),"data-slot":`item`,class:u(D.value.item({class:e(p).ui?.item}))},{default:j(()=>[s(t.$slots,`item`,f({ref_for:!0},{item:i,index:o,page:n,pageCount:r}),()=>[l(A,{color:n===i.value?e(p).activeColor:e(p).color,variant:n===i.value?e(p).activeVariant:e(p).variant,size:e(p).size,label:String(i.value),ui:{label:D.value.label()},to:e(p).to?.(i.value),square:``},null,8,[`color`,`variant`,`size`,`label`,`ui`,`to`])])]),_:2},1032,[`value`,`aria-label`,`class`])):(P(),h(e(be),{key:1,"as-child":``,"data-slot":`ellipsis`,class:u(D.value.ellipsis({class:e(p).ui?.ellipsis}))},{default:j(()=>[s(t.$slots,`ellipsis`,{ui:D.value},()=>[l(A,{as:`div`,color:e(p).color,variant:e(p).variant,size:e(p).size,icon:e(p).ellipsisIcon||e(b).ui.icons.ellipsis},null,8,[`color`,`variant`,`size`,`icon`])])]),_:3},8,[`class`]))],64))),128)),e(p).showControls||d.next?(P(),h(e(ke),{key:2,"as-child":``,"aria-label":e(y)(`pagination.next`),"data-slot":`next`,class:u(D.value.next({class:e(p).ui?.next}))},{default:j(()=>[s(t.$slots,`next`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:T.value,to:n<r?e(p).to?.(n+1):void 0},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:2},1032,[`aria-label`,`class`])):v(``,!0),e(p).showControls||d.last?(P(),h(e(we),{key:3,"as-child":``,"aria-label":e(y)(`pagination.last`),"data-slot":`last`,class:u(D.value.last({class:e(p).ui?.last}))},{default:j(()=>[s(t.$slots,`last`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:E.value,to:e(p).to?.(r)},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:2},1032,[`aria-label`,`class`])):v(``,!0)]),_:2},1032,[`class`])]),_:3},16,[`class`]))}};function Pe(e){return e?e[0].toUpperCase()+e.slice(1):``}function B(e,t){return typeof e==`function`?e(t):e}function V(e,t){return n=>{t.setState(t=>({...t,[e]:B(n,t[e])}))}}function Fe(e){return e instanceof Function}function Ie(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function Le(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function H(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
1
+ import{$r as e,A as t,Ei as n,Fr as r,Gn as i,Gt as a,Ht as o,Kn as s,Kr as c,Qt as l,Si as u,Ti as d,Tn as f,U as p,Ur as m,Ut as h,Vt as g,W as _,Wt as v,X as y,Xr as b,Yr as x,Yt as S,Zt as C,_ as w,cr as ee,dn as T,en as E,g as te,i as D,jt as O,kn as ne,lr as re,lt as ie,mr as ae,o as oe,or as k,pr as se,t as A,un as ce,v as le,vr as j,w as M,wi as ue,wn as de,y as N,zn as P}from"./Button-CLo6xV_j.js";import{B as fe,g as pe,i as me,n as F,z as he}from"./Presence-CNRQpqMN.js";import{t as ge}from"./Input-ziwF3Rrc.js";import{t as _e}from"./esm-CUWdxPuC.js";import{t as ve}from"./Checkbox-DUg9FPdC.js";import{d as ye}from"./session-CVs7LrtN.js";var be=E({__name:`PaginationEllipsis`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){let n=t;return F(),(t,r)=>(P(),h(e(N),f(n,{"data-type":`ellipsis`}),{default:j(()=>[s(t.$slots,`default`,{},()=>[r[0]||=C(`…`,-1)])]),_:3},16))}}),[I,xe]=M(`PaginationRoot`),Se=E({__name:`PaginationRoot`,props:{page:{type:Number,required:!1},defaultPage:{type:Number,required:!1,default:1},itemsPerPage:{type:Number,required:!0},total:{type:Number,required:!1,default:0},siblingCount:{type:Number,required:!1,default:2},disabled:{type:Boolean,required:!1},showEdges:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`nav`}},emits:[`update:page`],setup(t,{emit:n}){let r=t,i=n,{siblingCount:a,disabled:o,showEdges:c}=b(r);F();let l=pe(r,`page`,i,{defaultValue:r.defaultPage,passive:r.page===void 0}),u=g(()=>Math.max(1,Math.ceil(r.total/(r.itemsPerPage||1))));return xe({page:l,onPageChange(e){l.value=e},pageCount:u,siblingCount:a,disabled:o,showEdges:c}),(n,r)=>(P(),h(e(N),{as:t.as,"as-child":t.asChild},{default:j(()=>[s(n.$slots,`default`,{page:e(l),pageCount:u.value})]),_:3},8,[`as`,`as-child`]))}}),Ce=E({__name:`PaginationFirst`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=I();F();let i=g(()=>r.page.value===1||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`First Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(1)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`First page`,-1)])]),_:3},16,[`type`,`disabled`]))}}),we=E({__name:`PaginationLast`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=I();F();let i=g(()=>r.page.value===r.pageCount.value||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`Last Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(e(r).pageCount.value)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`Last page`,-1)])]),_:3},16,[`type`,`disabled`]))}});function L(e,t){let n=t-e+1;return Array.from({length:n},(t,n)=>n+e)}function Te(e){return e.map(e=>typeof e==`number`?{type:`page`,value:e}:{type:`ellipsis`})}var R=`ellipsis`;function Ee(e,t,n,r){let i=t,a=Math.max(e-n,1),o=Math.min(e+n,i);if(r){let e=Math.min(2*n+5,t)-2,r=a>3&&Math.abs(i-e-1+1)>2&&Math.abs(a-1)>2,s=o<i-2&&Math.abs(i-e)>2&&Math.abs(i-o)>2;return!r&&s?[...L(1,e),R,i]:r&&!s?[1,R,...L(i-e+1,i)]:r&&s?[1,R,...L(a,o),R,i]:L(1,i)}{let r=n*2+1;return t<r?L(1,i):e<=n+1?L(1,r):t-e<=n?L(t-r+1,i):L(a,o)}}var De=E({__name:`PaginationList`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){let n=t;F();let r=I(),i=g(()=>Te(Ee(r.page.value,r.pageCount.value,r.siblingCount.value,r.showEdges.value)));return(t,r)=>(P(),h(e(N),ue(ce(n)),{default:j(()=>[s(t.$slots,`default`,{items:i.value})]),_:3},16))}}),Oe=E({__name:`PaginationListItem`,props:{value:{type:Number,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let r=t;F();let i=I(),a=g(()=>i.page.value===r.value),o=g(()=>i.disabled.value);return(c,l)=>(P(),h(e(N),f(r,{"data-type":`page`,"aria-label":`Page ${t.value}`,"aria-current":a.value?`page`:void 0,"data-selected":a.value?`true`:void 0,disabled:o.value,type:t.as===`button`?`button`:void 0,onClick:l[0]||=n=>!o.value&&e(i).onPageChange(t.value)}),{default:j(()=>[s(c.$slots,`default`,{},()=>[C(n(t.value),1)])]),_:3},16,[`aria-label`,`aria-current`,`data-selected`,`disabled`,`type`]))}}),ke=E({__name:`PaginationNext`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t;F();let r=I(),i=g(()=>r.page.value===r.pageCount.value||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`Next Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(e(r).page.value+1)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`Next page`,-1)])]),_:3},16,[`type`,`disabled`]))}}),Ae=E({__name:`PaginationPrev`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t;F();let r=I(),i=g(()=>r.page.value===1||r.disabled.value);return(a,o)=>(P(),h(e(N),f(n,{"aria-label":`Previous Page`,type:t.as===`button`?`button`:void 0,disabled:i.value,onClick:o[0]||=t=>!i.value&&e(r).onPageChange(e(r).page.value-1)}),{default:j(()=>[s(a.$slots,`default`,{},()=>[o[1]||=C(`Prev page`,-1)])]),_:3},16,[`type`,`disabled`]))}}),z=E({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(t){let n=t,r=[`horizontal`,`vertical`];function i(e){return r.includes(e)}let a=g(()=>i(n.orientation)?n.orientation:`horizontal`),o=g(()=>a.value===`vertical`?n.orientation:void 0),c=g(()=>n.decorative?{role:`none`}:{"aria-orientation":o.value,role:`separator`});return(n,r)=>(P(),h(e(N),f({as:t.as,"as-child":t.asChild,"data-orientation":a.value},c.value),{default:j(()=>[s(n.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),je=E({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(P(),h(z,ue(ce(t)),{default:j(()=>[s(e.$slots,`default`)]),_:3},16))}}),Me={slots:{root:``,list:`flex items-center gap-1`,ellipsis:`pointer-events-none`,label:`min-w-5 text-center`,first:``,prev:``,item:``,next:``,last:``}},Ne={__name:`Pagination`,props:{as:{type:null,required:!1},firstIcon:{type:null,required:!1},prevIcon:{type:null,required:!1},nextIcon:{type:null,required:!1},lastIcon:{type:null,required:!1},ellipsisIcon:{type:null,required:!1},color:{type:null,required:!1,default:`neutral`},variant:{type:null,required:!1,default:`outline`},activeColor:{type:null,required:!1,default:`primary`},activeVariant:{type:null,required:!1,default:`solid`},showControls:{type:Boolean,required:!1,default:!0},size:{type:null,required:!1},to:{type:Function,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultPage:{type:Number,required:!1},disabled:{type:Boolean,required:!1},itemsPerPage:{type:Number,required:!1,default:10},page:{type:Number,required:!1},showEdges:{type:Boolean,required:!1,default:!1},siblingCount:{type:Number,required:!1,default:2},total:{type:Number,required:!1,default:0}},emits:[`update:page`],setup(n,{emit:r}){let o=n,c=r,d=ee(),p=le(`pagination`,o),{dir:m,t:y}=t(),b=_(),x=w(ie(p,`as`,`defaultPage`,`disabled`,`itemsPerPage`,`page`,`showEdges`,`siblingCount`,`total`),c),S=g(()=>p.firstIcon||(m.value===`rtl`?b.ui.icons.chevronDoubleRight:b.ui.icons.chevronDoubleLeft)),C=g(()=>p.prevIcon||(m.value===`rtl`?b.ui.icons.chevronRight:b.ui.icons.chevronLeft)),T=g(()=>p.nextIcon||(m.value===`rtl`?b.ui.icons.chevronLeft:b.ui.icons.chevronRight)),E=g(()=>p.lastIcon||(m.value===`rtl`?b.ui.icons.chevronDoubleLeft:b.ui.icons.chevronDoubleRight)),D=g(()=>te({extend:Me,...b.ui?.pagination||{}})());return(t,n)=>(P(),h(e(Se),f(e(x),{"data-slot":`root`,class:D.value.root({class:[e(p).ui?.root,e(p).class]})}),{default:j(({page:n,pageCount:r})=>[l(e(De),{"data-slot":`list`,class:u(D.value.list({class:e(p).ui?.list}))},{default:j(({items:o})=>[e(p).showControls||d.first?(P(),h(e(Ce),{key:0,"as-child":``,"aria-label":e(y)(`pagination.first`),"data-slot":`first`,class:u(D.value.first({class:e(p).ui?.first}))},{default:j(()=>[s(t.$slots,`first`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:S.value,to:e(p).to?.(1)},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:3},8,[`aria-label`,`class`])):v(``,!0),e(p).showControls||d.prev?(P(),h(e(Ae),{key:1,"as-child":``,"aria-label":e(y)(`pagination.prev`),"data-slot":`prev`,class:u(D.value.prev({class:e(p).ui?.prev}))},{default:j(()=>[s(t.$slots,`prev`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:C.value,to:n>1?e(p).to?.(n-1):void 0},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:2},1032,[`aria-label`,`class`])):v(``,!0),(P(!0),a(O,null,i(o,(i,o)=>(P(),a(O,{key:o},[i.type===`page`?(P(),h(e(Oe),{key:0,"as-child":``,value:i.value,"aria-label":e(y)(`pagination.page`,{page:i.value}),"data-slot":`item`,class:u(D.value.item({class:e(p).ui?.item}))},{default:j(()=>[s(t.$slots,`item`,f({ref_for:!0},{item:i,index:o,page:n,pageCount:r}),()=>[l(A,{color:n===i.value?e(p).activeColor:e(p).color,variant:n===i.value?e(p).activeVariant:e(p).variant,size:e(p).size,label:String(i.value),ui:{label:D.value.label()},to:e(p).to?.(i.value),square:``},null,8,[`color`,`variant`,`size`,`label`,`ui`,`to`])])]),_:2},1032,[`value`,`aria-label`,`class`])):(P(),h(e(be),{key:1,"as-child":``,"data-slot":`ellipsis`,class:u(D.value.ellipsis({class:e(p).ui?.ellipsis}))},{default:j(()=>[s(t.$slots,`ellipsis`,{ui:D.value},()=>[l(A,{as:`div`,color:e(p).color,variant:e(p).variant,size:e(p).size,icon:e(p).ellipsisIcon||e(b).ui.icons.ellipsis},null,8,[`color`,`variant`,`size`,`icon`])])]),_:3},8,[`class`]))],64))),128)),e(p).showControls||d.next?(P(),h(e(ke),{key:2,"as-child":``,"aria-label":e(y)(`pagination.next`),"data-slot":`next`,class:u(D.value.next({class:e(p).ui?.next}))},{default:j(()=>[s(t.$slots,`next`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:T.value,to:n<r?e(p).to?.(n+1):void 0},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:2},1032,[`aria-label`,`class`])):v(``,!0),e(p).showControls||d.last?(P(),h(e(we),{key:3,"as-child":``,"aria-label":e(y)(`pagination.last`),"data-slot":`last`,class:u(D.value.last({class:e(p).ui?.last}))},{default:j(()=>[s(t.$slots,`last`,{},()=>[l(A,{color:e(p).color,variant:e(p).variant,size:e(p).size,icon:E.value,to:e(p).to?.(r)},null,8,[`color`,`variant`,`size`,`icon`,`to`])])]),_:2},1032,[`aria-label`,`class`])):v(``,!0)]),_:2},1032,[`class`])]),_:3},16,[`class`]))}};function Pe(e){return e?e[0].toUpperCase()+e.slice(1):``}function B(e,t){return typeof e==`function`?e(t):e}function V(e,t){return n=>{t.setState(t=>({...t,[e]:B(n,t[e])}))}}function Fe(e){return e instanceof Function}function Ie(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function Le(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function H(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function U(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function W(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:H(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),U(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function Re(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:H(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],U(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:H(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},U(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var G=`debugHeaders`;function ze(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var K={createTable:e=>{e.getHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return q(t,[...a,...s,...o],e)},U(e.options,G,`getHeaderGroups`)),e.getCenterHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),q(t,n,e,`center`)),U(e.options,G,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>q(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),U(e.options,G,`getLeftHeaderGroups`)),e.getRightHeaderGroups=H(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>q(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),U(e.options,G,`getRightHeaderGroups`)),e.getFooterGroups=H(()=>[e.getHeaderGroups()],e=>[...e].reverse(),U(e.options,G,`getFooterGroups`)),e.getLeftFooterGroups=H(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),U(e.options,G,`getLeftFooterGroups`)),e.getCenterFooterGroups=H(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),U(e.options,G,`getCenterFooterGroups`)),e.getRightFooterGroups=H(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),U(e.options,G,`getRightFooterGroups`)),e.getFlatHeaders=H(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),U(e.options,G,`getFlatHeaders`)),e.getLeftFlatHeaders=H(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),U(e.options,G,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=H(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),U(e.options,G,`getCenterFlatHeaders`)),e.getRightFlatHeaders=H(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),U(e.options,G,`getRightFlatHeaders`)),e.getCenterLeafHeaders=H(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),U(e.options,G,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=H(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),U(e.options,G,`getLeftLeafHeaders`)),e.getRightLeafHeaders=H(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),U(e.options,G,`getRightLeafHeaders`)),e.getLeafHeaders=H(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),U(e.options,G,`getLeafHeaders`))}};function q(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=ze(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>ze(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var Be=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>Le(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:H(()=>[e.getAllLeafColumns()],t=>t.map(t=>W(e,s,t,t.id)),U(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:H(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),U(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},Ve={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},He=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!((i=e.getValue(t))!=null&&(i=i.toString())!=null&&(i=i.toLowerCase())!=null&&i.includes(a))};He.autoRemove=e=>Q(e);var Ue=(e,t,n)=>{var r;return!!((r=e.getValue(t))!=null&&(r=r.toString())!=null&&r.includes(n))};Ue.autoRemove=e=>Q(e);var J=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};J.autoRemove=e=>Q(e);var We=(e,t,n)=>e.getValue(t)?.includes(n);We.autoRemove=e=>Q(e);var Ge=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});Ge.autoRemove=e=>Q(e)||!(e!=null&&e.length);var Ke=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));Ke.autoRemove=e=>Q(e)||!(e!=null&&e.length);var Y=(e,t,n)=>e.getValue(t)===n;Y.autoRemove=e=>Q(e);var qe=(e,t,n)=>e.getValue(t)==n;qe.autoRemove=e=>Q(e);var X=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};X.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},X.autoRemove=e=>Q(e)||Q(e[0])&&Q(e[1]);var Z={includesString:He,includesStringSensitive:Ue,equalsString:J,arrIncludes:We,arrIncludesAll:Ge,arrIncludesSome:Ke,equals:Y,weakEquals:qe,inNumberRange:X};function Q(e){return e==null||e===``}var Je={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:V(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?Z.includesString:typeof n==`number`?Z.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?Z.equals:Array.isArray(n)?Z.arrIncludes:Z.weakEquals},e.getFilterFn=()=>Fe(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??Z[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=B(n,i?i.value:void 0);if(Ye(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>B(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&Ye(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Ye(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var Xe={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!Ie(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},Ze={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:V(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return Xe.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return Xe.extent},e.getAggregationFn=()=>{if(!e)throw Error();return Fe(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??Xe[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function Qe(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var $e={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:V(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=H(e=>[ut(t,e)],t=>t.findIndex(t=>t.id===e.id),U(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>ut(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=ut(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=H(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return Qe(i,t,n)},U(e.options,`debugTable`,`_getOrderColumnsFn`))}},et=()=>({left:[],right:[]}),tt={getInitialState:e=>({columnPinning:et(),...e}),getDefaultOptions:e=>({onColumnPinningChange:V(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=H(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},U(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=H(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),U(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=H(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),U(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?et():e.initialState?.columnPinning??et()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=H(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),U(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=H(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),U(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=H(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},U(e.options,`debugColumns`,`getCenterLeafColumns`))}};function nt(e){return e||(typeof document<`u`?document:null)}var rt={size:150,minSize:20,maxSize:2**53-1},it=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),at={getDefaultColumnDef:()=>rt,getInitialState:e=>({columnSizing:{},columnSizingInfo:it(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:V(`columnSizing`,e),onColumnSizingInfoChange:V(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??rt.minSize,n??e.columnDef.size??rt.size),e.columnDef.maxSize??rt.maxSize)},e.getStart=H(e=>[e,ut(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),U(t.options,`debugColumns`,`getStart`)),e.getAfter=H(e=>[e,ut(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),U(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),ct(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=ct(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=nt(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=st()?{passive:!1}:!1;ct(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?it():e.initialState.columnSizingInfo??it())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},ot=null;function st(){if(typeof ot==`boolean`)return ot;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return ot=e,ot}function ct(e){return e.type===`touchstart`}var lt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:V(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=H(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),U(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=H(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],U(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>H(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),U(e.options,`debugColumns`,t));e.getVisibleFlatColumns=t(`getVisibleFlatColumns`,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(`getVisibleLeafColumns`,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(`getLeftVisibleLeafColumns`,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(`getRightVisibleLeafColumns`,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(`getCenterVisibleLeafColumns`,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function ut(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var dt={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},ft={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:V(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r==`string`||typeof r==`number`}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>Z.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return Fe(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??Z[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},pt={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:V(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t)e._queue(()=>{t=!0});else if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{let i=r===!0||!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.length))},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},mt=0,ht=10,gt=()=>({pageIndex:mt,pageSize:ht}),_t={getInitialState:e=>({...e,pagination:{...gt(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:V(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t)e._queue(()=>{t=!0});else if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>B(t,e)),e.resetPagination=t=>{e.setPagination(t?gt():e.initialState.pagination??gt())},e.setPageIndex=t=>{e.setPagination(n=>{let r=B(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?mt:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??mt)},e.resetPageSize=t=>{var n;e.setPageSize(t?ht:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??ht)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,B(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=B(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=H(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},U(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1||n!==0&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},vt=()=>({top:[],bottom:[]}),yt={getInitialState:e=>({rowPinning:vt(),...e}),getDefaultOptions:e=>({onRowPinningChange:V(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?vt():e.initialState?.rowPinning??vt()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=H(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),U(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=H(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),U(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=H(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},U(e.options,`debugRows`,`getCenterRows`))}},bt={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:V(`rowSelection`,e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{xt(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=H(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?St(e,n):{rows:[],flatRows:[],rowsById:{}},U(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=H(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?St(e,n):{rows:[],flatRows:[],rowsById:{}},U(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=H(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?St(e,n):{rows:[],flatRows:[],rowsById:{}},U(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return xt(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return Ct(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return wt(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return wt(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},xt=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>xt(e,t.id,n,r,i))};function St(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=Ct(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function Ct(e,t){return t[e.id]??!1}function wt(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if((!a||i)&&(e.getCanSelect()&&(Ct(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=wt(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var Tt=/([0-9]+)/gm,Et=(e,t,n)=>Nt($(e.getValue(n)).toLowerCase(),$(t.getValue(n)).toLowerCase()),Dt=(e,t,n)=>Nt($(e.getValue(n)),$(t.getValue(n))),Ot=(e,t,n)=>Mt($(e.getValue(n)).toLowerCase(),$(t.getValue(n)).toLowerCase()),kt=(e,t,n)=>Mt($(e.getValue(n)),$(t.getValue(n))),At=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},jt=(e,t,n)=>Mt(e.getValue(n),t.getValue(n));function Mt(e,t){return e===t?0:e>t?1:-1}function $(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function Nt(e,t){let n=e.split(Tt).filter(Boolean),r=t.split(Tt).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}}return n.length-r.length}var Pt={alphanumeric:Et,alphanumericCaseSensitive:Dt,text:Ot,textCaseSensitive:kt,datetime:At,basic:jt},Ft=[K,lt,$e,tt,Ve,Je,dt,ft,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:V(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return Pt.datetime;if(typeof n==`string`&&(r=!0,n.split(Tt).length>1))return Pt.alphanumeric}return r?Pt.text:Pt.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return Fe(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??Pt[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{e.setSorting(t?[]:e.initialState?.sorting??[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Ze,pt,_t,yt,bt,at];function It(e){let t=[...Ft,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{let t=B(e,n.options);n.options=i(t)},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:H(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),U(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:H(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=Re(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},U(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:H(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),U(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:H(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),U(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:H(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),U(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function Lt(){return e=>H(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=Be(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},U(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function Rt(){return e=>H(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(e,t,n)=>!t.rows.length||e!==!0&&!Object.keys(e??{}).length||!n?t:zt(t),U(e.options,`debugTable`,`getExpandedRowModel`))}function zt(e){let t=[],n=e=>{var r;t.push(e),(r=e.subRows)!=null&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Bt(e,t,n){return n.options.filterFromLeafRows?Vt(e,t,n):Ht(e,t,n)}function Vt(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){var l;let d=e[u],f=Be(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(f.columnFilters=d.columnFilters,(l=d.subRows)!=null&&l.length&&s<a){if(f.subRows=o(d.subRows,s+1),d=f,t(d)&&!f.subRows.length||t(d)||f.subRows.length){c.push(d),i[d.id]=d,r.push(d);continue}}else d=f,t(d)&&(c.push(d),i[d.id]=d,r.push(d))}return c};return{rows:o(e),flatRows:r,rowsById:i}}function Ht(e,t,n){let r=[],i={},a=n.options.maxLeafRowFilterDepth??100,o=function(e,s){s===void 0&&(s=0);let c=[];for(let u=0;u<e.length;u++){let d=e[u];if(t(d)){var l;if((l=d.subRows)!=null&&l.length&&s<a){let e=Be(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=o(d.subRows,s+1),d=e}c.push(d),r.push(d),i[d.id]=d}}return c};return{rows:o(e),flatRows:r,rowsById:i}}function Ut(){return e=>H(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}let i=[],a=[];(n??[]).forEach(t=>{let n=e.getColumn(t.id);if(!n)return;let r=n.getFilterFn();r&&i.push({id:t.id,filterFn:r,resolvedValue:(r.resolveFilterValue==null?void 0:r.resolveFilterValue(t.value))??t.value})});let o=(n??[]).map(e=>e.id),s=e.getGlobalFilterFn(),c=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());r&&s&&c.length&&(o.push(`__global__`),c.forEach(e=>{a.push({id:e.id,filterFn:s,resolvedValue:(s.resolveFilterValue==null?void 0:s.resolveFilterValue(r))??r})}));let l,u;for(let e=0;e<t.flatRows.length;e++){let n=t.flatRows[e];if(n.columnFilters={},i.length)for(let e=0;e<i.length;e++){l=i[e];let t=l.id;n.columnFilters[t]=l.filterFn(n,t,l.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(a.length){for(let e=0;e<a.length;e++){u=a[e];let t=u.id;if(u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}n.columnFilters.__global__!==!0&&(n.columnFilters.__global__=!1)}}return Bt(t.rows,e=>{for(let t=0;t<o.length;t++)if(e.columnFilters[o[t]]===!1)return!1;return!0},e)},U(e.options,`debugTable`,`getFilteredRowModel`,()=>e._autoResetPageIndex()))}function Wt(e){return e=>H(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;let{pageSize:r,pageIndex:i}=t,{rows:a,flatRows:o,rowsById:s}=n,c=r*i,l=c+r;a=a.slice(c,l);let u;u=e.options.paginateExpandedRows?{rows:a,flatRows:o,rowsById:s}:zt({rows:a,flatRows:o,rowsById:s}),u.flatRows=[];let d=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return u.rows.forEach(d),u},U(e.options,`debugTable`,`getPaginationRowModel`))}function Gt(){return e=>H(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let r=e.getState().sorting,i=[],a=r.filter(t=>e.getColumn(t.id)?.getCanSort()),o={};a.forEach(t=>{let n=e.getColumn(t.id);n&&(o[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let r=a[n],i=o[r.id],s=i.sortUndefined,c=r?.desc??!1,l=0;if(s){let n=e.getValue(r.id),i=t.getValue(r.id),a=n===void 0,o=i===void 0;if(a||o){if(s===`first`)return a?-1:1;if(s===`last`)return a?1:-1;l=a&&o?0:a?s:-s}}if(l===0&&(l=i.sortingFn(e,t,r.id)),l!==0)return c&&(l*=-1),i.invertSorting&&(l*=-1),l}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),(t=e.subRows)!=null&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},U(e.options,`debugTable`,`getSortedRowModel`,()=>e._autoResetPageIndex()))}function Kt(){return!0}var qt=Symbol(`merge-proxy`),Jt={get(e,t,n){return t===qt?n:e.get(t)},has(e,t){return e.has(t)},set:Kt,deleteProperty:Kt,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Kt,deleteProperty:Kt}},ownKeys(e){return e.keys()}};function Yt(e){return`value`in e?e.value:e}function Xt(){var e=[...arguments];return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=Yt(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in Yt(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(Yt(e[n])));return[...Array.from(new Set(t))]}},Jt)}var Zt=E({props:[`render`,`props`],setup:e=>()=>typeof e.render==`function`||typeof e.render==`object`?T(e.render,e.props):e.render});function Qt(t){return Xt(t,{data:e(t.data)})}function $t(e){let t=r(e.data),n=It(Xt({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions(e,n){return t?{...e,...n}:Xt(e,n)}},t?Qt(e):e));if(t){let t=c(e.data);se(t,()=>{n.setState(e=>({...e,data:t.value}))},{immediate:!0})}let i=m(n.initialState);return ae(()=>{n.setOptions(n=>{let r=new Proxy({},{get:(e,t)=>i.value[t]});return Xt(n,t?Qt(e):e,{state:Xt(r,e.state??{}),onStateChange:t=>{t instanceof Function?i.value=t(i.value):i.value=t,e.onStateChange==null||e.onStateChange(t)}})})}),n}var en={slots:{root:`relative overflow-auto outline-primary/25 focus-visible:outline-3`,base:`min-w-full overflow-clip`,caption:`sr-only`,thead:`relative`,tbody:`isolate [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:outline-primary/25 [&>tr]:data-[selectable=true]:focus-visible:outline-3 [&>tr]:data-[selectable=true]:-outline-offset-3 divide-y divide-default`,tfoot:`relative [&>[data-slot=separator]]:z-2`,tr:`data-[selected=true]:bg-elevated/50`,th:`px-4 py-3.5 text-sm text-highlighted text-start font-semibold [&:has([role=checkbox])]:pe-0`,td:`p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0`,separator:`absolute z-1 start-0 w-full h-px bg-(--ui-border-accented)`,empty:`py-6 text-center text-sm text-muted`,loading:`py-6 text-center`},variants:{pinned:{true:{th:`sticky bg-default/75 z-1`,td:`sticky bg-default/75 z-1`}},sticky:{true:{thead:`sticky top-0 inset-x-0 bg-default/75 backdrop-blur-sm z-1`,tfoot:`sticky bottom-0 inset-x-0 bg-default/75 backdrop-blur-sm z-1`},header:{thead:`sticky top-0 inset-x-0 bg-default/75 backdrop-blur-sm z-1`},footer:{tfoot:`sticky bottom-0 inset-x-0 bg-default/75 backdrop-blur-sm z-1`}},loading:{true:{thead:`after:absolute after:z-1 after:h-px motion-reduce:after:inset-x-0 motion-reduce:after:animate-pulse`}},externalScroll:{true:{root:`overflow-visible`}},loadingAnimation:{carousel:``,"carousel-inverse":``,swing:``,elastic:``},loadingColor:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``}},compoundVariants:[{loading:!0,loadingColor:`primary`,class:{thead:`after:bg-primary`}},{loading:!0,loadingColor:`secondary`,class:{thead:`after:bg-secondary`}},{loading:!0,loadingColor:`success`,class:{thead:`after:bg-success`}},{loading:!0,loadingColor:`info`,class:{thead:`after:bg-info`}},{loading:!0,loadingColor:`warning`,class:{thead:`after:bg-warning`}},{loading:!0,loadingColor:`error`,class:{thead:`after:bg-error`}},{loading:!0,loadingColor:`neutral`,class:{thead:`after:bg-inverted`}},{loading:!0,loadingAnimation:`carousel`,class:{thead:`motion-safe:after:animate-[carousel_2s_linear_infinite] motion-safe:rtl:after:animate-[carousel-rtl_2s_linear_infinite]`}},{loading:!0,loadingAnimation:`carousel-inverse`,class:{thead:`motion-safe:after:animate-[carousel-inverse_2s_linear_infinite] motion-safe:rtl:after:animate-[carousel-inverse-rtl_2s_linear_infinite]`}},{loading:!0,loadingAnimation:`swing`,class:{thead:`motion-safe:after:animate-[swing_2s_var(--ease-in-out)_infinite]`}},{loading:!0,loadingAnimation:`elastic`,class:{thead:`motion-safe:after:animate-[elastic_2s_var(--ease-in-out)_infinite]`}}],defaultVariants:{loadingColor:`primary`,loadingAnimation:`carousel`}},tn=[`data-selected`,`data-selectable`,`data-expanded`,`data-pinned`,`tabindex`,`onClick`,`onKeydown`,`onPointerenter`,`onContextmenu`],nn=[`data-pinned`,`colspan`,`rowspan`],rn=[`colspan`],an=[`data-pinned`,`scope`,`colspan`,`rowspan`,`aria-sort`],on=[`colspan`],sn=[`colspan`],cn={key:1},ln=[`colspan`],un={key:2},dn=[`colspan`],fn=[`data-pinned`,`colspan`,`rowspan`],pn=Object.assign({inheritAttrs:!1},{__name:`Table`,props:de({as:{type:null,required:!1},data:{type:Array,required:!1},columns:{type:Array,required:!1},caption:{type:String,required:!1},meta:{type:Object,required:!1},virtualize:{type:[Boolean,Object],required:!1,default:!1},empty:{type:String,required:!1},sticky:{type:[Boolean,String],required:!1},loading:{type:Boolean,required:!1},loadingColor:{type:null,required:!1},loadingAnimation:{type:null,required:!1},watchOptions:{type:Object,required:!1,default:()=>({deep:!0})},globalFilterOptions:{type:Object,required:!1},columnFiltersOptions:{type:Object,required:!1},columnPinningOptions:{type:Object,required:!1},columnSizingOptions:{type:Object,required:!1},visibilityOptions:{type:Object,required:!1},sortingOptions:{type:Object,required:!1},groupingOptions:{type:Object,required:!1},expandedOptions:{type:Object,required:!1},rowSelectionOptions:{type:Object,required:!1},rowPinningOptions:{type:Object,required:!1},paginationOptions:{type:Object,required:!1},facetedOptions:{type:Object,required:!1},onSelect:{type:Function,required:!1},onHover:{type:Function,required:!1},onContextmenu:{type:[Function,Array],required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},state:{type:Object,required:!1},onStateChange:{type:Function,required:!1},renderFallbackValue:{type:null,required:!1},_features:{type:Array,required:!1},autoResetAll:{type:Boolean,required:!1},debugAll:{type:Boolean,required:!1},debugCells:{type:Boolean,required:!1},debugColumns:{type:Boolean,required:!1},debugHeaders:{type:Boolean,required:!1},debugRows:{type:Boolean,required:!1},debugTable:{type:Boolean,required:!1},defaultColumn:{type:Object,required:!1},getRowId:{type:Function,required:!1},getSubRows:{type:Function,required:!1},initialState:{type:Object,required:!1},mergeOptions:{type:Function,required:!1}},{globalFilter:{type:String},globalFilterModifiers:{},columnFilters:{type:Array},columnFiltersModifiers:{},columnOrder:{type:Array},columnOrderModifiers:{},columnVisibility:{type:Object},columnVisibilityModifiers:{},columnPinning:{type:Object},columnPinningModifiers:{},columnSizing:{type:Object},columnSizingModifiers:{},columnSizingInfo:{type:Object},columnSizingInfoModifiers:{},rowSelection:{type:Object},rowSelectionModifiers:{},rowPinning:{type:Object},rowPinningModifiers:{},sorting:{type:Array},sortingModifiers:{},grouping:{type:Array},groupingModifiers:{},expanded:{type:[Boolean,Object]},expandedModifiers:{},pagination:{type:Object},paginationModifiers:{}}),emits:[`update:globalFilter`,`update:columnFilters`,`update:columnOrder`,`update:columnVisibility`,`update:columnPinning`,`update:columnSizing`,`update:columnSizingInfo`,`update:rowSelection`,`update:rowPinning`,`update:sorting`,`update:grouping`,`update:expanded`,`update:pagination`],setup(r,{expose:c}){let m=r,b=ee(),S=le(`table`,m),{t:T}=t(),E=_(),D=y(S.data??[],S.watchOptions?.deep!==!1),ae=g(()=>S.meta??{}),oe=g(()=>A(S.columns??Object.keys(D.value[0]??{}).map(e=>({accessorKey:e,...S.defaultColumn?.header===void 0&&{header:Pe(e)}}))));function A(e){return e.map(e=>{let t={...e};return`columns`in t&&t.columns&&(t.columns=A(t.columns)),!t.cell&&!S.defaultColumn?.cell&&(t.cell=({getValue:e})=>{let t=e();return t===``||t==null?`\xA0`:String(t)}),t})}let ce=g(()=>typeof S.virtualize==`object`&&!!S.virtualize.getScrollElement),M=g(()=>te({extend:en,...E.ui?.table||{}})({sticky:S.sticky,loading:S.loading,loadingColor:S.loadingColor,loadingAnimation:S.loadingAnimation,externalScroll:ce.value})),[de,pe]=me(),[F,ge]=me({props:{row:{type:Object,required:!0},index:{type:Number,required:!1}}}),ve=g(()=>{function e(t){for(let n of t)if(`footer`in n||`columns`in n&&e(n.columns))return!0;return!1}return e(oe.value)}),ye=k(r,`globalFilter`),be=k(r,`columnFilters`),I=k(r,`columnOrder`),xe=k(r,`columnVisibility`),Se=k(r,`columnPinning`),Ce=k(r,`columnSizing`),we=k(r,`columnSizingInfo`),L=k(r,`rowSelection`),Te=k(r,`rowPinning`),R=k(r,`sorting`),Ee=k(r,`grouping`),De=k(r,`expanded`),Oe=k(r,`pagination`),ke=re(`rootRef`),Ae=re(`tableRef`),z=$t({...w(ie(S,`_features`,`autoResetAll`,`debugAll`,`debugCells`,`debugColumns`,`debugHeaders`,`debugRows`,`debugTable`,`defaultColumn`,`getRowId`,`getSubRows`,`initialState`,`mergeOptions`,`renderFallbackValue`)).value,get data(){return D.value},get columns(){return oe.value},meta:ae.value,getCoreRowModel:Lt(),...S.globalFilterOptions||{},...ye.value!==void 0&&{onGlobalFilterChange:e=>J(e,ye)},...S.columnFiltersOptions||{},getFilteredRowModel:Ut(),...be.value!==void 0&&{onColumnFiltersChange:e=>J(e,be)},...I.value!==void 0&&{onColumnOrderChange:e=>J(e,I)},...S.visibilityOptions||{},...xe.value!==void 0&&{onColumnVisibilityChange:e=>J(e,xe)},...S.columnPinningOptions||{},...Se.value!==void 0&&{onColumnPinningChange:e=>J(e,Se)},...S.columnSizingOptions||{},...Ce.value!==void 0&&{onColumnSizingChange:e=>J(e,Ce)},...we.value!==void 0&&{onColumnSizingInfoChange:e=>J(e,we)},...S.rowSelectionOptions||{},...L.value!==void 0&&{onRowSelectionChange:e=>J(e,L)},...S.rowPinningOptions||{},...Te.value!==void 0&&{onRowPinningChange:e=>J(e,Te)},...S.sortingOptions||{},getSortedRowModel:Gt(),...R.value!==void 0&&{onSortingChange:e=>J(e,R)},...S.groupingOptions||{},...Ee.value!==void 0&&{onGroupingChange:e=>J(e,Ee)},...S.expandedOptions||{},getExpandedRowModel:Rt(),...De.value!==void 0&&{onExpandedChange:e=>J(e,De)},...S.paginationOptions||{},...Oe.value!==void 0&&{onPaginationChange:e=>J(e,Oe)},...S.facetedOptions||{},state:{get globalFilter(){return ye.value},get columnFilters(){return be.value},get columnOrder(){return I.value},get columnVisibility(){return xe.value},get columnPinning(){return Se.value},get expanded(){return De.value},get rowSelection(){return L.value},get sorting(){return R.value},get grouping(){return Ee.value},get rowPinning(){return Te.value},get columnSizing(){return Ce.value},get columnSizingInfo(){return we.value},get pagination(){return Oe.value}}}),je=g(()=>z.getRowModel().rows),Me=g(()=>S.virtualize?[]:z.getTopRows()),Ne=g(()=>S.virtualize?[]:z.getBottomRows()),B=g(()=>Me.value.length||Ne.value.length?z.getCenterRows():je.value),V=x(()=>p(typeof S.virtualize==`boolean`?{}:S.virtualize,{estimateSize:65,overscan:12})),Fe=g(()=>V.value.indexAttribute??`data-index`),Ie=()=>(ce.value?V.value.getScrollElement?.():ke.value?.$el)??null,Le=g(()=>V.value.scrollMargin??0),H=g(()=>{let e=B.value,t=V.value.getItemKey;return t?e=>t(e):t=>e[t]?.id??t}),U=!!S.virtualize&&_e({...V.value,get count(){return B.value.length},get scrollMargin(){return Le.value},get getItemKey(){return H.value},measureElement:Be,getScrollElement:Ie,estimateSize:e=>{let t=V.value.estimateSize;return typeof t==`function`?t(e):t}}),W=g(()=>U?U.value.getVirtualItems():[]),Re=g(()=>(W.value[0]?.start??0)-Le.value),G=g(()=>!U||!W.value.length?0:U.value.getTotalSize()-(W.value[W.value.length-1]?.end??0)+Le.value);function ze(e){e instanceof Element&&U&&U.value.measureElement(e)}let K=new WeakMap,q;function Be(e,t,n){let r=V.value.measureElement,i=r?r(e,t,n):t?.borderBoxSize?.[0]?.blockSize??e.offsetHeight,a=e.nextElementSibling;return Math.round(i+(a&&K.get(a)===e?a.offsetHeight:0))}function Ve(e){if(!e?.isConnected||!U)return;let t=U.value;t.resizeItem(t.indexFromElement(e),t.options.measureElement(e,void 0,t))}function He({el:e}){U&&e instanceof Element&&e.previousElementSibling&&(K.set(e,e.previousElementSibling),Ve(e.previousElementSibling),typeof ResizeObserver<`u`&&(q??=new ResizeObserver(e=>e.forEach(e=>Ve(K.get(e.target)))),q.observe(e)))}function Ue({el:e}){if(!(e instanceof Element))return;let t=K.get(e);K.delete(e),q?.unobserve(e),Ve(t)}ne(()=>q?.disconnect());function J(e,t){t.value=typeof e==`function`?e(t.value):e}function We(e,t){S.onSelect&&(e.target.closest(`a, button, input, label, select, textarea`)||(e.preventDefault(),e.stopPropagation(),!e.repeat&&S.onSelect(e,t)))}function Ge(e,t){S.onHover&&S.onHover(e,t)}function Ke(e,t){S.onContextmenu&&(Array.isArray(S.onContextmenu)?S.onContextmenu.forEach(n=>n(e,t)):S.onContextmenu(e,t))}function Y(e,t){return typeof e==`function`?e(t):e}function qe(e){let t={},n=e.getIsPinned();return n===`left`?t.left=`${e.getStart(`left`)}px`:n===`right`&&(t.right=`${e.getAfter(`right`)}px`),t}function X(e){return e.columnDef.enableSorting===!0&&e.getCanSort()}function Z(e){if(e.isPlaceholder||!X(e.column))return;let t=e.column.getIsSorted();if(!t)return`none`;let n=new Set(z.getVisibleLeafColumns().filter(X).map(e=>e.id));return z.getState().sorting.find(({id:e})=>n.has(e))?.id===e.column.id?t===`asc`?`ascending`:`descending`:`none`}return se(()=>S.data,()=>{D.value=S.data?[...S.data]:[]},S.watchOptions),c({get $el(){return ke.value?.$el},tableRef:Ae,tableApi:z}),(t,r)=>(P(),a(O,null,[l(e(F),null,{default:j(({row:n,index:c})=>[o(`tr`,ue({ref:e(U)?ze:void 0,[Fe.value||``]:c,"data-selected":n.getIsSelected(),"data-selectable":!!e(S).onSelect||!!e(S).onHover||!!e(S).onContextmenu,"data-expanded":n.getIsExpanded(),"data-pinned":n.getIsPinned()||void 0,tabindex:e(S).onSelect?0:void 0,"data-slot":`tr`,class:M.value.tr({class:[e(S).ui?.tr,Y(e(z).options.meta?.class?.tr,n)]}),style:Y(e(z).options.meta?.style?.tr,n),onClick:e=>We(e,n),onKeydown:he(fe(e=>We(e,n),[`self`,`exact`]),[`enter`,`space`]),onPointerenter:e=>Ge(e,n),onPointerleave:r[0]||=e=>Ge(e,null),onContextmenu:e=>Ke(e,n)}),[(P(!0),a(O,null,i(n.getVisibleCells(),n=>(P(),a(`td`,{key:n.id,"data-pinned":n.column.getIsPinned(),colspan:Y(n.column.columnDef.meta?.colspan?.td,n),rowspan:Y(n.column.columnDef.meta?.rowspan?.td,n),"data-slot":`td`,class:u(M.value.td({class:[e(S).ui?.td,Y(n.column.columnDef.meta?.class?.td,n)],pinned:!!n.column.getIsPinned()})),style:d([qe(n.column),Y(n.column.columnDef.meta?.style?.td,n)])},[s(t.$slots,`${n.column.id}-cell`,f({ref_for:!0},n.getContext()),()=>[l(e(Zt),{render:n.column.columnDef.cell,props:n.getContext()},null,8,[`render`,`props`])])],14,nn))),128))],16,tn),n.getIsExpanded()?(P(),a(`tr`,{key:0,"data-slot":`tr`,class:u(M.value.tr({class:[e(S).ui?.tr]})),onVnodeMounted:He,onVnodeUnmounted:Ue},[o(`td`,{colspan:n.getVisibleCells().length,"data-slot":`td`,class:u(M.value.td({class:[e(S).ui?.td]}))},[s(t.$slots,`expanded`,{row:n})],10,rn)],2)):v(``,!0)]),_:3}),l(e(de),null,{default:j(()=>[o(`table`,{ref_key:`tableRef`,ref:Ae,"data-slot":`base`,class:u(M.value.base({class:[e(S).ui?.base]}))},[e(S).caption||b.caption?(P(),a(`caption`,{key:0,"data-slot":`caption`,class:u(M.value.caption({class:[e(S).ui?.caption]}))},[s(t.$slots,`caption`,{},()=>[C(n(e(S).caption),1)])],2)):v(``,!0),o(`thead`,{"data-slot":`thead`,class:u(M.value.thead({class:[e(S).ui?.thead]}))},[(P(!0),a(O,null,i(e(z).getHeaderGroups(),n=>(P(),a(`tr`,{key:n.id,"data-slot":`tr`,class:u(M.value.tr({class:[e(S).ui?.tr]}))},[(P(!0),a(O,null,i(n.headers,n=>(P(),a(`th`,{key:n.id,"data-pinned":n.column.getIsPinned(),scope:n.colSpan>1?`colgroup`:`col`,colspan:n.colSpan>1?n.colSpan:void 0,rowspan:n.rowSpan>1?n.rowSpan:void 0,"aria-sort":Z(n),"data-slot":`th`,class:u(M.value.th({class:[e(S).ui?.th,Y(n.column.columnDef.meta?.class?.th,n)],pinned:!!n.column.getIsPinned()})),style:d([qe(n.column),Y(n.column.columnDef.meta?.style?.th,n)])},[s(t.$slots,`${n.id}-header`,f({ref_for:!0},n.getContext()),()=>[n.isPlaceholder?v(``,!0):(P(),h(e(Zt),{key:0,render:n.column.columnDef.header,props:n.getContext()},null,8,[`render`,`props`]))])],14,an))),128))],2))),128)),o(`tr`,{"data-slot":`separator`,class:u(M.value.separator({class:[e(S).ui?.separator]}))},null,2)],2),o(`tbody`,{"data-slot":`tbody`,class:u(M.value.tbody({class:[e(S).ui?.tbody]}))},[s(t.$slots,`body-top`),je.value.length?(P(),a(O,{key:0},[(P(!0),a(O,null,i(Me.value,t=>(P(),h(e(ge),{key:t.id,row:t},null,8,[`row`]))),128)),e(U)?(P(),a(O,{key:0},[Re.value>0?(P(),a(`tr`,{key:0,style:d({height:`${Re.value}px`}),"aria-hidden":`true`},[o(`td`,{colspan:e(z).getVisibleLeafColumns().length},null,8,on)],4)):v(``,!0),(P(!0),a(O,null,i(W.value,t=>(P(),a(O,{key:B.value[t.index]?.id??`virtual-${t.index}`},[B.value[t.index]?(P(),h(e(ge),{key:0,row:B.value[t.index],index:t.index},null,8,[`row`,`index`])):v(``,!0)],64))),128)),G.value>0?(P(),a(`tr`,{key:1,style:d({height:`${G.value}px`}),"aria-hidden":`true`},[o(`td`,{colspan:e(z).getVisibleLeafColumns().length},null,8,sn)],4)):v(``,!0)],64)):(P(!0),a(O,{key:1},i(B.value,t=>(P(),h(e(ge),{key:t.id,row:t},null,8,[`row`]))),128)),(P(!0),a(O,null,i(Ne.value,t=>(P(),h(e(ge),{key:t.id,row:t},null,8,[`row`]))),128))],64)):e(S).loading&&b.loading?(P(),a(`tr`,cn,[o(`td`,{colspan:e(z).getVisibleLeafColumns().length,"data-slot":`loading`,class:u(M.value.loading({class:e(S).ui?.loading}))},[s(t.$slots,`loading`)],10,ln)])):(P(),a(`tr`,un,[o(`td`,{colspan:e(z).getVisibleLeafColumns().length,"data-slot":`empty`,class:u(M.value.empty({class:e(S).ui?.empty}))},[s(t.$slots,`empty`,{},()=>[C(n(e(S).empty||e(T)(`table.noData`)),1)])],10,dn)])),s(t.$slots,`body-bottom`)],2),ve.value?(P(),a(`tfoot`,{key:1,"data-slot":`tfoot`,class:u(M.value.tfoot({class:[e(S).ui?.tfoot]}))},[o(`tr`,{"data-slot":`separator`,class:u(M.value.separator({class:[e(S).ui?.separator]}))},null,2),(P(!0),a(O,null,i(e(z).getFooterGroups(),n=>(P(),a(`tr`,{key:n.id,"data-slot":`tr`,class:u(M.value.tr({class:[e(S).ui?.tr]}))},[(P(!0),a(O,null,i(n.headers,n=>(P(),a(`th`,{key:n.id,"data-pinned":n.column.getIsPinned(),colspan:n.colSpan>1?n.colSpan:void 0,rowspan:n.rowSpan>1?n.rowSpan:void 0,"data-slot":`th`,class:u(M.value.th({class:[e(S).ui?.th,Y(n.column.columnDef.meta?.class?.th,n)],pinned:!!n.column.getIsPinned()})),style:d([qe(n.column),Y(n.column.columnDef.meta?.style?.th,n)])},[s(t.$slots,`${n.id}-footer`,f({ref_for:!0},n.getContext()),()=>[n.isPlaceholder?v(``,!0):(P(),h(e(Zt),{key:0,render:n.column.columnDef.footer,props:n.getContext()},null,8,[`render`,`props`]))])],14,fn))),128))],2))),128))],2)):v(``,!0)],2)]),_:3}),l(e(N),f({ref_key:`rootRef`,ref:ke,as:e(S).as,"data-slot":`root`},t.$attrs,{class:M.value.root({class:[e(S).ui?.root,e(S).class]})}),{default:j(()=>[l(e(pe))]),_:1},16,[`as`,`class`])],64))}}),mn={slots:{root:`flex items-center text-center`,border:``,container:`font-medium text-default flex`,icon:`shrink-0 size-5`,avatar:`shrink-0`,avatarSize:`2xs`,label:`text-sm`},variants:{color:{primary:{border:`border-primary`},secondary:{border:`border-secondary`},success:{border:`border-success`},info:{border:`border-info`},warning:{border:`border-warning`},error:{border:`border-error`},neutral:{border:`border-default`}},orientation:{horizontal:{root:`w-full flex-row`,border:`w-full`,container:`whitespace-nowrap`},vertical:{root:`h-full flex-col`,border:`h-full`,container:``}},size:{xs:``,sm:``,md:``,lg:``,xl:``},position:{start:``,center:``,end:``},type:{solid:{border:`border-solid`},dashed:{border:`border-dashed`},dotted:{border:`border-dotted`}}},compoundVariants:[{orientation:`horizontal`,position:`start`,class:{container:`me-3`}},{orientation:`horizontal`,position:`center`,class:{container:`mx-3`}},{orientation:`horizontal`,position:`end`,class:{container:`ms-3`}},{orientation:`vertical`,position:`start`,class:{container:`mb-2`}},{orientation:`vertical`,position:`center`,class:{container:`my-2`}},{orientation:`vertical`,position:`end`,class:{container:`mt-2`}},{orientation:`horizontal`,size:`xs`,class:{border:`border-t`}},{orientation:`horizontal`,size:`sm`,class:{border:`border-t-[2px]`}},{orientation:`horizontal`,size:`md`,class:{border:`border-t-[3px]`}},{orientation:`horizontal`,size:`lg`,class:{border:`border-t-[4px]`}},{orientation:`horizontal`,size:`xl`,class:{border:`border-t-[5px]`}},{orientation:`vertical`,size:`xs`,class:{border:`border-s`}},{orientation:`vertical`,size:`sm`,class:{border:`border-s-[2px]`}},{orientation:`vertical`,size:`md`,class:{border:`border-s-[3px]`}},{orientation:`vertical`,size:`lg`,class:{border:`border-s-[4px]`}},{orientation:`vertical`,size:`xl`,class:{border:`border-s-[5px]`}}],defaultVariants:{color:`neutral`,size:`xs`,type:`solid`}},hn=Object.assign({inheritAttrs:!1},{__name:`Separator`,props:{as:{type:null,required:!1},label:{type:String,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},color:{type:null,required:!1},size:{type:null,required:!1},type:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},position:{type:null,required:!1,default:`center`},class:{type:null,required:!1},ui:{type:null,required:!1},decorative:{type:Boolean,required:!1}},setup(t){let r=t,i=ee(),c=le(`separator`,r),d=_(),p=w(ie(c,`as`,`decorative`,`orientation`)),[m,y]=me(),b=g(()=>!!(c.label||c.icon||c.avatar||i.default)),x=g(()=>te({extend:mn,...d.ui?.separator||{}})({color:c.color,orientation:c.orientation,size:c.size,position:c.position,type:c.type}));return(t,r)=>(P(),a(O,null,[l(e(m),null,{default:j(()=>[o(`div`,{"data-slot":`container`,class:u(x.value.container({class:e(c).ui?.container}))},[s(t.$slots,`default`,{ui:x.value},()=>[e(c).label?(P(),a(`span`,{key:0,"data-slot":`label`,class:u(x.value.label({class:e(c).ui?.label}))},n(e(c).label),3)):e(c).icon?(P(),h(oe,{key:1,name:e(c).icon,"data-slot":`icon`,class:u(x.value.icon({class:e(c).ui?.icon}))},null,8,[`name`,`class`])):e(c).avatar?(P(),h(D,f({key:2,size:e(c).ui?.avatarSize||x.value.avatarSize()},e(c).avatar,{"data-slot":`avatar`,class:x.value.avatar({class:e(c).ui?.avatar})}),null,16,[`size`,`class`])):v(``,!0)])],2)]),_:3}),l(e(je),f({"data-slot":`root`},{...e(p),...t.$attrs},{class:x.value.root({class:[e(c).ui?.root,e(c).class]})}),{default:j(()=>[b.value&&e(c).position===`start`?(P(),h(e(y),{key:0})):v(``,!0),o(`div`,{"data-slot":`border`,class:u(x.value.border({class:e(c).ui?.border}))},null,2),b.value&&e(c).position===`center`?(P(),a(O,{key:1},[l(e(y)),o(`div`,{"data-slot":`border`,class:u(x.value.border({class:e(c).ui?.border}))},null,2)],64)):v(``,!0),b.value&&e(c).position===`end`?(P(),h(e(y),{key:2})):v(``,!0)]),_:1},16,[`class`])],64))}}),gn={class:`space-y-3`},_n={class:`flex flex-wrap items-center gap-2`},vn=[`aria-label`],yn={class:`text-sm font-medium tabular-nums`},bn={class:`flex flex-wrap items-center justify-between gap-3 text-sm text-muted`},xn={class:`tabular-nums`},Sn=E({__name:`DataTable`,props:{data:{},columns:{},filterLabel:{default:void 0},pageSize:{default:25},loading:{type:Boolean,default:!1},empty:{default:void 0},selectable:{type:Boolean,default:!1},rowKey:{type:Function,default:e=>String(e.id)},rowLabel:{type:Function,default:void 0}},setup(t){let r=t,c=ye(),u=g(()=>r.filterLabel??c.value.table.filter),d=re(`table`),f=m(``),p=m([]),_=m({pageIndex:0,pageSize:r.pageSize}),y=g(()=>d.value?.tableApi),b=g(()=>y.value?.getFilteredRowModel().rows.length??r.data.length),x=g(()=>[...r.data]),C=m({}),w=g(()=>r.data.filter(e=>C.value[r.rowKey(e)]));function ee(){C.value={}}se(()=>r.data,e=>{let t=new Set(e.map(r.rowKey));C.value=Object.fromEntries(Object.entries(C.value).filter(([e,n])=>n&&t.has(e)))});let E=g(()=>r.selectable?[{id:`select`,header:({table:e})=>T(ve,{modelValue:e.getIsSomePageRowsSelected()?`indeterminate`:e.getIsAllPageRowsSelected(),"onUpdate:modelValue":t=>e.toggleAllPageRowsSelected(t===!0),"aria-label":c.value.table.selectPage}),cell:({row:e})=>T(ve,{modelValue:e.getIsSelected(),"onUpdate:modelValue":t=>e.toggleSelected(t===!0),"aria-label":c.value.table.selectRow(r.rowLabel?.(e.original)??r.rowKey(e.original))}),enableSorting:!1,enableGlobalFilter:!1},...r.columns]:r.columns);return(r,m)=>{let g=ge,T=hn,te=A,D=pn,O=Ne;return P(),a(`div`,gn,[o(`div`,_n,[s(r.$slots,`filters`),l(g,{modelValue:f.value,"onUpdate:modelValue":m[0]||=e=>f.value=e,icon:`i-lucide-search`,placeholder:u.value,"aria-label":u.value,class:`min-w-0 flex-1 basis-56`},null,8,[`modelValue`,`placeholder`,`aria-label`])]),w.value.length>0?(P(),a(`div`,{key:0,role:`toolbar`,"aria-label":e(c).table.bulk,class:`flex flex-wrap items-center gap-2 rounded-lg border border-default bg-elevated px-3 py-2`},[o(`span`,yn,n(e(c).table.selected(w.value.length)),1),l(T,{orientation:`vertical`,class:`h-5`}),s(r.$slots,`bulk`,{selected:w.value,clear:ee}),l(te,{label:e(c).table.clear,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,class:`ml-auto`,onClick:ee},null,8,[`label`])],8,vn)):v(``,!0),l(D,{ref_key:`table`,ref:d,"global-filter":f.value,"onUpdate:globalFilter":m[1]||=e=>f.value=e,sorting:p.value,"onUpdate:sorting":m[2]||=e=>p.value=e,pagination:_.value,"onUpdate:pagination":m[3]||=e=>_.value=e,"row-selection":C.value,"onUpdate:rowSelection":m[4]||=e=>C.value=e,"get-row-id":e=>t.rowKey(e),data:x.value,columns:E.value,loading:t.loading,empty:t.empty??e(c).table.empty,"pagination-options":{getPaginationRowModel:e(Wt)()},class:`rounded-lg border border-default`},S({_:2},[i(r.$slots,(e,t)=>({name:t,fn:j(e=>[t!==`filters`&&t!==`bulk`?s(r.$slots,t,ue(ce(e??{})),void 0,void 0,0):v(``,!0)])}))]),1032,[`global-filter`,`sorting`,`pagination`,`row-selection`,`get-row-id`,`data`,`columns`,`loading`,`empty`,`pagination-options`]),o(`div`,bn,[o(`span`,xn,n(e(c).table.count(b.value,t.data.length)),1),b.value>_.value.pageSize?(P(),h(O,{key:0,page:_.value.pageIndex+1,"items-per-page":_.value.pageSize,total:b.value,"onUpdate:page":m[5]||=e=>y.value?.setPageIndex(e-1)},null,8,[`page`,`items-per-page`,`total`])):v(``,!0)])])}}});export{Sn as t};