@aiquants/directory-tree 3.7.1 → 3.8.1

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