@aiquants/directory-tree 2.1.0 → 3.0.0

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.
package/README.md CHANGED
@@ -116,7 +116,7 @@ The main component for rendering the directory tree.
116
116
  #### Props
117
117
 
118
118
  | Prop | Type | Required | Description |
119
- |------|------|----------|-------------|
119
+ | ------ | ------ | ---------- | ------------- |
120
120
  | `entries` | `DirectoryEntry[]` | Yes | Array of root directory entries to display |
121
121
  | `expansion` | `object` | Yes | Configuration for tree expansion state and behavior |
122
122
  | `selection` | `object` | Yes | Configuration for item selection |
@@ -126,7 +126,7 @@ The main component for rendering the directory tree.
126
126
  #### Expansion Options (`expansion`)
127
127
 
128
128
  | Prop | Type | Required | Default | Description |
129
- |------|------|----------|---------|-------------|
129
+ | ------ | ------ | ---------- | --------- | ------------- |
130
130
  | `toggle` | `(path: string) => void` | Yes | - | Function to toggle directory expansion state |
131
131
  | `isExpanded` | `(path: string) => boolean` | Yes | - | Function to check if a directory is expanded |
132
132
  | `expandMultiple` | `(paths: string[]) => void` | Yes | - | Function to expand multiple directories |
@@ -138,7 +138,7 @@ The main component for rendering the directory tree.
138
138
  #### Selection Options (`selection`)
139
139
 
140
140
  | Prop | Type | Required | Default | Description |
141
- |------|------|----------|---------|-------------|
141
+ | ------ | ------ | ---------- | --------- | ------------- |
142
142
  | `onEntryClick` | `(event: DirectoryTreeClickEvent) => void` | Yes | - | Callback function triggered when an entry is clicked |
143
143
  | `selectedPath` | `string \| null` | No | - | The currently selected file path |
144
144
  | `mode` | `'none' \| 'single' \| 'multiple'` | No | `'none'` | Selection mode for items |
@@ -148,7 +148,7 @@ The main component for rendering the directory tree.
148
148
  #### Visual Options (`visual`)
149
149
 
150
150
  | Prop | Type | Required | Default | Description |
151
- |------|------|----------|---------|-------------|
151
+ | ------ | ------ | ---------- | --------- | ------------- |
152
152
  | `className` | `string` | No | - | Optional CSS class name for the container |
153
153
  | `style` | `React.CSSProperties` | No | - | Optional inline styles for the container |
154
154
  | `lineColor` | `string` | No | `'#A0AEC0'` | The color of the tree lines |
@@ -158,6 +158,7 @@ The main component for rendering the directory tree.
158
158
  | `showFileIcons` | `boolean` | No | `true` | Flag indicating whether to render file type icons |
159
159
  | `iconOverrides` | `DirectoryTreeIconOverrides` | No | - | Icon overrides applied globally |
160
160
  | `expandIconSize` | `number` | No | - | Size of the expand icon |
161
+ | `itemHeight` | `number \| ((entry, index) => number)` | No | `20` | Row height in px, or a function computing the height per entry (variable-height rows). Tree connector lines follow each row's cumulative offset. Invalid values (`NaN` / `Infinity` / `0` / negative) fall back to `20`. Memoize the function to keep its identity stable. |
161
162
  | `removeRootIndent` | `boolean` | No | `false` | If true, removes the indentation and connector lines for root-level items |
162
163
  | `highlightStyles` | `HighlightStyles` | No | - | Highlight styles configuration for hover and selection states |
163
164
  | `entryClassName` | `string` | No | - | Additional CSS classes for each entry row |
@@ -205,20 +206,20 @@ A hook for managing directory tree state with localStorage persistence.
205
206
  #### Parameters
206
207
 
207
208
  | Parameter | Type | Description |
208
- |-----------|------|-------------|
209
+ | ----------- | ------ | ------------- |
209
210
  | `options` | `UseDirectoryTreeStateProps` | Configuration options |
210
211
 
211
212
  #### Options
212
213
 
213
214
  | Option | Type | Description |
214
- |--------|------|-------------|
215
+ | -------- | ------ | ------------- |
215
216
  | `initialExpanded` | `Set<string>` | Initially expanded directories |
216
217
  | `storageKey` | `string` | localStorage key for persistence (default: 'directory-tree-state') |
217
218
 
218
219
  #### Returns
219
220
 
220
221
  | Property | Type | Description |
221
- |----------|------|-------------|
222
+ | ---------- | ------ | ------------- |
222
223
  | `expanded` | `Set<string>` | Currently expanded directories |
223
224
  | `toggle` | `(path: string) => void` | Toggle directory expansion |
224
225
  | `isExpanded` | `(path: string) => boolean` | Check if directory is expanded |
@@ -326,6 +327,67 @@ Alternatively, you can dynamically configure specific highlight styles for hover
326
327
 
327
328
  ## Advanced Usage
328
329
 
330
+ ### Row Height (fixed & variable)
331
+
332
+ Rows are 20px tall by default. Pass a number for a uniform height, or a function
333
+ for variable-height rows — the virtual scroller and the tree connector lines both
334
+ follow each row's resolved height. Memoize the function so its identity stays stable.
335
+
336
+ ```tsx
337
+ import { useCallback } from 'react';
338
+ import { DirectoryTree, type DirectoryEntry } from '@aiquants/directory-tree';
339
+
340
+ // Fixed height
341
+ <DirectoryTree entries={entries} /* ...required props */ visual={{ itemHeight: 28 }} />
342
+
343
+ // Variable height: taller rows for files that render inline metadata
344
+ const itemHeight = useCallback(
345
+ (entry: DirectoryEntry) => (entry.type === 'file' ? 32 : 24),
346
+ [],
347
+ );
348
+ <DirectoryTree entries={entries} /* ...required props */ visual={{ itemHeight }} />
349
+ ```
350
+
351
+ ### TreeGrid (columns) mode
352
+
353
+ Pass the optional `grid` prop to turn the tree into a **TreeGrid**: the name/tree column
354
+ is frozen on the left (indentation and connector lines stay confined there) while the
355
+ remaining columns render as a vertically-aligned grid — with an aligned column header, an
356
+ optional footer that aggregates over **all** entries (collapsed subtrees included), and a
357
+ horizontally scrollable numeric region (the name column stays put).
358
+
359
+ `columns[0]` is always the name/tree column. **`grid.columns` and every `render` / `footer`
360
+ must be stable references** (memoize them) — otherwise every visible row re-renders.
361
+
362
+ ```tsx
363
+ import { useMemo } from 'react';
364
+ import { DirectoryTree, type DirectoryTreeColumn, type DirectoryEntry } from '@aiquants/directory-tree';
365
+
366
+ const columns: DirectoryTreeColumn[] = useMemo(() => [
367
+ // columns[0] = name/tree column. `render` output becomes the label; indent + glyph + icon
368
+ // are drawn by the library. Omit `render` to fall back to entry.name.
369
+ { key: 'name', header: 'Name', width: 260, render: (e) => e.name },
370
+ { key: 'qty', header: 'Qty', width: 96, align: 'right', render: (e) => fmt(e.data.qty),
371
+ footer: (all) => fmt(all.reduce((s, e) => s + e.data.qty, 0)) },
372
+ { key: 'ratio', header: 'Ratio', width: 96, align: 'right', render: (e) => `${e.data.ratio}%` },
373
+ ], []);
374
+
375
+ <DirectoryTree
376
+ entries={entries}
377
+ /* ...required expansion / selection props */
378
+ grid={{ columns, showHeader: true, showFooter: true }}
379
+ />
380
+ ```
381
+
382
+ Grid mode exposes `role="treegrid"` / `row` / `gridcell` / `columnheader` semantics. Note that
383
+ `visual.removeRootIndent` is ignored in grid mode (the frozen name column must start at x=0), and
384
+ `grid.scrollBarWidth` defaults to the VirtualScroll scrollbar width so columns stay aligned. Import
385
+ the base grid styles alongside the component CSS:
386
+
387
+ ```ts
388
+ import '@aiquants/directory-tree/styles/directory-tree.css';
389
+ ```
390
+
329
391
  ### Large Datasets
330
392
 
331
393
  The component is optimized for large datasets through virtualization:
@@ -1 +1 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-amber-100:oklch(96.2% .059 95.617);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-900:oklch(42.1% .095 57.708);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-900:oklch(37.8% .077 168.94);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer theme,base;@layer components.utilities{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-rod{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-pupil{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}@layer utilities;}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-96{height:calc(var(--spacing) * 96)}.h-full{height:100%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/10{background-color:color-mix(in oklab,var(--color-blue-400) 10%,transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/20{background-color:color-mix(in oklab,var(--color-blue-400) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-yellow-50{background-color:var(--color-yellow-50)}.px-2{padding-inline:calc(var(--spacing) * 2)}.py-1{padding-block:calc(var(--spacing) * 1)}.pr-\[3px\]{padding-right:3px}.pb-\[5px\]{padding-bottom:5px}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab,var(--color-gray-400) 15%,transparent)}}.hover\:bg-slate-100\/50:hover{background-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-100\/50:hover{background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}}@media(prefers-color-scheme:dark){.dark\:bg-amber-900\/20{background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20{background-color:color-mix(in oklab,var(--color-amber-900) 20%,transparent)}}.dark\:bg-blue-400\/15{background-color:#54a2ff26}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/15{background-color:color-mix(in oklab,var(--color-blue-400) 15%,transparent)}}.dark\:bg-blue-400\/25{background-color:#54a2ff40}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/25{background-color:color-mix(in oklab,var(--color-blue-400) 25%,transparent)}}.dark\:bg-emerald-900\/20{background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20{background-color:color-mix(in oklab,var(--color-emerald-900) 20%,transparent)}}.dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark\:bg-indigo-900\/20{background-color:#312c8533}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-900\/20{background-color:color-mix(in oklab,var(--color-indigo-900) 20%,transparent)}}.dark\:bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-yellow-900\/20{background-color:color-mix(in oklab,var(--color-yellow-900) 20%,transparent)}}.dark\:text-blue-300{color:var(--color-blue-300)}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-slate-100{color:var(--color-slate-100)}.dark\:text-slate-300{color:var(--color-slate-300)}.dark\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.dark\:hover\:bg-gray-200\/10:hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-200\/10:hover{background-color:color-mix(in oklab,var(--color-gray-200) 10%,transparent)}}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--color-amber-100:oklch(96.2% .059 95.617);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-900:oklch(42.1% .095 57.708);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-900:oklch(37.8% .077 168.94);--color-cyan-400:oklch(78.9% .154 211.53);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-800:oklch(39.8% .195 277.366);--color-indigo-900:oklch(35.9% .144 278.697);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer base;@layer components{@layer theme,base;@layer components.utilities{.aqvs-scroll-pane{display:flex;position:relative}.aqvs-scroll-pane-content{flex:1;height:100%;position:relative;overflow:hidden}.aqvs-tap-scroll-circle{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;transition-property:transform;transition-duration:.1s;transition-timing-function:cubic-bezier(0,0,.2,1);display:flex;position:relative}.aqvs-tap-scroll-circle-visual-outer{border-radius:9999px;position:absolute;inset:0}.aqvs-tap-scroll-circle-gradient{background:linear-gradient(to bottom right,#1d4ed899,#60a5fa8c,#bfdbfe66);border-width:1px;border-color:#fff6;border-radius:9999px;position:absolute;inset:0;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-tap-scroll-circle-inner{border-radius:9999px;position:absolute;inset:18%}.aqvs-sample-visual-rod{background-color:#ffffffd9;border-width:1px;border-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-pupil{background-color:#fffc;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-sample-visual-highlight{background-color:#ffffff80;border-radius:9999px;position:absolute;top:50%;left:50%}.aqvs-scrollbar{z-index:50;cursor:default;-webkit-user-select:none;user-select:none;touch-action:none;background-color:#fff;position:relative}.aqvs-scrollbar-horizontal{flex-direction:row;align-items:stretch;display:flex}.aqvs-scrollbar-vertical{flex-direction:column;align-items:stretch;display:flex}.aqvs-scrollbar-tap-circle-wrapper{pointer-events:auto;transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);position:absolute}.aqvs-scrollbar-arrow-button{color:#313131;background-color:#e0e0e0;justify-content:center;align-items:center;font-size:.75rem;line-height:1rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1);display:flex}.aqvs-scrollbar-arrow-button:focus{outline-offset:2px;outline:2px solid #0000}.aqvs-scrollbar-arrow-button:focus-visible{outline-offset:1px;outline:2px solid #60a5fa}.aqvs-scrollbar-arrow-button:disabled{cursor:not-allowed;opacity:.5}.aqvs-scrollbar-arrow-button:enabled:hover{background-color:#d4d4d4}.aqvs-scrollbar-track{background-color:#f5f5f5;flex:1;position:relative}.aqvs-scrollbar-overlay{pointer-events:none;position:absolute;inset:0}.aqvs-scrollbar-thumb-wrapper{touch-action:none;position:absolute}.aqvs-scrollbar-thumb{transform-origin:50%;background-color:#7f7f7f;transition:transform 80ms ease-out;position:absolute}.aqvs-scrollbar-thumb[data-thumb-state=disabled]{transition:none;transform:none}.aqvs-scrollbar-thumb[data-thumb-state=hover]{background-color:#5f5f5f}.aqvs-scrollbar-thumb[data-thumb-state=dragging]{background-color:#4f4f4f;transition:transform 60ms ease-out}.aqvs-scrollbar-thumb-horizontal{inset:1.5px 0}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=hover]{top:-.5px;bottom:-.5px;transform:scaleY(1.06)}.aqvs-scrollbar-thumb-horizontal[data-thumb-state=dragging]{top:-.5px;bottom:-.5px;transform:scaleY(1.12)}.aqvs-scrollbar-thumb-vertical{inset:0 1.5px}.aqvs-scrollbar-thumb-vertical[data-thumb-state=hover]{left:-.5px;right:-.5px;transform:scaleX(1.06)}.aqvs-scrollbar-thumb-vertical[data-thumb-state=dragging]{left:-.5px;right:-.5px;transform:scaleX(1.12)}.aqvs-scroll-to-edge-button{pointer-events:auto;color:#fff;text-transform:uppercase;letter-spacing:.05em;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#1f2937cc;border-radius:9999px;padding:.25rem 3rem;font-size:10px;font-weight:500;transition-property:transform,background-color;transition-duration:.15s;transform:none;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.aqvs-scroll-to-edge-button:hover{background-color:#374151}.aqvs-scroll-to-edge-button:active{transform:scale(.95)}.aqvs-scroll-to-edge-overlay{pointer-events:none;z-index:10;transition-property:opacity;transition-duration:.5s;position:absolute;inset:0}.aqvs-scroll-to-edge-overlay[data-visible=true]{opacity:1}.aqvs-scroll-to-edge-overlay[data-visible=false]{opacity:0}.aqvs-scroll-to-edge-button-container{justify-content:center;display:flex;position:absolute;left:0;right:0}.aqvs-scroll-to-edge-button-container-top{top:.5rem}.aqvs-scroll-to-edge-button-container-bottom{bottom:.5rem}.aqvs-no-items-container{width:100%;position:absolute;top:0}.aqvs-no-items-text{text-align:center;color:#6b7280}.aqvs-item-container,.aqvs-bottom-inset,.aqvs-items-wrapper{width:100%;position:absolute}}@layer utilities{.dt-grid{flex-direction:column;display:flex;position:relative}.dt-grid-body{flex:1;min-height:0;position:relative}.dt-grid-header,.dt-grid-footer,.dt-grid-row,.dt-grid-hscrollbar-row{align-items:stretch;display:flex}.dt-grid-name-cell,.dt-grid-name-header,.dt-grid-name-footer{z-index:1;flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.dt-grid-numeric-viewport{flex:1;position:relative;overflow:hidden}.dt-grid-numeric-track{transform:translate(calc(-1 * var(--dt-hscroll,0px)));will-change:transform;display:grid}.dt-grid-cell{white-space:nowrap;text-overflow:ellipsis;align-items:center;padding:0 8px;display:flex;overflow:hidden}.dt-grid-cell--right{text-align:right;justify-content:flex-end}.dt-grid-cell--center{text-align:center;justify-content:center}.dt-grid-name-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.dt-grid-scrollbar-spacer{flex-shrink:0}}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-0{z-index:0}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-96{height:calc(var(--spacing) * 96)}.h-full{height:100%}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-full{width:100%}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.overflow-y-hidden{overflow-y:hidden}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-400\/10{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/10{background-color:color-mix(in oklab,var(--color-blue-400) 10%,transparent)}}.bg-blue-400\/20{background-color:#54a2ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-400\/20{background-color:color-mix(in oklab,var(--color-blue-400) 20%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-yellow-50{background-color:var(--color-yellow-50)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.py-1{padding-block:calc(var(--spacing) * 1)}.pr-\[3px\]{padding-right:3px}.pb-\[5px\]{padding-bottom:5px}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-blue-500{color:var(--color-blue-500)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-indigo-800{color:var(--color-indigo-800)}.text-slate-600{color:var(--color-slate-600)}.text-slate-800{color:var(--color-slate-800)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(59\,130\,246\,0\.3\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#3b82f64d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.hover\:bg-gray-400\/15:hover{background-color:#99a1af26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-400\/15:hover{background-color:color-mix(in oklab,var(--color-gray-400) 15%,transparent)}}.hover\:bg-slate-100\/50:hover{background-color:#f1f5f980}@supports (color:color-mix(in lab,red,red)){.hover\:bg-slate-100\/50:hover{background-color:color-mix(in oklab,var(--color-slate-100) 50%,transparent)}}}@media(prefers-color-scheme:dark){.dark\:bg-amber-900\/20{background-color:#7b330633}@supports (color:color-mix(in lab,red,red)){.dark\:bg-amber-900\/20{background-color:color-mix(in oklab,var(--color-amber-900) 20%,transparent)}}.dark\:bg-blue-400\/15{background-color:#54a2ff26}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/15{background-color:color-mix(in oklab,var(--color-blue-400) 15%,transparent)}}.dark\:bg-blue-400\/25{background-color:#54a2ff40}@supports (color:color-mix(in lab,red,red)){.dark\:bg-blue-400\/25{background-color:color-mix(in oklab,var(--color-blue-400) 25%,transparent)}}.dark\:bg-emerald-900\/20{background-color:#004e3b33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-emerald-900\/20{background-color:color-mix(in oklab,var(--color-emerald-900) 20%,transparent)}}.dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark\:bg-indigo-900\/20{background-color:#312c8533}@supports (color:color-mix(in lab,red,red)){.dark\:bg-indigo-900\/20{background-color:color-mix(in oklab,var(--color-indigo-900) 20%,transparent)}}.dark\:bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab,red,red)){.dark\:bg-yellow-900\/20{background-color:color-mix(in oklab,var(--color-yellow-900) 20%,transparent)}}.dark\:text-blue-300{color:var(--color-blue-300)}.dark\:text-blue-400{color:var(--color-blue-400)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-300{color:var(--color-gray-300)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-slate-100{color:var(--color-slate-100)}.dark\:text-slate-300{color:var(--color-slate-300)}.dark\:shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dark\:shadow-\[0_0_0_1px_rgba\(96\,165\,250\,0\.4\)\]{--tw-shadow:0 0 0 1px var(--tw-shadow-color,#60a5fa66);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@media(hover:hover){.dark\:hover\:bg-gray-200\/10:hover{background-color:#e5e7eb1a}@supports (color:color-mix(in lab,red,red)){.dark\:hover\:bg-gray-200\/10:hover{background-color:color-mix(in oklab,var(--color-gray-200) 10%,transparent)}}}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),Xe=require("@aiquants/virtualscroll"),pe=require("@heroicons/react/24/solid"),Ve=require("@phosphor-icons/react"),$=require("tailwind-merge");var ye={exports:{}},ce={};var Te;function qe(){if(Te)return ce;Te=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(l,n,s){var i=null;if(s!==void 0&&(i=""+s),n.key!==void 0&&(i=""+n.key),"key"in n){s={};for(var y in n)y!=="key"&&(s[y]=n[y])}else s=n;return n=s.ref,{$$typeof:e,type:l,key:i,ref:n!==void 0?n:null,props:s}}return ce.Fragment=r,ce.jsx=a,ce.jsxs=a,ce}var ue={};var Ne;function Je(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&(function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===D?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case o:return"Fragment";case k:return"Profiler";case h:return"StrictMode";case F:return"Suspense";case V:return"SuspenseList";case U:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case u:return"Portal";case w:return t.displayName||"Context";case N:return(t._context.displayName||"Context")+".Consumer";case f:var m=t.render;return t=t.displayName,t||(t=m.displayName||m.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Y:return m=t.displayName||null,m!==null?m:e(t.type)||"Memo";case B:m=t._payload,t=t._init;try{return e(t(m))}catch{}}return null}function r(t){return""+t}function a(t){try{r(t);var m=!1}catch{m=!0}if(m){m=console;var x=m.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return x.call(m,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),r(t)}}function l(t){if(t===o)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===B)return"<...>";try{var m=e(t);return m?"<"+m+">":"<...>"}catch{return"<...>"}}function n(){var t=H.A;return t===null?null:t.getOwner()}function s(){return Error("react-stack-top-frame")}function i(t){if(Z.call(t,"key")){var m=Object.getOwnPropertyDescriptor(t,"key").get;if(m&&m.isReactWarning)return!1}return t.key!==void 0}function y(t,m){function x(){E||(E=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",m))}x.isReactWarning=!0,Object.defineProperty(t,"key",{get:x,configurable:!0})}function S(){var t=e(this.type);return j[t]||(j[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function p(t,m,x,R,G,K){var _=x.ref;return t={$$typeof:I,type:t,key:m,props:x,_owner:R},(_!==void 0?_:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:S}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function c(t,m,x,R,G,K){var _=m.children;if(_!==void 0)if(R)if(q(_)){for(R=0;R<_.length;R++)v(_[R]);Object.freeze&&Object.freeze(_)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(_);if(Z.call(m,"key")){_=e(t);var W=Object.keys(m).filter(function(le){return le!=="key"});R=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",ne[_+R]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),ct=require("@aiquants/virtualscroll"),P=require("tailwind-merge"),Ce=require("@heroicons/react/24/solid"),jt=require("@phosphor-icons/react");var Se={exports:{}},ye={};var it;function Pt(){if(it)return ye;it=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(n,s,l){var o=null;if(l!==void 0&&(o=""+l),s.key!==void 0&&(o=""+s.key),"key"in s){l={};for(var m in s)m!=="key"&&(l[m]=s[m])}else l=s;return s=l.ref,{$$typeof:e,type:n,key:o,ref:s!==void 0?s:null,props:l}}return ye.Fragment=t,ye.jsx=a,ye.jsxs=a,ye}var pe={};var dt;function At(){return dt||(dt=1,process.env.NODE_ENV!=="production"&&(function(){function e(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===F?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case u:return"Fragment";case D:return"Profiler";case g:return"StrictMode";case T:return"Suspense";case W:return"SuspenseList";case G:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case d:return"Portal";case k:return r.displayName||"Context";case w:return(r._context.displayName||"Context")+".Consumer";case y:var b=r.render;return r=r.displayName,r||(r=b.displayName||b.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case L:return b=r.displayName||null,b!==null?b:e(r.type)||"Memo";case I:b=r._payload,r=r._init;try{return e(r(b))}catch{}}return null}function t(r){return""+r}function a(r){try{t(r);var b=!1}catch{b=!0}if(b){b=console;var R=b.error,_=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return R.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_),t(r)}}function n(r){if(r===u)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===I)return"<...>";try{var b=e(r);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function s(){var r=H.A;return r===null?null:r.getOwner()}function l(){return Error("react-stack-top-frame")}function o(r){if(K.call(r,"key")){var b=Object.getOwnPropertyDescriptor(r,"key").get;if(b&&b.isReactWarning)return!1}return r.key!==void 0}function m(r,b){function R(){M||(M=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",b))}R.isReactWarning=!0,Object.defineProperty(r,"key",{get:R,configurable:!0})}function E(){var r=e(this.type);return U[r]||(U[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function v(r,b,R,_,q,J){var j=R.ref;return r={$$typeof:N,type:r,key:b,props:R,_owner:_},(j!==void 0?j:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:E}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function i(r,b,R,_,q,J){var j=b.children;if(j!==void 0)if(_)if(z(j)){for(_=0;_<j.length;_++)h(j[_]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(j);if(K.call(b,"key")){j=e(r);var Z=Object.keys(b).filter(function(ie){return ie!=="key"});_=0<Z.length?"{key: someKey, "+Z.join(": ..., ")+": ...}":"{key: someKey}",re[j+_]||(Z=0<Z.length?"{"+Z.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,R,_,W,_),ne[_+R]=!0)}if(_=null,x!==void 0&&(a(x),_=""+x),i(m)&&(a(m.key),_=""+m.key),"key"in m){x={};for(var Q in m)Q!=="key"&&(x[Q]=m[Q])}else x=m;return _&&y(x,typeof t=="function"?t.displayName||t.name||"Unknown":t),p(t,_,x,n(),G,K)}function v(t){b(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===B&&(t._payload.status==="fulfilled"?b(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function b(t){return typeof t=="object"&&t!==null&&t.$$typeof===I}var g=d,I=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),w=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),H=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,q=Array.isArray,J=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(t){return t()}};var E,j={},O=g.react_stack_bottom_frame.bind(g,s)(),P=J(l(s)),ne={};ue.Fragment=o,ue.jsx=function(t,m,x){var R=1e4>H.recentlyCreatedOwnerStacks++;return c(t,m,x,!1,R?Error("react-stack-top-frame"):O,R?J(l(t)):P)},ue.jsxs=function(t,m,x){var R=1e4>H.recentlyCreatedOwnerStacks++;return c(t,m,x,!0,R?Error("react-stack-top-frame"):O,R?J(l(t)):P)}})()),ue}var Pe;function Ge(){return Pe||(Pe=1,process.env.NODE_ENV==="production"?ye.exports=qe():ye.exports=Je()),ye.exports}var T=Ge();const ze=(e,r,a)=>{const l=[];for(let n=r;n<a;n++){const s=e[n];if(!(!s||s.length===0))for(const i of s)l.push(i)}return l},Ue=(e,r,a)=>{const l=[];for(let n=r;n<a;n++){const s=e[n];if(!(!s||s.length===0))for(const i of s)l.push(i)}return l},Ze=(e,r,a,l)=>{const n=Math.max(1,Math.floor(r*l)),s=Math.max(1,Math.floor(a*l));(e.width!==n||e.height!==s)&&(e.width=n,e.height=s);const i=e.style;i.width!==`${r}px`&&(i.width=`${r}px`),i.height!==`${a}px`&&(i.height=`${a}px`)},Qe=(e,r,a)=>{e.lineWidth=a,e.beginPath();for(const l of r)e.moveTo(l.x1,l.y1),e.lineTo(l.x2,l.y2);e.stroke()},Ke=(e,r)=>{const a=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!a)return null;let l=a[1];l.length===3&&(l=l.split("").map(y=>y+y).join(""));const n=Number.parseInt(l.slice(0,2),16),s=Number.parseInt(l.slice(2,4),16),i=Number.parseInt(l.slice(4,6),16);return`rgba(${n}, ${s}, ${i}, ${r})`},et=(e,r,a,l)=>{if(r.length===0)return;const n=Ke(a,.14),s=e.strokeStyle,i=e.fillStyle,y=e.lineWidth,S=e.lineCap,p=e.lineJoin;e.strokeStyle=a,e.lineCap="round",e.lineJoin="round";for(const c of r){const v=l??c.size,b=Math.max(0,v/2),g=Math.max(1,Math.round(v*.08)),I=Math.max(1,Math.round(v*.14)),u=Math.max(0,b-g*.8),o=Math.max(0,u*.55);n&&(e.fillStyle=n,e.beginPath(),e.arc(c.centerX,c.centerY,u,0,Math.PI*2),e.fill()),e.lineWidth=g,e.beginPath(),e.arc(c.centerX,c.centerY,Math.max(0,b-g*.3),0,Math.PI*2),e.stroke(),e.lineWidth=I,e.beginPath(),e.moveTo(c.centerX-o,c.centerY),e.lineTo(c.centerX+o,c.centerY),e.stroke(),c.isExpanded||(e.beginPath(),e.moveTo(c.centerX,c.centerY-o),e.lineTo(c.centerX,c.centerY+o),e.stroke())}e.strokeStyle=s,e.fillStyle=i,e.lineWidth=y,e.lineCap=S,e.lineJoin=p},je=d.memo(({segmentsByItem:e,glyphsByItem:r,itemHeight:a,width:l,viewportHeight:n,scrollPosition:s,color:i="#a0aec0",strokeWidth:y=1,renderStartIndex:S,renderEndIndex:p,lookaheadEndIndex:c,devicePixelRatio:v,expandGlyphColor:b,expandGlyphSize:g})=>{const I=d.useRef(null),u=d.useRef(null),o=d.useRef({segmentsByItem:e,glyphsByItem:r,itemHeight:a,width:l,viewportHeight:n,scrollPosition:s,color:i,strokeWidth:y,renderStartIndex:S,renderEndIndex:p,lookaheadEndIndex:c,devicePixelRatio:v,expandGlyphColor:b,expandGlyphSize:g}),h=d.useCallback(()=>{u.current=null;const N=I.current;if(!N)return;const w=N.getContext("2d");if(!w)return;const f=o.current;if(f.width<=0||f.viewportHeight<=0){w.clearRect(0,0,N.width,N.height);return}const F=Number.isFinite(f.devicePixelRatio??NaN)?f.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;Ze(N,f.width,f.viewportHeight,F);const V=f.segmentsByItem.length,Y=typeof f.renderStartIndex=="number"&&Number.isFinite(f.renderStartIndex)?Math.max(0,Math.floor(f.renderStartIndex)):Math.max(0,Math.floor(f.scrollPosition/f.itemHeight)),B=Math.min(V,Math.ceil((f.scrollPosition+f.viewportHeight)/f.itemHeight)),U=(()=>{if(typeof f.renderEndIndex=="number"&&Number.isFinite(f.renderEndIndex)){const q=Math.floor(f.renderEndIndex);return Math.max(Math.min(V,q+1),Y)}return Math.max(B,Y)})(),D=(()=>{if(typeof f.lookaheadEndIndex=="number"&&Number.isFinite(f.lookaheadEndIndex)){const q=Math.floor(f.lookaheadEndIndex),J=Math.min(V,q+1);return Math.max(J,U)}return Math.max(B,U)})(),H=ze(f.segmentsByItem,Y,D),Z=Ue(f.glyphsByItem,Y,D);w.save(),w.scale(F,F),w.clearRect(0,0,f.width,f.viewportHeight),w.translate(0,-f.scrollPosition),w.strokeStyle=f.color,Qe(w,H,f.strokeWidth),et(w,Z,f.expandGlyphColor??f.color,f.expandGlyphSize),w.restore()},[]),k=d.useCallback(()=>{u.current===null&&(u.current=window.requestAnimationFrame(h))},[h]);return d.useEffect(()=>{o.current={segmentsByItem:e,glyphsByItem:r,itemHeight:a,width:l,viewportHeight:n,scrollPosition:s,color:i,strokeWidth:y,renderStartIndex:S,renderEndIndex:p,lookaheadEndIndex:c,devicePixelRatio:v,expandGlyphColor:b,expandGlyphSize:g},k()},[e,r,a,l,n,s,i,y,S,p,c,v,b,g,k]),d.useEffect(()=>()=>{u.current!==null&&(window.cancelAnimationFrame(u.current),u.current=null)},[]),T.jsx("canvas",{ref:I,className:"pointer-events-none absolute top-0 left-0 z-0"})});je.displayName="TreeLineCanvas";const A={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[5px] pr-[3px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none",entryHover:$.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:$.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:$.twMerge("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]","dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),expandIcon:$.twMerge("directory-tree-expand-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:$.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:$.twMerge("directory-tree-type-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:$.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:$.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory",nameSelected:$.twMerge("directory-tree-name--selected text-blue-800 font-medium","dark:text-blue-300")},tt={msOverflowStyle:"none",scrollbarWidth:"none"},rt=()=>{let e=document.getElementById("directory-tree-webkit-scrollbar-hide");e||(e=document.createElement("style"),e.id="directory-tree-webkit-scrollbar-hide",e.textContent=".directory-tree-container::-webkit-scrollbar { display: none; }",document.head.appendChild(e))},nt=(e,r,a,l)=>{const n=[],s=[];let i=0;const y=(S,p,c)=>{for(let v=0;v<S.length;v++){const b=S[v],g=v===S.length-1,I=[...c,g],u=b.children!==void 0,o=u&&r(b.absolutePath,b.relativePath);let h=p,k=I,N=c;l&&(h=p-1,k=I.slice(1),N=c.slice(1)),n.push({entry:b,indentLevel:h,parentIsLast:k}),a&&(h>i&&(i=h),s.push({id:b.absolutePath,name:b.name,absolutePath:b.absolutePath,indentLevel:h,isLastChild:g,isDirectory:u,isExpanded:o,ancestorIsLast:[...N],hideLines:l&&p===0})),u&&o&&b.children&&y(b.children,p+1,I)}};return y(e,0,[]),{flatItems:n,lineItems:s,maxIndent:i}},at=(e,r,a,l,n)=>{const s=l?.renderStart??Math.max(0,Math.floor(n/oe)),i=r>0?Math.ceil(r/oe)+a:a,y=e>0?Math.min(e-1,s+i):s,S=l?.renderEnd??y,p=e>0?Math.min(e-1,S+a):S;return{renderStart:s,renderEnd:S,lookaheadEnd:p}},st=({isDirectory:e,isExpanded:r,showExpandIcons:a,useCanvasExpandIcons:l,expandIconSize:n})=>{const s=n?{width:n,height:n}:void 0,i=n?"":"h-4 w-4";return!(a&&e)||l?T.jsx("span",{className:i,style:s,"aria-hidden":"true"}):r?T.jsx(pe.ChevronDownIcon,{className:i,style:s}):T.jsx(pe.ChevronRightIcon,{className:i,style:s})},ot=e=>e.slice((e.lastIndexOf(".")-1>>>0)+2).toLowerCase(),lt=(e,r,a,l,n)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const s=Array.from({length:e.length},()=>[]),i=Array.from({length:e.length},()=>[]),y=l?typeof n=="number"&&Number.isFinite(n)&&n>0?n:Math.max(8,Math.min(a*.9,r*.7)):0,S=3;for(let p=0;p<e.length;p++){const c=e[p];if(c.hideLines)continue;const v=[],b=p*r,g=b+r/2,I=y>0?y/2+2:a/1.5;for(let h=0;h<c.indentLevel;h++){if(c.ancestorIsLast[h]??!1)continue;let N=!1;for(let w=p;w<e.length;w++){const f=e[w];if(f.indentLevel>h&&f.ancestorIsLast.length>h&&!f.ancestorIsLast[h]){N=!0;break}if(w>p&&f.indentLevel===h)break}if(N){const w=h*a+a/2+S;v.push({key:`${c.id}-ancestor-${h}`,x1:w,y1:b,x2:w,y2:b+r,itemIndex:p})}}const u=c.indentLevel*a,o=u+a/2+S;if(c.isDirectory?v.push({key:`${c.id}-connector-top`,x1:o,y1:b,x2:o,y2:g-I,itemIndex:p}):v.push({key:`${c.id}-connector-top`,x1:o,y1:b,x2:o,y2:g,itemIndex:p}),!c.isDirectory&&c.isLastChild&&v.push({key:`${c.id}-connector-horizontal`,x1:o,y1:g,x2:u+a+S,y2:g,itemIndex:p}),c.isLastChild||(c.isDirectory?v.push({key:`${c.id}-connector-bottom`,x1:o,y1:g+I,x2:o,y2:b+r,itemIndex:p}):v.push({key:`${c.id}-connector-bottom`,x1:o,y1:g,x2:o,y2:b+r,itemIndex:p})),s[p]=v,l&&c.isDirectory){const h=y,k=o,N=g;i[p]=[{key:`${c.id}-glyph`,itemIndex:p,centerX:k,centerY:N,size:h,isExpanded:c.isExpanded}]}}return{segmentsByItem:s,glyphsByItem:i}},Ee=(e,r)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${r}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${r}". Not supported.`),null;if(Array.isArray(e)){const l=e.map(n=>Ee(n,r)).filter(Boolean);return l.length?l:null}const a=e.type;if(a&&a.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${r}". Not supported.`),null}return e},it=(e,r)=>{const{entry:a,isDirectory:l,isExpanded:n,extension:s}=e;let i;return a.icon!==void 0?i=a.icon:l?i=n&&r?.directoryExpanded||r?.directory||T.jsx(pe.FolderIcon,{className:"h-4 w-4"}):s&&r?.fileByExtension?.[s]?i=r.fileByExtension[s]:i=r?.file||(s==="md"?T.jsx(pe.DocumentTextIcon,{className:"h-4 w-4"}):T.jsx(Ve.FileIcon,{className:"h-4 w-4"})),Ee(typeof i=="function"?i(e):i,a.absolutePath)},xe=d.memo(({entry:e,indentLevel:r,isDirOpen:a,parentIsLast:l,renderChildren:n=!0,expansion:{toggleDirectory:s,onToggleDirectoryRecursive:i},selection:{onEntryClick:y,selectedPath:S,mode:p="none",selectedItems:c,onSelectionChange:v},visual:{iconOverrides:b,showExpandIcons:g=!0,showDirectoryIcons:I=!0,showFileIcons:u=!0,useCanvasExpandIcons:o=!1,expandIconSize:h,highlightStyles:k,entryClassName:N,entryStyle:w,nameClassName:f,nameStyle:F,directoryNameClassName:V,directoryNameStyle:Y,fileNameClassName:B,fileNameStyle:U}})=>{const D=d.useRef(null),[H,Z]=d.useState(null),[q,J]=d.useState(!1);d.useEffect(()=>()=>{D.current&&window.clearTimeout(D.current)},[]);const E=e.children!==void 0,j=E&&a(e.absolutePath),O=e.absolutePath===S,P=!E&&c?.has(e.absolutePath),ne=E?void 0:ot(e.name);d.useEffect(()=>{Z(j&&e.children?e.children:null)},[j,e.children]);const t=d.useCallback(L=>{L.stopPropagation(),p!=="none"&&!E&&v&&v(e,!P);let ae=!1;y({entry:e,isDirectory:E,isExpanded:j,preventDefault:()=>{ae=!0}}),!(!E||ae)&&(D.current?(window.clearTimeout(D.current),D.current=null,i(e)):D.current=window.setTimeout(()=>{s(e.absolutePath),D.current=null},500))},[E,e,j,i,s,y,p,v,P]),m=q?k?.hoverClassName!==void 0?k.hoverClassName:A.entryHover:"",x=(()=>{if(E){if(O)return k?.directorySelectedClassName!==void 0?k.directorySelectedClassName:A.entrySelected}else if(O||P)return k?.itemSelectedClassName!==void 0?k.itemSelectedClassName:$.twMerge(O&&A.entrySelected,P&&A.entryItemSelected);return""})(),R=$.twMerge(A.entry,m,x,N,e.className),G=$.twMerge(A.expandIcon,(O||P)&&A.expandIconSelected),K=$.twMerge(A.typeIcon,(O||P)&&A.typeIconSelected),_=$.twMerge(A.name,f,E&&A.nameDirectory,E&&V,!E&&B,(O||P)&&A.nameSelected),W=st({isDirectory:E,isExpanded:j,showExpandIcons:g,useCanvasExpandIcons:o,expandIconSize:h}),Q=(E?I:u)?it({entry:e,isDirectory:E,isExpanded:j,isSelected:O,isItemSelected:!!P,extension:ne},b):null,le={...q?k?.hoverStyle:{},...E&&O?k?.directorySelectedStyle:{},...!E&&(O||P)?k?.itemSelectedStyle:{}};return T.jsxs(d.Fragment,{children:[T.jsxs("div",{className:R,style:{paddingLeft:`${Math.max(0,r*de)}px`,transform:r<0?`translateX(${r*de}px)`:void 0,width:r<0?`calc(100% + ${Math.abs(r*de)}px)`:void 0,height:`${oe}px`,...le,...w,...e.style},"data-entry-type":E?"directory":"file","data-entry-expanded":E?String(j):void 0,"data-entry-selected":O?"true":void 0,"data-entry-item-selected":P?"true":void 0,onClick:t,onMouseEnter:()=>J(!0),onMouseLeave:()=>J(!1),onKeyDown:L=>L.key==="Enter"&&t(L),tabIndex:0,role:"treeitem","aria-expanded":E?j:void 0,"aria-label":`${e.name} (${E?"directory":"file"})`,children:[(g||o)&&T.jsx("span",{className:G,children:W}),(E?I:u)&&T.jsx("span",{className:K,children:Q}),T.jsx("span",{className:_,style:{...F,...E?Y:U},"data-entry-type":E?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),j&&H&&n&&T.jsx("fieldset",{children:H.map((L,ae)=>T.jsx(xe,{entry:L,indentLevel:r+1,isDirOpen:a,parentIsLast:[...l,ae===H.length-1],expansion:{toggleDirectory:s,onToggleDirectoryRecursive:i},selection:{onEntryClick:y,selectedPath:S,mode:p,selectedItems:c,onSelectionChange:v},visual:{iconOverrides:b,showExpandIcons:g,showDirectoryIcons:I,showFileIcons:u,useCanvasExpandIcons:o,expandIconSize:h,highlightStyles:k,entryClassName:N,entryStyle:w,nameClassName:f,nameStyle:F,directoryNameClassName:V,directoryNameStyle:Y,fileNameClassName:B,fileNameStyle:U}},L.absolutePath))})]},e.absolutePath)},(e,r)=>{if(e.entry!==r.entry)return!1;const a=e.entry.children!==void 0,l=r.entry.children!==void 0,n=a&&e.isDirOpen(e.entry.absolutePath),s=l&&r.isDirOpen(r.entry.absolutePath);return e.indentLevel===r.indentLevel&&n===s&&e.selection.selectedPath===r.selection.selectedPath&&e.selection.mode===r.selection.mode&&e.selection.selectedItems===r.selection.selectedItems&&e.visual.iconOverrides===r.visual.iconOverrides&&e.visual.showExpandIcons===r.visual.showExpandIcons&&e.visual.showDirectoryIcons===r.visual.showDirectoryIcons&&e.visual.showFileIcons===r.visual.showFileIcons&&e.visual.useCanvasExpandIcons===r.visual.useCanvasExpandIcons&&e.visual.expandIconSize===r.visual.expandIconSize&&e.visual.highlightStyles===r.visual.highlightStyles&&e.visual.entryClassName===r.visual.entryClassName&&e.visual.entryStyle===r.visual.entryStyle&&e.visual.nameClassName===r.visual.nameClassName&&e.visual.nameStyle===r.visual.nameStyle&&e.visual.directoryNameClassName===r.visual.directoryNameClassName&&e.visual.directoryNameStyle===r.visual.directoryNameStyle&&e.visual.fileNameClassName===r.visual.fileNameClassName&&e.visual.fileNameStyle===r.visual.fileNameStyle&&e.parentIsLast.length===r.parentIsLast.length&&e.parentIsLast.every((i,y)=>i===r.parentIsLast[y])});xe.displayName="DirectoryEntryItem";const oe=20,ct=()=>oe,de=16,Me=12,Oe=e=>{const r=[];if(e.children)for(const a of e.children)a.type==="directory"&&(r.push(a.absolutePath),r.push(...Oe(a)));return r},ut=({entries:e,expansion:{toggle:r,isExpanded:a,expandMultiple:l,collapseMultiple:n,isPending:s,alwaysExpanded:i=!1,doubleClickAction:y="recursive"},selection:{onEntryClick:S,selectedPath:p,mode:c="none",selectedItems:v,onSelectionChange:b},visual:{className:g,style:I,lineColor:u="#A0AEC0",showTreeLines:o=!0,showExpandIcons:h=!0,showDirectoryIcons:k=!0,showFileIcons:N=!0,iconOverrides:w,expandIconSize:f,removeRootIndent:F=!1,highlightStyles:V,entryClassName:Y,entryStyle:B,nameClassName:U,nameStyle:D,directoryNameClassName:H,directoryNameStyle:Z,fileNameClassName:q,fileNameStyle:J}={},virtualScroll:E})=>{const[j,O]=d.useState(!1),P=d.useRef(null),ne=d.useRef(null),[t,m]=d.useState(0),[x,R]=d.useState(null),{overscanCount:G=15,className:K,background:_,onScroll:W,onRangeChange:Q,initialScrollIndex:le,initialScrollOffset:L,callbackThrottleMs:ae=5,contentInsets:Ae,onItemFocus:$e,viewportHeightOverride:z,scrollBarOptions:De,behaviorOptions:Le}=E??{},[fe,Se]=d.useState(typeof L=="number"?L:0),Fe=d.useCallback((C,te)=>{Se(C),W?.(C,te)},[W]),Ye=d.useCallback(C=>{const{renderingStartIndex:te,renderingEndIndex:X}=C;R(M=>M&&M.renderStart===te&&M.renderEnd===X?M:{renderStart:te,renderEnd:X}),Q?.(C)},[Q]);d.useEffect(()=>{typeof L=="number"&&Se(L)},[L]),d.useEffect(()=>{O(!0),rt()},[]),d.useEffect(()=>{if(typeof z=="number"){m(M=>Math.abs(M-z)>1?z:M);return}const C=P.current;if(!C)return m(0);(()=>{const M=C.clientHeight;m(re=>Math.abs(re-M)>1?M:re)})();const X=new ResizeObserver(M=>{for(const re of M)re.target===C&&m(ve=>Math.abs(ve-re.contentRect.height)>1?re.contentRect.height:ve)});return X.observe(C),()=>X.disconnect()},[z]);const ee=typeof z=="number"?z:t,se=d.useCallback(C=>i||(j?a(C):!1),[j,a,i]),ke=$.twMerge(A.container,s&&A.containerPending,g),we=d.useMemo(()=>({...tt,...I??{},...typeof z=="number"?{height:z,minHeight:z}:{}}),[I,z]),Be=d.useCallback((C,te)=>{const X=[C.absolutePath,...Oe(C)],M=te||y;if(X.every(ge=>se(ge)))return n(X);if(X.every(ge=>!se(ge))||M==="recursive")return l(X);if(M==="toggle")return n(X);console.warn(`[DirectoryTree] Unknown double click action: ${M}. No action taken.`)},[se,l,n,y]),{flatItems:ie,lineItems:be,maxIndent:Ie}=d.useMemo(()=>nt(e,se,o,F),[e,se,o,F]),me=d.useMemo(()=>!o||be.length===0?{segmentsByItem:[],glyphsByItem:[]}:lt(be,oe,de,o,f??Me),[be,o,f]),he=d.useMemo(()=>!o||e.length===0?0:(Ie+2)*de,[e.length,Ie,o]),{renderStart:Re,renderEnd:_e,lookaheadEnd:Ce}=d.useMemo(()=>at(ie.length,ee,G,x,fe),[ie.length,ee,G,x,fe]),He=d.useMemo(()=>!o||he<=0||ee<=0||me.segmentsByItem.length===0?null:T.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:T.jsx("div",{className:"absolute top-0 left-0",style:{width:he,height:ee},children:T.jsx(je,{segmentsByItem:me.segmentsByItem,glyphsByItem:me.glyphsByItem,itemHeight:oe,width:he,viewportHeight:ee,scrollPosition:fe,color:u,expandGlyphColor:u,expandGlyphSize:f??Me,renderStartIndex:Re,renderEndIndex:_e,lookaheadEndIndex:Ce})})}),[he,ee,Re,_e,Ce,fe,me,u,o,f]),We=d.useCallback(C=>ie[C],[ie]);return e.length===0?T.jsx("div",{className:ke,style:we}):T.jsx("div",{ref:P,className:ke,style:we,role:"tree",children:T.jsx(Xe.VirtualScroll,{ref:ne,itemCount:ie.length,getItem:We,getItemHeight:ct,viewportSize:ee,overscanCount:G,onScroll:Fe,onRangeChange:Ye,className:K,background:T.jsxs(T.Fragment,{children:[He,_]}),initialScrollIndex:le,initialScrollOffset:L,onItemFocus:$e,callbackThrottleMs:ae,contentInsets:Ae,scrollBarOptions:De,behaviorOptions:Le,children:C=>C&&T.jsx(xe,{entry:C.entry,indentLevel:C.indentLevel,isDirOpen:se,parentIsLast:C.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:r,onToggleDirectoryRecursive:Be},selection:{onEntryClick:S,selectedPath:p??null,mode:c,selectedItems:v,onSelectionChange:b},visual:{iconOverrides:w,showExpandIcons:h,showDirectoryIcons:k,showFileIcons:N,useCanvasExpandIcons:o,expandIconSize:f,highlightStyles:V,entryClassName:Y,entryStyle:B,nameClassName:U,nameStyle:D,directoryNameClassName:H,directoryNameStyle:Z,fileNameClassName:q,fileNameStyle:J}},C.entry.absolutePath)})})},dt=({initialExpanded:e=new Set,storageKey:r}={})=>{const[a,l]=d.useTransition(),[n,s]=d.useState(()=>{if(typeof window<"u"&&r)try{const u=window.localStorage.getItem(r);if(u){const o=JSON.parse(u);return new Set(o)}}catch(u){console.error("[useDirectoryTreeState] Error reading from localStorage",u)}return e}),i=d.useCallback(u=>{l(()=>{s(o=>{const h=new Set(o);return u(h),h})})},[]),y=d.useCallback((u,o)=>{i(h=>{for(const k of u)o(h,k)})},[i]);d.useEffect(()=>{if(r&&typeof window<"u")try{window.localStorage.setItem(r,JSON.stringify(Array.from(n)))}catch(u){console.warn(`Error setting localStorage key "${r}":`,u)}},[n,r]);const S=d.useCallback(u=>{y([u],(o,h)=>{o.has(h)?o.delete(h):o.add(h)})},[y]),p=d.useCallback(u=>{y([u],(o,h)=>{o.add(h)})},[y]),c=d.useCallback(u=>{y([u],(o,h)=>{o.delete(h)})},[y]),v=d.useCallback(u=>{y(u,(o,h)=>{o.delete(h)})},[y]),b=d.useCallback(u=>{y(u,(o,h)=>{o.add(h)})},[y]),g=d.useCallback(()=>{i(u=>{u.clear()})},[i]),I=d.useCallback(u=>n.has(u),[n]);return{expanded:n,toggle:S,expand:p,collapse:c,collapseMultiple:v,expandMultiple:b,collapseAll:g,isExpanded:I,isPending:a}};exports.DirectoryTree=ut;exports.directoryTreeClasses=A;exports.useDirectoryTreeState=dt;
6
+ <%s key={someKey} {...props} />`,_,j,Z,j),re[j+_]=!0)}if(j=null,R!==void 0&&(a(R),j=""+R),o(b)&&(a(b.key),j=""+b.key),"key"in b){R={};for(var B in b)B!=="key"&&(R[B]=b[B])}else R=b;return j&&m(R,typeof r=="function"?r.displayName||r.name||"Unknown":r),v(r,j,R,s(),q,J)}function h(r){x(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===I&&(r._payload.status==="fulfilled"?x(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function x(r){return typeof r=="object"&&r!==null&&r.$$typeof===N}var S=c,N=Symbol.for("react.transitional.element"),d=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),H=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=Object.prototype.hasOwnProperty,z=Array.isArray,X=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(r){return r()}};var M,U={},C=S.react_stack_bottom_frame.bind(S,l)(),$=X(n(l)),re={};pe.Fragment=u,pe.jsx=function(r,b,R){var _=1e4>H.recentlyCreatedOwnerStacks++;return i(r,b,R,!1,_?Error("react-stack-top-frame"):C,_?X(n(r)):$)},pe.jsxs=function(r,b,R){var _=1e4>H.recentlyCreatedOwnerStacks++;return i(r,b,R,!0,_?Error("react-stack-top-frame"):C,_?X(n(r)):$)}})()),pe}var ut;function Ot(){return ut||(ut=1,process.env.NODE_ENV==="production"?Se.exports=Pt():Se.exports=At()),Se.exports}var p=Ot();const ke=20,he=16,ft=12,O={container:"directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[5px] pr-[3px]",containerPending:"opacity-70",entry:"directory-tree-entry flex items-center cursor-pointer relative select-none",entryHover:P.twMerge("directory-tree-entry--hover hover:bg-gray-400/15","dark:hover:bg-gray-200/10"),entrySelected:P.twMerge("directory-tree-entry--selected bg-blue-400/10","dark:bg-blue-400/15"),entryItemSelected:P.twMerge("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]","dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),expandIcon:P.twMerge("directory-tree-expand-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),expandIconSelected:P.twMerge("directory-tree-expand-icon--selected text-blue-700","dark:text-blue-400"),typeIcon:P.twMerge("directory-tree-type-icon w-5 h-5 flex-shrink-0 flex items-center justify-center","text-gray-500","dark:text-gray-400"),typeIconSelected:P.twMerge("directory-tree-type-icon--selected text-blue-700","dark:text-blue-400"),name:P.twMerge("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1","text-gray-700","dark:text-gray-200"),nameDirectory:"directory-tree-name--directory",nameSelected:P.twMerge("directory-tree-name--selected text-blue-800 font-medium","dark:text-blue-300")},pt=e=>e.slice((e.lastIndexOf(".")-1>>>0)+2).toLowerCase(),bt=({isDirectory:e,isExpanded:t,showExpandIcons:a,useCanvasExpandIcons:n,expandIconSize:s})=>{const l=s?{width:s,height:s}:void 0,o=s?"":"h-4 w-4";return!(a&&e)||n?p.jsx("span",{className:o,style:l,"aria-hidden":"true"}):t?p.jsx(Ce.ChevronDownIcon,{className:o,style:l}):p.jsx(Ce.ChevronRightIcon,{className:o,style:l})},Oe=(e,t)=>{if(e==null||typeof e=="boolean")return null;if(typeof e=="function")return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`),null;if(typeof e=="object"){if("then"in e)return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`),null;if(Array.isArray(e)){const n=e.map(s=>Oe(s,t)).filter(Boolean);return n.length?n:null}const a=e.type;if(a&&a.$$typeof===Symbol.for("react.lazy"))return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`),null}return e},vt=(e,t)=>{const{entry:a,isDirectory:n,isExpanded:s,extension:l}=e;let o;return a.icon!==void 0?o=a.icon:n?o=s&&t?.directoryExpanded||t?.directory||p.jsx(Ce.FolderIcon,{className:"h-4 w-4"}):l&&t?.fileByExtension?.[l]?o=t.fileByExtension[l]:o=t?.file||(l==="md"?p.jsx(Ce.DocumentTextIcon,{className:"h-4 w-4"}):p.jsx(jt.FileIcon,{className:"h-4 w-4"})),Oe(typeof o=="function"?o(e):o,a.absolutePath)},Dt=500,gt=({entry:e,isDirectory:t,isExpanded:a,isItemSelected:n,selectionMode:s,onSelectionChange:l,onEntryClick:o,toggleDirectory:m,onToggleDirectoryRecursive:E})=>{const v=c.useRef(null);return c.useEffect(()=>()=>{v.current&&window.clearTimeout(v.current)},[]),c.useCallback(i=>{i.stopPropagation(),s!=="none"&&!t&&l&&l(e,!n);let h=!1;o({entry:e,isDirectory:t,isExpanded:a,preventDefault:()=>{h=!0}}),!(!t||h)&&(v.current?(window.clearTimeout(v.current),v.current=null,E(e)):v.current=window.setTimeout(()=>{m(e.absolutePath),v.current=null},Dt))},[t,e,a,E,m,o,s,l,n])},xt=e=>e==="right"?"dt-grid-cell--right":e==="center"?"dt-grid-cell--center":"",mt=(e,t)=>e.children!==void 0&&t(e.absolutePath),wt=(e,t)=>({width:e,gridTemplateColumns:t}),Et=c.memo(({entry:e,indentLevel:t,rowHeight:a,isDirOpen:n,columns:s,numericTemplate:l,numericTotal:o,nameWidth:m,rowClassName:E,selection:{onEntryClick:v,selectedPath:i,mode:h="none",selectedItems:x,onSelectionChange:S},expansion:{toggleDirectory:N,onToggleDirectoryRecursive:d},visual:{iconOverrides:u,showExpandIcons:g=!0,showDirectoryIcons:D=!0,showFileIcons:w=!0,useCanvasExpandIcons:k=!1,expandIconSize:y,highlightStyles:T}})=>{const[W,L]=c.useState(!1),I=e.children!==void 0,G=I&&n(e.absolutePath),F=e.absolutePath===i,H=!I&&!!x?.has(e.absolutePath),K=I?void 0:pt(e.name),z=gt({entry:e,isDirectory:I,isExpanded:G,isItemSelected:H,selectionMode:h,onSelectionChange:S,onEntryClick:v,toggleDirectory:N,onToggleDirectoryRecursive:d}),X=W?T?.hoverClassName!==void 0?T.hoverClassName:O.entryHover:"",M=(()=>{if(I){if(F)return T?.directorySelectedClassName!==void 0?T.directorySelectedClassName:O.entrySelected}else if(F||H)return T?.itemSelectedClassName!==void 0?T.itemSelectedClassName:P.twMerge(F&&O.entrySelected,H&&O.entryItemSelected);return""})(),U=typeof E=="function"?E(e):E,C=P.twMerge("dt-grid-row cursor-pointer select-none",X,M,U,e.className),$=P.twMerge(O.expandIcon,(F||H)&&O.expandIconSelected),re=P.twMerge(O.typeIcon,(F||H)&&O.typeIconSelected),r=P.twMerge("dt-grid-name-label ml-1","text-gray-700 dark:text-gray-200",I&&O.nameDirectory,(F||H)&&O.nameSelected),b=bt({isDirectory:I,isExpanded:G,showExpandIcons:g,useCanvasExpandIcons:k,expandIconSize:y}),R=(I?D:w)?vt({entry:e,isDirectory:I,isExpanded:G,isSelected:F,isItemSelected:H,extension:K},u):null,_={indentLevel:t,isDirectory:I,isExpanded:G},[q,...J]=s,j=q?.render?q.render(e,_):e.label??e.name,Z={...W?T?.hoverStyle:{},...I&&F?T?.directorySelectedStyle:{},...!I&&(F||H)?T?.itemSelectedStyle:{}};return p.jsxs("div",{className:C,style:{height:a,...Z,...e.style},role:"row","aria-expanded":I?G:void 0,"aria-level":t+1,"data-entry-type":I?"directory":"file","data-entry-expanded":I?String(G):void 0,"data-entry-selected":F?"true":void 0,"data-entry-item-selected":H?"true":void 0,onClick:z,onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),onKeyDown:B=>B.key==="Enter"&&z(B),tabIndex:0,children:[p.jsxs("div",{className:P.twMerge("dt-grid-name-cell",q?.className),role:"gridcell",style:{width:m,paddingLeft:Math.max(0,t*he)},children:[(g||k)&&p.jsx("span",{className:$,children:b}),(I?D:w)&&p.jsx("span",{className:re,children:R}),p.jsx("span",{className:r,children:j})]}),J.length>0&&p.jsx("div",{className:"dt-grid-numeric-viewport",children:p.jsx("div",{className:"dt-grid-numeric-track",style:wt(o,l),children:J.map(B=>p.jsx("div",{className:P.twMerge("dt-grid-cell",xt(B.align),B.className),role:"gridcell",children:B.render?B.render(e,_):null},B.key))})})]})},(e,t)=>{if(e.entry!==t.entry)return!1;const a=mt(e.entry,e.isDirOpen),n=mt(t.entry,t.isDirOpen);return e.indentLevel===t.indentLevel&&e.rowHeight===t.rowHeight&&a===n&&e.columns===t.columns&&e.numericTemplate===t.numericTemplate&&e.numericTotal===t.numericTotal&&e.nameWidth===t.nameWidth&&e.rowClassName===t.rowClassName&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual===t.visual});Et.displayName="DirectoryTreeGridRow";const St=({kind:e,columns:t,numericTemplate:a,numericTotal:n,nameWidth:s,scrollBarWidth:l,className:o,nameContent:m,renderCell:E})=>{const[,...v]=t,i=e==="header"?"dt-grid-name-header":"dt-grid-name-footer",h=e==="header"?"dt-grid-header":"dt-grid-footer",x=e==="header"?"columnheader":"gridcell";return p.jsxs("div",{className:P.twMerge(h,"text-gray-600 dark:text-gray-300",o),role:"row",children:[p.jsx("div",{className:P.twMerge(i,"px-1"),role:x,style:{width:s},children:m}),v.length>0&&p.jsx("div",{className:"dt-grid-numeric-viewport",children:p.jsx("div",{className:"dt-grid-numeric-track",style:wt(n,a),children:v.map(S=>p.jsx("div",{className:P.twMerge("dt-grid-cell",xt(S.align),S.className),role:x,children:E(S)},S.key))})}),p.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:l},"aria-hidden":"true"})]})},Lt=({columns:e,className:t,...a})=>p.jsx(St,{kind:"header",columns:e,className:t,nameContent:e[0]?.header??null,renderCell:n=>n.header??null,...a}),ht=(e,t)=>typeof e=="function"?e(t):e??null,Ht=({columns:e,allEntries:t,className:a,...n})=>p.jsx(St,{kind:"footer",columns:e,className:a,nameContent:ht(e[0]?.footer,t),renderCell:s=>ht(s.footer,t),...n}),$t=240,kt=96,Ct=12,De=(e,t)=>{const a=e?.width;return typeof a=="number"&&Number.isFinite(a)&&a>0?a:t},Wt=e=>e.slice(1).map(t=>`${De(t,kt)}px`).join(" "),Ft=({measuredWidth:e,columns:t,scrollBarWidth:a=Ct})=>{const n=De(t[0],$t),s=t.slice(1).reduce((E,v)=>E+De(v,kt),0),l=Number.isFinite(e)&&e>0?e:0,o=Math.max(0,l-n-Math.max(0,a)),m=Math.max(0,s-o);return{nameWidth:n,numericTotal:s,numericVisible:o,maxHScroll:m}},Ae=(e,t)=>!Number.isFinite(e)||e<0?0:e>t?t:e,Bt=e=>{const t=[],a=n=>{for(const s of n)t.push(s),s.children&&s.children.length>0&&a(s.children)};return a(e),t},Yt=(e,t,a)=>{const n=[];for(let s=t;s<a;s++){const l=e[s];if(!(!l||l.length===0))for(const o of l)n.push(o)}return n},Gt=(e,t,a)=>{const n=[];for(let s=t;s<a;s++){const l=e[s];if(!(!l||l.length===0))for(const o of l)n.push(o)}return n},Ut=(e,t,a,n)=>{const s=Math.max(1,Math.floor(t*n)),l=Math.max(1,Math.floor(a*n));(e.width!==s||e.height!==l)&&(e.width=s,e.height=l);const o=e.style;o.width!==`${t}px`&&(o.width=`${t}px`),o.height!==`${a}px`&&(o.height=`${a}px`)},Vt=(e,t,a)=>{e.lineWidth=a,e.beginPath();for(const n of t)e.moveTo(n.x1,n.y1),e.lineTo(n.x2,n.y2);e.stroke()},zt=(e,t)=>{const a=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!a)return null;let n=a[1];n.length===3&&(n=n.split("").map(m=>m+m).join(""));const s=Number.parseInt(n.slice(0,2),16),l=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return`rgba(${s}, ${l}, ${o}, ${t})`},Xt=(e,t,a,n)=>{if(t.length===0)return;const s=zt(a,.14),l=e.strokeStyle,o=e.fillStyle,m=e.lineWidth,E=e.lineCap,v=e.lineJoin;e.strokeStyle=a,e.lineCap="round",e.lineJoin="round";for(const i of t){const h=n??i.size,x=Math.max(0,h/2),S=Math.max(1,Math.round(h*.08)),N=Math.max(1,Math.round(h*.14)),d=Math.max(0,x-S*.8),u=Math.max(0,d*.55);s&&(e.fillStyle=s,e.beginPath(),e.arc(i.centerX,i.centerY,d,0,Math.PI*2),e.fill()),e.lineWidth=S,e.beginPath(),e.arc(i.centerX,i.centerY,Math.max(0,x-S*.3),0,Math.PI*2),e.stroke(),e.lineWidth=N,e.beginPath(),e.moveTo(i.centerX-u,i.centerY),e.lineTo(i.centerX+u,i.centerY),e.stroke(),i.isExpanded||(e.beginPath(),e.moveTo(i.centerX,i.centerY-u),e.lineTo(i.centerX,i.centerY+u),e.stroke())}e.strokeStyle=l,e.fillStyle=o,e.lineWidth=m,e.lineCap=E,e.lineJoin=v},Nt=c.memo(({segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:s,scrollPosition:l,color:o="#a0aec0",strokeWidth:m=1,renderStartIndex:E,renderEndIndex:v,lookaheadEndIndex:i,devicePixelRatio:h,expandGlyphColor:x,expandGlyphSize:S})=>{const N=c.useRef(null),d=c.useRef(null),u=c.useRef({segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:s,scrollPosition:l,color:o,strokeWidth:m,renderStartIndex:E,renderEndIndex:v,lookaheadEndIndex:i,devicePixelRatio:h,expandGlyphColor:x,expandGlyphSize:S}),g=c.useCallback(()=>{d.current=null;const w=N.current;if(!w)return;const k=w.getContext("2d");if(!k)return;const y=u.current;if(y.width<=0||y.viewportHeight<=0){k.clearRect(0,0,w.width,w.height);return}const T=Number.isFinite(y.devicePixelRatio??NaN)?y.devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1;Ut(w,y.width,y.viewportHeight,T);const W=y.segmentsByItem.length,L=typeof y.renderStartIndex=="number"&&Number.isFinite(y.renderStartIndex)?Math.max(0,Math.floor(y.renderStartIndex)):Math.max(0,Math.floor(y.scrollPosition/y.itemHeight)),I=Math.min(W,Math.ceil((y.scrollPosition+y.viewportHeight)/y.itemHeight)),G=(()=>{if(typeof y.renderEndIndex=="number"&&Number.isFinite(y.renderEndIndex)){const z=Math.floor(y.renderEndIndex);return Math.max(Math.min(W,z+1),L)}return Math.max(I,L)})(),F=(()=>{if(typeof y.lookaheadEndIndex=="number"&&Number.isFinite(y.lookaheadEndIndex)){const z=Math.floor(y.lookaheadEndIndex),X=Math.min(W,z+1);return Math.max(X,G)}return Math.max(I,G)})(),H=Yt(y.segmentsByItem,L,F),K=Gt(y.glyphsByItem,L,F);k.save(),k.scale(T,T),k.clearRect(0,0,y.width,y.viewportHeight),k.translate(0,-y.scrollPosition),k.strokeStyle=y.color,Vt(k,H,y.strokeWidth),Xt(k,K,y.expandGlyphColor??y.color,y.expandGlyphSize),k.restore()},[]),D=c.useCallback(()=>{d.current===null&&(d.current=window.requestAnimationFrame(g))},[g]);return c.useEffect(()=>{u.current={segmentsByItem:e,glyphsByItem:t,itemHeight:a,width:n,viewportHeight:s,scrollPosition:l,color:o,strokeWidth:m,renderStartIndex:E,renderEndIndex:v,lookaheadEndIndex:i,devicePixelRatio:h,expandGlyphColor:x,expandGlyphSize:S},D()},[e,t,a,n,s,l,o,m,E,v,i,h,x,S,D]),c.useEffect(()=>()=>{d.current!==null&&(window.cancelAnimationFrame(d.current),d.current=null)},[]),p.jsx("canvas",{ref:N,className:"pointer-events-none absolute top-0 left-0 z-0"})});Nt.displayName="TreeLineCanvas";const qt={msOverflowStyle:"none",scrollbarWidth:"none"},Jt=()=>{let e=document.getElementById("directory-tree-webkit-scrollbar-hide");e||(e=document.createElement("style"),e.id="directory-tree-webkit-scrollbar-hide",e.textContent=".directory-tree-container::-webkit-scrollbar { display: none; }",document.head.appendChild(e))},Zt=(e,t,a,n)=>{const s=[],l=[];let o=0;const m=(E,v,i)=>{for(let h=0;h<E.length;h++){const x=E[h],S=h===E.length-1,N=[...i,S],d=x.children!==void 0,u=d&&t(x.absolutePath,x.relativePath);let g=v,D=N,w=i;n&&(g=v-1,D=N.slice(1),w=i.slice(1)),s.push({entry:x,indentLevel:g,parentIsLast:D}),a&&(g>o&&(o=g),l.push({id:x.absolutePath,name:x.name,absolutePath:x.absolutePath,indentLevel:g,isLastChild:S,isDirectory:d,isExpanded:u,ancestorIsLast:[...w],hideLines:n&&v===0})),d&&u&&x.children&&m(x.children,v+1,N)}};return m(e,0,[]),{flatItems:s,lineItems:l,maxIndent:o}},yt=(e,t)=>{const a=e.length-1;if(a<=0)return 0;let n=0,s=a-1,l=0;for(;n<=s;){const o=n+s>>>1;e[o]<=t?(l=o,n=o+1):s=o-1}return l},Qt=(e,t,a,n,s,l)=>{const o=n?.renderStart??Math.max(0,yt(l,s)),m=t>0?yt(l,s+t)+a:o+a,E=e>0?Math.min(e-1,Math.max(o,m)):o,v=n?.renderEnd??E,i=e>0?Math.min(e-1,v+a):v;return{renderStart:o,renderEnd:v,lookaheadEnd:i}},Kt=(e,t,a,n,s,l)=>{if(e.length===0)return{segmentsByItem:[],glyphsByItem:[]};const o=Array.from({length:e.length},()=>[]),m=Array.from({length:e.length},()=>[]),E=i=>s?typeof l=="number"&&Number.isFinite(l)&&l>0?l:Math.max(8,Math.min(n*.9,i*.7)):0,v=3;for(let i=0;i<e.length;i++){const h=e[i];if(h.hideLines)continue;const x=[],S=t[i]??0,N=a[i]??0,d=N+S/2,u=E(S),g=u>0?u/2+2:n/1.5;for(let k=0;k<h.indentLevel;k++){if(h.ancestorIsLast[k]??!1)continue;let T=!1;for(let W=i;W<e.length;W++){const L=e[W];if(L.indentLevel>k&&L.ancestorIsLast.length>k&&!L.ancestorIsLast[k]){T=!0;break}if(W>i&&L.indentLevel===k)break}if(T){const W=k*n+n/2+v;x.push({key:`${h.id}-ancestor-${k}`,x1:W,y1:N,x2:W,y2:N+S,itemIndex:i})}}const D=h.indentLevel*n,w=D+n/2+v;if(h.isDirectory?x.push({key:`${h.id}-connector-top`,x1:w,y1:N,x2:w,y2:d-g,itemIndex:i}):x.push({key:`${h.id}-connector-top`,x1:w,y1:N,x2:w,y2:d,itemIndex:i}),!h.isDirectory&&h.isLastChild&&x.push({key:`${h.id}-connector-horizontal`,x1:w,y1:d,x2:D+n+v,y2:d,itemIndex:i}),h.isLastChild||(h.isDirectory?x.push({key:`${h.id}-connector-bottom`,x1:w,y1:d+g,x2:w,y2:N+S,itemIndex:i}):x.push({key:`${h.id}-connector-bottom`,x1:w,y1:d,x2:w,y2:N+S,itemIndex:i})),o[i]=x,s&&h.isDirectory){const k=u,y=w,T=d;m[i]=[{key:`${h.id}-glyph`,itemIndex:i,centerX:y,centerY:T,size:k,isExpanded:h.isExpanded}]}}return{segmentsByItem:o,glyphsByItem:m}},Le=c.memo(({entry:e,indentLevel:t,rowHeight:a,isDirOpen:n,parentIsLast:s,renderChildren:l=!0,expansion:{toggleDirectory:o,onToggleDirectoryRecursive:m},selection:{onEntryClick:E,selectedPath:v,mode:i="none",selectedItems:h,onSelectionChange:x},visual:{iconOverrides:S,showExpandIcons:N=!0,showDirectoryIcons:d=!0,showFileIcons:u=!0,useCanvasExpandIcons:g=!1,expandIconSize:D,highlightStyles:w,entryClassName:k,entryStyle:y,nameClassName:T,nameStyle:W,directoryNameClassName:L,directoryNameStyle:I,fileNameClassName:G,fileNameStyle:F}})=>{const[H,K]=c.useState(null),[z,X]=c.useState(!1),M=e.children!==void 0,U=M&&n(e.absolutePath),C=e.absolutePath===v,$=!M&&h?.has(e.absolutePath),re=M?void 0:pt(e.name);c.useEffect(()=>{K(U&&e.children?e.children:null)},[U,e.children]);const r=gt({entry:e,isDirectory:M,isExpanded:U,isItemSelected:!!$,selectionMode:i,onSelectionChange:x,onEntryClick:E,toggleDirectory:o,onToggleDirectoryRecursive:m}),b=z?w?.hoverClassName!==void 0?w.hoverClassName:O.entryHover:"",R=(()=>{if(M){if(C)return w?.directorySelectedClassName!==void 0?w.directorySelectedClassName:O.entrySelected}else if(C||$)return w?.itemSelectedClassName!==void 0?w.itemSelectedClassName:P.twMerge(C&&O.entrySelected,$&&O.entryItemSelected);return""})(),_=P.twMerge(O.entry,b,R,k,e.className),q=P.twMerge(O.expandIcon,(C||$)&&O.expandIconSelected),J=P.twMerge(O.typeIcon,(C||$)&&O.typeIconSelected),j=P.twMerge(O.name,T,M&&O.nameDirectory,M&&L,!M&&G,(C||$)&&O.nameSelected),Z=bt({isDirectory:M,isExpanded:U,showExpandIcons:N,useCanvasExpandIcons:g,expandIconSize:D}),B=(M?d:u)?vt({entry:e,isDirectory:M,isExpanded:U,isSelected:C,isItemSelected:!!$,extension:re},S):null,ie={...z?w?.hoverStyle:{},...M&&C?w?.directorySelectedStyle:{},...!M&&(C||$)?w?.itemSelectedStyle:{}};return p.jsxs(c.Fragment,{children:[p.jsxs("div",{className:_,style:{paddingLeft:`${Math.max(0,t*he)}px`,transform:t<0?`translateX(${t*he}px)`:void 0,width:t<0?`calc(100% + ${Math.abs(t*he)}px)`:void 0,height:`${a}px`,...ie,...y,...e.style},"data-entry-type":M?"directory":"file","data-entry-expanded":M?String(U):void 0,"data-entry-selected":C?"true":void 0,"data-entry-item-selected":$?"true":void 0,onClick:r,onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),onKeyDown:se=>se.key==="Enter"&&r(se),tabIndex:0,role:"treeitem","aria-expanded":M?U:void 0,"aria-label":`${e.name} (${M?"directory":"file"})`,children:[(N||g)&&p.jsx("span",{className:q,children:Z}),(M?d:u)&&p.jsx("span",{className:J,children:B}),p.jsx("span",{className:j,style:{...W,...M?I:F},"data-entry-type":M?"directory":"file","data-entry-role":"name",children:e.label??e.name})]}),U&&H&&l&&p.jsx("fieldset",{children:H.map((se,Ne)=>p.jsx(Le,{entry:se,indentLevel:t+1,rowHeight:a,isDirOpen:n,parentIsLast:[...s,Ne===H.length-1],expansion:{toggleDirectory:o,onToggleDirectoryRecursive:m},selection:{onEntryClick:E,selectedPath:v,mode:i,selectedItems:h,onSelectionChange:x},visual:{iconOverrides:S,showExpandIcons:N,showDirectoryIcons:d,showFileIcons:u,useCanvasExpandIcons:g,expandIconSize:D,highlightStyles:w,entryClassName:k,entryStyle:y,nameClassName:T,nameStyle:W,directoryNameClassName:L,directoryNameStyle:I,fileNameClassName:G,fileNameStyle:F}},se.absolutePath))})]},e.absolutePath)},(e,t)=>{if(e.entry!==t.entry)return!1;const a=e.entry.children!==void 0,n=t.entry.children!==void 0,s=a&&e.isDirOpen(e.entry.absolutePath),l=n&&t.isDirOpen(t.entry.absolutePath);return e.indentLevel===t.indentLevel&&e.rowHeight===t.rowHeight&&s===l&&e.selection.selectedPath===t.selection.selectedPath&&e.selection.mode===t.selection.mode&&e.selection.selectedItems===t.selection.selectedItems&&e.visual.iconOverrides===t.visual.iconOverrides&&e.visual.showExpandIcons===t.visual.showExpandIcons&&e.visual.showDirectoryIcons===t.visual.showDirectoryIcons&&e.visual.showFileIcons===t.visual.showFileIcons&&e.visual.useCanvasExpandIcons===t.visual.useCanvasExpandIcons&&e.visual.expandIconSize===t.visual.expandIconSize&&e.visual.highlightStyles===t.visual.highlightStyles&&e.visual.entryClassName===t.visual.entryClassName&&e.visual.entryStyle===t.visual.entryStyle&&e.visual.nameClassName===t.visual.nameClassName&&e.visual.nameStyle===t.visual.nameStyle&&e.visual.directoryNameClassName===t.visual.directoryNameClassName&&e.visual.directoryNameStyle===t.visual.directoryNameStyle&&e.visual.fileNameClassName===t.visual.fileNameClassName&&e.visual.fileNameStyle===t.visual.fileNameStyle&&e.parentIsLast.length===t.parentIsLast.length&&e.parentIsLast.every((o,m)=>o===t.parentIsLast[m])});Le.displayName="DirectoryEntryItem";const It=e=>{const t=[];if(e.children)for(const a of e.children)a.type==="directory"&&(t.push(a.absolutePath),t.push(...It(a)));return t},er=({entries:e,expansion:{toggle:t,isExpanded:a,expandMultiple:n,collapseMultiple:s,isPending:l,alwaysExpanded:o=!1,doubleClickAction:m="recursive"},selection:{onEntryClick:E,selectedPath:v,mode:i="none",selectedItems:h,onSelectionChange:x},visual:{className:S,style:N,lineColor:d="#A0AEC0",showTreeLines:u=!0,showExpandIcons:g=!0,showDirectoryIcons:D=!0,showFileIcons:w=!0,iconOverrides:k,expandIconSize:y,itemHeight:T=ke,removeRootIndent:W=!1,highlightStyles:L,entryClassName:I,entryStyle:G,nameClassName:F,nameStyle:H,directoryNameClassName:K,directoryNameStyle:z,fileNameClassName:X,fileNameStyle:M}={},virtualScroll:U,grid:C})=>{const $=C!==void 0,[re,r]=c.useState(!1),b=c.useRef(null),R=c.useRef(null),_=c.useRef(null),[q,J]=c.useState(0),[j,Z]=c.useState(0),[B,ie]=c.useState(0),[se,Ne]=c.useState(null),{overscanCount:be=15,className:He,background:$e,onScroll:We,onRangeChange:Fe,initialScrollIndex:Be,initialScrollOffset:de,callbackThrottleMs:Ye=5,contentInsets:Ge,onItemFocus:Ue,viewportHeightOverride:ee,scrollBarOptions:Ie,behaviorOptions:Ve}=U??{},[ve,ze]=c.useState(typeof de=="number"?de:0),Xe=c.useCallback((f,A)=>{ze(f),We?.(f,A)},[We]),qe=c.useCallback(f=>{const{renderingStartIndex:A,renderingEndIndex:Y}=f;Ne(Q=>Q&&Q.renderStart===A&&Q.renderEnd===Y?Q:{renderStart:A,renderEnd:Y}),Fe?.(f)},[Fe]);c.useEffect(()=>{typeof de=="number"&&ze(de)},[de]),c.useEffect(()=>{r(!0),Jt()},[]),c.useEffect(()=>{const f=b.current,A=$?R.current:f,Y=()=>{if(f){const ne=f.clientWidth;Z(me=>Math.abs(me-ne)>1?ne:me)}if(typeof ee=="number")J(ne=>Math.abs(ne-ee)>1?ee:ne);else if(A){const ne=A.clientHeight;J(me=>Math.abs(me-ne)>1?ne:me)}};if(!(f||A))return J(0);Y();const Q=new ResizeObserver(Y);return f&&Q.observe(f),A&&A!==f&&Q.observe(A),()=>Q.disconnect()},[ee,$]);const ae=typeof ee=="number"?ee:q,oe=c.useCallback(f=>o||(re?a(f):!1),[re,a,o]),Re=P.twMerge(O.container,l&&O.containerPending,S),Te=c.useMemo(()=>({...qt,...N??{},...typeof ee=="number"?{height:ee,minHeight:ee}:{}}),[N,ee]),Me=c.useCallback((f,A)=>{const Y=[f.absolutePath,...It(f)],Q=A||m;if(Y.every(Pe=>oe(Pe)))return s(Y);if(Y.every(Pe=>!oe(Pe))||Q==="recursive")return n(Y);if(Q==="toggle")return s(Y);console.warn(`[DirectoryTree] Unknown double click action: ${Q}. No action taken.`)},[oe,n,s,m]),Je=$?!1:W,{flatItems:Ze,lineItems:_e,maxIndent:Qe}=c.useMemo(()=>Zt(e,oe,u,Je),[e,oe,u,Je]),te=c.useMemo(()=>Ze.map((f,A)=>{const Y=typeof T=="function"?T(f.entry,A):T;return{...f,rowHeight:Number.isFinite(Y)&&Y>0?Y:ke}}),[Ze,T]),le=c.useMemo(()=>te.map(f=>f.rowHeight),[te]),ge=c.useMemo(()=>{const f=new Array(le.length+1);f[0]=0;for(let A=0;A<le.length;A++)f[A+1]=f[A]+le[A];return f},[le]),Ke=c.useCallback(f=>te[f]?.rowHeight??ke,[te]),xe=c.useMemo(()=>!u||_e.length===0?{segmentsByItem:[],glyphsByItem:[]}:Kt(_e,le,ge,he,u,y??ft),[_e,le,ge,u,y]),we=c.useMemo(()=>!u||e.length===0?0:(Qe+2)*he,[e.length,Qe,u]),{renderStart:et,renderEnd:tt,lookaheadEnd:rt}=c.useMemo(()=>Qt(te.length,ae,be,se,ve,ge),[te.length,ae,be,se,ve,ge]),je=c.useMemo(()=>!u||we<=0||ae<=0||xe.segmentsByItem.length===0?null:p.jsx("div",{className:"pointer-events-none absolute inset-0 z-0","aria-hidden":"true",children:p.jsx("div",{className:"absolute top-0 left-0",style:{width:we,height:ae},children:p.jsx(Nt,{segmentsByItem:xe.segmentsByItem,glyphsByItem:xe.glyphsByItem,itemHeight:le[0]??ke,width:we,viewportHeight:ae,scrollPosition:ve,color:d,expandGlyphColor:d,expandGlyphSize:y??ft,renderStartIndex:et,renderEndIndex:tt,lookaheadEndIndex:rt})})}),[we,ae,et,tt,rt,ve,xe,d,u,y,le]),nt=c.useCallback(f=>te[f],[te]),ce=C?.columns,ue=C?.scrollBarWidth??Ie?.width??Ct,V=c.useMemo(()=>ce?Ft({measuredWidth:j,columns:ce,scrollBarWidth:ue}):null,[ce,j,ue]),Ee=c.useMemo(()=>ce?Wt(ce):"",[ce]),Rt=c.useMemo(()=>C?.showFooter&&ce?Bt(e):[],[C?.showFooter,ce,e]),fe=V?.maxHScroll??0;c.useEffect(()=>{ie(f=>Ae(f,fe))},[fe]);const st=c.useCallback(f=>ie(A=>Ae(A+f,fe)),[fe]),at=c.useMemo(()=>({iconOverrides:k,showExpandIcons:g,showDirectoryIcons:D,showFileIcons:w,useCanvasExpandIcons:u,expandIconSize:y,highlightStyles:L}),[k,g,D,w,u,y,L]),ot=e.length===0,lt=c.useMemo(()=>p.jsx(ct.VirtualScroll,{ref:_,itemCount:te.length,getItem:nt,getItemHeight:Ke,viewportSize:ae,overscanCount:be,onScroll:Xe,onRangeChange:qe,className:He,onWheelHorizontal:$?st:void 0,background:p.jsxs(p.Fragment,{children:[$&&V?p.jsx("div",{className:"pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden",style:{width:V.nameWidth},"aria-hidden":"true",children:je}):je,$e]}),initialScrollIndex:Be,initialScrollOffset:de,onItemFocus:Ue,callbackThrottleMs:Ye,contentInsets:Ge,scrollBarOptions:Ie,behaviorOptions:Ve,children:f=>f?$&&C&&V?p.jsx(Et,{entry:f.entry,indentLevel:f.indentLevel,rowHeight:f.rowHeight,isDirOpen:oe,columns:C.columns,numericTemplate:Ee,numericTotal:V.numericTotal,nameWidth:V.nameWidth,rowClassName:C.rowClassName,selection:{onEntryClick:E,selectedPath:v??null,mode:i,selectedItems:h,onSelectionChange:x},expansion:{toggleDirectory:t,onToggleDirectoryRecursive:Me},visual:at},f.entry.absolutePath):p.jsx(Le,{entry:f.entry,indentLevel:f.indentLevel,rowHeight:f.rowHeight,isDirOpen:oe,parentIsLast:f.parentIsLast,renderChildren:!1,expansion:{toggleDirectory:t,onToggleDirectoryRecursive:Me},selection:{onEntryClick:E,selectedPath:v??null,mode:i,selectedItems:h,onSelectionChange:x},visual:{iconOverrides:k,showExpandIcons:g,showDirectoryIcons:D,showFileIcons:w,useCanvasExpandIcons:u,expandIconSize:y,highlightStyles:L,entryClassName:I,entryStyle:G,nameClassName:F,nameStyle:H,directoryNameClassName:K,directoryNameStyle:z,fileNameClassName:X,fileNameStyle:M}},f.entry.absolutePath):null}),[te.length,nt,Ke,ae,be,Xe,qe,He,$,st,V,je,$e,Be,de,Ue,Ye,Ge,Ie,Ve,C,Ee,oe,E,v,i,h,x,t,Me,at,k,g,D,w,u,y,L,I,G,F,H,K,z,X,M]);if(!(C&&V))return ot?p.jsx("div",{className:Re,style:Te}):p.jsx("div",{ref:b,className:Re,style:Te,role:"tree",children:lt});const Tt=C.showHeader??!0,Mt=C.showFooter??!1,_t={...Te,"--dt-hscroll":`${B}px`};return p.jsxs("div",{ref:b,className:P.twMerge(Re,"dt-grid"),style:_t,role:"treegrid",children:[Tt&&p.jsx(Lt,{columns:C.columns,numericTemplate:Ee,numericTotal:V.numericTotal,nameWidth:V.nameWidth,scrollBarWidth:ue,className:C.headerClassName}),p.jsx("div",{ref:R,className:"dt-grid-body",children:!ot&&lt}),fe>0&&p.jsxs("div",{className:"dt-grid-hscrollbar-row",children:[p.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:V.nameWidth},"aria-hidden":"true"}),p.jsx(ct.ScrollBar,{horizontal:!0,contentSize:V.numericTotal,viewportSize:V.numericVisible,scrollPosition:B,scrollBarWidth:ue,onScroll:f=>{const A=typeof f=="function"?f(B):f,Y=Ae(A,fe);return ie(Y),Y}}),p.jsx("div",{className:"dt-grid-scrollbar-spacer",style:{width:ue},"aria-hidden":"true"})]}),Mt&&p.jsx(Ht,{columns:C.columns,numericTemplate:Ee,numericTotal:V.numericTotal,nameWidth:V.nameWidth,scrollBarWidth:ue,allEntries:Rt,className:C.footerClassName})]})},tr=({initialExpanded:e=new Set,storageKey:t}={})=>{const[a,n]=c.useTransition(),[s,l]=c.useState(()=>{if(typeof window<"u"&&t)try{const d=window.localStorage.getItem(t);if(d){const u=JSON.parse(d);return new Set(u)}}catch(d){console.error("[useDirectoryTreeState] Error reading from localStorage",d)}return e}),o=c.useCallback(d=>{n(()=>{l(u=>{const g=new Set(u);return d(g),g})})},[]),m=c.useCallback((d,u)=>{o(g=>{for(const D of d)u(g,D)})},[o]);c.useEffect(()=>{if(t&&typeof window<"u")try{window.localStorage.setItem(t,JSON.stringify(Array.from(s)))}catch(d){console.warn(`Error setting localStorage key "${t}":`,d)}},[s,t]);const E=c.useCallback(d=>{m([d],(u,g)=>{u.has(g)?u.delete(g):u.add(g)})},[m]),v=c.useCallback(d=>{m([d],(u,g)=>{u.add(g)})},[m]),i=c.useCallback(d=>{m([d],(u,g)=>{u.delete(g)})},[m]),h=c.useCallback(d=>{m(d,(u,g)=>{u.delete(g)})},[m]),x=c.useCallback(d=>{m(d,(u,g)=>{u.add(g)})},[m]),S=c.useCallback(()=>{o(d=>{d.clear()})},[o]),N=c.useCallback(d=>s.has(d),[s]);return{expanded:s,toggle:E,expand:v,collapse:i,collapseMultiple:h,expandMultiple:x,collapseAll:S,isExpanded:N,isPending:a}};exports.DirectoryTree=er;exports.directoryTreeClasses=O;exports.useDirectoryTreeState=tr;