@aiquants/directory-tree 3.1.3 → 3.2.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/dist/index.js CHANGED
@@ -1,193 +1,193 @@
1
- import Ot, { useRef as he, useEffect as ae, useCallback as F, memo as We, useState as ne, useMemo as X, Fragment as Dt, useTransition as Lt } from "react";
2
- import { VirtualScroll as Ht, ScrollBar as $t } from "@aiquants/virtualscroll";
3
- import { twMerge as P } from "tailwind-merge";
4
- import { FolderIcon as Wt, DocumentTextIcon as Ft, ChevronDownIcon as Bt, ChevronRightIcon as Yt } from "@heroicons/react/24/solid";
5
- import { FileIcon as Gt } from "@phosphor-icons/react";
6
- var Te = { exports: {} }, ge = {};
7
- var mt;
8
- function Ut() {
9
- if (mt) return ge;
10
- mt = 1;
1
+ import Zt, { useRef as ie, useEffect as ce, useCallback as B, memo as Ye, useState as se, useMemo as q, useLayoutEffect as Qt, Fragment as Kt, useTransition as er } from "react";
2
+ import { VirtualScroll as tr, ScrollBar as rr } from "@aiquants/virtualscroll";
3
+ import { twMerge as M } from "tailwind-merge";
4
+ import { FolderIcon as nr, ChevronDownIcon as sr, ChevronRightIcon as ar } from "@heroicons/react/24/solid";
5
+ import { FileMd as xt, FilePdf as vt, FileXls as bt, FileCsv as gt, FileDoc as wt, FilePpt as kt, FileImage as Nt, FileAudio as Et, FileVideo as St, FileZip as It, FileCode as jt, FileText as Tt, FileIcon as or } from "@phosphor-icons/react";
6
+ var Ce = { exports: {} }, Ne = {};
7
+ var Rt;
8
+ function lr() {
9
+ if (Rt) return Ne;
10
+ Rt = 1;
11
11
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function o(n, s, l) {
13
- var a = null;
14
- if (l !== void 0 && (a = "" + l), s.key !== void 0 && (a = "" + s.key), "key" in s) {
15
- l = {};
16
- for (var m in s)
17
- m !== "key" && (l[m] = s[m]);
18
- } else l = s;
19
- return s = l.ref, {
12
+ function a(n, r, o) {
13
+ var l = null;
14
+ if (o !== void 0 && (l = "" + o), r.key !== void 0 && (l = "" + r.key), "key" in r) {
15
+ o = {};
16
+ for (var d in r)
17
+ d !== "key" && (o[d] = r[d]);
18
+ } else o = r;
19
+ return r = o.ref, {
20
20
  $$typeof: e,
21
21
  type: n,
22
- key: a,
23
- ref: s !== void 0 ? s : null,
24
- props: l
22
+ key: l,
23
+ ref: r !== void 0 ? r : null,
24
+ props: o
25
25
  };
26
26
  }
27
- return ge.Fragment = t, ge.jsx = o, ge.jsxs = o, ge;
27
+ return Ne.Fragment = t, Ne.jsx = a, Ne.jsxs = a, Ne;
28
28
  }
29
- var xe = {};
30
- var ft;
31
- function Vt() {
32
- return ft || (ft = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function e(r) {
34
- if (r == null) return null;
35
- if (typeof r == "function")
36
- return r.$$typeof === W ? null : r.displayName || r.name || null;
37
- if (typeof r == "string") return r;
38
- switch (r) {
39
- case d:
29
+ var Ee = {};
30
+ var Ct;
31
+ function ir() {
32
+ return Ct || (Ct = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function e(s) {
34
+ if (s == null) return null;
35
+ if (typeof s == "function")
36
+ return s.$$typeof === H ? null : s.displayName || s.name || null;
37
+ if (typeof s == "string") return s;
38
+ switch (s) {
39
+ case f:
40
40
  return "Fragment";
41
41
  case O:
42
42
  return "Profiler";
43
- case b:
43
+ case v:
44
44
  return "StrictMode";
45
45
  case R:
46
46
  return "Suspense";
47
47
  case $:
48
48
  return "SuspenseList";
49
- case G:
49
+ case z:
50
50
  return "Activity";
51
51
  }
52
- if (typeof r == "object")
53
- switch (typeof r.tag == "number" && console.error(
52
+ if (typeof s == "object")
53
+ switch (typeof s.tag == "number" && console.error(
54
54
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
55
- ), r.$$typeof) {
56
- case c:
55
+ ), s.$$typeof) {
56
+ case u:
57
57
  return "Portal";
58
58
  case N:
59
- return r.displayName || "Context";
60
- case x:
61
- return (r._context.displayName || "Context") + ".Consumer";
62
- case h:
63
- var p = r.render;
64
- return r = r.displayName, r || (r = p.displayName || p.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
59
+ return s.displayName || "Context";
60
+ case g:
61
+ return (s._context.displayName || "Context") + ".Consumer";
62
+ case p:
63
+ var y = s.render;
64
+ return s = s.displayName, s || (s = y.displayName || y.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
65
65
  case D:
66
- return p = r.displayName || null, p !== null ? p : e(r.type) || "Memo";
67
- case k:
68
- p = r._payload, r = r._init;
66
+ return y = s.displayName || null, y !== null ? y : e(s.type) || "Memo";
67
+ case I:
68
+ y = s._payload, s = s._init;
69
69
  try {
70
- return e(r(p));
70
+ return e(s(y));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function t(r) {
77
- return "" + r;
76
+ function t(s) {
77
+ return "" + s;
78
78
  }
79
- function o(r) {
79
+ function a(s) {
80
80
  try {
81
- t(r);
82
- var p = !1;
81
+ t(s);
82
+ var y = !1;
83
83
  } catch {
84
- p = !0;
84
+ y = !0;
85
85
  }
86
- if (p) {
87
- p = console;
88
- var T = p.error, _ = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
89
- return T.call(
90
- p,
86
+ if (y) {
87
+ y = console;
88
+ var j = y.error, _ = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
89
+ return j.call(
90
+ y,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
92
  _
93
- ), t(r);
93
+ ), t(s);
94
94
  }
95
95
  }
96
- function n(r) {
97
- if (r === d) return "<>";
98
- if (typeof r == "object" && r !== null && r.$$typeof === k)
96
+ function n(s) {
97
+ if (s === f) return "<>";
98
+ if (typeof s == "object" && s !== null && s.$$typeof === I)
99
99
  return "<...>";
100
100
  try {
101
- var p = e(r);
102
- return p ? "<" + p + ">" : "<...>";
101
+ var y = e(s);
102
+ return y ? "<" + y + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
- function s() {
108
- var r = L.A;
109
- return r === null ? null : r.getOwner();
107
+ function r() {
108
+ var s = L.A;
109
+ return s === null ? null : s.getOwner();
110
110
  }
111
- function l() {
111
+ function o() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function a(r) {
115
- if (ee.call(r, "key")) {
116
- var p = Object.getOwnPropertyDescriptor(r, "key").get;
117
- if (p && p.isReactWarning) return !1;
114
+ function l(s) {
115
+ if (te.call(s, "key")) {
116
+ var y = Object.getOwnPropertyDescriptor(s, "key").get;
117
+ if (y && y.isReactWarning) return !1;
118
118
  }
119
- return r.key !== void 0;
119
+ return s.key !== void 0;
120
120
  }
121
- function m(r, p) {
122
- function T() {
121
+ function d(s, y) {
122
+ function j() {
123
123
  C || (C = !0, console.error(
124
124
  "%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)",
125
- p
125
+ y
126
126
  ));
127
127
  }
128
- T.isReactWarning = !0, Object.defineProperty(r, "key", {
129
- get: T,
128
+ j.isReactWarning = !0, Object.defineProperty(s, "key", {
129
+ get: j,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
- function E() {
134
- var r = e(this.type);
135
- return U[r] || (U[r] = !0, console.error(
133
+ function w() {
134
+ var s = e(this.type);
135
+ return G[s] || (G[s] = !0, console.error(
136
136
  "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."
137
- )), r = this.props.ref, r !== void 0 ? r : null;
137
+ )), s = this.props.ref, s !== void 0 ? s : null;
138
138
  }
139
- function v(r, p, T, _, q, Z) {
140
- var j = T.ref;
141
- return r = {
142
- $$typeof: I,
143
- type: r,
144
- key: p,
145
- props: T,
139
+ function x(s, y, j, _, Q, K) {
140
+ var P = j.ref;
141
+ return s = {
142
+ $$typeof: S,
143
+ type: s,
144
+ key: y,
145
+ props: j,
146
146
  _owner: _
147
- }, (j !== void 0 ? j : null) !== null ? Object.defineProperty(r, "ref", {
147
+ }, (P !== void 0 ? P : null) !== null ? Object.defineProperty(s, "ref", {
148
148
  enumerable: !1,
149
- get: E
150
- }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
149
+ get: w
150
+ }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
151
151
  configurable: !1,
152
152
  enumerable: !1,
153
153
  writable: !0,
154
154
  value: 0
155
- }), Object.defineProperty(r, "_debugInfo", {
155
+ }), Object.defineProperty(s, "_debugInfo", {
156
156
  configurable: !1,
157
157
  enumerable: !1,
158
158
  writable: !0,
159
159
  value: null
160
- }), Object.defineProperty(r, "_debugStack", {
160
+ }), Object.defineProperty(s, "_debugStack", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: q
165
- }), Object.defineProperty(r, "_debugTask", {
164
+ value: Q
165
+ }), Object.defineProperty(s, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: Z
170
- }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
169
+ value: K
170
+ }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
171
171
  }
172
- function i(r, p, T, _, q, Z) {
173
- var j = p.children;
174
- if (j !== void 0)
172
+ function c(s, y, j, _, Q, K) {
173
+ var P = y.children;
174
+ if (P !== void 0)
175
175
  if (_)
176
- if (z(j)) {
177
- for (_ = 0; _ < j.length; _++)
178
- f(j[_]);
179
- Object.freeze && Object.freeze(j);
176
+ if (X(P)) {
177
+ for (_ = 0; _ < P.length; _++)
178
+ h(P[_]);
179
+ Object.freeze && Object.freeze(P);
180
180
  } else
181
181
  console.error(
182
182
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
183
183
  );
184
- else f(j);
185
- if (ee.call(p, "key")) {
186
- j = e(r);
187
- var Q = Object.keys(p).filter(function(me) {
188
- return me !== "key";
184
+ else h(P);
185
+ if (te.call(y, "key")) {
186
+ P = e(s);
187
+ var ee = Object.keys(y).filter(function(pe) {
188
+ return pe !== "key";
189
189
  });
190
- _ = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", se[j + _] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ _ = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", ae[P + _] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
191
191
  `A props object containing a "key" prop is being spread into JSX:
192
192
  let props = %s;
193
193
  <%s {...props} />
@@ -195,97 +195,101 @@ React keys must be passed directly to JSX without using spread:
195
195
  let props = %s;
196
196
  <%s key={someKey} {...props} />`,
197
197
  _,
198
- j,
199
- Q,
200
- j
201
- ), se[j + _] = !0);
198
+ P,
199
+ ee,
200
+ P
201
+ ), ae[P + _] = !0);
202
202
  }
203
- if (j = null, T !== void 0 && (o(T), j = "" + T), a(p) && (o(p.key), j = "" + p.key), "key" in p) {
204
- T = {};
205
- for (var B in p)
206
- B !== "key" && (T[B] = p[B]);
207
- } else T = p;
208
- return j && m(
209
- T,
210
- typeof r == "function" ? r.displayName || r.name || "Unknown" : r
211
- ), v(
212
- r,
203
+ if (P = null, j !== void 0 && (a(j), P = "" + j), l(y) && (a(y.key), P = "" + y.key), "key" in y) {
204
+ j = {};
205
+ for (var Y in y)
206
+ Y !== "key" && (j[Y] = y[Y]);
207
+ } else j = y;
208
+ return P && d(
213
209
  j,
214
- T,
215
- s(),
216
- q,
217
- Z
210
+ typeof s == "function" ? s.displayName || s.name || "Unknown" : s
211
+ ), x(
212
+ s,
213
+ P,
214
+ j,
215
+ r(),
216
+ Q,
217
+ K
218
218
  );
219
219
  }
220
- function f(r) {
221
- g(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === k && (r._payload.status === "fulfilled" ? g(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
220
+ function h(s) {
221
+ b(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === I && (s._payload.status === "fulfilled" ? b(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
222
222
  }
223
- function g(r) {
224
- return typeof r == "object" && r !== null && r.$$typeof === I;
223
+ function b(s) {
224
+ return typeof s == "object" && s !== null && s.$$typeof === S;
225
225
  }
226
- var w = Ot, I = /* @__PURE__ */ Symbol.for("react.transitional.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), b = /* @__PURE__ */ Symbol.for("react.strict_mode"), O = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.consumer"), N = /* @__PURE__ */ Symbol.for("react.context"), h = /* @__PURE__ */ Symbol.for("react.forward_ref"), R = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), D = /* @__PURE__ */ Symbol.for("react.memo"), k = /* @__PURE__ */ Symbol.for("react.lazy"), G = /* @__PURE__ */ Symbol.for("react.activity"), W = /* @__PURE__ */ Symbol.for("react.client.reference"), L = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, z = Array.isArray, J = console.createTask ? console.createTask : function() {
226
+ var k = Zt, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.portal"), f = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), O = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.consumer"), N = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), R = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), D = /* @__PURE__ */ Symbol.for("react.memo"), I = /* @__PURE__ */ Symbol.for("react.lazy"), z = /* @__PURE__ */ Symbol.for("react.activity"), H = /* @__PURE__ */ Symbol.for("react.client.reference"), L = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, X = Array.isArray, Z = console.createTask ? console.createTask : function() {
227
227
  return null;
228
228
  };
229
- w = {
230
- react_stack_bottom_frame: function(r) {
231
- return r();
229
+ k = {
230
+ react_stack_bottom_frame: function(s) {
231
+ return s();
232
232
  }
233
233
  };
234
- var C, U = {}, S = w.react_stack_bottom_frame.bind(
235
- w,
236
- l
237
- )(), H = J(n(l)), se = {};
238
- xe.Fragment = d, xe.jsx = function(r, p, T) {
234
+ var C, G = {}, E = k.react_stack_bottom_frame.bind(
235
+ k,
236
+ o
237
+ )(), F = Z(n(o)), ae = {};
238
+ Ee.Fragment = f, Ee.jsx = function(s, y, j) {
239
239
  var _ = 1e4 > L.recentlyCreatedOwnerStacks++;
240
- return i(
241
- r,
242
- p,
243
- T,
240
+ return c(
241
+ s,
242
+ y,
243
+ j,
244
244
  !1,
245
- _ ? Error("react-stack-top-frame") : S,
246
- _ ? J(n(r)) : H
245
+ _ ? Error("react-stack-top-frame") : E,
246
+ _ ? Z(n(s)) : F
247
247
  );
248
- }, xe.jsxs = function(r, p, T) {
248
+ }, Ee.jsxs = function(s, y, j) {
249
249
  var _ = 1e4 > L.recentlyCreatedOwnerStacks++;
250
- return i(
251
- r,
252
- p,
253
- T,
250
+ return c(
251
+ s,
252
+ y,
253
+ j,
254
254
  !0,
255
- _ ? Error("react-stack-top-frame") : S,
256
- _ ? J(n(r)) : H
255
+ _ ? Error("react-stack-top-frame") : E,
256
+ _ ? Z(n(s)) : F
257
257
  );
258
258
  };
259
- })()), xe;
259
+ })()), Ee;
260
260
  }
261
- var ht;
262
- function zt() {
263
- return ht || (ht = 1, process.env.NODE_ENV === "production" ? Te.exports = Ut() : Te.exports = Vt()), Te.exports;
261
+ var _t;
262
+ function cr() {
263
+ return _t || (_t = 1, process.env.NODE_ENV === "production" ? Ce.exports = lr() : Ce.exports = ir()), Ce.exports;
264
264
  }
265
- var y = zt();
266
- const Re = 20, be = 16, yt = 12, A = {
265
+ var i = cr();
266
+ const _e = 20, ke = 16, Pt = 12, A = {
267
267
  container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[5px] pr-[3px]",
268
268
  containerPending: "opacity-70",
269
269
  entry: "directory-tree-entry flex items-center cursor-pointer relative select-none",
270
270
  // ホバー時のスタイル(ライト/ダークモード対応)
271
- entryHover: P("directory-tree-entry--hover hover:bg-gray-400/15", "dark:hover:bg-gray-200/10"),
271
+ entryHover: M("directory-tree-entry--hover hover:bg-gray-400/15", "dark:hover:bg-gray-200/10"),
272
272
  // 選択時のスタイル(ライト/ダークモード対応)
273
- entrySelected: P("directory-tree-entry--selected bg-blue-400/10", "dark:bg-blue-400/15"),
273
+ entrySelected: M("directory-tree-entry--selected bg-blue-400/10", "dark:bg-blue-400/15"),
274
274
  // アイテム選択時のスタイル(ライト/ダークモード対応)
275
- entryItemSelected: P("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)]"),
275
+ entryItemSelected: M("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)]"),
276
276
  // アイコンのスタイル
277
- expandIcon: P("directory-tree-expand-icon w-5 h-5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
278
- expandIconSelected: P("directory-tree-expand-icon--selected text-blue-700", "dark:text-blue-400"),
279
- typeIcon: P("directory-tree-type-icon w-5 h-5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
280
- typeIconSelected: P("directory-tree-type-icon--selected text-blue-700", "dark:text-blue-400"),
277
+ expandIcon: M("directory-tree-expand-icon w-5 h-5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
278
+ expandIconSelected: M("directory-tree-expand-icon--selected text-blue-700", "dark:text-blue-400"),
279
+ typeIcon: M("directory-tree-type-icon w-5 h-5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
280
+ typeIconSelected: M("directory-tree-type-icon--selected text-blue-700", "dark:text-blue-400"),
281
281
  // テキストのスタイル
282
- name: P("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1", "text-gray-700", "dark:text-gray-200"),
282
+ name: M("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1", "text-gray-700", "dark:text-gray-200"),
283
283
  nameDirectory: "directory-tree-name--directory",
284
- nameSelected: P("directory-tree-name--selected text-blue-800 font-medium", "dark:text-blue-300")
285
- }, gt = (e) => e.slice((e.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase(), xt = ({ isDirectory: e, isExpanded: t, showExpandIcons: o, useCanvasExpandIcons: n, expandIconSize: s }) => {
286
- const l = s ? { width: s, height: s } : void 0, a = s ? "" : "h-4 w-4";
287
- return !(o && e) || n ? /* @__PURE__ */ y.jsx("span", { className: a, style: l, "aria-hidden": "true" }) : t ? /* @__PURE__ */ y.jsx(Bt, { className: a, style: l }) : /* @__PURE__ */ y.jsx(Yt, { className: a, style: l });
288
- }, He = (e, t) => {
284
+ nameSelected: M("directory-tree-name--selected text-blue-800 font-medium", "dark:text-blue-300")
285
+ }, xe = (e) => {
286
+ if (!e) return "";
287
+ const t = e.split("?")[0].split("#")[0].split("/").pop() || e, a = t.lastIndexOf(".");
288
+ return a <= 0 ? "" : t.slice(a + 1).toLowerCase();
289
+ }, Dt = ({ isDirectory: e, isExpanded: t, showExpandIcons: a, useCanvasExpandIcons: n, expandIconSize: r }) => {
290
+ const o = r ? { width: r, height: r } : void 0, l = r ? "" : "h-4 w-4";
291
+ return !(a && e) || n ? /* @__PURE__ */ i.jsx("span", { className: l, style: o, "aria-hidden": "true" }) : t ? /* @__PURE__ */ i.jsx(sr, { className: l, style: o }) : /* @__PURE__ */ i.jsx(ar, { className: l, style: o });
292
+ }, We = (e, t) => {
289
293
  if (e == null || typeof e == "boolean") return null;
290
294
  if (typeof e == "function")
291
295
  return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`), null;
@@ -293,455 +297,537 @@ const Re = 20, be = 16, yt = 12, A = {
293
297
  if ("then" in e)
294
298
  return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
295
299
  if (Array.isArray(e)) {
296
- const n = e.map((s) => He(s, t)).filter(Boolean);
300
+ const n = e.map((r) => We(r, t)).filter(Boolean);
297
301
  return n.length ? n : null;
298
302
  }
299
- const o = e.type;
300
- if (o && o.$$typeof === /* @__PURE__ */ Symbol.for("react.lazy"))
303
+ const a = e.type;
304
+ if (a && a.$$typeof === /* @__PURE__ */ Symbol.for("react.lazy"))
301
305
  return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`), null;
302
306
  }
303
307
  return e;
304
- }, Et = (e, t) => {
305
- const { entry: o, isDirectory: n, isExpanded: s, extension: l } = e;
306
- let a;
307
- return o.icon !== void 0 ? a = o.icon : n ? a = s && t?.directoryExpanded || t?.directory || /* @__PURE__ */ y.jsx(Wt, { className: "h-4 w-4" }) : l && t?.fileByExtension?.[l] ? a = t.fileByExtension[l] : a = t?.file || (l === "md" ? /* @__PURE__ */ y.jsx(Ft, { className: "h-4 w-4" }) : /* @__PURE__ */ y.jsx(Gt, { className: "h-4 w-4" })), He(typeof a == "function" ? a(e) : a, o.absolutePath);
308
- }, Xt = 500, wt = ({ entry: e, isDirectory: t, isExpanded: o, isItemSelected: n, selectionMode: s, onSelectionChange: l, onEntryClick: a, toggleDirectory: m, onToggleDirectoryRecursive: E }) => {
309
- const v = he(null);
310
- return ae(
308
+ }, dr = (e, t, a) => {
309
+ const n = (t || (a ? xe(a) : "")).toLowerCase(), r = (e || "").toLowerCase();
310
+ if (r && r !== "application/octet-stream") {
311
+ if (r === "text/markdown" || r === "text/x-markdown")
312
+ return /* @__PURE__ */ i.jsx(xt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
313
+ if (r === "application/pdf")
314
+ return /* @__PURE__ */ i.jsx(vt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
315
+ if (r.includes("excel") || r.includes("spreadsheet") || r.includes("google-apps.spreadsheet"))
316
+ return /* @__PURE__ */ i.jsx(bt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
317
+ if (r === "text/csv" || r === "text/tab-separated-values")
318
+ return /* @__PURE__ */ i.jsx(gt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
319
+ if (r.includes("word") || r.includes("msword") || r.includes("wordprocessingml") || r.includes("google-apps.document") || r === "application/rtf")
320
+ return /* @__PURE__ */ i.jsx(wt, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
321
+ if (r.includes("powerpoint") || r.includes("presentation") || r.includes("google-apps.presentation"))
322
+ return /* @__PURE__ */ i.jsx(kt, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
323
+ if (r.startsWith("image/"))
324
+ return /* @__PURE__ */ i.jsx(Nt, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
325
+ if (r.startsWith("audio/"))
326
+ return /* @__PURE__ */ i.jsx(Et, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
327
+ if (r.startsWith("video/"))
328
+ return /* @__PURE__ */ i.jsx(St, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
329
+ if (r.includes("zip") || r.includes("tar") || r.includes("compressed") || r.includes("archive"))
330
+ return /* @__PURE__ */ i.jsx(It, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
331
+ if (r === "application/json" || r.includes("javascript") || r.includes("typescript") || r.includes("xml") || r.startsWith("text/html") || r.startsWith("text/css") || r.includes("x-python") || r.includes("x-sh") || r.includes("x-go") || r.includes("x-rust"))
332
+ return /* @__PURE__ */ i.jsx(jt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
333
+ if (r.startsWith("text/"))
334
+ return /* @__PURE__ */ i.jsx(Tt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
335
+ }
336
+ if (n) {
337
+ if (n === "md" || n === "markdown" || n === "mdx")
338
+ return /* @__PURE__ */ i.jsx(xt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
339
+ if (n === "pdf")
340
+ return /* @__PURE__ */ i.jsx(vt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
341
+ if (["xls", "xlsx", "xlsm", "xlsb", "ods"].includes(n))
342
+ return /* @__PURE__ */ i.jsx(bt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
343
+ if (["csv", "tsv"].includes(n))
344
+ return /* @__PURE__ */ i.jsx(gt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
345
+ if (["doc", "docx", "rtf", "odt"].includes(n))
346
+ return /* @__PURE__ */ i.jsx(wt, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
347
+ if (["ppt", "pptx", "odp"].includes(n))
348
+ return /* @__PURE__ */ i.jsx(kt, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
349
+ if (["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp", "tiff", "avif"].includes(n))
350
+ return /* @__PURE__ */ i.jsx(Nt, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
351
+ if (["js", "mjs", "cjs", "ts", "tsx", "jsx", "json", "html", "htm", "css", "scss", "py", "go", "rs", "c", "cpp", "h", "hpp", "sh", "bash", "yaml", "yml", "sql", "xml", "toml"].includes(
352
+ n
353
+ ))
354
+ return /* @__PURE__ */ i.jsx(jt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
355
+ if (["mp3", "wav", "ogg", "m4a", "flac", "aac", "wma"].includes(n))
356
+ return /* @__PURE__ */ i.jsx(Et, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
357
+ if (["mp4", "webm", "mov", "avi", "mkv", "wmv", "flv"].includes(n))
358
+ return /* @__PURE__ */ i.jsx(St, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
359
+ if (["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"].includes(n))
360
+ return /* @__PURE__ */ i.jsx(It, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
361
+ if (["txt", "log"].includes(n))
362
+ return /* @__PURE__ */ i.jsx(Tt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
363
+ }
364
+ return /* @__PURE__ */ i.jsx(or, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
365
+ }, Lt = (e, t) => {
366
+ const { entry: a, isDirectory: n, isExpanded: r, extension: o, mimeType: l } = e;
367
+ let d;
368
+ const w = l || a.mimeType;
369
+ return a.icon !== void 0 ? d = a.icon : n ? d = r && t?.directoryExpanded || t?.directory || /* @__PURE__ */ i.jsx(nr, { className: "h-4 w-4" }) : o && t?.fileByExtension?.[o] ? d = t.fileByExtension[o] : d = t?.file || dr(w, o, a.name), We(typeof d == "function" ? d(e) : d, a.absolutePath);
370
+ }, ur = 500, Ft = ({ entry: e, isDirectory: t, isExpanded: a, isItemSelected: n, selectionMode: r, onSelectionChange: o, onEntryClick: l, toggleDirectory: d, onToggleDirectoryRecursive: w }) => {
371
+ const x = ie(null);
372
+ return ce(
311
373
  () => () => {
312
- v.current && window.clearTimeout(v.current);
374
+ x.current && window.clearTimeout(x.current);
313
375
  },
314
376
  []
315
- ), F(
316
- (i) => {
317
- i.stopPropagation(), s !== "none" && !t && l && l(e, !n);
318
- let f = !1;
319
- a({
377
+ ), B(
378
+ (c) => {
379
+ c.stopPropagation(), r !== "none" && !t && o && o(e, !n);
380
+ let h = !1;
381
+ l({
320
382
  entry: e,
321
383
  isDirectory: t,
322
- isExpanded: o,
384
+ isExpanded: a,
323
385
  preventDefault: () => {
324
- f = !0;
386
+ h = !0;
325
387
  }
326
- }), !(!t || f) && (v.current ? (window.clearTimeout(v.current), v.current = null, E(e)) : v.current = window.setTimeout(() => {
327
- m(e.absolutePath), v.current = null;
328
- }, Xt));
388
+ }), !(!t || h) && (x.current ? (window.clearTimeout(x.current), x.current = null, w(e)) : x.current = window.setTimeout(() => {
389
+ d(e.absolutePath), x.current = null;
390
+ }, ur));
329
391
  },
330
- [t, e, o, E, m, a, s, l, n]
392
+ [t, e, a, w, d, l, r, o, n]
331
393
  );
332
- }, Nt = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", pt = (e, t) => e.children !== void 0 && t(e.absolutePath), St = (e, t) => ({
394
+ }, $t = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", Mt = (e, t) => e.children !== void 0 && t(e.absolutePath), Ht = (e, t) => ({
333
395
  width: e,
334
396
  gridTemplateColumns: t
335
- }), It = We(
397
+ }), Wt = Ye(
336
398
  ({
337
399
  entry: e,
338
400
  indentLevel: t,
339
- rowHeight: o,
401
+ rowHeight: a,
340
402
  isDirOpen: n,
341
- columns: s,
342
- numericTemplate: l,
343
- numericTotal: a,
344
- nameWidth: m,
345
- rowClassName: E,
346
- selection: { onEntryClick: v, selectedPath: i, mode: f = "none", selectedItems: g, onSelectionChange: w },
347
- expansion: { toggleDirectory: I, onToggleDirectoryRecursive: c },
348
- visual: { iconOverrides: d, showExpandIcons: b = !0, showDirectoryIcons: O = !0, showFileIcons: x = !0, useCanvasExpandIcons: N = !1, expandIconSize: h, highlightStyles: R }
403
+ columns: r,
404
+ numericTemplate: o,
405
+ numericTotal: l,
406
+ nameWidth: d,
407
+ rowClassName: w,
408
+ selection: { onEntryClick: x, selectedPath: c, mode: h = "none", selectedItems: b, onSelectionChange: k },
409
+ expansion: { toggleDirectory: S, onToggleDirectoryRecursive: u },
410
+ visual: { iconOverrides: f, showExpandIcons: v = !0, showDirectoryIcons: O = !0, showFileIcons: g = !0, useCanvasExpandIcons: N = !1, expandIconSize: p, highlightStyles: R }
349
411
  }) => {
350
- const [$, D] = ne(!1), k = e.children !== void 0, G = k && n(e.absolutePath), W = e.absolutePath === i, L = !k && !!g?.has(e.absolutePath), ee = k ? void 0 : gt(e.name), z = wt({ entry: e, isDirectory: k, isExpanded: G, isItemSelected: L, selectionMode: f, onSelectionChange: w, onEntryClick: v, toggleDirectory: I, onToggleDirectoryRecursive: c }), J = $ ? R?.hoverClassName !== void 0 ? R.hoverClassName : A.entryHover : "", C = (() => {
351
- if (k) {
352
- if (W) return R?.directorySelectedClassName !== void 0 ? R.directorySelectedClassName : A.entrySelected;
353
- } else if (W || L)
354
- return R?.itemSelectedClassName !== void 0 ? R.itemSelectedClassName : P(W && A.entrySelected, L && A.entryItemSelected);
412
+ const [$, D] = se(!1), I = e.children !== void 0, z = I && n(e.absolutePath), H = e.absolutePath === c, L = !I && !!b?.has(e.absolutePath), te = I ? void 0 : xe(e.name) || xe(e.relativePath) || xe(e.absolutePath), X = Ft({ entry: e, isDirectory: I, isExpanded: z, isItemSelected: L, selectionMode: h, onSelectionChange: k, onEntryClick: x, toggleDirectory: S, onToggleDirectoryRecursive: u }), Z = $ ? R?.hoverClassName !== void 0 ? R.hoverClassName : A.entryHover : "", C = (() => {
413
+ if (I) {
414
+ if (H) return R?.directorySelectedClassName !== void 0 ? R.directorySelectedClassName : A.entrySelected;
415
+ } else if (H || L)
416
+ return R?.itemSelectedClassName !== void 0 ? R.itemSelectedClassName : M(H && A.entrySelected, L && A.entryItemSelected);
355
417
  return "";
356
- })(), U = typeof E == "function" ? E(e) : E, S = P("dt-grid-row cursor-pointer select-none", J, C, U, e.className), H = P(A.expandIcon, (W || L) && A.expandIconSelected), se = P(A.typeIcon, (W || L) && A.typeIconSelected), r = P("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", k && A.nameDirectory, (W || L) && A.nameSelected), p = xt({ isDirectory: k, isExpanded: G, showExpandIcons: b, useCanvasExpandIcons: N, expandIconSize: h }), T = (k ? O : x) ? Et({ entry: e, isDirectory: k, isExpanded: G, isSelected: W, isItemSelected: L, extension: ee }, d) : null, _ = { indentLevel: t, isDirectory: k, isExpanded: G }, [q, ...Z] = s, j = q?.render ? q.render(e, _) : e.label ?? e.name, Q = {
418
+ })(), G = typeof w == "function" ? w(e) : w, E = M("dt-grid-row cursor-pointer select-none", Z, C, G, e.className), F = M(A.expandIcon, (H || L) && A.expandIconSelected), ae = M(A.typeIcon, (H || L) && A.typeIconSelected), s = M("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", I && A.nameDirectory, (H || L) && A.nameSelected), y = Dt({ isDirectory: I, isExpanded: z, showExpandIcons: v, useCanvasExpandIcons: N, expandIconSize: p }), j = (I ? O : g) ? Lt({ entry: e, isDirectory: I, isExpanded: z, isSelected: H, isItemSelected: L, extension: te, mimeType: e.mimeType }, f) : null, _ = { indentLevel: t, isDirectory: I, isExpanded: z }, [Q, ...K] = r, P = Q?.render ? Q.render(e, _) : e.label ?? e.name, ee = {
357
419
  ...$ ? R?.hoverStyle : {},
358
- ...k && W ? R?.directorySelectedStyle : {},
359
- ...!k && (W || L) ? R?.itemSelectedStyle : {}
420
+ ...I && H ? R?.directorySelectedStyle : {},
421
+ ...!I && (H || L) ? R?.itemSelectedStyle : {}
360
422
  };
361
- return /* @__PURE__ */ y.jsxs(
423
+ return /* @__PURE__ */ i.jsxs(
362
424
  "div",
363
425
  {
364
- className: S,
365
- style: { height: o, ...Q, ...e.style },
426
+ className: E,
427
+ style: { height: a, ...ee, ...e.style },
366
428
  role: "row",
367
- "aria-expanded": k ? G : void 0,
429
+ "aria-expanded": I ? z : void 0,
368
430
  "aria-level": t + 1,
369
- "data-entry-type": k ? "directory" : "file",
370
- "data-entry-expanded": k ? String(G) : void 0,
371
- "data-entry-selected": W ? "true" : void 0,
431
+ "data-entry-type": I ? "directory" : "file",
432
+ "data-entry-expanded": I ? String(z) : void 0,
433
+ "data-entry-selected": H ? "true" : void 0,
372
434
  "data-entry-item-selected": L ? "true" : void 0,
373
- onClick: z,
435
+ onClick: X,
374
436
  onMouseEnter: () => D(!0),
375
437
  onMouseLeave: () => D(!1),
376
- onKeyDown: (B) => B.key === "Enter" && z(B),
438
+ onKeyDown: (Y) => Y.key === "Enter" && X(Y),
377
439
  tabIndex: 0,
378
440
  children: [
379
- /* @__PURE__ */ y.jsxs("div", { className: P("dt-grid-name-cell", q?.className), role: "gridcell", style: { width: m, paddingLeft: Math.max(0, t * be) }, children: [
380
- (b || N) && /* @__PURE__ */ y.jsx("span", { className: H, children: p }),
381
- (k ? O : x) && /* @__PURE__ */ y.jsx("span", { className: se, children: T }),
382
- /* @__PURE__ */ y.jsx("span", { className: r, children: j })
441
+ /* @__PURE__ */ i.jsxs("div", { className: M("dt-grid-name-cell", Q?.className), role: "gridcell", style: { width: d, paddingLeft: Math.max(0, t * ke) }, children: [
442
+ (v || N) && /* @__PURE__ */ i.jsx("span", { className: F, children: y }),
443
+ (I ? O : g) && /* @__PURE__ */ i.jsx("span", { className: ae, children: j }),
444
+ /* @__PURE__ */ i.jsx("span", { className: s, children: P })
383
445
  ] }),
384
- Z.length > 0 && /* @__PURE__ */ y.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ y.jsx("div", { className: "dt-grid-numeric-track", style: St(a, l), children: Z.map((B) => /* @__PURE__ */ y.jsx("div", { className: P("dt-grid-cell", Nt(B.align), B.className), role: "gridcell", children: B.render ? B.render(e, _) : null }, B.key)) }) })
446
+ K.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Ht(l, o), children: K.map((Y) => /* @__PURE__ */ i.jsx("div", { className: M("dt-grid-cell", $t(Y.align), Y.className), role: "gridcell", children: Y.render ? Y.render(e, _) : null }, Y.key)) }) })
385
447
  ]
386
448
  }
387
449
  );
388
450
  },
389
451
  (e, t) => {
390
452
  if (e.entry !== t.entry) return !1;
391
- const o = pt(e.entry, e.isDirOpen), n = pt(t.entry, t.isDirOpen);
392
- return e.indentLevel === t.indentLevel && e.rowHeight === t.rowHeight && o === 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;
453
+ const a = Mt(e.entry, e.isDirOpen), n = Mt(t.entry, t.isDirOpen);
454
+ 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;
393
455
  }
394
456
  );
395
- It.displayName = "DirectoryTreeGridRow";
396
- const kt = ({
457
+ Wt.displayName = "DirectoryTreeGridRow";
458
+ const Bt = ({
397
459
  kind: e,
398
460
  columns: t,
399
- numericTemplate: o,
461
+ numericTemplate: a,
400
462
  numericTotal: n,
401
- nameWidth: s,
402
- scrollBarWidth: l,
403
- className: a,
404
- nameContent: m,
405
- renderCell: E
463
+ nameWidth: r,
464
+ scrollBarWidth: o,
465
+ className: l,
466
+ nameContent: d,
467
+ renderCell: w
406
468
  }) => {
407
- const [, ...v] = t, i = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", f = e === "header" ? "dt-grid-header" : "dt-grid-footer", g = e === "header" ? "columnheader" : "gridcell";
408
- return /* @__PURE__ */ y.jsxs("div", { className: P(f, "text-gray-600 dark:text-gray-300", a), role: "row", children: [
409
- /* @__PURE__ */ y.jsx("div", { className: P(i, "px-1", t[0]?.className), role: g, style: { width: s }, children: m }),
410
- v.length > 0 && /* @__PURE__ */ y.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ y.jsx("div", { className: "dt-grid-numeric-track", style: St(n, o), children: v.map((w) => /* @__PURE__ */ y.jsx("div", { className: P("dt-grid-cell", Nt(w.align), w.className), role: g, children: E(w) }, w.key)) }) }),
411
- /* @__PURE__ */ y.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: l }, "aria-hidden": "true" })
469
+ const [, ...x] = t, c = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", h = e === "header" ? "dt-grid-header" : "dt-grid-footer", b = e === "header" ? "columnheader" : "gridcell";
470
+ return /* @__PURE__ */ i.jsxs("div", { className: M(h, "text-gray-600 dark:text-gray-300", l), role: "row", children: [
471
+ /* @__PURE__ */ i.jsx("div", { className: M(c, "px-1", t[0]?.className), role: b, style: { width: r }, children: d }),
472
+ x.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Ht(n, a), children: x.map((k) => /* @__PURE__ */ i.jsx("div", { className: M("dt-grid-cell", $t(k.align), k.className), role: b, children: w(k) }, k.key)) }) }),
473
+ /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: o }, "aria-hidden": "true" })
412
474
  ] });
413
- }, Jt = ({ columns: e, className: t, ...o }) => /* @__PURE__ */ y.jsx(kt, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...o }), vt = (e, t) => typeof e == "function" ? e(t) : e ?? null, qt = ({ columns: e, allEntries: t, className: o, ...n }) => /* @__PURE__ */ y.jsx(kt, { kind: "footer", columns: e, className: o, nameContent: vt(e[0]?.footer, t), renderCell: (s) => vt(s.footer, t), ...n }), Zt = 240, Tt = 96, Rt = 12, $e = (e, t) => {
414
- const o = e?.width;
415
- return typeof o == "number" && Number.isFinite(o) && o > 0 ? o : t;
416
- }, Qt = (e) => e.slice(1).map((t) => `${$e(t, Tt)}px`).join(" "), Kt = ({ measuredWidth: e, columns: t, scrollBarWidth: o = Rt }) => {
417
- const n = $e(t[0], Zt), s = t.slice(1).reduce((E, v) => E + $e(v, Tt), 0), l = Number.isFinite(e) && e > 0 ? e : 0, a = Math.max(0, l - n - Math.max(0, o)), m = Math.max(0, s - a);
418
- return { nameWidth: n, numericTotal: s, numericVisible: a, maxHScroll: m };
419
- }, Le = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, er = (e) => {
420
- const t = [], o = (n) => {
421
- for (const s of n)
422
- t.push(s), s.children && s.children.length > 0 && o(s.children);
475
+ }, mr = ({ columns: e, className: t, ...a }) => /* @__PURE__ */ i.jsx(Bt, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...a }), At = (e, t) => typeof e == "function" ? e(t) : e ?? null, fr = ({ columns: e, allEntries: t, className: a, ...n }) => /* @__PURE__ */ i.jsx(Bt, { kind: "footer", columns: e, className: a, nameContent: At(e[0]?.footer, t), renderCell: (r) => At(r.footer, t), ...n }), hr = 240, Yt = 96, zt = 12, Be = (e, t) => {
476
+ const a = e?.width;
477
+ return typeof a == "number" && Number.isFinite(a) && a > 0 ? a : t;
478
+ }, pr = (e) => e.slice(1).map((t) => `${Be(t, Yt)}px`).join(" "), yr = ({ measuredWidth: e, columns: t, scrollBarWidth: a = zt }) => {
479
+ const n = Be(t[0], hr), r = t.slice(1).reduce((w, x) => w + Be(x, Yt), 0), o = Number.isFinite(e) && e > 0 ? e : 0, l = Math.max(0, o - n - Math.max(0, a)), d = Math.max(0, r - l);
480
+ return { nameWidth: n, numericTotal: r, numericVisible: l, maxHScroll: d };
481
+ }, He = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, xr = (e) => {
482
+ const t = [], a = (n) => {
483
+ for (const r of n)
484
+ t.push(r), r.children && r.children.length > 0 && a(r.children);
423
485
  };
424
- return o(e), t;
425
- }, tr = (e, t, o) => {
486
+ return a(e), t;
487
+ }, vr = (e, t) => {
488
+ const a = e.length - 1;
489
+ if (a <= 0) return 0;
490
+ let n = 0, r = a - 1, o = 0;
491
+ for (; n <= r; ) {
492
+ const l = n + r >>> 1;
493
+ e[l] <= t ? (o = l, n = l + 1) : r = l - 1;
494
+ }
495
+ return o;
496
+ }, br = (e, t, a) => {
497
+ if (a <= 0 || e.length === 0 || t.length !== e.length + 1)
498
+ return null;
499
+ const n = vr(t, a), r = e[n];
500
+ return r ? {
501
+ path: r.entry.absolutePath,
502
+ offsetInViewport: a - t[n]
503
+ } : null;
504
+ }, gr = (e, t, a) => {
505
+ if (t.length === 0 || a.length !== t.length + 1)
506
+ return null;
507
+ for (let n = 0; n < t.length; n++)
508
+ if (t[n].entry.absolutePath === e.path)
509
+ return Math.max(0, a[n] + e.offsetInViewport);
510
+ return null;
511
+ }, wr = (e, t, a) => {
426
512
  const n = [];
427
- for (let s = t; s < o; s++) {
428
- const l = e[s];
429
- if (!(!l || l.length === 0))
430
- for (const a of l)
431
- n.push(a);
513
+ for (let r = t; r < a; r++) {
514
+ const o = e[r];
515
+ if (!(!o || o.length === 0))
516
+ for (const l of o)
517
+ n.push(l);
432
518
  }
433
519
  return n;
434
- }, rr = (e, t, o) => {
520
+ }, kr = (e, t, a) => {
435
521
  const n = [];
436
- for (let s = t; s < o; s++) {
437
- const l = e[s];
438
- if (!(!l || l.length === 0))
439
- for (const a of l)
440
- n.push(a);
522
+ for (let r = t; r < a; r++) {
523
+ const o = e[r];
524
+ if (!(!o || o.length === 0))
525
+ for (const l of o)
526
+ n.push(l);
441
527
  }
442
528
  return n;
443
- }, nr = (e, t, o, n) => {
444
- const s = Math.max(1, Math.floor(t * n)), l = Math.max(1, Math.floor(o * n));
445
- (e.width !== s || e.height !== l) && (e.width = s, e.height = l);
446
- const a = e.style;
447
- a.width !== `${t}px` && (a.width = `${t}px`), a.height !== `${o}px` && (a.height = `${o}px`);
448
- }, sr = (e, t, o) => {
449
- e.lineWidth = o, e.beginPath();
529
+ }, Nr = (e, t, a, n) => {
530
+ const r = Math.max(1, Math.floor(t * n)), o = Math.max(1, Math.floor(a * n));
531
+ (e.width !== r || e.height !== o) && (e.width = r, e.height = o);
532
+ const l = e.style;
533
+ l.width !== `${t}px` && (l.width = `${t}px`), l.height !== `${a}px` && (l.height = `${a}px`);
534
+ }, Er = (e, t, a) => {
535
+ e.lineWidth = a, e.beginPath();
450
536
  for (const n of t)
451
537
  e.moveTo(n.x1, n.y1), e.lineTo(n.x2, n.y2);
452
538
  e.stroke();
453
- }, or = (e, t) => {
454
- const o = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
455
- if (!o)
539
+ }, Sr = (e, t) => {
540
+ const a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
541
+ if (!a)
456
542
  return null;
457
- let n = o[1];
458
- n.length === 3 && (n = n.split("").map((m) => m + m).join(""));
459
- const s = Number.parseInt(n.slice(0, 2), 16), l = Number.parseInt(n.slice(2, 4), 16), a = Number.parseInt(n.slice(4, 6), 16);
460
- return `rgba(${s}, ${l}, ${a}, ${t})`;
461
- }, ar = (e, t, o, n) => {
543
+ let n = a[1];
544
+ n.length === 3 && (n = n.split("").map((d) => d + d).join(""));
545
+ const r = Number.parseInt(n.slice(0, 2), 16), o = Number.parseInt(n.slice(2, 4), 16), l = Number.parseInt(n.slice(4, 6), 16);
546
+ return `rgba(${r}, ${o}, ${l}, ${t})`;
547
+ }, Ir = (e, t, a, n) => {
462
548
  if (t.length === 0)
463
549
  return;
464
- const s = or(o, 0.14), l = e.strokeStyle, a = e.fillStyle, m = e.lineWidth, E = e.lineCap, v = e.lineJoin;
465
- e.strokeStyle = o, e.lineCap = "round", e.lineJoin = "round";
466
- for (const i of t) {
467
- const f = n ?? i.size, g = Math.max(0, f / 2), w = Math.max(1, Math.round(f * 0.08)), I = Math.max(1, Math.round(f * 0.14)), c = Math.max(0, g - w * 0.8), d = Math.max(0, c * 0.55);
468
- s && (e.fillStyle = s, e.beginPath(), e.arc(i.centerX, i.centerY, c, 0, Math.PI * 2), e.fill()), e.lineWidth = w, e.beginPath(), e.arc(i.centerX, i.centerY, Math.max(0, g - w * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = I, e.beginPath(), e.moveTo(i.centerX - d, i.centerY), e.lineTo(i.centerX + d, i.centerY), e.stroke(), i.isExpanded || (e.beginPath(), e.moveTo(i.centerX, i.centerY - d), e.lineTo(i.centerX, i.centerY + d), e.stroke());
550
+ const r = Sr(a, 0.14), o = e.strokeStyle, l = e.fillStyle, d = e.lineWidth, w = e.lineCap, x = e.lineJoin;
551
+ e.strokeStyle = a, e.lineCap = "round", e.lineJoin = "round";
552
+ for (const c of t) {
553
+ const h = n ?? c.size, b = Math.max(0, h / 2), k = Math.max(1, Math.round(h * 0.08)), S = Math.max(1, Math.round(h * 0.14)), u = Math.max(0, b - k * 0.8), f = Math.max(0, u * 0.55);
554
+ r && (e.fillStyle = r, e.beginPath(), e.arc(c.centerX, c.centerY, u, 0, Math.PI * 2), e.fill()), e.lineWidth = k, e.beginPath(), e.arc(c.centerX, c.centerY, Math.max(0, b - k * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = S, e.beginPath(), e.moveTo(c.centerX - f, c.centerY), e.lineTo(c.centerX + f, c.centerY), e.stroke(), c.isExpanded || (e.beginPath(), e.moveTo(c.centerX, c.centerY - f), e.lineTo(c.centerX, c.centerY + f), e.stroke());
469
555
  }
470
- e.strokeStyle = l, e.fillStyle = a, e.lineWidth = m, e.lineCap = E, e.lineJoin = v;
471
- }, Ct = We(({ segmentsByItem: e, glyphsByItem: t, itemHeight: o, width: n, viewportHeight: s, scrollPosition: l, color: a = "#a0aec0", strokeWidth: m = 1, renderStartIndex: E, renderEndIndex: v, lookaheadEndIndex: i, devicePixelRatio: f, expandGlyphColor: g, expandGlyphSize: w }) => {
472
- const I = he(null), c = he(null), d = he({
556
+ e.strokeStyle = o, e.fillStyle = l, e.lineWidth = d, e.lineCap = w, e.lineJoin = x;
557
+ }, Gt = Ye(({ segmentsByItem: e, glyphsByItem: t, itemHeight: a, width: n, viewportHeight: r, scrollPosition: o, color: l = "#a0aec0", strokeWidth: d = 1, renderStartIndex: w, renderEndIndex: x, lookaheadEndIndex: c, devicePixelRatio: h, expandGlyphColor: b, expandGlyphSize: k }) => {
558
+ const S = ie(null), u = ie(null), f = ie({
473
559
  segmentsByItem: e,
474
560
  glyphsByItem: t,
475
- itemHeight: o,
561
+ itemHeight: a,
476
562
  width: n,
477
- viewportHeight: s,
478
- scrollPosition: l,
479
- color: a,
480
- strokeWidth: m,
481
- renderStartIndex: E,
482
- renderEndIndex: v,
483
- lookaheadEndIndex: i,
484
- devicePixelRatio: f,
485
- expandGlyphColor: g,
486
- expandGlyphSize: w
487
- }), b = F(() => {
488
- c.current = null;
489
- const x = I.current;
490
- if (!x)
563
+ viewportHeight: r,
564
+ scrollPosition: o,
565
+ color: l,
566
+ strokeWidth: d,
567
+ renderStartIndex: w,
568
+ renderEndIndex: x,
569
+ lookaheadEndIndex: c,
570
+ devicePixelRatio: h,
571
+ expandGlyphColor: b,
572
+ expandGlyphSize: k
573
+ }), v = B(() => {
574
+ u.current = null;
575
+ const g = S.current;
576
+ if (!g)
491
577
  return;
492
- const N = x.getContext("2d");
578
+ const N = g.getContext("2d");
493
579
  if (!N)
494
580
  return;
495
- const h = d.current;
496
- if (h.width <= 0 || h.viewportHeight <= 0) {
497
- N.clearRect(0, 0, x.width, x.height);
581
+ const p = f.current;
582
+ if (p.width <= 0 || p.viewportHeight <= 0) {
583
+ N.clearRect(0, 0, g.width, g.height);
498
584
  return;
499
585
  }
500
- const R = Number.isFinite(h.devicePixelRatio ?? NaN) ? h.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
501
- nr(x, h.width, h.viewportHeight, R);
502
- const $ = h.segmentsByItem.length, D = typeof h.renderStartIndex == "number" && Number.isFinite(h.renderStartIndex) ? Math.max(0, Math.floor(h.renderStartIndex)) : Math.max(0, Math.floor(h.scrollPosition / h.itemHeight)), k = Math.min($, Math.ceil((h.scrollPosition + h.viewportHeight) / h.itemHeight)), G = (() => {
503
- if (typeof h.renderEndIndex == "number" && Number.isFinite(h.renderEndIndex)) {
504
- const z = Math.floor(h.renderEndIndex);
505
- return Math.max(Math.min($, z + 1), D);
586
+ const R = Number.isFinite(p.devicePixelRatio ?? NaN) ? p.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
587
+ Nr(g, p.width, p.viewportHeight, R);
588
+ const $ = p.segmentsByItem.length, D = typeof p.renderStartIndex == "number" && Number.isFinite(p.renderStartIndex) ? Math.max(0, Math.floor(p.renderStartIndex)) : Math.max(0, Math.floor(p.scrollPosition / p.itemHeight)), I = Math.min($, Math.ceil((p.scrollPosition + p.viewportHeight) / p.itemHeight)), z = (() => {
589
+ if (typeof p.renderEndIndex == "number" && Number.isFinite(p.renderEndIndex)) {
590
+ const X = Math.floor(p.renderEndIndex);
591
+ return Math.max(Math.min($, X + 1), D);
506
592
  }
507
- return Math.max(k, D);
508
- })(), W = (() => {
509
- if (typeof h.lookaheadEndIndex == "number" && Number.isFinite(h.lookaheadEndIndex)) {
510
- const z = Math.floor(h.lookaheadEndIndex), J = Math.min($, z + 1);
511
- return Math.max(J, G);
593
+ return Math.max(I, D);
594
+ })(), H = (() => {
595
+ if (typeof p.lookaheadEndIndex == "number" && Number.isFinite(p.lookaheadEndIndex)) {
596
+ const X = Math.floor(p.lookaheadEndIndex), Z = Math.min($, X + 1);
597
+ return Math.max(Z, z);
512
598
  }
513
- return Math.max(k, G);
514
- })(), L = tr(h.segmentsByItem, D, W), ee = rr(h.glyphsByItem, D, W);
515
- N.save(), N.scale(R, R), N.clearRect(0, 0, h.width, h.viewportHeight), N.translate(0, -h.scrollPosition), N.strokeStyle = h.color, sr(N, L, h.strokeWidth), ar(N, ee, h.expandGlyphColor ?? h.color, h.expandGlyphSize), N.restore();
516
- }, []), O = F(() => {
517
- c.current === null && (c.current = window.requestAnimationFrame(b));
518
- }, [b]);
519
- return ae(() => {
520
- d.current = {
599
+ return Math.max(I, z);
600
+ })(), L = wr(p.segmentsByItem, D, H), te = kr(p.glyphsByItem, D, H);
601
+ N.save(), N.scale(R, R), N.clearRect(0, 0, p.width, p.viewportHeight), N.translate(0, -p.scrollPosition), N.strokeStyle = p.color, Er(N, L, p.strokeWidth), Ir(N, te, p.expandGlyphColor ?? p.color, p.expandGlyphSize), N.restore();
602
+ }, []), O = B(() => {
603
+ u.current === null && (u.current = window.requestAnimationFrame(v));
604
+ }, [v]);
605
+ return ce(() => {
606
+ f.current = {
521
607
  segmentsByItem: e,
522
608
  glyphsByItem: t,
523
- itemHeight: o,
609
+ itemHeight: a,
524
610
  width: n,
525
- viewportHeight: s,
526
- scrollPosition: l,
527
- color: a,
528
- strokeWidth: m,
529
- renderStartIndex: E,
530
- renderEndIndex: v,
531
- lookaheadEndIndex: i,
532
- devicePixelRatio: f,
533
- expandGlyphColor: g,
534
- expandGlyphSize: w
611
+ viewportHeight: r,
612
+ scrollPosition: o,
613
+ color: l,
614
+ strokeWidth: d,
615
+ renderStartIndex: w,
616
+ renderEndIndex: x,
617
+ lookaheadEndIndex: c,
618
+ devicePixelRatio: h,
619
+ expandGlyphColor: b,
620
+ expandGlyphSize: k
535
621
  }, O();
536
- }, [e, t, o, n, s, l, a, m, E, v, i, f, g, w, O]), ae(() => () => {
537
- c.current !== null && (window.cancelAnimationFrame(c.current), c.current = null);
538
- }, []), /* @__PURE__ */ y.jsx("canvas", { ref: I, className: "pointer-events-none absolute top-0 left-0 z-0" });
622
+ }, [e, t, a, n, r, o, l, d, w, x, c, h, b, k, O]), ce(() => () => {
623
+ u.current !== null && (window.cancelAnimationFrame(u.current), u.current = null);
624
+ }, []), /* @__PURE__ */ i.jsx("canvas", { ref: S, className: "pointer-events-none absolute top-0 left-0 z-0" });
539
625
  });
540
- Ct.displayName = "TreeLineCanvas";
541
- const lr = {
626
+ Gt.displayName = "TreeLineCanvas";
627
+ const jr = {
542
628
  msOverflowStyle: "none",
543
629
  scrollbarWidth: "none"
544
- }, ir = () => {
630
+ }, Tr = () => {
545
631
  let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
546
632
  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));
547
- }, cr = (e, t, o, n) => {
548
- const s = [], l = [];
549
- let a = 0;
550
- const m = (E, v, i) => {
551
- for (let f = 0; f < E.length; f++) {
552
- const g = E[f], w = f === E.length - 1, I = [...i, w], c = g.children !== void 0, d = c && t(g.absolutePath, g.relativePath);
553
- let b = v, O = I, x = i;
554
- n && (b = v - 1, O = I.slice(1), x = i.slice(1)), s.push({ entry: g, indentLevel: b, parentIsLast: O }), o && (b > a && (a = b), l.push({
555
- id: g.absolutePath,
556
- name: g.name,
557
- absolutePath: g.absolutePath,
558
- indentLevel: b,
559
- isLastChild: w,
560
- isDirectory: c,
561
- isExpanded: d,
562
- ancestorIsLast: [...x],
563
- hideLines: n && v === 0
564
- })), c && d && g.children && m(g.children, v + 1, I);
633
+ }, Rr = (e, t, a, n) => {
634
+ const r = [], o = [];
635
+ let l = 0;
636
+ const d = (w, x, c) => {
637
+ for (let h = 0; h < w.length; h++) {
638
+ const b = w[h], k = h === w.length - 1, S = [...c, k], u = b.children !== void 0, f = u && t(b.absolutePath, b.relativePath);
639
+ let v = x, O = S, g = c;
640
+ n && (v = x - 1, O = S.slice(1), g = c.slice(1)), r.push({ entry: b, indentLevel: v, parentIsLast: O }), a && (v > l && (l = v), o.push({
641
+ id: b.absolutePath,
642
+ name: b.name,
643
+ absolutePath: b.absolutePath,
644
+ indentLevel: v,
645
+ isLastChild: k,
646
+ isDirectory: u,
647
+ isExpanded: f,
648
+ ancestorIsLast: [...g],
649
+ hideLines: n && x === 0
650
+ })), u && f && b.children && d(b.children, x + 1, S);
565
651
  }
566
652
  };
567
- return m(e, 0, []), { flatItems: s, lineItems: l, maxIndent: a };
568
- }, bt = (e, t) => {
569
- const o = e.length - 1;
570
- if (o <= 0) return 0;
571
- let n = 0, s = o - 1, l = 0;
572
- for (; n <= s; ) {
573
- const a = n + s >>> 1;
574
- e[a] <= t ? (l = a, n = a + 1) : s = a - 1;
653
+ return d(e, 0, []), { flatItems: r, lineItems: o, maxIndent: l };
654
+ }, Ot = (e, t) => {
655
+ const a = e.length - 1;
656
+ if (a <= 0) return 0;
657
+ let n = 0, r = a - 1, o = 0;
658
+ for (; n <= r; ) {
659
+ const l = n + r >>> 1;
660
+ e[l] <= t ? (o = l, n = l + 1) : r = l - 1;
575
661
  }
576
- return l;
577
- }, dr = (e, t, o, n, s, l) => {
578
- const a = n?.renderStart ?? Math.max(0, bt(l, s)), m = t > 0 ? bt(l, s + t) + o : a + o, E = e > 0 ? Math.min(e - 1, Math.max(a, m)) : a, v = n?.renderEnd ?? E, i = e > 0 ? Math.min(e - 1, v + o) : v;
579
- return { renderStart: a, renderEnd: v, lookaheadEnd: i };
580
- }, ur = (e, t, o, n, s, l) => {
662
+ return o;
663
+ }, Cr = (e, t, a, n, r, o) => {
664
+ const l = n?.renderStart ?? Math.max(0, Ot(o, r)), d = t > 0 ? Ot(o, r + t) + a : l + a, w = e > 0 ? Math.min(e - 1, Math.max(l, d)) : l, x = n?.renderEnd ?? w, c = e > 0 ? Math.min(e - 1, x + a) : x;
665
+ return { renderStart: l, renderEnd: x, lookaheadEnd: c };
666
+ }, _r = (e, t, a, n, r, o) => {
581
667
  if (e.length === 0)
582
668
  return { segmentsByItem: [], glyphsByItem: [] };
583
- const a = 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 * 0.9, i * 0.7)) : 0, v = 3;
584
- for (let i = 0; i < e.length; i++) {
585
- const f = e[i];
586
- if (f.hideLines)
669
+ const l = Array.from({ length: e.length }, () => []), d = Array.from({ length: e.length }, () => []), w = (c) => r ? typeof o == "number" && Number.isFinite(o) && o > 0 ? o : Math.max(8, Math.min(n * 0.9, c * 0.7)) : 0, x = 3;
670
+ for (let c = 0; c < e.length; c++) {
671
+ const h = e[c];
672
+ if (h.hideLines)
587
673
  continue;
588
- const g = [], w = t[i] ?? 0, I = o[i] ?? 0, c = I + w / 2, d = E(w), b = d > 0 ? d / 2 + 2 : n / 1.5;
589
- for (let N = 0; N < f.indentLevel; N++) {
590
- if (f.ancestorIsLast[N] ?? !1)
674
+ const b = [], k = t[c] ?? 0, S = a[c] ?? 0, u = S + k / 2, f = w(k), v = f > 0 ? f / 2 + 2 : n / 1.5;
675
+ for (let N = 0; N < h.indentLevel; N++) {
676
+ if (h.ancestorIsLast[N] ?? !1)
591
677
  continue;
592
678
  let R = !1;
593
- for (let $ = i; $ < e.length; $++) {
679
+ for (let $ = c; $ < e.length; $++) {
594
680
  const D = e[$];
595
681
  if (D.indentLevel > N && D.ancestorIsLast.length > N && !D.ancestorIsLast[N]) {
596
682
  R = !0;
597
683
  break;
598
684
  }
599
- if ($ > i && D.indentLevel === N)
685
+ if ($ > c && D.indentLevel === N)
600
686
  break;
601
687
  }
602
688
  if (R) {
603
- const $ = N * n + n / 2 + v;
604
- g.push({
605
- key: `${f.id}-ancestor-${N}`,
689
+ const $ = N * n + n / 2 + x;
690
+ b.push({
691
+ key: `${h.id}-ancestor-${N}`,
606
692
  x1: $,
607
- y1: I,
693
+ y1: S,
608
694
  x2: $,
609
- y2: I + w,
610
- itemIndex: i
695
+ y2: S + k,
696
+ itemIndex: c
611
697
  });
612
698
  }
613
699
  }
614
- const O = f.indentLevel * n, x = O + n / 2 + v;
615
- if (f.isDirectory ? g.push({
616
- key: `${f.id}-connector-top`,
617
- x1: x,
618
- y1: I,
619
- x2: x,
620
- y2: c - b,
621
- itemIndex: i
622
- }) : g.push({
623
- key: `${f.id}-connector-top`,
624
- x1: x,
625
- y1: I,
626
- x2: x,
627
- y2: c,
628
- itemIndex: i
629
- }), !f.isDirectory && f.isLastChild && g.push({
630
- key: `${f.id}-connector-horizontal`,
631
- x1: x,
632
- y1: c,
633
- x2: O + n + v,
634
- y2: c,
635
- itemIndex: i
636
- }), f.isLastChild || (f.isDirectory ? g.push({
637
- key: `${f.id}-connector-bottom`,
638
- x1: x,
639
- y1: c + b,
640
- x2: x,
641
- y2: I + w,
642
- itemIndex: i
643
- }) : g.push({
644
- key: `${f.id}-connector-bottom`,
645
- x1: x,
646
- y1: c,
647
- x2: x,
648
- y2: I + w,
649
- itemIndex: i
650
- })), a[i] = g, s && f.isDirectory) {
651
- const N = d, h = x, R = c;
652
- m[i] = [
700
+ const O = h.indentLevel * n, g = O + n / 2 + x;
701
+ if (h.isDirectory ? b.push({
702
+ key: `${h.id}-connector-top`,
703
+ x1: g,
704
+ y1: S,
705
+ x2: g,
706
+ y2: u - v,
707
+ itemIndex: c
708
+ }) : b.push({
709
+ key: `${h.id}-connector-top`,
710
+ x1: g,
711
+ y1: S,
712
+ x2: g,
713
+ y2: u,
714
+ itemIndex: c
715
+ }), !h.isDirectory && h.isLastChild && b.push({
716
+ key: `${h.id}-connector-horizontal`,
717
+ x1: g,
718
+ y1: u,
719
+ x2: O + n + x,
720
+ y2: u,
721
+ itemIndex: c
722
+ }), h.isLastChild || (h.isDirectory ? b.push({
723
+ key: `${h.id}-connector-bottom`,
724
+ x1: g,
725
+ y1: u + v,
726
+ x2: g,
727
+ y2: S + k,
728
+ itemIndex: c
729
+ }) : b.push({
730
+ key: `${h.id}-connector-bottom`,
731
+ x1: g,
732
+ y1: u,
733
+ x2: g,
734
+ y2: S + k,
735
+ itemIndex: c
736
+ })), l[c] = b, r && h.isDirectory) {
737
+ const N = f, p = g, R = u;
738
+ d[c] = [
653
739
  {
654
- key: `${f.id}-glyph`,
655
- itemIndex: i,
656
- centerX: h,
740
+ key: `${h.id}-glyph`,
741
+ itemIndex: c,
742
+ centerX: p,
657
743
  centerY: R,
658
744
  size: N,
659
- isExpanded: f.isExpanded
745
+ isExpanded: h.isExpanded
660
746
  }
661
747
  ];
662
748
  }
663
749
  }
664
- return { segmentsByItem: a, glyphsByItem: m };
665
- }, Fe = We(
750
+ return { segmentsByItem: l, glyphsByItem: d };
751
+ }, ze = Ye(
666
752
  ({
667
753
  entry: e,
668
754
  indentLevel: t,
669
- rowHeight: o,
755
+ rowHeight: a,
670
756
  isDirOpen: n,
671
- parentIsLast: s,
672
- renderChildren: l = !0,
673
- expansion: { toggleDirectory: a, onToggleDirectoryRecursive: m },
674
- selection: { onEntryClick: E, selectedPath: v, mode: i = "none", selectedItems: f, onSelectionChange: g },
757
+ parentIsLast: r,
758
+ renderChildren: o = !0,
759
+ expansion: { toggleDirectory: l, onToggleDirectoryRecursive: d },
760
+ selection: { onEntryClick: w, selectedPath: x, mode: c = "none", selectedItems: h, onSelectionChange: b },
675
761
  visual: {
676
- iconOverrides: w,
677
- showExpandIcons: I = !0,
678
- showDirectoryIcons: c = !0,
679
- showFileIcons: d = !0,
680
- useCanvasExpandIcons: b = !1,
762
+ iconOverrides: k,
763
+ showExpandIcons: S = !0,
764
+ showDirectoryIcons: u = !0,
765
+ showFileIcons: f = !0,
766
+ useCanvasExpandIcons: v = !1,
681
767
  expandIconSize: O,
682
- highlightStyles: x,
768
+ highlightStyles: g,
683
769
  entryClassName: N,
684
- entryStyle: h,
770
+ entryStyle: p,
685
771
  nameClassName: R,
686
772
  nameStyle: $,
687
773
  directoryNameClassName: D,
688
- directoryNameStyle: k,
689
- fileNameClassName: G,
690
- fileNameStyle: W
774
+ directoryNameStyle: I,
775
+ fileNameClassName: z,
776
+ fileNameStyle: H
691
777
  }
692
778
  }) => {
693
- const [L, ee] = ne(null), [z, J] = ne(!1), C = e.children !== void 0, U = C && n(e.absolutePath), S = e.absolutePath === v, H = !C && f?.has(e.absolutePath), se = C ? void 0 : gt(e.name);
694
- ae(() => {
695
- ee(U && e.children ? e.children : null);
696
- }, [U, e.children]);
697
- const r = wt({ entry: e, isDirectory: C, isExpanded: U, isItemSelected: !!H, selectionMode: i, onSelectionChange: g, onEntryClick: E, toggleDirectory: a, onToggleDirectoryRecursive: m }), p = z ? x?.hoverClassName !== void 0 ? x.hoverClassName : A.entryHover : "", T = (() => {
779
+ const [L, te] = se(null), [X, Z] = se(!1), C = e.children !== void 0, G = C && n(e.absolutePath), E = e.absolutePath === x, F = !C && h?.has(e.absolutePath), ae = C ? void 0 : xe(e.name) || xe(e.relativePath) || xe(e.absolutePath);
780
+ ce(() => {
781
+ te(G && e.children ? e.children : null);
782
+ }, [G, e.children]);
783
+ const s = Ft({ entry: e, isDirectory: C, isExpanded: G, isItemSelected: !!F, selectionMode: c, onSelectionChange: b, onEntryClick: w, toggleDirectory: l, onToggleDirectoryRecursive: d }), y = X ? g?.hoverClassName !== void 0 ? g.hoverClassName : A.entryHover : "", j = (() => {
698
784
  if (C) {
699
- if (S)
700
- return x?.directorySelectedClassName !== void 0 ? x.directorySelectedClassName : A.entrySelected;
701
- } else if (S || H)
702
- return x?.itemSelectedClassName !== void 0 ? x.itemSelectedClassName : P(S && A.entrySelected, H && A.entryItemSelected);
785
+ if (E)
786
+ return g?.directorySelectedClassName !== void 0 ? g.directorySelectedClassName : A.entrySelected;
787
+ } else if (E || F)
788
+ return g?.itemSelectedClassName !== void 0 ? g.itemSelectedClassName : M(E && A.entrySelected, F && A.entryItemSelected);
703
789
  return "";
704
- })(), _ = P(A.entry, p, T, N, e.className), q = P(A.expandIcon, (S || H) && A.expandIconSelected), Z = P(A.typeIcon, (S || H) && A.typeIconSelected), j = P(A.name, R, C && A.nameDirectory, C && D, !C && G, (S || H) && A.nameSelected), Q = xt({ isDirectory: C, isExpanded: U, showExpandIcons: I, useCanvasExpandIcons: b, expandIconSize: O }), B = (C ? c : d) ? Et({ entry: e, isDirectory: C, isExpanded: U, isSelected: S, isItemSelected: !!H, extension: se }, w) : null, me = {
705
- ...z ? x?.hoverStyle : {},
706
- ...C && S ? x?.directorySelectedStyle : {},
707
- ...!C && (S || H) ? x?.itemSelectedStyle : {}
790
+ })(), _ = M(A.entry, y, j, N, e.className), Q = M(A.expandIcon, (E || F) && A.expandIconSelected), K = M(A.typeIcon, (E || F) && A.typeIconSelected), P = M(A.name, R, C && A.nameDirectory, C && D, !C && z, (E || F) && A.nameSelected), ee = Dt({ isDirectory: C, isExpanded: G, showExpandIcons: S, useCanvasExpandIcons: v, expandIconSize: O }), Y = (C ? u : f) ? Lt({ entry: e, isDirectory: C, isExpanded: G, isSelected: E, isItemSelected: !!F, extension: ae, mimeType: e.mimeType }, k) : null, pe = {
791
+ ...X ? g?.hoverStyle : {},
792
+ ...C && E ? g?.directorySelectedStyle : {},
793
+ ...!C && (E || F) ? g?.itemSelectedStyle : {}
708
794
  };
709
- return /* @__PURE__ */ y.jsxs(Dt, { children: [
710
- /* @__PURE__ */ y.jsxs(
795
+ return /* @__PURE__ */ i.jsxs(Kt, { children: [
796
+ /* @__PURE__ */ i.jsxs(
711
797
  "div",
712
798
  {
713
799
  className: _,
714
800
  style: {
715
- paddingLeft: `${Math.max(0, t * be)}px`,
716
- transform: t < 0 ? `translateX(${t * be}px)` : void 0,
717
- width: t < 0 ? `calc(100% + ${Math.abs(t * be)}px)` : void 0,
718
- height: `${o}px`,
719
- ...me,
720
- ...h,
801
+ paddingLeft: `${Math.max(0, t * ke)}px`,
802
+ transform: t < 0 ? `translateX(${t * ke}px)` : void 0,
803
+ width: t < 0 ? `calc(100% + ${Math.abs(t * ke)}px)` : void 0,
804
+ height: `${a}px`,
805
+ ...pe,
806
+ ...p,
721
807
  ...e.style
722
808
  },
723
809
  "data-entry-type": C ? "directory" : "file",
724
- "data-entry-expanded": C ? String(U) : void 0,
725
- "data-entry-selected": S ? "true" : void 0,
726
- "data-entry-item-selected": H ? "true" : void 0,
727
- onClick: r,
728
- onMouseEnter: () => J(!0),
729
- onMouseLeave: () => J(!1),
730
- onKeyDown: (le) => le.key === "Enter" && r(le),
810
+ "data-entry-expanded": C ? String(G) : void 0,
811
+ "data-entry-selected": E ? "true" : void 0,
812
+ "data-entry-item-selected": F ? "true" : void 0,
813
+ onClick: s,
814
+ onMouseEnter: () => Z(!0),
815
+ onMouseLeave: () => Z(!1),
816
+ onKeyDown: (de) => de.key === "Enter" && s(de),
731
817
  tabIndex: 0,
732
818
  role: "treeitem",
733
- "aria-expanded": C ? U : void 0,
819
+ "aria-expanded": C ? G : void 0,
734
820
  "aria-label": `${e.name} (${C ? "directory" : "file"})`,
735
821
  children: [
736
- (I || b) && /* @__PURE__ */ y.jsx("span", { className: q, children: Q }),
737
- (C ? c : d) && /* @__PURE__ */ y.jsx("span", { className: Z, children: B }),
738
- /* @__PURE__ */ y.jsx(
822
+ (S || v) && /* @__PURE__ */ i.jsx("span", { className: Q, children: ee }),
823
+ (C ? u : f) && /* @__PURE__ */ i.jsx("span", { className: K, children: Y }),
824
+ /* @__PURE__ */ i.jsx(
739
825
  "span",
740
826
  {
741
- className: j,
827
+ className: P,
742
828
  style: {
743
829
  ...$,
744
- ...C ? k : W
830
+ ...C ? I : H
745
831
  },
746
832
  "data-entry-type": C ? "directory" : "file",
747
833
  "data-entry-role": "name",
@@ -751,429 +837,447 @@ const lr = {
751
837
  ]
752
838
  }
753
839
  ),
754
- U && L && l && /* @__PURE__ */ y.jsx("fieldset", { children: L.map((le, Ce) => /* @__PURE__ */ y.jsx(
755
- Fe,
840
+ G && L && o && /* @__PURE__ */ i.jsx("fieldset", { children: L.map((de, Pe) => /* @__PURE__ */ i.jsx(
841
+ ze,
756
842
  {
757
- entry: le,
843
+ entry: de,
758
844
  indentLevel: t + 1,
759
- rowHeight: o,
845
+ rowHeight: a,
760
846
  isDirOpen: n,
761
- parentIsLast: [...s, Ce === L.length - 1],
762
- expansion: { toggleDirectory: a, onToggleDirectoryRecursive: m },
763
- selection: { onEntryClick: E, selectedPath: v, mode: i, selectedItems: f, onSelectionChange: g },
847
+ parentIsLast: [...r, Pe === L.length - 1],
848
+ expansion: { toggleDirectory: l, onToggleDirectoryRecursive: d },
849
+ selection: { onEntryClick: w, selectedPath: x, mode: c, selectedItems: h, onSelectionChange: b },
764
850
  visual: {
765
- iconOverrides: w,
766
- showExpandIcons: I,
767
- showDirectoryIcons: c,
768
- showFileIcons: d,
769
- useCanvasExpandIcons: b,
851
+ iconOverrides: k,
852
+ showExpandIcons: S,
853
+ showDirectoryIcons: u,
854
+ showFileIcons: f,
855
+ useCanvasExpandIcons: v,
770
856
  expandIconSize: O,
771
- highlightStyles: x,
857
+ highlightStyles: g,
772
858
  entryClassName: N,
773
- entryStyle: h,
859
+ entryStyle: p,
774
860
  nameClassName: R,
775
861
  nameStyle: $,
776
862
  directoryNameClassName: D,
777
- directoryNameStyle: k,
778
- fileNameClassName: G,
779
- fileNameStyle: W
863
+ directoryNameStyle: I,
864
+ fileNameClassName: z,
865
+ fileNameStyle: H
780
866
  }
781
867
  },
782
- le.absolutePath
868
+ de.absolutePath
783
869
  )) })
784
870
  ] }, e.absolutePath);
785
871
  },
786
872
  (e, t) => {
787
873
  if (e.entry !== t.entry) return !1;
788
- const o = e.entry.children !== void 0, n = t.entry.children !== void 0, s = o && e.isDirOpen(e.entry.absolutePath), l = n && t.isDirOpen(t.entry.absolutePath);
789
- 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((a, m) => a === t.parentIsLast[m]);
874
+ const a = e.entry.children !== void 0, n = t.entry.children !== void 0, r = a && e.isDirOpen(e.entry.absolutePath), o = n && t.isDirOpen(t.entry.absolutePath);
875
+ return e.indentLevel === t.indentLevel && e.rowHeight === t.rowHeight && r === o && 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((l, d) => l === t.parentIsLast[d]);
790
876
  }
791
877
  );
792
- Fe.displayName = "DirectoryEntryItem";
793
- const _t = (e) => {
878
+ ze.displayName = "DirectoryEntryItem";
879
+ const Vt = (e) => {
794
880
  const t = [];
795
881
  if (e.children)
796
- for (const o of e.children)
797
- o.type === "directory" && (t.push(o.absolutePath), t.push(..._t(o)));
882
+ for (const a of e.children)
883
+ a.type === "directory" && (t.push(a.absolutePath), t.push(...Vt(a)));
798
884
  return t;
799
- }, vr = ({
885
+ }, Lr = ({
800
886
  entries: e,
801
- expansion: { toggle: t, isExpanded: o, expandMultiple: n, collapseMultiple: s, isPending: l, alwaysExpanded: a = !1, doubleClickAction: m = "recursive" },
802
- selection: { onEntryClick: E, selectedPath: v, mode: i = "none", selectedItems: f, onSelectionChange: g },
887
+ expansion: { toggle: t, isExpanded: a, expandMultiple: n, collapseMultiple: r, isPending: o, alwaysExpanded: l = !1, doubleClickAction: d = "recursive" },
888
+ selection: { onEntryClick: w, selectedPath: x, mode: c = "none", selectedItems: h, onSelectionChange: b },
803
889
  visual: {
804
- className: w,
805
- style: I,
806
- lineColor: c = "#A0AEC0",
807
- showTreeLines: d = !0,
808
- showExpandIcons: b = !0,
890
+ className: k,
891
+ style: S,
892
+ lineColor: u = "#A0AEC0",
893
+ showTreeLines: f = !0,
894
+ showExpandIcons: v = !0,
809
895
  showDirectoryIcons: O = !0,
810
- showFileIcons: x = !0,
896
+ showFileIcons: g = !0,
811
897
  iconOverrides: N,
812
- expandIconSize: h,
813
- itemHeight: R = Re,
898
+ expandIconSize: p,
899
+ itemHeight: R = _e,
814
900
  removeRootIndent: $ = !1,
815
901
  highlightStyles: D,
816
- entryClassName: k,
817
- entryStyle: G,
818
- nameClassName: W,
902
+ entryClassName: I,
903
+ entryStyle: z,
904
+ nameClassName: H,
819
905
  nameStyle: L,
820
- directoryNameClassName: ee,
821
- directoryNameStyle: z,
822
- fileNameClassName: J,
906
+ directoryNameClassName: te,
907
+ directoryNameStyle: X,
908
+ fileNameClassName: Z,
823
909
  fileNameStyle: C
824
910
  } = {},
825
- virtualScroll: U,
826
- grid: S
911
+ virtualScroll: G,
912
+ grid: E
827
913
  }) => {
828
- const H = S !== void 0, [se, r] = ne(!1), p = he(null), T = he(null), _ = he(null), [q, Z] = ne(0), [j, Q] = ne(0), [B, me] = ne(0), [le, Ce] = ne(null), {
829
- overscanCount: Ee = 15,
830
- className: Be,
831
- background: Ye,
832
- onScroll: Ge,
833
- onRangeChange: Ue,
834
- initialScrollIndex: Ve,
835
- initialScrollOffset: fe,
836
- callbackThrottleMs: ze = 5,
837
- contentInsets: Xe,
838
- onItemFocus: Je,
839
- viewportHeightOverride: te,
840
- scrollBarOptions: _e,
841
- behaviorOptions: qe
842
- } = U ?? {}, [we, Ze] = ne(typeof fe == "number" ? fe : 0), Qe = F(
843
- (u, M) => {
844
- Ze(u), Ge?.(u, M);
845
- },
846
- [Ge]
847
- ), Ke = F(
848
- (u) => {
849
- const { renderingStartIndex: M, renderingEndIndex: Y } = u;
850
- Ce((K) => K && K.renderStart === M && K.renderEnd === Y ? K : { renderStart: M, renderEnd: Y }), Ue?.(u);
914
+ const F = E !== void 0, [ae, s] = se(!1), y = ie(null), j = ie(null), _ = ie(null), [Q, K] = se(0), [P, ee] = se(0), [Y, pe] = se(0), [de, Pe] = se(null), {
915
+ overscanCount: Se = 15,
916
+ className: Ge,
917
+ background: Ve,
918
+ onScroll: Ue,
919
+ onRangeChange: Xe,
920
+ initialScrollIndex: Je,
921
+ initialScrollOffset: oe,
922
+ callbackThrottleMs: qe = 5,
923
+ contentInsets: ve,
924
+ onItemFocus: Ze,
925
+ viewportHeightOverride: ne,
926
+ scrollBarOptions: Me,
927
+ behaviorOptions: Qe,
928
+ preserveScrollAnchor: Ke = !1
929
+ } = G ?? {}, [Ie, Ae] = se(typeof oe == "number" ? oe : 0), Oe = ie(typeof oe == "number" ? oe : 0), et = B(
930
+ (m, T) => {
931
+ Oe.current = m, Ae(m), Ue?.(m, T);
851
932
  },
852
933
  [Ue]
934
+ ), tt = B(
935
+ (m) => {
936
+ const { renderingStartIndex: T, renderingEndIndex: W } = m;
937
+ Pe((U) => U && U.renderStart === T && U.renderEnd === W ? U : { renderStart: T, renderEnd: W }), Xe?.(m);
938
+ },
939
+ [Xe]
853
940
  );
854
- ae(() => {
855
- typeof fe == "number" && Ze(fe);
856
- }, [fe]), ae(() => {
857
- r(!0), ir();
858
- }, []), ae(() => {
859
- const u = p.current, M = H ? T.current : u, Y = () => {
860
- if (u) {
861
- const oe = u.clientWidth;
862
- Q((ve) => Math.abs(ve - oe) > 1 ? oe : ve);
941
+ ce(() => {
942
+ typeof oe == "number" && Ae(oe);
943
+ }, [oe]), ce(() => {
944
+ s(!0), Tr();
945
+ }, []), ce(() => {
946
+ const m = y.current, T = F ? j.current : m, W = () => {
947
+ if (m) {
948
+ const re = m.clientWidth;
949
+ ee((le) => Math.abs(le - re) > 1 ? re : le);
863
950
  }
864
- if (typeof te == "number")
865
- Z((oe) => Math.abs(oe - te) > 1 ? te : oe);
866
- else if (M) {
867
- const oe = M.clientHeight;
868
- Z((ve) => Math.abs(ve - oe) > 1 ? oe : ve);
951
+ if (typeof ne == "number")
952
+ K((re) => Math.abs(re - ne) > 1 ? ne : re);
953
+ else if (T) {
954
+ const re = T.clientHeight;
955
+ K((le) => Math.abs(le - re) > 1 ? re : le);
869
956
  }
870
957
  };
871
- if (!(u || M)) return Z(0);
872
- Y();
873
- const K = new ResizeObserver(Y);
874
- return u && K.observe(u), M && M !== u && K.observe(M), () => K.disconnect();
875
- }, [te, H]);
876
- const ie = typeof te == "number" ? te : q, ce = F((u) => a || (se ? o(u) : !1), [se, o, a]), je = P(A.container, l && A.containerPending, w), Pe = X(
958
+ if (!(m || T)) return K(0);
959
+ W();
960
+ const U = new ResizeObserver(W);
961
+ return m && U.observe(m), T && T !== m && U.observe(T), () => U.disconnect();
962
+ }, [ne, F]);
963
+ const ue = typeof ne == "number" ? ne : Q, me = B((m) => l || (ae ? a(m) : !1), [ae, a, l]), rt = M(A.container, o && A.containerPending, k), nt = q(
877
964
  () => ({
878
- ...lr,
879
- ...I ?? {},
880
- ...typeof te == "number" ? { height: te, minHeight: te } : {}
965
+ ...jr,
966
+ ...S ?? {},
967
+ ...typeof ne == "number" ? { height: ne, minHeight: ne } : {}
881
968
  }),
882
- [I, te]
883
- ), Me = F(
884
- (u, M) => {
885
- const Y = [u.absolutePath, ..._t(u)], K = M || m;
886
- if (Y.every((De) => ce(De))) return s(Y);
887
- if (Y.every((De) => !ce(De)) || K === "recursive") return n(Y);
888
- if (K === "toggle") return s(Y);
889
- console.warn(`[DirectoryTree] Unknown double click action: ${K}. No action taken.`);
969
+ [S, ne]
970
+ ), De = B(
971
+ (m, T) => {
972
+ const W = [m.absolutePath, ...Vt(m)], U = T || d;
973
+ if (W.every((we) => me(we))) return r(W);
974
+ if (W.every((we) => !me(we)) || U === "recursive") return n(W);
975
+ if (U === "toggle") return r(W);
976
+ console.warn(`[DirectoryTree] Unknown double click action: ${U}. No action taken.`);
890
977
  },
891
- [ce, n, s, m]
892
- ), et = H ? !1 : $, { flatItems: tt, lineItems: Ae, maxIndent: rt } = X(() => cr(e, ce, d, et), [e, ce, d, et]), re = X(
893
- () => tt.map((u, M) => {
894
- const Y = typeof R == "function" ? R(u.entry, M) : R;
895
- return { ...u, rowHeight: Number.isFinite(Y) && Y > 0 ? Y : Re };
978
+ [me, n, r, d]
979
+ ), st = F ? !1 : $, { flatItems: at, lineItems: Le, maxIndent: ot } = q(() => Rr(e, me, f, st), [e, me, f, st]), J = q(
980
+ () => at.map((m, T) => {
981
+ const W = typeof R == "function" ? R(m.entry, T) : R;
982
+ return { ...m, rowHeight: Number.isFinite(W) && W > 0 ? W : _e };
896
983
  }),
897
- [tt, R]
898
- ), de = X(() => re.map((u) => u.rowHeight), [re]), Ne = X(() => {
899
- const u = new Array(de.length + 1);
900
- u[0] = 0;
901
- for (let M = 0; M < de.length; M++)
902
- u[M + 1] = u[M] + de[M];
903
- return u;
904
- }, [de]), nt = F((u) => re[u]?.rowHeight ?? Re, [re]), Se = X(
905
- () => !d || Ae.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : ur(Ae, de, Ne, be, d, h ?? yt),
906
- [Ae, de, Ne, d, h]
907
- ), Ie = X(() => !d || e.length === 0 ? 0 : (rt + 2) * be, [e.length, rt, d]), { renderStart: st, renderEnd: ot, lookaheadEnd: at } = X(
908
- () => dr(re.length, ie, Ee, le, we, Ne),
909
- [re.length, ie, Ee, le, we, Ne]
910
- ), Oe = X(() => !d || Ie <= 0 || ie <= 0 || Se.segmentsByItem.length === 0 ? null : /* @__PURE__ */ y.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ y.jsx("div", { className: "absolute top-0 left-0", style: { width: Ie, height: ie }, children: /* @__PURE__ */ y.jsx(
911
- Ct,
984
+ [at, R]
985
+ ), fe = q(() => J.map((m) => m.rowHeight), [J]), ye = q(() => {
986
+ const m = new Array(fe.length + 1);
987
+ m[0] = 0;
988
+ for (let T = 0; T < fe.length; T++)
989
+ m[T + 1] = m[T] + fe[T];
990
+ return m;
991
+ }, [fe]), lt = B((m) => J[m]?.rowHeight ?? _e, [J]), je = q(
992
+ () => !f || Le.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : _r(Le, fe, ye, ke, f, p ?? Pt),
993
+ [Le, fe, ye, f, p]
994
+ ), Te = q(() => !f || e.length === 0 ? 0 : (ot + 2) * ke, [e.length, ot, f]), { renderStart: it, renderEnd: ct, lookaheadEnd: dt } = q(
995
+ () => Cr(J.length, ue, Se, de, Ie, ye),
996
+ [J.length, ue, Se, de, Ie, ye]
997
+ ), Fe = q(() => !f || Te <= 0 || ue <= 0 || je.segmentsByItem.length === 0 ? null : /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("div", { className: "absolute top-0 left-0", style: { width: Te, height: ue }, children: /* @__PURE__ */ i.jsx(
998
+ Gt,
912
999
  {
913
- segmentsByItem: Se.segmentsByItem,
914
- glyphsByItem: Se.glyphsByItem,
915
- itemHeight: de[0] ?? Re,
916
- width: Ie,
917
- viewportHeight: ie,
918
- scrollPosition: we,
919
- color: c,
920
- expandGlyphColor: c,
921
- expandGlyphSize: h ?? yt,
922
- renderStartIndex: st,
923
- renderEndIndex: ot,
924
- lookaheadEndIndex: at
1000
+ segmentsByItem: je.segmentsByItem,
1001
+ glyphsByItem: je.glyphsByItem,
1002
+ itemHeight: fe[0] ?? _e,
1003
+ width: Te,
1004
+ viewportHeight: ue,
1005
+ scrollPosition: Ie,
1006
+ color: u,
1007
+ expandGlyphColor: u,
1008
+ expandGlyphSize: p ?? Pt,
1009
+ renderStartIndex: it,
1010
+ renderEndIndex: ct,
1011
+ lookaheadEndIndex: dt
925
1012
  }
926
- ) }) }), [Ie, ie, st, ot, at, we, Se, c, d, h, de]), lt = F((u) => re[u], [re]), ue = S?.columns, ye = S?.scrollBarWidth ?? _e?.width ?? Rt, V = X(() => ue ? Kt({ measuredWidth: j, columns: ue, scrollBarWidth: ye }) : null, [ue, j, ye]), ke = X(() => ue ? Qt(ue) : "", [ue]), jt = X(() => S?.showFooter && ue ? er(e) : [], [S?.showFooter, ue, e]), pe = V?.maxHScroll ?? 0;
927
- ae(() => {
928
- me((u) => Le(u, pe));
929
- }, [pe]);
930
- const it = F((u) => me((M) => Le(M + u, pe)), [pe]), ct = X(
931
- () => ({ iconOverrides: N, showExpandIcons: b, showDirectoryIcons: O, showFileIcons: x, useCanvasExpandIcons: d, expandIconSize: h, highlightStyles: D }),
932
- [N, b, O, x, d, h, D]
933
- ), dt = e.length === 0, ut = X(
934
- () => /* @__PURE__ */ y.jsx(
935
- Ht,
1013
+ ) }) }), [Te, ue, it, ct, dt, Ie, je, u, f, p, fe]), ut = B((m) => J[m], [J]), mt = ie(null);
1014
+ Qt(() => {
1015
+ const m = mt.current;
1016
+ if (mt.current = { items: J, offsets: ye }, !Ke || !m || m.items === J)
1017
+ return;
1018
+ const T = _.current, W = typeof ve == "number" ? ve : ve?.top ?? 0, U = T ? T.getScrollPosition() : Oe.current, re = U - W, le = br(m.items, m.offsets, re);
1019
+ if (!le)
1020
+ return;
1021
+ const we = gr(le, J, ye);
1022
+ if (we === null)
1023
+ return;
1024
+ const $e = we + W;
1025
+ if (Math.abs($e - U) < 1)
1026
+ return;
1027
+ const yt = T?.scrollTo($e) ?? $e;
1028
+ Oe.current = yt, Ae(yt);
1029
+ }, [J, ye, Ke, ve]);
1030
+ const he = E?.columns, be = E?.scrollBarWidth ?? Me?.width ?? zt, V = q(() => he ? yr({ measuredWidth: P, columns: he, scrollBarWidth: be }) : null, [he, P, be]), Re = q(() => he ? pr(he) : "", [he]), Ut = q(() => E?.showFooter && he ? xr(e) : [], [E?.showFooter, he, e]), ge = V?.maxHScroll ?? 0;
1031
+ ce(() => {
1032
+ pe((m) => He(m, ge));
1033
+ }, [ge]);
1034
+ const ft = B((m) => pe((T) => He(T + m, ge)), [ge]), ht = q(
1035
+ () => ({ iconOverrides: N, showExpandIcons: v, showDirectoryIcons: O, showFileIcons: g, useCanvasExpandIcons: f, expandIconSize: p, highlightStyles: D }),
1036
+ [N, v, O, g, f, p, D]
1037
+ ), pt = q(
1038
+ () => /* @__PURE__ */ i.jsx(
1039
+ tr,
936
1040
  {
937
1041
  ref: _,
938
- itemCount: re.length,
939
- getItem: lt,
940
- getItemHeight: nt,
941
- viewportSize: ie,
942
- overscanCount: Ee,
943
- onScroll: Qe,
944
- onRangeChange: Ke,
945
- className: Be,
946
- onWheelHorizontal: H ? it : void 0,
947
- background: /* @__PURE__ */ y.jsxs(y.Fragment, { children: [
948
- H && V ? (
1042
+ itemCount: J.length,
1043
+ getItem: ut,
1044
+ getItemHeight: lt,
1045
+ viewportSize: ue,
1046
+ overscanCount: Se,
1047
+ onScroll: et,
1048
+ onRangeChange: tt,
1049
+ className: Ge,
1050
+ onWheelHorizontal: F ? ft : void 0,
1051
+ background: /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1052
+ F && V ? (
949
1053
  // Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
950
- /* @__PURE__ */ y.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: Oe })
951
- ) : Oe,
952
- Ye
1054
+ /* @__PURE__ */ i.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: Fe })
1055
+ ) : Fe,
1056
+ Ve
953
1057
  ] }),
954
- initialScrollIndex: Ve,
955
- initialScrollOffset: fe,
956
- onItemFocus: Je,
957
- callbackThrottleMs: ze,
958
- contentInsets: Xe,
959
- scrollBarOptions: _e,
960
- behaviorOptions: qe,
961
- children: (u) => u ? H && S && V ? /* @__PURE__ */ y.jsx(
962
- It,
1058
+ initialScrollIndex: Je,
1059
+ initialScrollOffset: oe,
1060
+ onItemFocus: Ze,
1061
+ callbackThrottleMs: qe,
1062
+ contentInsets: ve,
1063
+ scrollBarOptions: Me,
1064
+ behaviorOptions: Qe,
1065
+ children: (m) => m ? F && E && V ? /* @__PURE__ */ i.jsx(
1066
+ Wt,
963
1067
  {
964
- entry: u.entry,
965
- indentLevel: u.indentLevel,
966
- rowHeight: u.rowHeight,
967
- isDirOpen: ce,
968
- columns: S.columns,
969
- numericTemplate: ke,
1068
+ entry: m.entry,
1069
+ indentLevel: m.indentLevel,
1070
+ rowHeight: m.rowHeight,
1071
+ isDirOpen: me,
1072
+ columns: E.columns,
1073
+ numericTemplate: Re,
970
1074
  numericTotal: V.numericTotal,
971
1075
  nameWidth: V.nameWidth,
972
- rowClassName: S.rowClassName,
973
- selection: { onEntryClick: E, selectedPath: v ?? null, mode: i, selectedItems: f, onSelectionChange: g },
974
- expansion: { toggleDirectory: t, onToggleDirectoryRecursive: Me },
975
- visual: ct
1076
+ rowClassName: E.rowClassName,
1077
+ selection: { onEntryClick: w, selectedPath: x ?? null, mode: c, selectedItems: h, onSelectionChange: b },
1078
+ expansion: { toggleDirectory: t, onToggleDirectoryRecursive: De },
1079
+ visual: ht
976
1080
  },
977
- u.entry.absolutePath
978
- ) : /* @__PURE__ */ y.jsx(
979
- Fe,
1081
+ m.entry.absolutePath
1082
+ ) : /* @__PURE__ */ i.jsx(
1083
+ ze,
980
1084
  {
981
- entry: u.entry,
982
- indentLevel: u.indentLevel,
983
- rowHeight: u.rowHeight,
984
- isDirOpen: ce,
985
- parentIsLast: u.parentIsLast,
1085
+ entry: m.entry,
1086
+ indentLevel: m.indentLevel,
1087
+ rowHeight: m.rowHeight,
1088
+ isDirOpen: me,
1089
+ parentIsLast: m.parentIsLast,
986
1090
  renderChildren: !1,
987
- expansion: { toggleDirectory: t, onToggleDirectoryRecursive: Me },
988
- selection: { onEntryClick: E, selectedPath: v ?? null, mode: i, selectedItems: f, onSelectionChange: g },
1091
+ expansion: { toggleDirectory: t, onToggleDirectoryRecursive: De },
1092
+ selection: { onEntryClick: w, selectedPath: x ?? null, mode: c, selectedItems: h, onSelectionChange: b },
989
1093
  visual: {
990
1094
  iconOverrides: N,
991
- showExpandIcons: b,
1095
+ showExpandIcons: v,
992
1096
  showDirectoryIcons: O,
993
- showFileIcons: x,
994
- useCanvasExpandIcons: d,
995
- expandIconSize: h,
1097
+ showFileIcons: g,
1098
+ useCanvasExpandIcons: f,
1099
+ expandIconSize: p,
996
1100
  highlightStyles: D,
997
- entryClassName: k,
998
- entryStyle: G,
999
- nameClassName: W,
1101
+ entryClassName: I,
1102
+ entryStyle: z,
1103
+ nameClassName: H,
1000
1104
  nameStyle: L,
1001
- directoryNameClassName: ee,
1002
- directoryNameStyle: z,
1003
- fileNameClassName: J,
1105
+ directoryNameClassName: te,
1106
+ directoryNameStyle: X,
1107
+ fileNameClassName: Z,
1004
1108
  fileNameStyle: C
1005
1109
  }
1006
1110
  },
1007
- u.entry.absolutePath
1111
+ m.entry.absolutePath
1008
1112
  ) : null
1009
1113
  }
1010
1114
  ),
1011
1115
  [
1012
- re.length,
1116
+ J.length,
1117
+ ut,
1013
1118
  lt,
1014
- nt,
1015
- ie,
1016
- Ee,
1017
- Qe,
1018
- Ke,
1019
- Be,
1020
- H,
1021
- it,
1119
+ ue,
1120
+ Se,
1121
+ et,
1122
+ tt,
1123
+ Ge,
1124
+ F,
1125
+ ft,
1022
1126
  V,
1023
- Oe,
1024
- Ye,
1127
+ Fe,
1025
1128
  Ve,
1026
- fe,
1027
1129
  Je,
1028
- ze,
1029
- Xe,
1030
- _e,
1130
+ oe,
1131
+ Ze,
1031
1132
  qe,
1032
- S,
1033
- ke,
1034
- ce,
1133
+ ve,
1134
+ Me,
1135
+ Qe,
1035
1136
  E,
1036
- v,
1037
- i,
1038
- f,
1039
- g,
1137
+ Re,
1138
+ me,
1139
+ w,
1140
+ x,
1141
+ c,
1142
+ h,
1143
+ b,
1040
1144
  t,
1041
- Me,
1042
- ct,
1145
+ De,
1146
+ ht,
1043
1147
  N,
1044
- b,
1148
+ v,
1045
1149
  O,
1046
- x,
1047
- d,
1048
- h,
1150
+ g,
1151
+ f,
1152
+ p,
1049
1153
  D,
1050
- k,
1051
- G,
1052
- W,
1053
- L,
1054
- ee,
1154
+ I,
1055
1155
  z,
1056
- J,
1156
+ H,
1157
+ L,
1158
+ te,
1159
+ X,
1160
+ Z,
1057
1161
  C
1058
1162
  ]
1059
1163
  );
1060
- if (!(S && V))
1061
- return dt ? /* @__PURE__ */ y.jsx("div", { className: je, style: Pe }) : /* @__PURE__ */ y.jsx("div", { ref: p, className: je, style: Pe, role: "tree", children: ut });
1062
- const Pt = S.showHeader ?? !0, Mt = S.showFooter ?? !1, At = { ...Pe, "--dt-hscroll": `${B}px` };
1063
- return /* @__PURE__ */ y.jsxs("div", { ref: p, className: P(je, "dt-grid"), style: At, role: "treegrid", children: [
1064
- Pt && /* @__PURE__ */ y.jsx(Jt, { columns: S.columns, numericTemplate: ke, numericTotal: V.numericTotal, nameWidth: V.nameWidth, scrollBarWidth: ye, className: S.headerClassName }),
1065
- /* @__PURE__ */ y.jsx("div", { ref: T, className: "dt-grid-body", children: !dt && ut }),
1066
- pe > 0 && /* @__PURE__ */ y.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1067
- /* @__PURE__ */ y.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: V.nameWidth }, "aria-hidden": "true" }),
1068
- /* @__PURE__ */ y.jsx(
1069
- $t,
1164
+ if (!(E && V))
1165
+ return /* @__PURE__ */ i.jsx("div", { ref: y, className: rt, style: nt, role: "tree", children: pt });
1166
+ const Xt = E.showHeader ?? !0, Jt = E.showFooter ?? !1, qt = { ...nt, "--dt-hscroll": `${Y}px` };
1167
+ return /* @__PURE__ */ i.jsxs("div", { ref: y, className: M(rt, "dt-grid"), style: qt, role: "treegrid", children: [
1168
+ Xt && /* @__PURE__ */ i.jsx(mr, { columns: E.columns, numericTemplate: Re, numericTotal: V.numericTotal, nameWidth: V.nameWidth, scrollBarWidth: be, className: E.headerClassName }),
1169
+ /* @__PURE__ */ i.jsx("div", { ref: j, className: "dt-grid-body", children: pt }),
1170
+ ge > 0 && /* @__PURE__ */ i.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1171
+ /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: V.nameWidth }, "aria-hidden": "true" }),
1172
+ /* @__PURE__ */ i.jsx(
1173
+ rr,
1070
1174
  {
1071
1175
  horizontal: !0,
1072
1176
  contentSize: V.numericTotal,
1073
1177
  viewportSize: V.numericVisible,
1074
- scrollPosition: B,
1075
- scrollBarWidth: ye,
1076
- onScroll: (u) => {
1077
- const M = typeof u == "function" ? u(B) : u, Y = Le(M, pe);
1078
- return me(Y), Y;
1178
+ scrollPosition: Y,
1179
+ scrollBarWidth: be,
1180
+ onScroll: (m) => {
1181
+ const T = typeof m == "function" ? m(Y) : m, W = He(T, ge);
1182
+ return pe(W), W;
1079
1183
  }
1080
1184
  }
1081
1185
  ),
1082
- /* @__PURE__ */ y.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: ye }, "aria-hidden": "true" })
1186
+ /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: be }, "aria-hidden": "true" })
1083
1187
  ] }),
1084
- Mt && /* @__PURE__ */ y.jsx(qt, { columns: S.columns, numericTemplate: ke, numericTotal: V.numericTotal, nameWidth: V.nameWidth, scrollBarWidth: ye, allEntries: jt, className: S.footerClassName })
1188
+ Jt && /* @__PURE__ */ i.jsx(fr, { columns: E.columns, numericTemplate: Re, numericTotal: V.numericTotal, nameWidth: V.nameWidth, scrollBarWidth: be, allEntries: Ut, className: E.footerClassName })
1085
1189
  ] });
1086
- }, br = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1087
- const [o, n] = Lt(), [s, l] = ne(() => {
1190
+ }, Fr = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1191
+ const [a, n] = er(), [r, o] = se(() => {
1088
1192
  if (typeof window < "u" && t)
1089
1193
  try {
1090
- const c = window.localStorage.getItem(t);
1091
- if (c) {
1092
- const d = JSON.parse(c);
1093
- return new Set(d);
1194
+ const u = window.localStorage.getItem(t);
1195
+ if (u) {
1196
+ const f = JSON.parse(u);
1197
+ return new Set(f);
1094
1198
  }
1095
- } catch (c) {
1096
- console.error("[useDirectoryTreeState] Error reading from localStorage", c);
1199
+ } catch (u) {
1200
+ console.error("[useDirectoryTreeState] Error reading from localStorage", u);
1097
1201
  }
1098
1202
  return e;
1099
- }), a = F((c) => {
1203
+ }), l = B((u) => {
1100
1204
  n(() => {
1101
- l((d) => {
1102
- const b = new Set(d);
1103
- return c(b), b;
1205
+ o((f) => {
1206
+ const v = new Set(f);
1207
+ return u(v), v;
1104
1208
  });
1105
1209
  });
1106
- }, []), m = F(
1107
- (c, d) => {
1108
- a((b) => {
1109
- for (const O of c)
1110
- d(b, O);
1210
+ }, []), d = B(
1211
+ (u, f) => {
1212
+ l((v) => {
1213
+ for (const O of u)
1214
+ f(v, O);
1111
1215
  });
1112
1216
  },
1113
- [a]
1217
+ [l]
1114
1218
  );
1115
- ae(() => {
1219
+ ce(() => {
1116
1220
  if (t && typeof window < "u")
1117
1221
  try {
1118
- window.localStorage.setItem(t, JSON.stringify(Array.from(s)));
1119
- } catch (c) {
1120
- console.warn(`Error setting localStorage key "${t}":`, c);
1222
+ window.localStorage.setItem(t, JSON.stringify(Array.from(r)));
1223
+ } catch (u) {
1224
+ console.warn(`Error setting localStorage key "${t}":`, u);
1121
1225
  }
1122
- }, [s, t]);
1123
- const E = F(
1124
- (c) => {
1125
- m([c], (d, b) => {
1126
- d.has(b) ? d.delete(b) : d.add(b);
1226
+ }, [r, t]);
1227
+ const w = B(
1228
+ (u) => {
1229
+ d([u], (f, v) => {
1230
+ f.has(v) ? f.delete(v) : f.add(v);
1127
1231
  });
1128
1232
  },
1129
- [m]
1130
- ), v = F(
1131
- (c) => {
1132
- m([c], (d, b) => {
1133
- d.add(b);
1233
+ [d]
1234
+ ), x = B(
1235
+ (u) => {
1236
+ d([u], (f, v) => {
1237
+ f.add(v);
1134
1238
  });
1135
1239
  },
1136
- [m]
1137
- ), i = F(
1138
- (c) => {
1139
- m([c], (d, b) => {
1140
- d.delete(b);
1240
+ [d]
1241
+ ), c = B(
1242
+ (u) => {
1243
+ d([u], (f, v) => {
1244
+ f.delete(v);
1141
1245
  });
1142
1246
  },
1143
- [m]
1144
- ), f = F(
1145
- (c) => {
1146
- m(c, (d, b) => {
1147
- d.delete(b);
1247
+ [d]
1248
+ ), h = B(
1249
+ (u) => {
1250
+ d(u, (f, v) => {
1251
+ f.delete(v);
1148
1252
  });
1149
1253
  },
1150
- [m]
1151
- ), g = F(
1152
- (c) => {
1153
- m(c, (d, b) => {
1154
- d.add(b);
1254
+ [d]
1255
+ ), b = B(
1256
+ (u) => {
1257
+ d(u, (f, v) => {
1258
+ f.add(v);
1155
1259
  });
1156
1260
  },
1157
- [m]
1158
- ), w = F(() => {
1159
- a((c) => {
1160
- c.clear();
1261
+ [d]
1262
+ ), k = B(() => {
1263
+ l((u) => {
1264
+ u.clear();
1161
1265
  });
1162
- }, [a]), I = F((c) => s.has(c), [s]);
1266
+ }, [l]), S = B((u) => r.has(u), [r]);
1163
1267
  return {
1164
- expanded: s,
1165
- toggle: E,
1166
- expand: v,
1167
- collapse: i,
1168
- collapseMultiple: f,
1169
- expandMultiple: g,
1170
- collapseAll: w,
1171
- isExpanded: I,
1172
- isPending: o
1268
+ expanded: r,
1269
+ toggle: w,
1270
+ expand: x,
1271
+ collapse: c,
1272
+ collapseMultiple: h,
1273
+ expandMultiple: b,
1274
+ collapseAll: k,
1275
+ isExpanded: S,
1276
+ isPending: a
1173
1277
  };
1174
1278
  };
1175
1279
  export {
1176
- vr as DirectoryTree,
1280
+ Lr as DirectoryTree,
1177
1281
  A as directoryTreeClasses,
1178
- br as useDirectoryTreeState
1282
+ Fr as useDirectoryTreeState
1179
1283
  };