@aiquants/directory-tree 4.1.1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import * as me from "react";
2
- import qr, { useRef as V, useEffect as Re, useCallback as P, memo as _t, useState as le, useMemo as G, useLayoutEffect as hr, useImperativeHandle as Qr, Fragment as en, useTransition as tn } from "react";
3
- import { VIRTUAL_SCROLL_LABEL_KEYS as ut, VIRTUAL_SCROLL_LABEL_CATALOGS as mr, resolveVirtualScrollLocale as Tr, resolveVirtualScrollLabels as rn, VirtualScroll as nn, ScrollBar as on } from "@aiquants/virtualscroll";
1
+ import * as he from "react";
2
+ import Qr, { useRef as V, useEffect as Se, useCallback as j, memo as _t, useState as ie, useMemo as G, useLayoutEffect as mr, useImperativeHandle as en, Fragment as tn, useTransition as rn } from "react";
3
+ import { VIRTUAL_SCROLL_LABEL_KEYS as ut, VIRTUAL_SCROLL_LABEL_CATALOGS as pr, resolveVirtualScrollLocale as Pr, resolveVirtualScrollLabels as nn, VirtualScroll as on, ScrollBar as sn } from "@aiquants/virtualscroll";
4
4
  import { twMerge as O } from "tailwind-merge";
5
- import { FileIcon as sn, FileText as an, FileCode as ln, FileZip as cn, FileVideo as un, FileAudio as dn, FileImage as fn, FilePpt as hn, FileDoc as mn, FileCsv as pn, FileXls as yn, FilePdf as bn, FileMd as gn } from "@phosphor-icons/react";
6
- var lt = { exports: {} }, Ye = {};
7
- var pr;
8
- function vn() {
9
- if (pr) return Ye;
10
- pr = 1;
5
+ import { FileIcon as an, FileText as ln, FileCode as cn, FileZip as dn, FileVideo as un, FileAudio as fn, FileImage as hn, FilePpt as mn, FileDoc as pn, FileCsv as yn, FileXls as bn, FilePdf as gn, FileMd as vn } from "@phosphor-icons/react";
6
+ var ct = { exports: {} }, Ge = {};
7
+ var yr;
8
+ function wn() {
9
+ if (yr) return Ge;
10
+ yr = 1;
11
11
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function r(n, a, l) {
12
+ function r(o, a, l) {
13
13
  var c = null;
14
14
  if (l !== void 0 && (c = "" + l), a.key !== void 0 && (c = "" + a.key), "key" in a) {
15
15
  l = {};
@@ -18,315 +18,315 @@ function vn() {
18
18
  } else l = a;
19
19
  return a = l.ref, {
20
20
  $$typeof: e,
21
- type: n,
21
+ type: o,
22
22
  key: c,
23
23
  ref: a !== void 0 ? a : null,
24
24
  props: l
25
25
  };
26
26
  }
27
- return Ye.Fragment = t, Ye.jsx = r, Ye.jsxs = r, Ye;
27
+ return Ge.Fragment = t, Ge.jsx = r, Ge.jsxs = r, Ge;
28
28
  }
29
- var Ge = {};
30
- var yr;
31
- function wn() {
32
- return yr || (yr = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function e(o) {
34
- if (o == null) return null;
35
- if (typeof o == "function")
36
- return o.$$typeof === Z ? null : o.displayName || o.name || null;
37
- if (typeof o == "string") return o;
38
- switch (o) {
39
- case v:
29
+ var Ve = {};
30
+ var br;
31
+ function xn() {
32
+ return br || (br = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function e(n) {
34
+ if (n == null) return null;
35
+ if (typeof n == "function")
36
+ return n.$$typeof === $ ? null : n.displayName || n.name || null;
37
+ if (typeof n == "string") return n;
38
+ switch (n) {
39
+ case w:
40
40
  return "Fragment";
41
41
  case M:
42
42
  return "Profiler";
43
- case R:
43
+ case S:
44
44
  return "StrictMode";
45
- case B:
45
+ case K:
46
46
  return "Suspense";
47
- case D:
47
+ case U:
48
48
  return "SuspenseList";
49
- case ce:
49
+ case te:
50
50
  return "Activity";
51
51
  }
52
- if (typeof o == "object")
53
- switch (typeof o.tag == "number" && console.error(
52
+ if (typeof n == "object")
53
+ switch (typeof n.tag == "number" && console.error(
54
54
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
55
- ), o.$$typeof) {
56
- case h:
55
+ ), n.$$typeof) {
56
+ case f:
57
57
  return "Portal";
58
- case k:
59
- return o.displayName || "Context";
60
- case w:
61
- return (o._context.displayName || "Context") + ".Consumer";
58
+ case T:
59
+ return n.displayName || "Context";
60
+ case I:
61
+ return (n._context.displayName || "Context") + ".Consumer";
62
62
  case y:
63
- var m = o.render;
64
- return o = o.displayName, o || (o = m.displayName || m.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
65
- case C:
66
- return m = o.displayName || null, m !== null ? m : e(o.type) || "Memo";
67
- case U:
68
- m = o._payload, o = o._init;
63
+ var b = n.render;
64
+ return n = n.displayName, n || (n = b.displayName || b.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
65
+ case P:
66
+ return b = n.displayName || null, b !== null ? b : e(n.type) || "Memo";
67
+ case _:
68
+ b = n._payload, n = n._init;
69
69
  try {
70
- return e(o(m));
70
+ return e(n(b));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function t(o) {
77
- return "" + o;
76
+ function t(n) {
77
+ return "" + n;
78
78
  }
79
- function r(o) {
79
+ function r(n) {
80
80
  try {
81
- t(o);
82
- var m = !1;
81
+ t(n);
82
+ var b = !1;
83
83
  } catch {
84
- m = !0;
84
+ b = !0;
85
85
  }
86
- if (m) {
87
- m = console;
88
- var g = m.error, T = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
89
- return g.call(
90
- m,
86
+ if (b) {
87
+ b = console;
88
+ var m = b.error, C = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
89
+ return m.call(
90
+ b,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
- T
93
- ), t(o);
92
+ C
93
+ ), t(n);
94
94
  }
95
95
  }
96
- function n(o) {
97
- if (o === v) return "<>";
98
- if (typeof o == "object" && o !== null && o.$$typeof === U)
96
+ function o(n) {
97
+ if (n === w) return "<>";
98
+ if (typeof n == "object" && n !== null && n.$$typeof === _)
99
99
  return "<...>";
100
100
  try {
101
- var m = e(o);
102
- return m ? "<" + m + ">" : "<...>";
101
+ var b = e(n);
102
+ return b ? "<" + b + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
107
  function a() {
108
- var o = Q.A;
109
- return o === null ? null : o.getOwner();
108
+ var n = F.A;
109
+ return n === null ? null : n.getOwner();
110
110
  }
111
111
  function l() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function c(o) {
115
- if (oe.call(o, "key")) {
116
- var m = Object.getOwnPropertyDescriptor(o, "key").get;
117
- if (m && m.isReactWarning) return !1;
114
+ function c(n) {
115
+ if (X.call(n, "key")) {
116
+ var b = Object.getOwnPropertyDescriptor(n, "key").get;
117
+ if (b && b.isReactWarning) return !1;
118
118
  }
119
- return o.key !== void 0;
119
+ return n.key !== void 0;
120
120
  }
121
- function i(o, m) {
122
- function g() {
123
- pe || (pe = !0, console.error(
121
+ function i(n, b) {
122
+ function m() {
123
+ J || (J = !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
- m
125
+ b
126
126
  ));
127
127
  }
128
- g.isReactWarning = !0, Object.defineProperty(o, "key", {
129
- get: g,
128
+ m.isReactWarning = !0, Object.defineProperty(n, "key", {
129
+ get: m,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
- function I() {
134
- var o = e(this.type);
135
- return ie[o] || (ie[o] = !0, console.error(
133
+ function R() {
134
+ var n = e(this.type);
135
+ return de[n] || (de[n] = !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
- )), o = this.props.ref, o !== void 0 ? o : null;
137
+ )), n = this.props.ref, n !== void 0 ? n : null;
138
138
  }
139
- function x(o, m, g, T, se, de) {
140
- var A = g.ref;
141
- return o = {
142
- $$typeof: j,
143
- type: o,
144
- key: m,
145
- props: g,
146
- _owner: T
147
- }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(o, "ref", {
139
+ function E(n, b, m, C, H, pe) {
140
+ var A = m.ref;
141
+ return n = {
142
+ $$typeof: N,
143
+ type: n,
144
+ key: b,
145
+ props: m,
146
+ _owner: C
147
+ }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(n, "ref", {
148
148
  enumerable: !1,
149
- get: I
150
- }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
149
+ get: R
150
+ }) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
151
151
  configurable: !1,
152
152
  enumerable: !1,
153
153
  writable: !0,
154
154
  value: 0
155
- }), Object.defineProperty(o, "_debugInfo", {
155
+ }), Object.defineProperty(n, "_debugInfo", {
156
156
  configurable: !1,
157
157
  enumerable: !1,
158
158
  writable: !0,
159
159
  value: null
160
- }), Object.defineProperty(o, "_debugStack", {
160
+ }), Object.defineProperty(n, "_debugStack", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: se
165
- }), Object.defineProperty(o, "_debugTask", {
164
+ value: H
165
+ }), Object.defineProperty(n, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: de
170
- }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
169
+ value: pe
170
+ }), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
171
171
  }
172
- function f(o, m, g, T, se, de) {
173
- var A = m.children;
172
+ function g(n, b, m, C, H, pe) {
173
+ var A = b.children;
174
174
  if (A !== void 0)
175
- if (T)
175
+ if (C)
176
176
  if (re(A)) {
177
- for (T = 0; T < A.length; T++)
178
- p(A[T]);
177
+ for (C = 0; C < A.length; C++)
178
+ h(A[C]);
179
179
  Object.freeze && Object.freeze(A);
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 p(A);
185
- if (oe.call(m, "key")) {
186
- A = e(o);
187
- var ee = Object.keys(m).filter(function(fe) {
188
- return fe !== "key";
184
+ else h(A);
185
+ if (X.call(b, "key")) {
186
+ A = e(n);
187
+ var ne = Object.keys(b).filter(function(ue) {
188
+ return ue !== "key";
189
189
  });
190
- T = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", _[A + T] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ C = 0 < ne.length ? "{key: someKey, " + ne.join(": ..., ") + ": ...}" : "{key: someKey}", le[A + C] || (ne = 0 < ne.length ? "{" + ne.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
- T,
197
+ C,
198
198
  A,
199
- ee,
199
+ ne,
200
200
  A
201
- ), _[A + T] = !0);
201
+ ), le[A + C] = !0);
202
202
  }
203
- if (A = null, g !== void 0 && (r(g), A = "" + g), c(m) && (r(m.key), A = "" + m.key), "key" in m) {
204
- g = {};
205
- for (var ye in m)
206
- ye !== "key" && (g[ye] = m[ye]);
207
- } else g = m;
203
+ if (A = null, m !== void 0 && (r(m), A = "" + m), c(b) && (r(b.key), A = "" + b.key), "key" in b) {
204
+ m = {};
205
+ for (var ye in b)
206
+ ye !== "key" && (m[ye] = b[ye]);
207
+ } else m = b;
208
208
  return A && i(
209
- g,
210
- typeof o == "function" ? o.displayName || o.name || "Unknown" : o
211
- ), x(
212
- o,
209
+ m,
210
+ typeof n == "function" ? n.displayName || n.name || "Unknown" : n
211
+ ), E(
212
+ n,
213
213
  A,
214
- g,
214
+ m,
215
215
  a(),
216
- se,
217
- de
216
+ H,
217
+ pe
218
218
  );
219
219
  }
220
- function p(o) {
221
- S(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === U && (o._payload.status === "fulfilled" ? S(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
220
+ function h(n) {
221
+ p(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === _ && (n._payload.status === "fulfilled" ? p(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
222
222
  }
223
- function S(o) {
224
- return typeof o == "object" && o !== null && o.$$typeof === j;
223
+ function p(n) {
224
+ return typeof n == "object" && n !== null && n.$$typeof === N;
225
225
  }
226
- var E = qr, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), h = /* @__PURE__ */ Symbol.for("react.portal"), v = /* @__PURE__ */ Symbol.for("react.fragment"), R = /* @__PURE__ */ Symbol.for("react.strict_mode"), M = /* @__PURE__ */ Symbol.for("react.profiler"), w = /* @__PURE__ */ Symbol.for("react.consumer"), k = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), B = /* @__PURE__ */ Symbol.for("react.suspense"), D = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), U = /* @__PURE__ */ Symbol.for("react.lazy"), ce = /* @__PURE__ */ Symbol.for("react.activity"), Z = /* @__PURE__ */ Symbol.for("react.client.reference"), Q = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, oe = Object.prototype.hasOwnProperty, re = Array.isArray, $ = console.createTask ? console.createTask : function() {
226
+ var x = Qr, N = /* @__PURE__ */ Symbol.for("react.transitional.element"), f = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), M = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.consumer"), T = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), K = /* @__PURE__ */ Symbol.for("react.suspense"), U = /* @__PURE__ */ Symbol.for("react.suspense_list"), P = /* @__PURE__ */ Symbol.for("react.memo"), _ = /* @__PURE__ */ Symbol.for("react.lazy"), te = /* @__PURE__ */ Symbol.for("react.activity"), $ = /* @__PURE__ */ Symbol.for("react.client.reference"), F = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, re = Array.isArray, ae = console.createTask ? console.createTask : function() {
227
227
  return null;
228
228
  };
229
- E = {
230
- react_stack_bottom_frame: function(o) {
231
- return o();
229
+ x = {
230
+ react_stack_bottom_frame: function(n) {
231
+ return n();
232
232
  }
233
233
  };
234
- var pe, ie = {}, ue = E.react_stack_bottom_frame.bind(
235
- E,
234
+ var J, de = {}, me = x.react_stack_bottom_frame.bind(
235
+ x,
236
236
  l
237
- )(), z = $(n(l)), _ = {};
238
- Ge.Fragment = v, Ge.jsx = function(o, m, g) {
239
- var T = 1e4 > Q.recentlyCreatedOwnerStacks++;
240
- return f(
241
- o,
237
+ )(), W = ae(o(l)), le = {};
238
+ Ve.Fragment = w, Ve.jsx = function(n, b, m) {
239
+ var C = 1e4 > F.recentlyCreatedOwnerStacks++;
240
+ return g(
241
+ n,
242
+ b,
242
243
  m,
243
- g,
244
244
  !1,
245
- T ? Error("react-stack-top-frame") : ue,
246
- T ? $(n(o)) : z
245
+ C ? Error("react-stack-top-frame") : me,
246
+ C ? ae(o(n)) : W
247
247
  );
248
- }, Ge.jsxs = function(o, m, g) {
249
- var T = 1e4 > Q.recentlyCreatedOwnerStacks++;
250
- return f(
251
- o,
248
+ }, Ve.jsxs = function(n, b, m) {
249
+ var C = 1e4 > F.recentlyCreatedOwnerStacks++;
250
+ return g(
251
+ n,
252
+ b,
252
253
  m,
253
- g,
254
254
  !0,
255
- T ? Error("react-stack-top-frame") : ue,
256
- T ? $(n(o)) : z
255
+ C ? Error("react-stack-top-frame") : me,
256
+ C ? ae(o(n)) : W
257
257
  );
258
258
  };
259
- })()), Ge;
259
+ })()), Ve;
260
260
  }
261
- var br;
262
- function xn() {
263
- return br || (br = 1, process.env.NODE_ENV === "production" ? lt.exports = vn() : lt.exports = wn()), lt.exports;
261
+ var gr;
262
+ function En() {
263
+ return gr || (gr = 1, process.env.NODE_ENV === "production" ? ct.exports = wn() : ct.exports = xn()), ct.exports;
264
264
  }
265
- var d = xn();
266
- function En({
265
+ var u = En();
266
+ function Sn({
267
267
  title: e,
268
268
  titleId: t,
269
269
  ...r
270
- }, n) {
271
- return /* @__PURE__ */ me.createElement("svg", Object.assign({
270
+ }, o) {
271
+ return /* @__PURE__ */ he.createElement("svg", Object.assign({
272
272
  xmlns: "http://www.w3.org/2000/svg",
273
273
  viewBox: "0 0 24 24",
274
274
  fill: "currentColor",
275
275
  "aria-hidden": "true",
276
276
  "data-slot": "icon",
277
- ref: n,
277
+ ref: o,
278
278
  "aria-labelledby": t
279
- }, r), e ? /* @__PURE__ */ me.createElement("title", {
279
+ }, r), e ? /* @__PURE__ */ he.createElement("title", {
280
280
  id: t
281
- }, e) : null, /* @__PURE__ */ me.createElement("path", {
281
+ }, e) : null, /* @__PURE__ */ he.createElement("path", {
282
282
  fillRule: "evenodd",
283
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
284
  clipRule: "evenodd"
285
285
  }));
286
286
  }
287
- const Sn = /* @__PURE__ */ me.forwardRef(En);
287
+ const In = /* @__PURE__ */ he.forwardRef(Sn);
288
288
  function Rn({
289
289
  title: e,
290
290
  titleId: t,
291
291
  ...r
292
- }, n) {
293
- return /* @__PURE__ */ me.createElement("svg", Object.assign({
292
+ }, o) {
293
+ return /* @__PURE__ */ he.createElement("svg", Object.assign({
294
294
  xmlns: "http://www.w3.org/2000/svg",
295
295
  viewBox: "0 0 24 24",
296
296
  fill: "currentColor",
297
297
  "aria-hidden": "true",
298
298
  "data-slot": "icon",
299
- ref: n,
299
+ ref: o,
300
300
  "aria-labelledby": t
301
- }, r), e ? /* @__PURE__ */ me.createElement("title", {
301
+ }, r), e ? /* @__PURE__ */ he.createElement("title", {
302
302
  id: t
303
- }, e) : null, /* @__PURE__ */ me.createElement("path", {
303
+ }, e) : null, /* @__PURE__ */ he.createElement("path", {
304
304
  fillRule: "evenodd",
305
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
306
  clipRule: "evenodd"
307
307
  }));
308
308
  }
309
- const In = /* @__PURE__ */ me.forwardRef(Rn);
310
- function kn({
309
+ const kn = /* @__PURE__ */ he.forwardRef(Rn);
310
+ function Nn({
311
311
  title: e,
312
312
  titleId: t,
313
313
  ...r
314
- }, n) {
315
- return /* @__PURE__ */ me.createElement("svg", Object.assign({
314
+ }, o) {
315
+ return /* @__PURE__ */ he.createElement("svg", Object.assign({
316
316
  xmlns: "http://www.w3.org/2000/svg",
317
317
  viewBox: "0 0 24 24",
318
318
  fill: "currentColor",
319
319
  "aria-hidden": "true",
320
320
  "data-slot": "icon",
321
- ref: n,
321
+ ref: o,
322
322
  "aria-labelledby": t
323
- }, r), e ? /* @__PURE__ */ me.createElement("title", {
323
+ }, r), e ? /* @__PURE__ */ he.createElement("title", {
324
324
  id: t
325
- }, e) : null, /* @__PURE__ */ me.createElement("path", {
325
+ }, e) : null, /* @__PURE__ */ he.createElement("path", {
326
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
327
  }));
328
328
  }
329
- const Nn = /* @__PURE__ */ me.forwardRef(kn), ct = 18, it = 12, gr = 8, F = {
329
+ const Tn = /* @__PURE__ */ he.forwardRef(Nn), it = 44, dt = 12, vr = 8, Ct = 14, D = {
330
330
  container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",
331
331
  containerPending: "opacity-70",
332
332
  entry: "directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",
@@ -339,18 +339,19 @@ const Nn = /* @__PURE__ */ me.forwardRef(kn), ct = 18, it = 12, gr = 8, F = {
339
339
  // アイコンのスタイル
340
340
  expandIcon: O("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
341
  expandIconSelected: O("directory-tree-expand-icon--selected text-blue-700", "dark:text-blue-400"),
342
- typeIcon: O("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"),
342
+ // 箱の大きさはクラスでなく TYPE_ICON_SIZE から行が付ける (ツリーラインのジオメトリと同じ値を読むため)
343
+ typeIcon: O("directory-tree-type-icon flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
343
344
  typeIconSelected: O("directory-tree-type-icon--selected text-blue-700", "dark:text-blue-400"),
344
345
  // テキストのスタイル
345
346
  name: O("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal", "text-gray-700", "dark:text-gray-200"),
346
347
  nameDirectory: "directory-tree-name--directory font-medium",
347
348
  nameSelected: O("directory-tree-name--selected text-blue-800 font-semibold", "dark:text-blue-300")
348
- }, Ct = (e) => {
349
+ }, At = (e) => {
349
350
  const t = e.slice(e.lastIndexOf("/") + 1), r = t.lastIndexOf(".");
350
351
  return r <= 0 ? "" : t.slice(r + 1).toLowerCase();
351
- }, Tn = /^[a-z][a-z\d+.-]*:\/\//i, vr = (e) => Ct(Tn.test(e) ? e.split(/[?#]/, 1)[0] : e), jr = (e) => Ct(e.name) || vr(e.relativePath) || vr(e.absolutePath), Pr = ({ isDirectory: e, isExpanded: t, showExpandIcons: r, useCanvasExpandIcons: n, expandIconSize: a }) => {
352
+ }, Pn = /^[a-z][a-z\d+.-]*:\/\//i, wr = (e) => At(Pn.test(e) ? e.split(/[?#]/, 1)[0] : e), jr = (e) => At(e.name) || wr(e.relativePath) || wr(e.absolutePath), _r = ({ isDirectory: e, isExpanded: t, showExpandIcons: r, useCanvasExpandIcons: o, expandIconSize: a }) => {
352
353
  const l = a ? { width: a, height: a } : void 0, c = a ? "" : "h-4 w-4";
353
- return !(r && e) || n ? /* @__PURE__ */ d.jsx("span", { className: c, style: l, "aria-hidden": "true" }) : t ? /* @__PURE__ */ d.jsx(Sn, { className: c, style: l }) : /* @__PURE__ */ d.jsx(In, { className: c, style: l });
354
+ return !(r && e) || o ? /* @__PURE__ */ u.jsx("span", { className: c, style: l, "aria-hidden": "true" }) : t ? /* @__PURE__ */ u.jsx(In, { className: c, style: l }) : /* @__PURE__ */ u.jsx(kn, { className: c, style: l });
354
355
  }, Tt = (e, t) => {
355
356
  if (e == null || typeof e == "boolean") return null;
356
357
  if (typeof e == "function")
@@ -359,8 +360,8 @@ const Nn = /* @__PURE__ */ me.forwardRef(kn), ct = 18, it = 12, gr = 8, F = {
359
360
  if ("then" in e)
360
361
  return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
361
362
  if (Array.isArray(e)) {
362
- const n = e.map((a) => Tt(a, t)).filter(Boolean);
363
- return n.length ? n : null;
363
+ const o = e.map((a) => Tt(a, t)).filter(Boolean);
364
+ return o.length ? o : null;
364
365
  }
365
366
  const r = e.type;
366
367
  if (r && r.$$typeof === /* @__PURE__ */ Symbol.for("react.lazy"))
@@ -368,19 +369,19 @@ const Nn = /* @__PURE__ */ me.forwardRef(kn), ct = 18, it = 12, gr = 8, F = {
368
369
  }
369
370
  return e;
370
371
  }, jn = {
371
- markdown: () => /* @__PURE__ */ d.jsx(gn, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" }),
372
- pdf: () => /* @__PURE__ */ d.jsx(bn, { className: "h-4 w-4 text-red-500 dark:text-red-400" }),
373
- spreadsheet: () => /* @__PURE__ */ d.jsx(yn, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" }),
374
- csv: () => /* @__PURE__ */ d.jsx(pn, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" }),
375
- document: () => /* @__PURE__ */ d.jsx(mn, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" }),
376
- presentation: () => /* @__PURE__ */ d.jsx(hn, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" }),
377
- image: () => /* @__PURE__ */ d.jsx(fn, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" }),
378
- audio: () => /* @__PURE__ */ d.jsx(dn, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" }),
379
- video: () => /* @__PURE__ */ d.jsx(un, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" }),
380
- archive: () => /* @__PURE__ */ d.jsx(cn, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" }),
381
- code: () => /* @__PURE__ */ d.jsx(ln, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" }),
382
- text: () => /* @__PURE__ */ d.jsx(an, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" })
383
- }, Pn = {
372
+ markdown: () => /* @__PURE__ */ u.jsx(vn, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" }),
373
+ pdf: () => /* @__PURE__ */ u.jsx(gn, { className: "h-4 w-4 text-red-500 dark:text-red-400" }),
374
+ spreadsheet: () => /* @__PURE__ */ u.jsx(bn, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" }),
375
+ csv: () => /* @__PURE__ */ u.jsx(yn, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" }),
376
+ document: () => /* @__PURE__ */ u.jsx(pn, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" }),
377
+ presentation: () => /* @__PURE__ */ u.jsx(mn, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" }),
378
+ image: () => /* @__PURE__ */ u.jsx(hn, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" }),
379
+ audio: () => /* @__PURE__ */ u.jsx(fn, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" }),
380
+ video: () => /* @__PURE__ */ u.jsx(un, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" }),
381
+ archive: () => /* @__PURE__ */ u.jsx(dn, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" }),
382
+ code: () => /* @__PURE__ */ u.jsx(cn, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" }),
383
+ text: () => /* @__PURE__ */ u.jsx(ln, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" })
384
+ }, _n = {
384
385
  markdown: ["md", "markdown", "mdx"],
385
386
  pdf: ["pdf"],
386
387
  spreadsheet: ["xls", "xlsx", "xlsm", "xlsb", "ods"],
@@ -393,7 +394,7 @@ const Nn = /* @__PURE__ */ me.forwardRef(kn), ct = 18, it = 12, gr = 8, F = {
393
394
  archive: ["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"],
394
395
  code: ["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"],
395
396
  text: ["txt", "log"]
396
- }, _n = new Map(Object.entries(Pn).flatMap(([e, t]) => t.map((r) => [r, e]))), Cn = /* @__PURE__ */ new Set(["", "application/octet-stream", "binary/octet-stream", "text/plain", "application/x-empty"]), An = (e) => (e ?? "").split(";", 1)[0].trim().toLowerCase(), On = (e) => {
397
+ }, Cn = new Map(Object.entries(_n).flatMap(([e, t]) => t.map((r) => [r, e]))), An = /* @__PURE__ */ new Set(["", "application/octet-stream", "binary/octet-stream", "text/plain", "application/x-empty"]), On = (e) => (e ?? "").split(";", 1)[0].trim().toLowerCase(), Ln = (e) => {
397
398
  if (e === "text/markdown" || e === "text/x-markdown") return "markdown";
398
399
  if (e === "application/pdf") return "pdf";
399
400
  if (e.includes("excel") || e.includes("spreadsheet")) return "spreadsheet";
@@ -407,162 +408,162 @@ const Nn = /* @__PURE__ */ me.forwardRef(kn), ct = 18, it = 12, gr = 8, F = {
407
408
  if (e === "application/json" || e.includes("javascript") || e.includes("typescript") || e.includes("xml") || e.startsWith("text/html") || e.startsWith("text/css") || e.includes("x-python") || e.includes("x-sh") || e.includes("x-go") || e.includes("x-rust"))
408
409
  return "code";
409
410
  if (e.startsWith("text/")) return "text";
410
- }, Ln = (e, t, r) => {
411
- const n = An(e), a = On(n), l = _n.get((t || (r ? Ct(r) : "")).toLowerCase()), i = (Cn.has(n) ? [l, a] : [a, l]).find((I) => I !== void 0);
412
- return i === void 0 ? /* @__PURE__ */ d.jsx(sn, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" }) : jn[i]();
413
- }, _r = (e, t) => {
414
- const { entry: r, isDirectory: n, isExpanded: a, extension: l, mimeType: c } = e;
411
+ }, Dn = (e, t, r) => {
412
+ const o = On(e), a = Ln(o), l = Cn.get((t || (r ? At(r) : "")).toLowerCase()), i = (An.has(o) ? [l, a] : [a, l]).find((R) => R !== void 0);
413
+ return i === void 0 ? /* @__PURE__ */ u.jsx(an, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" }) : jn[i]();
414
+ }, Cr = (e, t) => {
415
+ const { entry: r, isDirectory: o, isExpanded: a, extension: l, mimeType: c } = e;
415
416
  let i;
416
- const I = c || r.mimeType;
417
- return r.icon !== void 0 ? i = r.icon : n ? i = a && t?.directoryExpanded || t?.directory || /* @__PURE__ */ d.jsx(Nn, { className: "h-4 w-4" }) : l && t?.fileByExtension?.[l] ? i = t.fileByExtension[l] : i = t?.file || Ln(I, l, r.name), Tt(typeof i == "function" ? i(e) : i, r.absolutePath);
418
- }, Dn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Cr = (e) => {
417
+ const R = c || r.mimeType;
418
+ return r.icon !== void 0 ? i = r.icon : o ? i = a && t?.directoryExpanded || t?.directory || /* @__PURE__ */ u.jsx(Tn, { className: "h-4 w-4" }) : l && t?.fileByExtension?.[l] ? i = t.fileByExtension[l] : i = t?.file || Dn(R, l, r.name), Tt(typeof i == "function" ? i(e) : i, r.absolutePath);
419
+ }, Fn = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Ar = (e) => {
419
420
  if (!e)
420
421
  return;
421
422
  const t = Object.entries(e).filter(([, r]) => r != null);
422
423
  if (t.length !== 0)
423
- return Object.fromEntries(t.map(([r, n]) => [`data-${Dn(r)}`, String(n)]));
424
- }, Fn = 500, Ar = ({ entry: e, isDirectory: t, isExpanded: r, isItemSelected: n, selectionMode: a, onSelectionChange: l, onEntryClick: c, toggleDirectory: i, onToggleDirectoryRecursive: I }) => {
425
- const x = V(null);
426
- return Re(
424
+ return Object.fromEntries(t.map(([r, o]) => [`data-${Fn(r)}`, String(o)]));
425
+ }, Mn = 500, Or = ({ entry: e, isDirectory: t, isExpanded: r, isItemSelected: o, selectionMode: a, onSelectionChange: l, onEntryClick: c, toggleDirectory: i, onToggleDirectoryRecursive: R }) => {
426
+ const E = V(null);
427
+ return Se(
427
428
  () => () => {
428
- x.current && window.clearTimeout(x.current);
429
+ E.current && window.clearTimeout(E.current);
429
430
  },
430
431
  []
431
- ), P(
432
- (f) => {
433
- f.stopPropagation(), a !== "none" && !t && l && l(e, !n);
434
- let p = !1;
432
+ ), j(
433
+ (g) => {
434
+ g.stopPropagation(), a !== "none" && !t && l && l(e, !o);
435
+ let h = !1;
435
436
  c({
436
437
  entry: e,
437
438
  isDirectory: t,
438
439
  isExpanded: r,
439
440
  preventDefault: () => {
440
- p = !0;
441
+ h = !0;
441
442
  }
442
- }), !(!t || p) && (x.current ? (window.clearTimeout(x.current), x.current = null, I(e)) : x.current = window.setTimeout(() => {
443
- i(e.absolutePath), x.current = null;
444
- }, Fn));
443
+ }), !(!t || h) && (E.current ? (window.clearTimeout(E.current), E.current = null, R(e)) : E.current = window.setTimeout(() => {
444
+ i(e.absolutePath), E.current = null;
445
+ }, Mn));
445
446
  },
446
- [t, e, r, I, i, c, a, l, n]
447
+ [t, e, r, R, i, c, a, l, o]
447
448
  );
448
- }, Or = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", wr = (e, t) => e.children !== void 0 && t(e.absolutePath), Lr = (e, t) => ({
449
+ }, Lr = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", xr = (e, t) => e.children !== void 0 && t(e.absolutePath), Dr = (e, t) => ({
449
450
  width: e,
450
451
  gridTemplateColumns: t
451
- }), Dr = _t(
452
+ }), Fr = _t(
452
453
  ({
453
454
  entry: e,
454
455
  indentLevel: t,
455
456
  positionInSet: r,
456
- setSize: n,
457
+ setSize: o,
457
458
  rowIndex: a,
458
459
  flatIndex: l,
459
460
  onRowFocus: c,
460
461
  onRowBlur: i,
461
- isSelectedForAria: I,
462
- rowHeight: x,
463
- isDirOpen: f,
464
- columns: p,
465
- numericTemplate: S,
466
- numericTotal: E,
467
- nameWidth: j,
468
- rowClassName: h,
469
- selection: { onEntryClick: v, selectedPath: R, currentPath: M, mode: w = "none", selectedItems: k, onSelectionChange: y },
470
- expansion: { toggleDirectory: B, onToggleDirectoryRecursive: D },
471
- visual: { iconOverrides: C, showExpandIcons: U = !0, showDirectoryIcons: ce = !0, showFileIcons: Z = !0, useCanvasExpandIcons: Q = !1, expandIconSize: oe, indentSize: re = it, highlightStyles: $, expandIconClassName: pe, expandIconStyle: ie }
462
+ isSelectedForAria: R,
463
+ rowHeight: E,
464
+ isDirOpen: g,
465
+ columns: h,
466
+ numericTemplate: p,
467
+ numericTotal: x,
468
+ nameWidth: N,
469
+ rowClassName: f,
470
+ selection: { onEntryClick: w, selectedPath: S, currentPath: M, mode: I = "none", selectedItems: T, onSelectionChange: y },
471
+ expansion: { toggleDirectory: K, onToggleDirectoryRecursive: U },
472
+ visual: { iconOverrides: P, showExpandIcons: _ = !0, showDirectoryIcons: te = !0, showFileIcons: $ = !0, useCanvasExpandIcons: F = !1, expandIconSize: X, typeIconSize: re = Ct, indentSize: ae = dt, highlightStyles: J, expandIconClassName: de, expandIconStyle: me }
472
473
  }) => {
473
- const [ue, z] = le(!1), _ = e.children !== void 0, o = _ && f(e.absolutePath), m = e.absolutePath === R, g = e.absolutePath === M, T = !_ && !!k?.has(e.absolutePath), se = _ ? void 0 : jr(e), de = Ar({ entry: e, isDirectory: _, isExpanded: o, isItemSelected: T, selectionMode: w, onSelectionChange: y, onEntryClick: v, toggleDirectory: B, onToggleDirectoryRecursive: D }), A = ue ? $?.hoverClassName !== void 0 ? $.hoverClassName : F.entryHover : "", ee = (() => {
474
- if (_) {
475
- if (m) return $?.directorySelectedClassName !== void 0 ? $.directorySelectedClassName : F.entrySelected;
476
- } else if (m || T)
477
- return $?.itemSelectedClassName !== void 0 ? $.itemSelectedClassName : O(m && F.entrySelected, T && F.entryItemSelected);
474
+ const [W, le] = ie(!1), n = e.children !== void 0, b = n && g(e.absolutePath), m = e.absolutePath === S, C = e.absolutePath === M, H = !n && !!T?.has(e.absolutePath), pe = n ? void 0 : jr(e), A = Or({ entry: e, isDirectory: n, isExpanded: b, isItemSelected: H, selectionMode: I, onSelectionChange: y, onEntryClick: w, toggleDirectory: K, onToggleDirectoryRecursive: U }), ne = W ? J?.hoverClassName !== void 0 ? J.hoverClassName : D.entryHover : "", ye = (() => {
475
+ if (n) {
476
+ if (m) return J?.directorySelectedClassName !== void 0 ? J.directorySelectedClassName : D.entrySelected;
477
+ } else if (m || H)
478
+ return J?.itemSelectedClassName !== void 0 ? J.itemSelectedClassName : O(m && D.entrySelected, H && D.entryItemSelected);
478
479
  return "";
479
- })(), ye = typeof h == "function" ? h(e) : h, fe = O("dt-grid-row cursor-pointer select-none", A, ee, ye, e.className), Pe = O(F.expandIcon, pe, (m || T) && F.expandIconSelected), Ie = O(F.typeIcon, (m || T) && F.typeIconSelected), ne = O("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", _ && F.nameDirectory, (m || T) && F.nameSelected), L = Pr({ isDirectory: _, isExpanded: o, showExpandIcons: U, useCanvasExpandIcons: Q, expandIconSize: oe }), he = (_ ? ce : Z) ? _r({ entry: e, isDirectory: _, isExpanded: o, isSelected: m, isItemSelected: T, extension: se, mimeType: e.mimeType }, C) : null, X = { indentLevel: t, isDirectory: _, isExpanded: o }, [xe, ...K] = p, Fe = xe?.render ? xe.render(e, X) : e.label ?? e.name, ke = {
480
- ...ue ? $?.hoverStyle : {},
481
- ..._ && m ? $?.directorySelectedStyle : {},
482
- ...!_ && (m || T) ? $?.itemSelectedStyle : {}
480
+ })(), ue = typeof f == "function" ? f(e) : f, _e = O("dt-grid-row cursor-pointer select-none", ne, ye, ue, e.className), Ie = O(D.expandIcon, de, (m || H) && D.expandIconSelected), se = O(D.typeIcon, (m || H) && D.typeIconSelected), L = O("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", n && D.nameDirectory, (m || H) && D.nameSelected), fe = _r({ isDirectory: n, isExpanded: b, showExpandIcons: _, useCanvasExpandIcons: F, expandIconSize: X }), Q = (n ? te : $) ? Cr({ entry: e, isDirectory: n, isExpanded: b, isSelected: m, isItemSelected: H, extension: pe, mimeType: e.mimeType }, P) : null, Re = { indentLevel: t, isDirectory: n, isExpanded: b }, [z, ...Ce] = h, ke = z?.render ? z.render(e, Re) : e.label ?? e.name, Ne = {
481
+ ...W ? J?.hoverStyle : {},
482
+ ...n && m ? J?.directorySelectedStyle : {},
483
+ ...!n && (m || H) ? J?.itemSelectedStyle : {}
483
484
  };
484
- return /* @__PURE__ */ d.jsxs(
485
+ return /* @__PURE__ */ u.jsxs(
485
486
  "div",
486
487
  {
487
- className: fe,
488
- style: { height: x, ...ke, ...e.style },
488
+ className: _e,
489
+ style: { height: E, ...Ne, ...e.style },
489
490
  role: "row",
490
- "aria-expanded": _ ? o : void 0,
491
+ "aria-expanded": n ? b : void 0,
491
492
  "aria-level": t + 1,
492
493
  "aria-posinset": r,
493
- "aria-setsize": n,
494
+ "aria-setsize": o,
494
495
  "aria-rowindex": a,
495
- "aria-selected": w === "none" ? void 0 : I,
496
- "aria-current": g ? "page" : void 0,
497
- ...Cr(e.data),
498
- "data-entry-type": _ ? "directory" : "file",
499
- "data-entry-expanded": _ ? String(o) : void 0,
496
+ "aria-selected": I === "none" ? void 0 : R,
497
+ "aria-current": C ? "page" : void 0,
498
+ ...Ar(e.data),
499
+ "data-entry-type": n ? "directory" : "file",
500
+ "data-entry-expanded": n ? String(b) : void 0,
500
501
  "data-entry-selected": m ? "true" : void 0,
501
- "data-entry-item-selected": T ? "true" : void 0,
502
- onClick: de,
503
- onMouseEnter: () => z(!0),
504
- onMouseLeave: () => z(!1),
505
- onFocus: (W) => c(l, e.absolutePath, W.currentTarget),
506
- onBlur: (W) => i(e.absolutePath, W.currentTarget),
507
- onKeyDown: (W) => {
508
- if (W.key === "Enter") {
509
- if (W.repeat) {
510
- W.preventDefault();
502
+ "data-entry-item-selected": H ? "true" : void 0,
503
+ onClick: A,
504
+ onMouseEnter: () => le(!0),
505
+ onMouseLeave: () => le(!1),
506
+ onFocus: (Z) => c(l, e.absolutePath, Z.currentTarget),
507
+ onBlur: (Z) => i(e.absolutePath, Z.currentTarget),
508
+ onKeyDown: (Z) => {
509
+ if (Z.key === "Enter") {
510
+ if (Z.repeat) {
511
+ Z.preventDefault();
511
512
  return;
512
513
  }
513
- de(W);
514
+ A(Z);
514
515
  }
515
516
  },
516
517
  tabIndex: 0,
517
518
  children: [
518
- /* @__PURE__ */ d.jsxs("div", { className: O("dt-grid-name-cell", xe?.className), role: "gridcell", style: { width: j, paddingLeft: Math.max(0, t * re) }, children: [
519
- (U || Q) && /* @__PURE__ */ d.jsx("span", { className: Pe, style: ie, children: L }),
520
- (_ ? ce : Z) && /* @__PURE__ */ d.jsx("span", { className: Ie, children: he }),
521
- /* @__PURE__ */ d.jsx("span", { className: ne, children: Fe })
519
+ /* @__PURE__ */ u.jsxs("div", { className: O("dt-grid-name-cell", z?.className), role: "gridcell", style: { width: N, paddingLeft: Math.max(0, t * ae) }, children: [
520
+ (_ || F) && /* @__PURE__ */ u.jsx("span", { className: Ie, style: me, children: fe }),
521
+ (n ? te : $) && /* @__PURE__ */ u.jsx("span", { className: se, style: { width: re, height: re }, children: Q }),
522
+ /* @__PURE__ */ u.jsx("span", { className: L, children: ke })
522
523
  ] }),
523
- K.length > 0 && /* @__PURE__ */ d.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ d.jsx("div", { className: "dt-grid-numeric-track", style: Lr(E, S), children: K.map((W) => /* @__PURE__ */ d.jsx("div", { className: O("dt-grid-cell", Or(W.align), W.className), role: "gridcell", children: W.render ? W.render(e, X) : null }, W.key)) }) })
524
+ Ce.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ u.jsx("div", { className: "dt-grid-numeric-track", style: Dr(x, p), children: Ce.map((Z) => /* @__PURE__ */ u.jsx("div", { className: O("dt-grid-cell", Lr(Z.align), Z.className), role: "gridcell", children: Z.render ? Z.render(e, Re) : null }, Z.key)) }) })
524
525
  ]
525
526
  }
526
527
  );
527
528
  },
528
529
  (e, t) => {
529
530
  if (e.entry !== t.entry) return !1;
530
- const r = wr(e.entry, e.isDirOpen), n = wr(t.entry, t.isDirOpen);
531
+ const r = xr(e.entry, e.isDirOpen), o = xr(t.entry, t.isDirOpen);
531
532
  return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowIndex === t.rowIndex && // 焦点の通知は行番号で行うため、番号が変われば描き直してハンドラへ新しい番号を渡す
532
- e.flatIndex === t.flatIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && r === 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.currentPath === t.selection.currentPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
533
+ e.flatIndex === t.flatIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && r === o && 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.currentPath === t.selection.currentPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
533
534
  }
534
535
  );
535
- Dr.displayName = "DirectoryTreeGridRow";
536
- const Fr = ({
536
+ Fr.displayName = "DirectoryTreeGridRow";
537
+ const Mr = ({
537
538
  kind: e,
538
539
  columns: t,
539
540
  numericTemplate: r,
540
- numericTotal: n,
541
+ numericTotal: o,
541
542
  nameWidth: a,
542
543
  scrollBarWidth: l,
543
544
  className: c,
544
545
  nameContent: i,
545
- renderCell: I
546
+ renderCell: R
546
547
  }) => {
547
- const [, ...x] = t, f = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", p = e === "header" ? "dt-grid-header" : "dt-grid-footer", S = e === "header" ? "columnheader" : "gridcell";
548
- return /* @__PURE__ */ d.jsxs("div", { className: O(p, "text-gray-600 dark:text-gray-300", c), role: "row", children: [
549
- /* @__PURE__ */ d.jsx("div", { className: O(f, "px-1", t[0]?.className), role: S, style: { width: a }, children: i }),
550
- x.length > 0 && /* @__PURE__ */ d.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ d.jsx("div", { className: "dt-grid-numeric-track", style: Lr(n, r), children: x.map((E) => /* @__PURE__ */ d.jsx("div", { className: O("dt-grid-cell", Or(E.align), E.className), role: S, children: I(E) }, E.key)) }) }),
551
- /* @__PURE__ */ d.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: l }, "aria-hidden": "true" })
548
+ const [, ...E] = t, g = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", h = e === "header" ? "dt-grid-header" : "dt-grid-footer", p = e === "header" ? "columnheader" : "gridcell";
549
+ return /* @__PURE__ */ u.jsxs("div", { className: O(h, "text-gray-600 dark:text-gray-300", c), role: "row", children: [
550
+ /* @__PURE__ */ u.jsx("div", { className: O(g, "px-1", t[0]?.className), role: p, style: { width: a }, children: i }),
551
+ E.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ u.jsx("div", { className: "dt-grid-numeric-track", style: Dr(o, r), children: E.map((x) => /* @__PURE__ */ u.jsx("div", { className: O("dt-grid-cell", Lr(x.align), x.className), role: p, children: R(x) }, x.key)) }) }),
552
+ /* @__PURE__ */ u.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: l }, "aria-hidden": "true" })
552
553
  ] });
553
- }, Mn = ({ columns: e, className: t, ...r }) => /* @__PURE__ */ d.jsx(Fr, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...r }), xr = (e, t) => typeof e == "function" ? e(t) : e ?? null, $n = ({ columns: e, allEntries: t, className: r, ...n }) => /* @__PURE__ */ d.jsx(Fr, { kind: "footer", columns: e, className: r, nameContent: xr(e[0]?.footer, t), renderCell: (a) => xr(a.footer, t), ...n }), Hn = 240, Mr = 96, $r = 12, jt = (e, t) => {
554
+ }, $n = ({ columns: e, className: t, ...r }) => /* @__PURE__ */ u.jsx(Mr, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (o) => o.header ?? null, ...r }), Er = (e, t) => typeof e == "function" ? e(t) : e ?? null, Hn = ({ columns: e, allEntries: t, className: r, ...o }) => /* @__PURE__ */ u.jsx(Mr, { kind: "footer", columns: e, className: r, nameContent: Er(e[0]?.footer, t), renderCell: (a) => Er(a.footer, t), ...o }), Bn = 240, $r = 96, Hr = 12, Pt = (e, t) => {
554
555
  const r = e?.width;
555
556
  return typeof r == "number" && Number.isFinite(r) && r > 0 ? r : t;
556
- }, Bn = (e) => e.slice(1).map((t) => `${jt(t, Mr)}px`).join(" "), Wn = ({ measuredWidth: e, columns: t, scrollBarWidth: r = $r }) => {
557
- const n = jt(t[0], Hn), a = t.slice(1).reduce((I, x) => I + jt(x, Mr), 0), l = Number.isFinite(e) && e > 0 ? e : 0, c = Math.max(0, l - n - Math.max(0, r)), i = Math.max(0, a - c);
558
- return { nameWidth: n, numericTotal: a, numericVisible: c, maxHScroll: i };
559
- }, Nt = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, zn = (e) => {
560
- const t = [], r = (n) => {
561
- for (const a of n)
557
+ }, Wn = (e) => e.slice(1).map((t) => `${Pt(t, $r)}px`).join(" "), zn = ({ measuredWidth: e, columns: t, scrollBarWidth: r = Hr }) => {
558
+ const o = Pt(t[0], Bn), a = t.slice(1).reduce((R, E) => R + Pt(E, $r), 0), l = Number.isFinite(e) && e > 0 ? e : 0, c = Math.max(0, l - o - Math.max(0, r)), i = Math.max(0, a - c);
559
+ return { nameWidth: o, numericTotal: a, numericVisible: c, maxHScroll: i };
560
+ }, Nt = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, Yn = (e) => {
561
+ const t = [], r = (o) => {
562
+ for (const a of o)
562
563
  t.push(a), a.children && a.children.length > 0 && r(a.children);
563
564
  };
564
565
  return r(e), t;
565
- }, Hr = ["entryKindDirectory", "entryKindFile"], Er = [...ut, ...Hr], Pt = Object.freeze({
566
+ }, Br = ["entryKindDirectory", "entryKindFile"], Sr = [...ut, ...Br], jt = Object.freeze({
566
567
  en: Object.freeze({
567
568
  entryKindDirectory: "directory",
568
569
  entryKindFile: "file"
@@ -571,45 +572,45 @@ const Fr = ({
571
572
  entryKindDirectory: "ディレクトリ",
572
573
  entryKindFile: "ファイル"
573
574
  })
574
- }), Yn = Object.freeze({
575
- en: Object.freeze({ ...mr.en, ...Pt.en }),
576
- ja: Object.freeze({ ...mr.ja, ...Pt.ja })
577
- }), Sr = (e) => typeof e == "string" ? JSON.stringify(e) : e === null ? "null" : typeof e, Gn = (e) => {
575
+ }), Gn = Object.freeze({
576
+ en: Object.freeze({ ...pr.en, ...jt.en }),
577
+ ja: Object.freeze({ ...pr.ja, ...jt.ja })
578
+ }), Ir = (e) => typeof e == "string" ? JSON.stringify(e) : e === null ? "null" : typeof e, Vn = (e) => {
578
579
  const t = {};
579
580
  let r = !1;
580
- for (const n of ut) {
581
- const a = Object.hasOwn(e, n) ? e[n] : void 0;
582
- a !== void 0 && (t[n] = a, r = !0);
581
+ for (const o of ut) {
582
+ const a = Object.hasOwn(e, o) ? e[o] : void 0;
583
+ a !== void 0 && (t[o] = a, r = !0);
583
584
  }
584
585
  return r ? t : void 0;
585
- }, Vn = (e, t) => {
586
- const r = Tr(e);
586
+ }, Kn = (e, t) => {
587
+ const r = Pr(e);
587
588
  if (t === void 0)
588
- return Yn[r];
589
+ return Gn[r];
589
590
  if (t === null || typeof t != "object")
590
- throw new RangeError(`[directory-tree] labels must be an object; got ${Sr(t)}`);
591
- const n = Object.getPrototypeOf(t);
592
- if (n !== Object.prototype && n !== null)
591
+ throw new RangeError(`[directory-tree] labels must be an object; got ${Ir(t)}`);
592
+ const o = Object.getPrototypeOf(t);
593
+ if (o !== Object.prototype && o !== null)
593
594
  throw new RangeError(`[directory-tree] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t) ? "an array" : "an object with a non-plain prototype"}`);
594
595
  for (const c of Object.keys(t))
595
- if (!Er.includes(c))
596
- throw new RangeError(`[directory-tree] labels.${c} is not a known label key; expected one of ${Er.join(", ")}`);
597
- const l = { ...rn(r, Gn(t)), ...Pt[r] };
598
- for (const c of Hr) {
596
+ if (!Sr.includes(c))
597
+ throw new RangeError(`[directory-tree] labels.${c} is not a known label key; expected one of ${Sr.join(", ")}`);
598
+ const l = { ...nn(r, Vn(t)), ...jt[r] };
599
+ for (const c of Br) {
599
600
  const i = Object.hasOwn(t, c) ? t[c] : void 0;
600
601
  if (i !== void 0) {
601
602
  if (typeof i != "string" || i.trim() === "")
602
- throw new RangeError(`[directory-tree] labels.${c} must be a non-blank string; got ${Sr(i)}`);
603
+ throw new RangeError(`[directory-tree] labels.${c} must be a non-blank string; got ${Ir(i)}`);
603
604
  l[c] = i;
604
605
  }
605
606
  }
606
607
  return Object.freeze(l);
607
- }, Kn = (e) => {
608
+ }, Un = (e) => {
608
609
  const t = {};
609
610
  for (const r of ut)
610
611
  t[r] = e[r];
611
612
  return Object.freeze(t);
612
- }, Un = () => {
613
+ }, Xn = () => {
613
614
  let e = null;
614
615
  return {
615
616
  mark: (t) => {
@@ -620,156 +621,156 @@ const Fr = ({
620
621
  },
621
622
  landedOn: (t) => e?.includes(t) === !0
622
623
  };
623
- }, Xn = (e, t) => {
624
+ }, Jn = (e, t) => {
624
625
  const r = e.length - 1;
625
626
  if (r <= 0) return 0;
626
- let n = 0, a = r - 1, l = 0;
627
- for (; n <= a; ) {
628
- const c = n + a >>> 1;
629
- e[c] <= t ? (l = c, n = c + 1) : a = c - 1;
627
+ let o = 0, a = r - 1, l = 0;
628
+ for (; o <= a; ) {
629
+ const c = o + a >>> 1;
630
+ e[c] <= t ? (l = c, o = c + 1) : a = c - 1;
630
631
  }
631
632
  return l;
632
- }, Jn = (e, t, r) => {
633
+ }, Zn = (e, t, r) => {
633
634
  if (r <= 0 || e.length === 0 || t.length !== e.length + 1)
634
635
  return null;
635
- const n = Xn(t, r), a = e[n];
636
+ const o = Jn(t, r), a = e[o];
636
637
  return a ? {
637
638
  path: a.entry.absolutePath,
638
- offsetInViewport: r - t[n]
639
+ offsetInViewport: r - t[o]
639
640
  } : null;
640
- }, Zn = (e, t, r) => {
641
+ }, qn = (e, t, r) => {
641
642
  if (t.length === 0 || r.length !== t.length + 1)
642
643
  return null;
643
- for (let n = 0; n < t.length; n++)
644
- if (t[n].entry.absolutePath === e.path)
645
- return Math.max(0, r[n] + e.offsetInViewport);
644
+ for (let o = 0; o < t.length; o++)
645
+ if (t[o].entry.absolutePath === e.path)
646
+ return Math.max(0, r[o] + e.offsetInViewport);
646
647
  return null;
647
- }, qn = (e, t, r) => {
648
- const n = [];
648
+ }, Qn = (e, t, r) => {
649
+ const o = [];
649
650
  for (let a = t; a < r; a++) {
650
651
  const l = e[a];
651
652
  if (!(!l || l.length === 0))
652
653
  for (const c of l)
653
- n.push(c);
654
+ o.push(c);
654
655
  }
655
- return n;
656
- }, Qn = (e, t, r) => {
657
- const n = [];
656
+ return o;
657
+ }, eo = (e, t, r) => {
658
+ const o = [];
658
659
  for (let a = t; a < r; a++) {
659
660
  const l = e[a];
660
661
  if (!(!l || l.length === 0))
661
662
  for (const c of l)
662
- n.push(c);
663
+ o.push(c);
663
664
  }
664
- return n;
665
- }, eo = (e, t, r, n) => {
666
- const a = Math.max(1, Math.floor(t * n)), l = Math.max(1, Math.floor(r * n));
665
+ return o;
666
+ }, to = (e, t, r, o) => {
667
+ const a = Math.max(1, Math.floor(t * o)), l = Math.max(1, Math.floor(r * o));
667
668
  (e.width !== a || e.height !== l) && (e.width = a, e.height = l);
668
669
  const c = e.style;
669
670
  c.width !== `${t}px` && (c.width = `${t}px`), c.height !== `${r}px` && (c.height = `${r}px`);
670
- }, to = (e, t, r) => {
671
+ }, ro = (e, t, r) => {
671
672
  e.lineWidth = r, e.beginPath();
672
- for (const n of t)
673
- e.moveTo(n.x1, n.y1), e.lineTo(n.x2, n.y2);
673
+ for (const o of t)
674
+ e.moveTo(o.x1, o.y1), e.lineTo(o.x2, o.y2);
674
675
  e.stroke();
675
- }, ro = (e, t) => {
676
+ }, no = (e, t) => {
676
677
  const r = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
677
678
  if (!r)
678
679
  return null;
679
- let n = r[1];
680
- n.length === 3 && (n = n.split("").map((i) => i + i).join(""));
681
- const a = Number.parseInt(n.slice(0, 2), 16), l = Number.parseInt(n.slice(2, 4), 16), c = Number.parseInt(n.slice(4, 6), 16);
680
+ let o = r[1];
681
+ o.length === 3 && (o = o.split("").map((i) => i + i).join(""));
682
+ const a = Number.parseInt(o.slice(0, 2), 16), l = Number.parseInt(o.slice(2, 4), 16), c = Number.parseInt(o.slice(4, 6), 16);
682
683
  return `rgba(${a}, ${l}, ${c}, ${t})`;
683
- }, no = (e, t, r, n) => {
684
+ }, oo = (e, t, r, o) => {
684
685
  if (t.length === 0)
685
686
  return;
686
- const a = ro(r, 0.14), l = e.strokeStyle, c = e.fillStyle, i = e.lineWidth, I = e.lineCap, x = e.lineJoin;
687
+ const a = no(r, 0.14), l = e.strokeStyle, c = e.fillStyle, i = e.lineWidth, R = e.lineCap, E = e.lineJoin;
687
688
  e.strokeStyle = r, e.lineCap = "round", e.lineJoin = "round";
688
- for (const f of t) {
689
- const p = n ?? f.size, S = Math.max(0, p / 2), E = Math.max(1, Math.round(p * 0.08)), j = Math.max(1, Math.round(p * 0.14)), h = Math.max(0, S - E * 0.8), v = Math.max(0, h * 0.55);
690
- a && (e.fillStyle = a, e.beginPath(), e.arc(f.centerX, f.centerY, h, 0, Math.PI * 2), e.fill()), e.lineWidth = E, e.beginPath(), e.arc(f.centerX, f.centerY, Math.max(0, S - E * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = j, e.beginPath(), e.moveTo(f.centerX - v, f.centerY), e.lineTo(f.centerX + v, f.centerY), e.stroke(), f.isExpanded || (e.beginPath(), e.moveTo(f.centerX, f.centerY - v), e.lineTo(f.centerX, f.centerY + v), e.stroke());
689
+ for (const g of t) {
690
+ const h = o ?? g.size, p = Math.max(0, h / 2), x = Math.max(1, Math.round(h * 0.08)), N = Math.max(1, Math.round(h * 0.14)), f = Math.max(0, p - x * 0.8), w = Math.max(0, f * 0.55);
691
+ a && (e.fillStyle = a, e.beginPath(), e.arc(g.centerX, g.centerY, f, 0, Math.PI * 2), e.fill()), e.lineWidth = x, e.beginPath(), e.arc(g.centerX, g.centerY, Math.max(0, p - x * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = N, e.beginPath(), e.moveTo(g.centerX - w, g.centerY), e.lineTo(g.centerX + w, g.centerY), e.stroke(), g.isExpanded || (e.beginPath(), e.moveTo(g.centerX, g.centerY - w), e.lineTo(g.centerX, g.centerY + w), e.stroke());
691
692
  }
692
- e.strokeStyle = l, e.fillStyle = c, e.lineWidth = i, e.lineCap = I, e.lineJoin = x;
693
- }, Br = _t(({ segmentsByItem: e, glyphsByItem: t, itemHeight: r, width: n, viewportHeight: a, scrollPosition: l, color: c = "#a0aec0", strokeWidth: i = 1, renderStartIndex: I, renderEndIndex: x, lookaheadEndIndex: f, devicePixelRatio: p, expandGlyphColor: S, expandGlyphSize: E }) => {
694
- const j = V(null), h = V(null), v = V({
693
+ e.strokeStyle = l, e.fillStyle = c, e.lineWidth = i, e.lineCap = R, e.lineJoin = E;
694
+ }, Wr = _t(({ segmentsByItem: e, glyphsByItem: t, itemHeight: r, width: o, viewportHeight: a, scrollPosition: l, color: c = "#a0aec0", strokeWidth: i = 1, renderStartIndex: R, renderEndIndex: E, lookaheadEndIndex: g, devicePixelRatio: h, expandGlyphColor: p, expandGlyphSize: x }) => {
695
+ const N = V(null), f = V(null), w = V({
695
696
  segmentsByItem: e,
696
697
  glyphsByItem: t,
697
698
  itemHeight: r,
698
- width: n,
699
+ width: o,
699
700
  viewportHeight: a,
700
701
  scrollPosition: l,
701
702
  color: c,
702
703
  strokeWidth: i,
703
- renderStartIndex: I,
704
- renderEndIndex: x,
705
- lookaheadEndIndex: f,
706
- devicePixelRatio: p,
707
- expandGlyphColor: S,
708
- expandGlyphSize: E
709
- }), R = P(() => {
710
- h.current = null;
711
- const w = j.current;
712
- if (!w)
704
+ renderStartIndex: R,
705
+ renderEndIndex: E,
706
+ lookaheadEndIndex: g,
707
+ devicePixelRatio: h,
708
+ expandGlyphColor: p,
709
+ expandGlyphSize: x
710
+ }), S = j(() => {
711
+ f.current = null;
712
+ const I = N.current;
713
+ if (!I)
713
714
  return;
714
- const k = w.getContext("2d");
715
- if (!k)
715
+ const T = I.getContext("2d");
716
+ if (!T)
716
717
  return;
717
- const y = v.current;
718
+ const y = w.current;
718
719
  if (y.width <= 0 || y.viewportHeight <= 0) {
719
- k.clearRect(0, 0, w.width, w.height);
720
+ T.clearRect(0, 0, I.width, I.height);
720
721
  return;
721
722
  }
722
- const B = Number.isFinite(y.devicePixelRatio ?? NaN) ? y.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
723
- eo(w, y.width, y.viewportHeight, B);
724
- const D = y.segmentsByItem.length, C = typeof y.renderStartIndex == "number" && Number.isFinite(y.renderStartIndex) ? Math.max(0, Math.floor(y.renderStartIndex)) : Math.max(0, Math.floor(y.scrollPosition / y.itemHeight)), U = Math.min(D, Math.ceil((y.scrollPosition + y.viewportHeight) / y.itemHeight)), ce = (() => {
723
+ const K = Number.isFinite(y.devicePixelRatio ?? NaN) ? y.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
724
+ to(I, y.width, y.viewportHeight, K);
725
+ const U = y.segmentsByItem.length, P = typeof y.renderStartIndex == "number" && Number.isFinite(y.renderStartIndex) ? Math.max(0, Math.floor(y.renderStartIndex)) : Math.max(0, Math.floor(y.scrollPosition / y.itemHeight)), _ = Math.min(U, Math.ceil((y.scrollPosition + y.viewportHeight) / y.itemHeight)), te = (() => {
725
726
  if (typeof y.renderEndIndex == "number" && Number.isFinite(y.renderEndIndex)) {
726
727
  const re = Math.floor(y.renderEndIndex);
727
- return Math.max(Math.min(D, re + 1), C);
728
+ return Math.max(Math.min(U, re + 1), P);
728
729
  }
729
- return Math.max(U, C);
730
- })(), Z = (() => {
730
+ return Math.max(_, P);
731
+ })(), $ = (() => {
731
732
  if (typeof y.lookaheadEndIndex == "number" && Number.isFinite(y.lookaheadEndIndex)) {
732
- const re = Math.floor(y.lookaheadEndIndex), $ = Math.min(D, re + 1);
733
- return Math.max($, ce);
733
+ const re = Math.floor(y.lookaheadEndIndex), ae = Math.min(U, re + 1);
734
+ return Math.max(ae, te);
734
735
  }
735
- return Math.max(U, ce);
736
- })(), Q = qn(y.segmentsByItem, C, Z), oe = Qn(y.glyphsByItem, C, Z);
737
- k.save(), k.scale(B, B), k.clearRect(0, 0, y.width, y.viewportHeight), k.translate(0, -y.scrollPosition), k.strokeStyle = y.color, to(k, Q, y.strokeWidth), no(k, oe, y.expandGlyphColor ?? y.color, y.expandGlyphSize), k.restore();
738
- }, []), M = P(() => {
739
- h.current === null && (h.current = window.requestAnimationFrame(R));
740
- }, [R]);
741
- return Re(() => {
742
- v.current = {
736
+ return Math.max(_, te);
737
+ })(), F = Qn(y.segmentsByItem, P, $), X = eo(y.glyphsByItem, P, $);
738
+ T.save(), T.scale(K, K), T.clearRect(0, 0, y.width, y.viewportHeight), T.translate(0, -y.scrollPosition), T.strokeStyle = y.color, ro(T, F, y.strokeWidth), oo(T, X, y.expandGlyphColor ?? y.color, y.expandGlyphSize), T.restore();
739
+ }, []), M = j(() => {
740
+ f.current === null && (f.current = window.requestAnimationFrame(S));
741
+ }, [S]);
742
+ return Se(() => {
743
+ w.current = {
743
744
  segmentsByItem: e,
744
745
  glyphsByItem: t,
745
746
  itemHeight: r,
746
- width: n,
747
+ width: o,
747
748
  viewportHeight: a,
748
749
  scrollPosition: l,
749
750
  color: c,
750
751
  strokeWidth: i,
751
- renderStartIndex: I,
752
- renderEndIndex: x,
753
- lookaheadEndIndex: f,
754
- devicePixelRatio: p,
755
- expandGlyphColor: S,
756
- expandGlyphSize: E
752
+ renderStartIndex: R,
753
+ renderEndIndex: E,
754
+ lookaheadEndIndex: g,
755
+ devicePixelRatio: h,
756
+ expandGlyphColor: p,
757
+ expandGlyphSize: x
757
758
  }, M();
758
- }, [e, t, r, n, a, l, c, i, I, x, f, p, S, E, M]), Re(() => () => {
759
- h.current !== null && (window.cancelAnimationFrame(h.current), h.current = null);
760
- }, []), /* @__PURE__ */ d.jsx("canvas", { ref: j, className: "pointer-events-none absolute top-0 left-0 z-0" });
759
+ }, [e, t, r, o, a, l, c, i, R, E, g, h, p, x, M]), Se(() => () => {
760
+ f.current !== null && (window.cancelAnimationFrame(f.current), f.current = null);
761
+ }, []), /* @__PURE__ */ u.jsx("canvas", { ref: N, className: "pointer-events-none absolute top-0 left-0 z-0" });
761
762
  });
762
- Br.displayName = "TreeLineCanvas";
763
- const oo = (e) => {
763
+ Wr.displayName = "TreeLineCanvas";
764
+ const so = (e) => {
764
765
  const t = /* @__PURE__ */ new Map();
765
766
  for (let r = 0; r < e.length; r++) {
766
- const n = e[r].entry.absolutePath;
767
- t.has(n) || t.set(n, r);
767
+ const o = e[r].entry.absolutePath;
768
+ t.has(o) || t.set(o, r);
768
769
  }
769
770
  return t;
770
- }, Rr = (e, t) => e.selectedPath === t ? e : { selectedPath: t, selectionGeneration: e.selectionGeneration + 1, anchor: e.anchor }, so = (e, t) => ({ ...e, anchor: { path: t, selectionGeneration: e.selectionGeneration, focused: !0 } }), ao = (e, t) => {
771
- const { anchor: r, selectionGeneration: n, selectedPath: a } = t;
772
- if (r !== null && (r.focused || r.selectionGeneration === n)) {
771
+ }, Rr = (e, t) => e.selectedPath === t ? e : { selectedPath: t, selectionGeneration: e.selectionGeneration + 1, anchor: e.anchor }, ao = (e, t) => ({ ...e, anchor: { path: t, selectionGeneration: e.selectionGeneration, focused: !0 } }), lo = (e, t) => {
772
+ const { anchor: r, selectionGeneration: o, selectedPath: a } = t;
773
+ if (r !== null && (r.focused || r.selectionGeneration === o)) {
773
774
  const l = e.get(r.path);
774
775
  if (l !== void 0)
775
776
  return l;
@@ -780,23 +781,23 @@ const oo = (e) => {
780
781
  return l;
781
782
  }
782
783
  return 0;
783
- }, lo = {
784
+ }, co = {
784
785
  msOverflowStyle: "none",
785
786
  scrollbarWidth: "none"
786
- }, co = () => {
787
+ }, io = () => {
787
788
  let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
788
789
  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));
789
- }, io = (e) => {
790
+ }, uo = (e) => {
790
791
  const t = V(null), r = t.current;
791
- return r !== null && ut.every((n) => r[n] === e[n]) ? r : (t.current = e, e);
792
- }, Ir = /* @__PURE__ */ new Set(["top", "bottom", "center", "nearest"]), kr = (e) => {
792
+ return r !== null && ut.every((o) => r[o] === e[o]) ? r : (t.current = e, e);
793
+ }, kr = /* @__PURE__ */ new Set(["top", "bottom", "center", "nearest"]), Nr = (e) => {
793
794
  const t = e?.align;
794
795
  if (t === void 0)
795
796
  return "top";
796
- if (!Ir.has(t))
797
- throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...Ir].join(", ")}.`);
797
+ if (!kr.has(t))
798
+ throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...kr].join(", ")}.`);
798
799
  return t;
799
- }, uo = {
800
+ }, fo = {
800
801
  position: "absolute",
801
802
  width: 1,
802
803
  height: 1,
@@ -806,239 +807,234 @@ const oo = (e) => {
806
807
  overflow: "hidden",
807
808
  clipPath: "inset(50%)",
808
809
  whiteSpace: "nowrap"
809
- }, fo = (e, t, r, n, a) => {
810
+ }, ho = (e, t, r, o, a) => {
810
811
  const l = [], c = [];
811
812
  let i = 0;
812
- const I = (x, f, p) => {
813
- const S = a ? [...x].sort(a) : x;
814
- for (let E = 0; E < S.length; E++) {
815
- const j = S[E], h = E === S.length - 1, v = [...p, h], R = j.children !== void 0, M = R && t(j.absolutePath, j.relativePath);
816
- let w = f, k = v, y = p;
817
- n && (w = f - 1, k = v.slice(1), y = p.slice(1)), l.push({ entry: j, indentLevel: w, depth: f, positionInSet: E + 1, setSize: S.length, parentIsLast: k }), r && (w > i && (i = w), c.push({
818
- id: j.absolutePath,
819
- name: j.name,
820
- absolutePath: j.absolutePath,
821
- indentLevel: w,
822
- isLastChild: h,
823
- isDirectory: R,
813
+ const R = (E, g, h) => {
814
+ const p = a ? [...E].sort(a) : E;
815
+ for (let x = 0; x < p.length; x++) {
816
+ const N = p[x], f = x === p.length - 1, w = [...h, f], S = N.children !== void 0, M = S && t(N.absolutePath, N.relativePath);
817
+ let I = g, T = w, y = h;
818
+ o && (I = g - 1, T = w.slice(1), y = h.slice(1)), l.push({ entry: N, indentLevel: I, depth: g, positionInSet: x + 1, setSize: p.length, parentIsLast: T }), r && (I > i && (i = I), c.push({
819
+ id: N.absolutePath,
820
+ name: N.name,
821
+ absolutePath: N.absolutePath,
822
+ indentLevel: I,
823
+ isLastChild: f,
824
+ isDirectory: S,
824
825
  isExpanded: M,
825
826
  ancestorIsLast: [...y],
826
- hideLines: n && f === 0
827
- })), R && M && j.children && I(j.children, f + 1, v);
827
+ hideLines: o && g === 0
828
+ })), S && M && N.children && R(N.children, g + 1, w);
828
829
  }
829
830
  };
830
- return I(e, 0, []), { flatItems: l, lineItems: c, maxIndent: i };
831
- }, Nr = (e, t) => {
831
+ return R(e, 0, []), { flatItems: l, lineItems: c, maxIndent: i };
832
+ }, Tr = (e, t) => {
832
833
  const r = e.length - 1;
833
834
  if (r <= 0) return 0;
834
- let n = 0, a = r - 1, l = 0;
835
- for (; n <= a; ) {
836
- const c = n + a >>> 1;
837
- e[c] <= t ? (l = c, n = c + 1) : a = c - 1;
835
+ let o = 0, a = r - 1, l = 0;
836
+ for (; o <= a; ) {
837
+ const c = o + a >>> 1;
838
+ e[c] <= t ? (l = c, o = c + 1) : a = c - 1;
838
839
  }
839
840
  return l;
840
- }, ho = (e, t, r, n, a, l) => {
841
- const c = n?.renderStart ?? Math.max(0, Nr(l, a)), i = t > 0 ? Nr(l, a + t) + r : c + r, I = e > 0 ? Math.min(e - 1, Math.max(c, i)) : c, x = n?.renderEnd ?? I, f = e > 0 ? Math.min(e - 1, x + r) : x;
842
- return { renderStart: c, renderEnd: x, lookaheadEnd: f };
843
- }, mo = (e, t, r, n, a, l) => {
841
+ }, mo = (e, t, r, o, a, l) => {
842
+ const c = o?.renderStart ?? Math.max(0, Tr(l, a)), i = t > 0 ? Tr(l, a + t) + r : c + r, R = e > 0 ? Math.min(e - 1, Math.max(c, i)) : c, E = o?.renderEnd ?? R, g = e > 0 ? Math.min(e - 1, E + r) : E;
843
+ return { renderStart: c, renderEnd: E, lookaheadEnd: g };
844
+ }, po = (e, t, r, o, a, l) => {
844
845
  if (e.length === 0)
845
846
  return { segmentsByItem: [], glyphsByItem: [] };
846
- const c = Array.from({ length: e.length }, () => []), i = Array.from({ length: e.length }, () => []), I = (f) => a ? typeof l == "number" && Number.isFinite(l) && l > 0 ? l : Math.max(8, Math.min(n * 0.9, f * 0.7)) : 0, x = 3;
847
- for (let f = 0; f < e.length; f++) {
848
- const p = e[f];
849
- if (p.hideLines)
847
+ const c = Array.from({ length: e.length }, () => []), i = Array.from({ length: e.length }, () => []), R = (h) => a ? typeof l == "number" && Number.isFinite(l) && l > 0 ? l : Math.max(8, Math.min(o * 0.9, h * 0.7)) : 0, E = 3, g = (h) => h * o + o / 2 + E;
848
+ for (let h = 0; h < e.length; h++) {
849
+ const p = e[h], x = t[h] ?? 0, N = r[h] ?? 0, f = N + x / 2, w = e[h + 1], S = f + Ct / 2, M = N + x, I = w !== void 0 && w.indentLevel === p.indentLevel + 1 && S < M ? { key: `${p.id}-connector-children`, x1: g(w.indentLevel), y1: S, x2: g(w.indentLevel), y2: M, itemIndex: h } : null;
850
+ if (p.hideLines) {
851
+ I !== null && (c[h] = [I]);
850
852
  continue;
851
- const S = [], E = t[f] ?? 0, j = r[f] ?? 0, h = j + E / 2, v = I(E), R = v > 0 ? v / 2 + 2 : n / 1.5;
852
- for (let k = 0; k < p.indentLevel; k++) {
853
- if (p.ancestorIsLast[k] ?? !1)
853
+ }
854
+ const T = [], y = R(x), K = y > 0 ? y / 2 + 2 : o / 1.5;
855
+ for (let _ = 0; _ < p.indentLevel; _++) {
856
+ if (p.ancestorIsLast[_] ?? !1)
854
857
  continue;
855
- let B = !1;
856
- for (let D = f; D < e.length; D++) {
857
- const C = e[D];
858
- if (C.indentLevel > k && C.ancestorIsLast.length > k && !C.ancestorIsLast[k]) {
859
- B = !0;
858
+ let $ = !1;
859
+ for (let F = h; F < e.length; F++) {
860
+ const X = e[F];
861
+ if (X.indentLevel > _ && X.ancestorIsLast.length > _ && !X.ancestorIsLast[_]) {
862
+ $ = !0;
860
863
  break;
861
864
  }
862
- if (D > f && C.indentLevel === k)
865
+ if (F > h && X.indentLevel === _)
863
866
  break;
864
867
  }
865
- if (B) {
866
- const D = k * n + n / 2 + x;
867
- S.push({
868
- key: `${p.id}-ancestor-${k}`,
869
- x1: D,
870
- y1: j,
871
- x2: D,
872
- y2: j + E,
873
- itemIndex: f
868
+ if ($) {
869
+ const F = g(_);
870
+ T.push({
871
+ key: `${p.id}-ancestor-${_}`,
872
+ x1: F,
873
+ y1: N,
874
+ x2: F,
875
+ y2: N + x,
876
+ itemIndex: h
874
877
  });
875
878
  }
876
879
  }
877
- const M = p.indentLevel * n, w = M + n / 2 + x;
878
- if (p.isDirectory ? S.push({
880
+ const U = p.indentLevel * o, P = g(p.indentLevel);
881
+ if (h > 0 && T.push({
879
882
  key: `${p.id}-connector-top`,
880
- x1: w,
881
- y1: j,
882
- x2: w,
883
- y2: h - R,
884
- itemIndex: f
885
- }) : S.push({
886
- key: `${p.id}-connector-top`,
887
- x1: w,
888
- y1: j,
889
- x2: w,
890
- y2: h,
891
- itemIndex: f
892
- }), !p.isDirectory && p.isLastChild && S.push({
883
+ x1: P,
884
+ y1: N,
885
+ x2: P,
886
+ y2: p.isDirectory ? f - K : f,
887
+ itemIndex: h
888
+ }), !p.isDirectory && p.isLastChild && T.push({
893
889
  key: `${p.id}-connector-horizontal`,
894
- x1: w,
895
- y1: h,
896
- x2: M + n + x,
897
- y2: h,
898
- itemIndex: f
899
- }), p.isLastChild || (p.isDirectory ? S.push({
890
+ x1: P,
891
+ y1: f,
892
+ x2: U + o + E,
893
+ y2: f,
894
+ itemIndex: h
895
+ }), p.isLastChild || (p.isDirectory ? T.push({
900
896
  key: `${p.id}-connector-bottom`,
901
- x1: w,
902
- y1: h + R,
903
- x2: w,
904
- y2: j + E,
905
- itemIndex: f
906
- }) : S.push({
897
+ x1: P,
898
+ y1: f + K,
899
+ x2: P,
900
+ y2: N + x,
901
+ itemIndex: h
902
+ }) : T.push({
907
903
  key: `${p.id}-connector-bottom`,
908
- x1: w,
909
- y1: h,
910
- x2: w,
911
- y2: j + E,
912
- itemIndex: f
913
- })), c[f] = S, a && p.isDirectory) {
914
- const k = v, y = w, B = h;
915
- i[f] = [
904
+ x1: P,
905
+ y1: f,
906
+ x2: P,
907
+ y2: N + x,
908
+ itemIndex: h
909
+ })), I !== null && T.push(I), c[h] = T, a && p.isDirectory) {
910
+ const _ = y, te = P, $ = f;
911
+ i[h] = [
916
912
  {
917
913
  key: `${p.id}-glyph`,
918
- itemIndex: f,
919
- centerX: y,
920
- centerY: B,
921
- size: k,
914
+ itemIndex: h,
915
+ centerX: te,
916
+ centerY: $,
917
+ size: _,
922
918
  isExpanded: p.isExpanded
923
919
  }
924
920
  ];
925
921
  }
926
922
  }
927
923
  return { segmentsByItem: c, glyphsByItem: i };
928
- }, At = _t(
924
+ }, Ot = _t(
929
925
  ({
930
926
  entry: e,
931
927
  indentLevel: t,
932
928
  depth: r,
933
- positionInSet: n,
929
+ positionInSet: o,
934
930
  setSize: a,
935
931
  isSelectedForAria: l,
936
932
  flatIndex: c,
937
933
  isActive: i,
938
- registerRowRef: I,
939
- onNavigationKeyDown: x,
940
- onRowFocus: f,
941
- onRowBlur: p,
942
- rowHeight: S,
943
- entryKindDirectory: E,
944
- entryKindFile: j,
945
- isDirOpen: h,
946
- parentIsLast: v,
947
- renderChildren: R = !0,
948
- expansion: { toggleDirectory: M, onToggleDirectoryRecursive: w },
949
- selection: { onEntryClick: k, selectedPath: y, currentPath: B, mode: D = "none", selectedItems: C, onSelectionChange: U },
934
+ registerRowRef: R,
935
+ onNavigationKeyDown: E,
936
+ onRowFocus: g,
937
+ onRowBlur: h,
938
+ rowHeight: p,
939
+ entryKindDirectory: x,
940
+ entryKindFile: N,
941
+ isDirOpen: f,
942
+ parentIsLast: w,
943
+ renderChildren: S = !0,
944
+ expansion: { toggleDirectory: M, onToggleDirectoryRecursive: I },
945
+ selection: { onEntryClick: T, selectedPath: y, currentPath: K, mode: U = "none", selectedItems: P, onSelectionChange: _ },
950
946
  visual: {
951
- iconOverrides: ce,
952
- showExpandIcons: Z = !0,
953
- showDirectoryIcons: Q = !0,
954
- showFileIcons: oe = !0,
947
+ iconOverrides: te,
948
+ showExpandIcons: $ = !0,
949
+ showDirectoryIcons: F = !0,
950
+ showFileIcons: X = !0,
955
951
  useCanvasExpandIcons: re = !1,
956
- expandIconSize: $,
957
- typeIconSize: pe,
958
- fontSize: ie,
959
- indentSize: ue = it,
960
- highlightStyles: z,
961
- entryClassName: _,
962
- entryStyle: o,
963
- nameClassName: m,
964
- nameStyle: g,
965
- directoryNameClassName: T,
966
- directoryNameStyle: se,
967
- fileNameClassName: de,
952
+ expandIconSize: ae,
953
+ typeIconSize: J = Ct,
954
+ fontSize: de,
955
+ indentSize: me = dt,
956
+ highlightStyles: W,
957
+ entryClassName: le,
958
+ entryStyle: n,
959
+ nameClassName: b,
960
+ nameStyle: m,
961
+ directoryNameClassName: C,
962
+ directoryNameStyle: H,
963
+ fileNameClassName: pe,
968
964
  fileNameStyle: A,
969
- expandIconClassName: ee,
965
+ expandIconClassName: ne,
970
966
  expandIconStyle: ye
971
967
  }
972
968
  }) => {
973
- const [fe, Pe] = le(null), [Ie, ne] = le(!1), L = e.children !== void 0, he = L && h(e.absolutePath), X = e.absolutePath === y, xe = e.absolutePath === B, K = !L && C?.has(e.absolutePath), Fe = P((Y) => I(c, Y), [I, c]), ke = L ? void 0 : jr(e);
974
- Re(() => {
975
- Pe(he && e.children ? e.children : null);
976
- }, [he, e.children]);
977
- const W = Ar({ entry: e, isDirectory: L, isExpanded: he, isItemSelected: !!K, selectionMode: D, onSelectionChange: U, onEntryClick: k, toggleDirectory: M, onToggleDirectoryRecursive: w }), dt = Ie ? z?.hoverClassName !== void 0 ? z.hoverClassName : F.entryHover : "", Me = (() => {
969
+ const [ue, _e] = ie(null), [Ie, se] = ie(!1), L = e.children !== void 0, fe = L && f(e.absolutePath), Q = e.absolutePath === y, Re = e.absolutePath === K, z = !L && P?.has(e.absolutePath), Ce = j((Y) => R(c, Y), [R, c]), ke = L ? void 0 : jr(e);
970
+ Se(() => {
971
+ _e(fe && e.children ? e.children : null);
972
+ }, [fe, e.children]);
973
+ const Ne = Or({ entry: e, isDirectory: L, isExpanded: fe, isItemSelected: !!z, selectionMode: U, onSelectionChange: _, onEntryClick: T, toggleDirectory: M, onToggleDirectoryRecursive: I }), Z = Ie ? W?.hoverClassName !== void 0 ? W.hoverClassName : D.entryHover : "", $e = (() => {
978
974
  if (L) {
979
- if (X)
980
- return z?.directorySelectedClassName !== void 0 ? z.directorySelectedClassName : F.entrySelected;
981
- } else if (X || K)
982
- return z?.itemSelectedClassName !== void 0 ? z.itemSelectedClassName : O(X && F.entrySelected, K && F.entryItemSelected);
975
+ if (Q)
976
+ return W?.directorySelectedClassName !== void 0 ? W.directorySelectedClassName : D.entrySelected;
977
+ } else if (Q || z)
978
+ return W?.itemSelectedClassName !== void 0 ? W.itemSelectedClassName : O(Q && D.entrySelected, z && D.entryItemSelected);
983
979
  return "";
984
- })(), $e = O(F.entry, dt, Me, _, e.className), Ve = O(F.expandIcon, ee, (X || K) && F.expandIconSelected), ft = O(F.typeIcon, (X || K) && F.typeIconSelected), _e = O(F.name, m, L && F.nameDirectory, L && T, !L && de, (X || K) && F.nameSelected), Ke = Pr({ isDirectory: L, isExpanded: he, showExpandIcons: Z, useCanvasExpandIcons: re, expandIconSize: $ }), Ue = (L ? Q : oe) ? _r({ entry: e, isDirectory: L, isExpanded: he, isSelected: X, isItemSelected: !!K, extension: ke, mimeType: e.mimeType }, ce) : null, Xe = {
985
- ...Ie ? z?.hoverStyle : {},
986
- ...L && X ? z?.directorySelectedStyle : {},
987
- ...!L && (X || K) ? z?.itemSelectedStyle : {}
988
- }, Je = Cr(e.data), Ze = pe ? { width: pe, height: pe } : void 0, He = ie ? { fontSize: typeof ie == "number" ? `${ie}px` : ie } : void 0;
989
- return /* @__PURE__ */ d.jsxs(en, { children: [
990
- /* @__PURE__ */ d.jsxs(
980
+ })(), He = O(D.entry, Z, $e, le, e.className), Ke = O(D.expandIcon, ne, (Q || z) && D.expandIconSelected), ft = O(D.typeIcon, (Q || z) && D.typeIconSelected), Ae = O(D.name, b, L && D.nameDirectory, L && C, !L && pe, (Q || z) && D.nameSelected), Ue = _r({ isDirectory: L, isExpanded: fe, showExpandIcons: $, useCanvasExpandIcons: re, expandIconSize: ae }), Xe = (L ? F : X) ? Cr({ entry: e, isDirectory: L, isExpanded: fe, isSelected: Q, isItemSelected: !!z, extension: ke, mimeType: e.mimeType }, te) : null, Je = {
981
+ ...Ie ? W?.hoverStyle : {},
982
+ ...L && Q ? W?.directorySelectedStyle : {},
983
+ ...!L && (Q || z) ? W?.itemSelectedStyle : {}
984
+ }, Ze = Ar(e.data), qe = { width: J, height: J }, Be = de ? { fontSize: typeof de == "number" ? `${de}px` : de } : void 0;
985
+ return /* @__PURE__ */ u.jsxs(tn, { children: [
986
+ /* @__PURE__ */ u.jsxs(
991
987
  "div",
992
988
  {
993
- className: $e,
989
+ className: He,
994
990
  style: {
995
- paddingLeft: `${Math.max(0, t * ue)}px`,
996
- transform: t < 0 ? `translateX(${t * ue}px)` : void 0,
997
- width: t < 0 ? `calc(100% + ${Math.abs(t * ue)}px)` : void 0,
998
- height: `${S}px`,
999
- ...He,
1000
- ...Xe,
1001
- ...o,
991
+ paddingLeft: `${Math.max(0, t * me)}px`,
992
+ transform: t < 0 ? `translateX(${t * me}px)` : void 0,
993
+ width: t < 0 ? `calc(100% + ${Math.abs(t * me)}px)` : void 0,
994
+ height: `${p}px`,
995
+ ...Be,
996
+ ...Je,
997
+ ...n,
1002
998
  ...e.style
1003
999
  },
1004
- ...Je,
1000
+ ...Ze,
1005
1001
  "data-entry-type": L ? "directory" : "file",
1006
- "data-entry-expanded": L ? String(he) : void 0,
1007
- "data-entry-selected": X ? "true" : void 0,
1008
- "data-entry-item-selected": K ? "true" : void 0,
1009
- onClick: W,
1010
- onMouseEnter: () => ne(!0),
1011
- onMouseLeave: () => ne(!1),
1012
- onFocus: (Y) => f(c, e.absolutePath, Y.currentTarget),
1013
- onBlur: (Y) => p(e.absolutePath, Y.currentTarget),
1014
- ref: Fe,
1002
+ "data-entry-expanded": L ? String(fe) : void 0,
1003
+ "data-entry-selected": Q ? "true" : void 0,
1004
+ "data-entry-item-selected": z ? "true" : void 0,
1005
+ onClick: Ne,
1006
+ onMouseEnter: () => se(!0),
1007
+ onMouseLeave: () => se(!1),
1008
+ onFocus: (Y) => g(c, e.absolutePath, Y.currentTarget),
1009
+ onBlur: (Y) => h(e.absolutePath, Y.currentTarget),
1010
+ ref: Ce,
1015
1011
  onKeyDown: (Y) => {
1016
1012
  if (Y.key === "Enter" || Y.key === " ") {
1017
- Y.preventDefault(), Y.repeat || W(Y);
1013
+ Y.preventDefault(), Y.repeat || Ne(Y);
1018
1014
  return;
1019
1015
  }
1020
- x(Y, c);
1016
+ E(Y, c);
1021
1017
  },
1022
1018
  tabIndex: i ? 0 : -1,
1023
1019
  role: "treeitem",
1024
- "aria-expanded": L ? he : void 0,
1020
+ "aria-expanded": L ? fe : void 0,
1025
1021
  "aria-level": r + 1,
1026
- "aria-posinset": n,
1022
+ "aria-posinset": o,
1027
1023
  "aria-setsize": a,
1028
- "aria-selected": D === "none" ? void 0 : l,
1029
- "aria-current": xe ? "page" : void 0,
1030
- "aria-label": `${e.name} (${L ? E : j})`,
1024
+ "aria-selected": U === "none" ? void 0 : l,
1025
+ "aria-current": Re ? "page" : void 0,
1026
+ "aria-label": `${e.name} (${L ? x : N})`,
1031
1027
  children: [
1032
- (Z || re) && /* @__PURE__ */ d.jsx("span", { className: Ve, style: ye, children: Ke }),
1033
- (L ? Q : oe) && /* @__PURE__ */ d.jsx("span", { className: ft, style: Ze, children: Ue }),
1034
- /* @__PURE__ */ d.jsx(
1028
+ ($ || re) && /* @__PURE__ */ u.jsx("span", { className: Ke, style: ye, children: Ue }),
1029
+ (L ? F : X) && /* @__PURE__ */ u.jsx("span", { className: ft, style: qe, children: Xe }),
1030
+ /* @__PURE__ */ u.jsx(
1035
1031
  "span",
1036
1032
  {
1037
- className: _e,
1033
+ className: Ae,
1038
1034
  style: {
1039
- ...He,
1040
- ...g,
1041
- ...L ? se : A
1035
+ ...Be,
1036
+ ...m,
1037
+ ...L ? H : A
1042
1038
  },
1043
1039
  "data-entry-type": L ? "directory" : "file",
1044
1040
  "data-entry-role": "name",
@@ -1048,45 +1044,45 @@ const oo = (e) => {
1048
1044
  ]
1049
1045
  }
1050
1046
  ),
1051
- he && fe && R && /* @__PURE__ */ d.jsx("fieldset", { children: fe.map((Y, ge) => /* @__PURE__ */ d.jsx(
1052
- At,
1047
+ fe && ue && S && /* @__PURE__ */ u.jsx("fieldset", { children: ue.map((Y, ge) => /* @__PURE__ */ u.jsx(
1048
+ Ot,
1053
1049
  {
1054
1050
  entry: Y,
1055
1051
  indentLevel: t + 1,
1056
1052
  depth: r + 1,
1057
1053
  positionInSet: ge + 1,
1058
- setSize: fe.length,
1059
- isSelectedForAria: !!C?.has(Y.absolutePath),
1054
+ setSize: ue.length,
1055
+ isSelectedForAria: !!P?.has(Y.absolutePath),
1060
1056
  flatIndex: -1,
1061
1057
  isActive: !1,
1062
- registerRowRef: I,
1063
- onNavigationKeyDown: x,
1064
- onRowFocus: f,
1065
- onRowBlur: p,
1066
- rowHeight: S,
1067
- entryKindDirectory: E,
1068
- entryKindFile: j,
1069
- isDirOpen: h,
1070
- parentIsLast: [...v, ge === fe.length - 1],
1071
- expansion: { toggleDirectory: M, onToggleDirectoryRecursive: w },
1072
- selection: { onEntryClick: k, selectedPath: y, currentPath: B, mode: D, selectedItems: C, onSelectionChange: U },
1058
+ registerRowRef: R,
1059
+ onNavigationKeyDown: E,
1060
+ onRowFocus: g,
1061
+ onRowBlur: h,
1062
+ rowHeight: p,
1063
+ entryKindDirectory: x,
1064
+ entryKindFile: N,
1065
+ isDirOpen: f,
1066
+ parentIsLast: [...w, ge === ue.length - 1],
1067
+ expansion: { toggleDirectory: M, onToggleDirectoryRecursive: I },
1068
+ selection: { onEntryClick: T, selectedPath: y, currentPath: K, mode: U, selectedItems: P, onSelectionChange: _ },
1073
1069
  visual: {
1074
- iconOverrides: ce,
1075
- showExpandIcons: Z,
1076
- showDirectoryIcons: Q,
1077
- showFileIcons: oe,
1070
+ iconOverrides: te,
1071
+ showExpandIcons: $,
1072
+ showDirectoryIcons: F,
1073
+ showFileIcons: X,
1078
1074
  useCanvasExpandIcons: re,
1079
- expandIconSize: $,
1080
- highlightStyles: z,
1081
- entryClassName: _,
1082
- entryStyle: o,
1083
- nameClassName: m,
1084
- nameStyle: g,
1085
- directoryNameClassName: T,
1086
- directoryNameStyle: se,
1087
- fileNameClassName: de,
1075
+ expandIconSize: ae,
1076
+ highlightStyles: W,
1077
+ entryClassName: le,
1078
+ entryStyle: n,
1079
+ nameClassName: b,
1080
+ nameStyle: m,
1081
+ directoryNameClassName: C,
1082
+ directoryNameStyle: H,
1083
+ fileNameClassName: pe,
1088
1084
  fileNameStyle: A,
1089
- expandIconClassName: ee,
1085
+ expandIconClassName: ne,
1090
1086
  expandIconStyle: ye
1091
1087
  }
1092
1088
  },
@@ -1096,251 +1092,251 @@ const oo = (e) => {
1096
1092
  },
1097
1093
  (e, t) => {
1098
1094
  if (e.entry !== t.entry) return !1;
1099
- const r = e.entry.children !== void 0, n = t.entry.children !== void 0, a = r && e.isDirOpen(e.entry.absolutePath), l = n && t.isDirOpen(t.entry.absolutePath);
1095
+ const r = e.entry.children !== void 0, o = t.entry.children !== void 0, a = r && e.isDirOpen(e.entry.absolutePath), l = o && t.isDirOpen(t.entry.absolutePath);
1100
1096
  return e.indentLevel === t.indentLevel && // 位置情報は aria として描画されるため、変化したら再描画が必要
1101
1097
  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 && // 種別語はアクセシブルネームとして描画されるため、ロケール / 上書きの変更で再描画が必要
1102
1098
  e.entryKindDirectory === t.entryKindDirectory && e.entryKindFile === t.entryKindFile && a === l && e.selection.selectedPath === t.selection.selectedPath && e.selection.currentPath === t.selection.currentPath && 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.visual.expandIconClassName === t.visual.expandIconClassName && e.visual.expandIconStyle === t.visual.expandIconStyle && e.parentIsLast.length === t.parentIsLast.length && e.parentIsLast.every((c, i) => c === t.parentIsLast[i]);
1103
1099
  }
1104
1100
  );
1105
- At.displayName = "DirectoryEntryItem";
1106
- const Wr = (e) => {
1101
+ Ot.displayName = "DirectoryEntryItem";
1102
+ const zr = (e) => {
1107
1103
  const t = [];
1108
1104
  if (e.children)
1109
1105
  for (const r of e.children)
1110
- r.type === "directory" && (t.push(r.absolutePath), t.push(...Wr(r)));
1106
+ r.type === "directory" && (t.push(r.absolutePath), t.push(...zr(r)));
1111
1107
  return t;
1112
- }, vo = ({
1108
+ }, wo = ({
1113
1109
  entries: e,
1114
- expansion: { toggle: t, isExpanded: r, expandMultiple: n, collapseMultiple: a, isPending: l, alwaysExpanded: c = !1, doubleClickAction: i = "recursive" },
1115
- selection: { onEntryClick: I, selectedPath: x, currentPath: f, mode: p = "none", selectedItems: S, onSelectionChange: E },
1110
+ expansion: { toggle: t, isExpanded: r, expandMultiple: o, collapseMultiple: a, isPending: l, alwaysExpanded: c = !1, doubleClickAction: i = "recursive" },
1111
+ selection: { onEntryClick: R, selectedPath: E, currentPath: g, mode: h = "none", selectedItems: p, onSelectionChange: x },
1116
1112
  visual: {
1117
- className: j,
1118
- style: h,
1119
- ariaLabel: v,
1120
- ariaLabelledBy: R,
1113
+ className: N,
1114
+ style: f,
1115
+ ariaLabel: w,
1116
+ ariaLabelledBy: S,
1121
1117
  lineColor: M = "#A0AEC0",
1122
- showTreeLines: w = !0,
1123
- showExpandIcons: k = !0,
1118
+ showTreeLines: I = !0,
1119
+ showExpandIcons: T = !0,
1124
1120
  showDirectoryIcons: y = !0,
1125
- showFileIcons: B = !0,
1126
- iconOverrides: D,
1127
- expandIconSize: C,
1128
- itemHeight: U = ct,
1129
- removeRootIndent: ce = !1,
1130
- highlightStyles: Z,
1131
- entryClassName: Q,
1132
- entryStyle: oe,
1121
+ showFileIcons: K = !0,
1122
+ iconOverrides: U,
1123
+ expandIconSize: P,
1124
+ itemHeight: _ = it,
1125
+ removeRootIndent: te = !1,
1126
+ highlightStyles: $,
1127
+ entryClassName: F,
1128
+ entryStyle: X,
1133
1129
  nameClassName: re,
1134
- nameStyle: $,
1135
- directoryNameClassName: pe,
1136
- directoryNameStyle: ie,
1137
- fileNameClassName: ue,
1138
- fileNameStyle: z,
1139
- expandIconClassName: _,
1140
- expandIconStyle: o
1130
+ nameStyle: ae,
1131
+ directoryNameClassName: J,
1132
+ directoryNameStyle: de,
1133
+ fileNameClassName: me,
1134
+ fileNameStyle: W,
1135
+ expandIconClassName: le,
1136
+ expandIconStyle: n
1141
1137
  } = {},
1142
- virtualScroll: m,
1143
- grid: g,
1144
- sort: T,
1145
- locale: se,
1146
- labels: de,
1138
+ virtualScroll: b,
1139
+ grid: m,
1140
+ sort: C,
1141
+ locale: H,
1142
+ labels: pe,
1147
1143
  ref: A
1148
1144
  }) => {
1149
- const ee = Tr(se), ye = G(() => Vn(se, de), [se, de]), fe = io(Kn(ye)), { entryKindDirectory: Pe, entryKindFile: Ie } = ye, ne = g !== void 0, [L, he] = le(!1), X = V(null), xe = V(null), K = V(null), [Fe, ke] = le(0), [W, dt] = le(0), [Me, $e] = le(0), [Ve, ft] = le(null), {
1150
- overscanCount: _e = 15,
1151
- className: Ke,
1152
- background: Ue,
1153
- onScroll: Xe,
1154
- onRangeChange: Je,
1155
- onScrollAdjust: Ze,
1156
- liveRegion: He,
1145
+ const ne = Pr(H), ye = G(() => Kn(H, pe), [H, pe]), ue = uo(Un(ye)), { entryKindDirectory: _e, entryKindFile: Ie } = ye, se = m !== void 0, [L, fe] = ie(!1), Q = V(null), Re = V(null), z = V(null), [Ce, ke] = ie(0), [Ne, Z] = ie(0), [$e, He] = ie(0), [Ke, ft] = ie(null), {
1146
+ overscanCount: Ae = 15,
1147
+ className: Ue,
1148
+ background: Xe,
1149
+ onScroll: Je,
1150
+ onRangeChange: Ze,
1151
+ onScrollAdjust: qe,
1152
+ liveRegion: Be,
1157
1153
  initialScrollIndex: Y,
1158
1154
  initialScrollOffset: ge,
1159
- initialScrollAnchor: Ot,
1160
- callbackThrottleMs: Lt = 5,
1161
- contentInsets: Dt,
1162
- onItemFocus: Ft,
1163
- viewportHeightOverride: ae,
1155
+ initialScrollAnchor: Lt,
1156
+ callbackThrottleMs: Dt = 5,
1157
+ contentInsets: Ft,
1158
+ onItemFocus: Mt,
1159
+ viewportHeightOverride: ce,
1164
1160
  scrollBarOptions: ht,
1165
- behaviorOptions: Mt,
1166
- preserveScrollAnchor: $t = !1,
1167
- getItemKey: zr,
1161
+ behaviorOptions: $t,
1162
+ preserveScrollAnchor: Ht = !1,
1163
+ getItemKey: Yr,
1168
1164
  // 素通しの pass-through。型で受け付けているものは実際に転送する
1169
- testId: Ht,
1165
+ testId: Bt,
1170
1166
  contentProps: mt
1171
- } = m ?? {}, Bt = G(
1172
- () => ne ? { ...mt, role: "rowgroup" } : { ...mt, role: "tree", "aria-label": R ? void 0 : v, "aria-labelledby": R, "aria-multiselectable": p === "multiple" ? !0 : void 0 },
1173
- [ne, mt, v, R, p]
1174
- ), Wt = G(() => ({ ...Mt, enableKeyboardNavigation: !1 }), [Mt]), [qe, zt] = le(typeof ge == "number" ? ge : 0), pt = V(typeof ge == "number" ? ge : 0), Yt = P(
1175
- (s, u) => {
1176
- pt.current = s, zt(s), Xe?.(s, u);
1167
+ } = b ?? {}, Wt = G(
1168
+ () => se ? { ...mt, role: "rowgroup" } : { ...mt, role: "tree", "aria-label": S ? void 0 : w, "aria-labelledby": S, "aria-multiselectable": h === "multiple" ? !0 : void 0 },
1169
+ [se, mt, w, S, h]
1170
+ ), zt = G(() => ({ ...$t, enableKeyboardNavigation: !1 }), [$t]), [Qe, Yt] = ie(typeof ge == "number" ? ge : 0), pt = V(typeof ge == "number" ? ge : 0), Gt = j(
1171
+ (s, d) => {
1172
+ pt.current = s, Yt(s), Je?.(s, d);
1177
1173
  },
1178
- [Xe]
1179
- ), Gt = P(
1174
+ [Je]
1175
+ ), Vt = j(
1180
1176
  (s) => {
1181
- const { renderingStartIndex: u, renderingEndIndex: b } = s;
1182
- ft((N) => N && N.renderStart === u && N.renderEnd === b ? N : { renderStart: u, renderEnd: b }), Je?.(s);
1177
+ const { renderingStartIndex: d, renderingEndIndex: v } = s;
1178
+ ft((k) => k && k.renderStart === d && k.renderEnd === v ? k : { renderStart: d, renderEnd: v }), Ze?.(s);
1183
1179
  },
1184
- [Je]
1180
+ [Ze]
1185
1181
  );
1186
- Re(() => {
1187
- he(!0), co();
1188
- }, []), Re(() => {
1189
- const s = X.current, u = ne ? xe.current : s, b = () => {
1182
+ Se(() => {
1183
+ fe(!0), io();
1184
+ }, []), Se(() => {
1185
+ const s = Q.current, d = se ? Re.current : s, v = () => {
1190
1186
  if (s) {
1191
- const H = s.clientWidth;
1192
- dt((q) => Math.abs(q - H) > 1 ? H : q);
1187
+ const B = s.clientWidth;
1188
+ Z((ee) => Math.abs(ee - B) > 1 ? B : ee);
1193
1189
  }
1194
- if (typeof ae == "number")
1195
- ke((H) => Math.abs(H - ae) > 1 ? ae : H);
1196
- else if (u) {
1197
- const H = u.clientHeight;
1198
- ke((q) => Math.abs(q - H) > 1 ? H : q);
1190
+ if (typeof ce == "number")
1191
+ ke((B) => Math.abs(B - ce) > 1 ? ce : B);
1192
+ else if (d) {
1193
+ const B = d.clientHeight;
1194
+ ke((ee) => Math.abs(ee - B) > 1 ? B : ee);
1199
1195
  }
1200
1196
  };
1201
- if (!(s || u)) return ke(0);
1202
- b();
1203
- const N = new ResizeObserver(b);
1204
- return s && N.observe(s), u && u !== s && N.observe(u), () => N.disconnect();
1205
- }, [ae, ne]);
1206
- const Ce = typeof ae == "number" ? ae : Fe, be = P((s) => c || (L ? r(s) : !1), [L, r, c]), Vt = O(F.container, l && F.containerPending, j), Kt = G(
1197
+ if (!(s || d)) return ke(0);
1198
+ v();
1199
+ const k = new ResizeObserver(v);
1200
+ return s && k.observe(s), d && d !== s && k.observe(d), () => k.disconnect();
1201
+ }, [ce, se]);
1202
+ const Oe = typeof ce == "number" ? ce : Ce, be = j((s) => c || (L ? r(s) : !1), [L, r, c]), Kt = O(D.container, l && D.containerPending, N), Ut = G(
1207
1203
  () => ({
1208
- ...lo,
1209
- ...h ?? {},
1210
- ...typeof ae == "number" ? { height: ae, minHeight: ae } : {}
1204
+ ...co,
1205
+ ...f ?? {},
1206
+ ...typeof ce == "number" ? { height: ce, minHeight: ce } : {}
1211
1207
  }),
1212
- [h, ae]
1213
- ), yt = P(
1214
- (s, u) => {
1215
- const b = [s.absolutePath, ...Wr(s)], N = u || i;
1216
- if (b.every((we) => be(we))) return a(b);
1217
- if (b.every((we) => !be(we)) || N === "recursive") return n(b);
1218
- if (N === "toggle") return a(b);
1219
- console.warn(`[DirectoryTree] Unknown double click action: ${N}. No action taken.`);
1208
+ [f, ce]
1209
+ ), yt = j(
1210
+ (s, d) => {
1211
+ const v = [s.absolutePath, ...zr(s)], k = d || i;
1212
+ if (v.every((we) => be(we))) return a(v);
1213
+ if (v.every((we) => !be(we)) || k === "recursive") return o(v);
1214
+ if (k === "toggle") return a(v);
1215
+ console.warn(`[DirectoryTree] Unknown double click action: ${k}. No action taken.`);
1220
1216
  },
1221
- [be, n, a, i]
1222
- ), Ut = ne ? !1 : ce, { flatItems: Ne, lineItems: bt, maxIndent: Xt } = G(() => fo(e, be, w, Ut, T), [e, be, w, Ut, T]), J = G(
1223
- () => Ne.map((s, u) => {
1224
- const b = typeof U == "function" ? U(s.entry, u) : U;
1225
- return { ...s, rowHeight: Number.isFinite(b) && b > 0 ? b : ct };
1217
+ [be, o, a, i]
1218
+ ), Xt = se ? !1 : te, { flatItems: Te, lineItems: bt, maxIndent: Jt } = G(() => ho(e, be, I, Xt, C), [e, be, I, Xt, C]), q = G(
1219
+ () => Te.map((s, d) => {
1220
+ const v = typeof _ == "function" ? _(s.entry, d) : _;
1221
+ return { ...s, rowHeight: Number.isFinite(v) && v > 0 ? v : it };
1226
1222
  }),
1227
- [Ne, U]
1228
- ), Ee = G(() => J.map((s) => s.rowHeight), [J]), Te = G(() => {
1229
- const s = new Array(Ee.length + 1);
1223
+ [Te, _]
1224
+ ), xe = G(() => q.map((s) => s.rowHeight), [q]), Pe = G(() => {
1225
+ const s = new Array(xe.length + 1);
1230
1226
  s[0] = 0;
1231
- for (let u = 0; u < Ee.length; u++)
1232
- s[u + 1] = s[u] + Ee[u];
1227
+ for (let d = 0; d < xe.length; d++)
1228
+ s[d + 1] = s[d] + xe[d];
1233
1229
  return s;
1234
- }, [Ee]), Jt = P((s) => J[s]?.rowHeight ?? ct, [J]), Yr = P((s) => J[s]?.entry.absolutePath ?? s, [J]), Zt = zr ?? Yr, Ae = x ?? null, gt = f ?? null, [qt, Be] = le(() => ({ selectedPath: Ae, selectionGeneration: 0, anchor: null })), vt = Rr(qt, Ae);
1235
- vt !== qt && Be((s) => Rr(s, Ae));
1236
- const Qe = G(() => oo(Ne), [Ne]), Oe = G(() => ao(Qe, vt), [Qe, vt]), We = V(/* @__PURE__ */ new Map()), et = V(null), [tt] = le(Un), ze = V(null), [Gr, Qt] = le(!0), wt = V(Ne);
1237
- wt.current = Ne;
1238
- const er = V(be);
1239
- er.current = be;
1230
+ }, [xe]), Zt = j((s) => q[s]?.rowHeight ?? it, [q]), Gr = j((s) => q[s]?.entry.absolutePath ?? s, [q]), qt = Yr ?? Gr, Le = E ?? null, gt = g ?? null, [Qt, We] = ie(() => ({ selectedPath: Le, selectionGeneration: 0, anchor: null })), vt = Rr(Qt, Le);
1231
+ vt !== Qt && We((s) => Rr(s, Le));
1232
+ const et = G(() => so(Te), [Te]), De = G(() => lo(et, vt), [et, vt]), ze = V(/* @__PURE__ */ new Map()), tt = V(null), [rt] = ie(Xn), Ye = V(null), [Vr, er] = ie(!0), wt = V(Te);
1233
+ wt.current = Te;
1234
+ const tr = V(be);
1235
+ tr.current = be;
1240
1236
  const xt = V(t);
1241
1237
  xt.current = t;
1242
- const tr = V(Qe);
1243
- tr.current = Qe;
1244
- const Et = V(Oe);
1245
- Et.current = Oe;
1246
- const rr = V(Ft);
1247
- rr.current = Ft;
1248
- const je = P((s) => {
1249
- const u = K.current;
1250
- return !u || u.getViewportSize() <= 0 ? !1 : (u.scrollToIndex(s, { align: "nearest" }), !0);
1251
- }, []), ve = P(
1238
+ const rr = V(et);
1239
+ rr.current = et;
1240
+ const Et = V(De);
1241
+ Et.current = De;
1242
+ const nr = V(Mt);
1243
+ nr.current = Mt;
1244
+ const je = j((s) => {
1245
+ const d = z.current;
1246
+ return !d || d.getViewportSize() <= 0 ? !1 : (d.scrollToIndex(s, { align: "nearest" }), !0);
1247
+ }, []), ve = j(
1252
1248
  (s) => {
1253
- const u = We.current.get(s);
1254
- if (u === void 0) {
1255
- ze.current = s, je(s) || (ze.current = null);
1249
+ const d = ze.current.get(s);
1250
+ if (d === void 0) {
1251
+ Ye.current = s, je(s) || (Ye.current = null);
1256
1252
  return;
1257
1253
  }
1258
- ze.current = null, je(s), u.focus({ preventScroll: !0 });
1254
+ Ye.current = null, je(s), d.focus({ preventScroll: !0 });
1259
1255
  },
1260
1256
  [je]
1261
- ), nr = P((s, u) => {
1262
- if (u)
1263
- We.current.set(s, u), ze.current === s ? (ze.current = null, u.focus({ preventScroll: !0 })) : u.contains(u.ownerDocument.activeElement) && Be((b) => b.anchor === null ? b : { ...b, anchor: { ...b.anchor, focused: !0 } });
1257
+ ), or = j((s, d) => {
1258
+ if (d)
1259
+ ze.current.set(s, d), Ye.current === s ? (Ye.current = null, d.focus({ preventScroll: !0 })) : d.contains(d.ownerDocument.activeElement) && We((v) => v.anchor === null ? v : { ...v, anchor: { ...v.anchor, focused: !0 } });
1264
1260
  else {
1265
- const b = We.current.get(s);
1266
- We.current.delete(s), b?.contains(b.ownerDocument.activeElement) && Be((N) => N.anchor === null ? N : { ...N, anchor: { ...N.anchor, focused: !1 } });
1261
+ const v = ze.current.get(s);
1262
+ ze.current.delete(s), v?.contains(v.ownerDocument.activeElement) && We((k) => k.anchor === null ? k : { ...k, anchor: { ...k.anchor, focused: !1 } });
1267
1263
  }
1268
- s === Et.current && Qt(u !== null);
1264
+ s === Et.current && er(d !== null);
1269
1265
  }, []);
1270
- hr(() => {
1271
- Qt(We.current.has(Oe));
1272
- }, [Oe]);
1273
- const St = P(
1274
- (s, u, b) => {
1275
- const N = et.current === b;
1276
- et.current = null, N || (Be((H) => so(H, u)), tt.landedOn(b) || je(s)), rr.current?.(s);
1266
+ mr(() => {
1267
+ er(ze.current.has(De));
1268
+ }, [De]);
1269
+ const St = j(
1270
+ (s, d, v) => {
1271
+ const k = tt.current === v;
1272
+ tt.current = null, k || (We((B) => ao(B, d)), rt.landedOn(v) || je(s)), nr.current?.(s);
1277
1273
  },
1278
- [je, tt]
1279
- ), rt = P((s) => tt.mark(s.nativeEvent), [tt]), Rt = P((s, u) => {
1280
- const { ownerDocument: b } = u;
1281
- if (!b.hasFocus() && u.contains(b.activeElement)) {
1282
- et.current = u;
1274
+ [je, rt]
1275
+ ), nt = j((s) => rt.mark(s.nativeEvent), [rt]), It = j((s, d) => {
1276
+ const { ownerDocument: v } = d;
1277
+ if (!v.hasFocus() && d.contains(v.activeElement)) {
1278
+ tt.current = d;
1283
1279
  return;
1284
1280
  }
1285
- et.current = null, Be((N) => N.anchor !== null && N.anchor.path === s ? { ...N, anchor: { ...N.anchor, focused: !1 } } : N);
1286
- }, []), Vr = P(() => ve(Et.current), [ve]), It = P(
1287
- (s, u) => {
1288
- const b = kr(u), N = wt.current.length;
1289
- if (!Number.isInteger(s) || s < 0 || s >= N)
1290
- throw new RangeError(`[directory-tree] scrollToIndex: ${String(s)} is not a row index (${N === 0 ? "the tree has no rows" : `expected an integer in 0..${String(N - 1)}`}).`);
1291
- if (b === "nearest") {
1281
+ tt.current = null, We((k) => k.anchor !== null && k.anchor.path === s ? { ...k, anchor: { ...k.anchor, focused: !1 } } : k);
1282
+ }, []), Kr = j(() => ve(Et.current), [ve]), Rt = j(
1283
+ (s, d) => {
1284
+ const v = Nr(d), k = wt.current.length;
1285
+ if (!Number.isInteger(s) || s < 0 || s >= k)
1286
+ throw new RangeError(`[directory-tree] scrollToIndex: ${String(s)} is not a row index (${k === 0 ? "the tree has no rows" : `expected an integer in 0..${String(k - 1)}`}).`);
1287
+ if (v === "nearest") {
1292
1288
  je(s);
1293
1289
  return;
1294
1290
  }
1295
- K.current?.scrollToIndex(s, { align: b });
1291
+ z.current?.scrollToIndex(s, { align: v });
1296
1292
  },
1297
1293
  [je]
1298
1294
  );
1299
- Qr(
1295
+ en(
1300
1296
  A,
1301
1297
  () => ({
1302
- scrollToIndex: It,
1303
- scrollToPath: (s, u) => {
1304
- kr(u);
1305
- const b = tr.current.get(s);
1306
- return b === void 0 ? !1 : (It(b, u), !0);
1298
+ scrollToIndex: Rt,
1299
+ scrollToPath: (s, d) => {
1300
+ Nr(d);
1301
+ const v = rr.current.get(s);
1302
+ return v === void 0 ? !1 : (Rt(v, d), !0);
1307
1303
  },
1308
- getScrollAnchor: () => K.current?.getScrollAnchor() ?? null
1304
+ getScrollAnchor: () => z.current?.getScrollAnchor() ?? null
1309
1305
  }),
1310
- [It]
1306
+ [Rt]
1311
1307
  );
1312
- const or = P(
1313
- (s, u) => {
1308
+ const sr = j(
1309
+ (s, d) => {
1314
1310
  if (s.altKey || s.ctrlKey || s.metaKey)
1315
1311
  return;
1316
- const b = wt.current, N = b.length - 1;
1317
- if (N < 0) return;
1318
- const H = b[u], q = H?.entry.children !== void 0, we = q && er.current(H.entry.absolutePath);
1312
+ const v = wt.current, k = v.length - 1;
1313
+ if (k < 0) return;
1314
+ const B = v[d], ee = B?.entry.children !== void 0, we = ee && tr.current(B.entry.absolutePath);
1319
1315
  switch (s.key) {
1320
1316
  case "ArrowDown":
1321
- s.preventDefault(), ve(Math.min(u + 1, N));
1317
+ s.preventDefault(), ve(Math.min(d + 1, k));
1322
1318
  break;
1323
1319
  case "ArrowUp":
1324
- s.preventDefault(), ve(Math.max(u - 1, 0));
1320
+ s.preventDefault(), ve(Math.max(d - 1, 0));
1325
1321
  break;
1326
1322
  case "Home":
1327
1323
  s.preventDefault(), ve(0);
1328
1324
  break;
1329
1325
  case "End":
1330
- s.preventDefault(), ve(N);
1326
+ s.preventDefault(), ve(k);
1331
1327
  break;
1332
1328
  case "ArrowRight":
1333
- s.preventDefault(), q && !we ? xt.current(H.entry.absolutePath) : q && u < N && b[u + 1].depth > H.depth && ve(u + 1);
1329
+ s.preventDefault(), ee && !we ? xt.current(B.entry.absolutePath) : ee && d < k && v[d + 1].depth > B.depth && ve(d + 1);
1334
1330
  break;
1335
1331
  case "ArrowLeft": {
1336
- if (s.preventDefault(), q && we) {
1337
- xt.current(H.entry.absolutePath);
1332
+ if (s.preventDefault(), ee && we) {
1333
+ xt.current(B.entry.absolutePath);
1338
1334
  break;
1339
1335
  }
1340
- const Zr = H?.depth ?? 0;
1341
- for (let at = u - 1; at >= 0; at--)
1342
- if (b[at].depth < Zr) {
1343
- ve(at);
1336
+ const qr = B?.depth ?? 0;
1337
+ for (let lt = d - 1; lt >= 0; lt--)
1338
+ if (v[lt].depth < qr) {
1339
+ ve(lt);
1344
1340
  break;
1345
1341
  }
1346
1342
  break;
@@ -1348,149 +1344,149 @@ const Wr = (e) => {
1348
1344
  }
1349
1345
  },
1350
1346
  [ve]
1351
- ), nt = G(
1352
- () => !w || bt.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : mo(bt, Ee, Te, it, w, C ?? gr),
1353
- [bt, Ee, Te, w, C]
1354
- ), ot = G(() => !w || e.length === 0 ? 0 : (Xt + 2) * it, [e.length, Xt, w]), { renderStart: sr, renderEnd: ar, lookaheadEnd: lr } = G(
1355
- () => ho(J.length, Ce, _e, Ve, qe, Te),
1356
- [J.length, Ce, _e, Ve, qe, Te]
1357
- ), kt = G(() => !w || ot <= 0 || Ce <= 0 || nt.segmentsByItem.length === 0 ? null : /* @__PURE__ */ d.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ d.jsx("div", { className: "absolute top-0 left-0", style: { width: ot, height: Ce }, children: /* @__PURE__ */ d.jsx(
1358
- Br,
1347
+ ), ot = G(
1348
+ () => !I || bt.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : po(bt, xe, Pe, dt, I, P ?? vr),
1349
+ [bt, xe, Pe, I, P]
1350
+ ), st = G(() => !I || e.length === 0 ? 0 : (Jt + 2) * dt, [e.length, Jt, I]), { renderStart: ar, renderEnd: lr, lookaheadEnd: cr } = G(
1351
+ () => mo(q.length, Oe, Ae, Ke, Qe, Pe),
1352
+ [q.length, Oe, Ae, Ke, Qe, Pe]
1353
+ ), kt = G(() => !I || st <= 0 || Oe <= 0 || ot.segmentsByItem.length === 0 ? null : /* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("div", { className: "absolute top-0 left-0", style: { width: st, height: Oe }, children: /* @__PURE__ */ u.jsx(
1354
+ Wr,
1359
1355
  {
1360
- segmentsByItem: nt.segmentsByItem,
1361
- glyphsByItem: nt.glyphsByItem,
1362
- itemHeight: Ee[0] ?? ct,
1363
- width: ot,
1364
- viewportHeight: Ce,
1365
- scrollPosition: qe,
1356
+ segmentsByItem: ot.segmentsByItem,
1357
+ glyphsByItem: ot.glyphsByItem,
1358
+ itemHeight: xe[0] ?? it,
1359
+ width: st,
1360
+ viewportHeight: Oe,
1361
+ scrollPosition: Qe,
1366
1362
  color: M,
1367
1363
  expandGlyphColor: M,
1368
- expandGlyphSize: C ?? gr,
1369
- renderStartIndex: sr,
1370
- renderEndIndex: ar,
1371
- lookaheadEndIndex: lr
1364
+ expandGlyphSize: P ?? vr,
1365
+ renderStartIndex: ar,
1366
+ renderEndIndex: lr,
1367
+ lookaheadEndIndex: cr
1372
1368
  }
1373
- ) }) }), [ot, Ce, sr, ar, lr, qe, nt, M, w, C, Ee]), cr = P((s) => J[s], [J]), ir = V(null);
1374
- hr(() => {
1375
- const s = ir.current;
1376
- if (ir.current = { items: J, offsets: Te }, !$t || !s || s.items === J)
1369
+ ) }) }), [st, Oe, ar, lr, cr, Qe, ot, M, I, P, xe]), ir = j((s) => q[s], [q]), dr = V(null);
1370
+ mr(() => {
1371
+ const s = dr.current;
1372
+ if (dr.current = { items: q, offsets: Pe }, !Ht || !s || s.items === q)
1377
1373
  return;
1378
- const u = K.current, b = u?.getScrollPosition(), N = typeof b == "number" && b >= 0 ? b : pt.current, H = Jn(s.items, s.offsets, N);
1379
- if (!H)
1374
+ const d = z.current, v = d?.getScrollPosition(), k = typeof v == "number" && v >= 0 ? v : pt.current, B = Zn(s.items, s.offsets, k);
1375
+ if (!B)
1380
1376
  return;
1381
- const q = Zn(H, J, Te);
1382
- if (q === null || Math.abs(q - N) < 1)
1377
+ const ee = qn(B, q, Pe);
1378
+ if (ee === null || Math.abs(ee - k) < 1)
1383
1379
  return;
1384
- const we = u ? u.scrollTo(q) : q;
1385
- pt.current = we, zt(we);
1386
- }, [J, Te, $t]);
1387
- const Se = g?.columns, Le = g?.scrollBarWidth ?? ht?.width ?? $r, te = G(() => Se ? Wn({ measuredWidth: W, columns: Se, scrollBarWidth: Le }) : null, [Se, W, Le]), st = G(() => Se ? Bn(Se) : "", [Se]), Kr = G(() => g?.showFooter && Se ? zn(e) : [], [g?.showFooter, Se, e]), De = te?.maxHScroll ?? 0;
1388
- Re(() => {
1389
- $e((s) => Nt(s, De));
1390
- }, [De]);
1391
- const ur = P((s) => $e((u) => Nt(u + s, De)), [De]), dr = G(
1392
- () => ({ iconOverrides: D, showExpandIcons: k, showDirectoryIcons: y, showFileIcons: B, useCanvasExpandIcons: w, expandIconSize: C, highlightStyles: Z, expandIconClassName: _, expandIconStyle: o }),
1393
- [D, k, y, B, w, C, Z, _, o]
1394
- ), fr = G(
1395
- () => /* @__PURE__ */ d.jsx(
1396
- nn,
1380
+ const we = d ? d.scrollTo(ee) : ee;
1381
+ pt.current = we, Yt(we);
1382
+ }, [q, Pe, Ht]);
1383
+ const Ee = m?.columns, Fe = m?.scrollBarWidth ?? ht?.width ?? Hr, oe = G(() => Ee ? zn({ measuredWidth: Ne, columns: Ee, scrollBarWidth: Fe }) : null, [Ee, Ne, Fe]), at = G(() => Ee ? Wn(Ee) : "", [Ee]), Ur = G(() => m?.showFooter && Ee ? Yn(e) : [], [m?.showFooter, Ee, e]), Me = oe?.maxHScroll ?? 0;
1384
+ Se(() => {
1385
+ He((s) => Nt(s, Me));
1386
+ }, [Me]);
1387
+ const ur = j((s) => He((d) => Nt(d + s, Me)), [Me]), fr = G(
1388
+ () => ({ iconOverrides: U, showExpandIcons: T, showDirectoryIcons: y, showFileIcons: K, useCanvasExpandIcons: I, expandIconSize: P, highlightStyles: $, expandIconClassName: le, expandIconStyle: n }),
1389
+ [U, T, y, K, I, P, $, le, n]
1390
+ ), hr = G(
1391
+ () => /* @__PURE__ */ u.jsx(
1392
+ on,
1397
1393
  {
1398
- ref: K,
1399
- itemCount: J.length,
1400
- getItem: cr,
1401
- getItemHeight: Jt,
1402
- getItemKey: Zt,
1403
- testId: Ht,
1404
- contentProps: Bt,
1405
- locale: ee,
1406
- labels: fe,
1407
- viewportSize: typeof ae == "number" ? ae : void 0,
1408
- overscanCount: _e,
1409
- onScroll: Yt,
1410
- onRangeChange: Gt,
1411
- onScrollAdjust: Ze,
1412
- liveRegion: He,
1413
- className: Ke,
1414
- onWheelHorizontal: ne ? ur : void 0,
1415
- background: /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1416
- ne && te ? (
1394
+ ref: z,
1395
+ itemCount: q.length,
1396
+ getItem: ir,
1397
+ getItemHeight: Zt,
1398
+ getItemKey: qt,
1399
+ testId: Bt,
1400
+ contentProps: Wt,
1401
+ locale: ne,
1402
+ labels: ue,
1403
+ viewportSize: typeof ce == "number" ? ce : void 0,
1404
+ overscanCount: Ae,
1405
+ onScroll: Gt,
1406
+ onRangeChange: Vt,
1407
+ onScrollAdjust: qe,
1408
+ liveRegion: Be,
1409
+ className: Ue,
1410
+ onWheelHorizontal: se ? ur : void 0,
1411
+ background: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
1412
+ se && oe ? (
1417
1413
  // Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
1418
- /* @__PURE__ */ d.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: te.nameWidth }, "aria-hidden": "true", children: kt })
1414
+ /* @__PURE__ */ u.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: oe.nameWidth }, "aria-hidden": "true", children: kt })
1419
1415
  ) : kt,
1420
- Ue
1416
+ Xe
1421
1417
  ] }),
1422
1418
  initialScrollIndex: Y,
1423
1419
  initialScrollOffset: ge,
1424
- initialScrollAnchor: Ot,
1425
- callbackThrottleMs: Lt,
1426
- contentInsets: Dt,
1420
+ initialScrollAnchor: Lt,
1421
+ callbackThrottleMs: Dt,
1422
+ contentInsets: Ft,
1427
1423
  scrollBarOptions: ht,
1428
- behaviorOptions: Wt,
1429
- children: (s, u) => s ? ne && g && te ? /* @__PURE__ */ d.jsx(
1430
- Dr,
1424
+ behaviorOptions: zt,
1425
+ children: (s, d) => s ? se && m && oe ? /* @__PURE__ */ u.jsx(
1426
+ Fr,
1431
1427
  {
1432
1428
  entry: s.entry,
1433
1429
  indentLevel: s.indentLevel,
1434
1430
  positionInSet: s.positionInSet,
1435
1431
  setSize: s.setSize,
1436
- rowIndex: u + (g.showHeader ?? !0 ? 2 : 1),
1437
- flatIndex: u,
1432
+ rowIndex: d + (m.showHeader ?? !0 ? 2 : 1),
1433
+ flatIndex: d,
1438
1434
  onRowFocus: St,
1439
- onRowBlur: Rt,
1440
- isSelectedForAria: !!S?.has(s.entry.absolutePath),
1435
+ onRowBlur: It,
1436
+ isSelectedForAria: !!p?.has(s.entry.absolutePath),
1441
1437
  rowHeight: s.rowHeight,
1442
1438
  isDirOpen: be,
1443
- columns: g.columns,
1444
- numericTemplate: st,
1445
- numericTotal: te.numericTotal,
1446
- nameWidth: te.nameWidth,
1447
- rowClassName: g.rowClassName,
1448
- selection: { onEntryClick: I, selectedPath: Ae, currentPath: gt, mode: p, selectedItems: S, onSelectionChange: E },
1439
+ columns: m.columns,
1440
+ numericTemplate: at,
1441
+ numericTotal: oe.numericTotal,
1442
+ nameWidth: oe.nameWidth,
1443
+ rowClassName: m.rowClassName,
1444
+ selection: { onEntryClick: R, selectedPath: Le, currentPath: gt, mode: h, selectedItems: p, onSelectionChange: x },
1449
1445
  expansion: { toggleDirectory: t, onToggleDirectoryRecursive: yt },
1450
- visual: dr
1446
+ visual: fr
1451
1447
  },
1452
1448
  s.entry.absolutePath
1453
- ) : /* @__PURE__ */ d.jsx(
1454
- At,
1449
+ ) : /* @__PURE__ */ u.jsx(
1450
+ Ot,
1455
1451
  {
1456
1452
  entry: s.entry,
1457
1453
  indentLevel: s.indentLevel,
1458
1454
  depth: s.depth,
1459
1455
  positionInSet: s.positionInSet,
1460
1456
  setSize: s.setSize,
1461
- isSelectedForAria: !!S?.has(s.entry.absolutePath),
1462
- flatIndex: u,
1463
- isActive: u === Oe,
1464
- registerRowRef: nr,
1465
- onNavigationKeyDown: or,
1457
+ isSelectedForAria: !!p?.has(s.entry.absolutePath),
1458
+ flatIndex: d,
1459
+ isActive: d === De,
1460
+ registerRowRef: or,
1461
+ onNavigationKeyDown: sr,
1466
1462
  onRowFocus: St,
1467
- onRowBlur: Rt,
1463
+ onRowBlur: It,
1468
1464
  rowHeight: s.rowHeight,
1469
- entryKindDirectory: Pe,
1465
+ entryKindDirectory: _e,
1470
1466
  entryKindFile: Ie,
1471
1467
  isDirOpen: be,
1472
1468
  parentIsLast: s.parentIsLast,
1473
1469
  renderChildren: !1,
1474
1470
  expansion: { toggleDirectory: t, onToggleDirectoryRecursive: yt },
1475
- selection: { onEntryClick: I, selectedPath: Ae, currentPath: gt, mode: p, selectedItems: S, onSelectionChange: E },
1471
+ selection: { onEntryClick: R, selectedPath: Le, currentPath: gt, mode: h, selectedItems: p, onSelectionChange: x },
1476
1472
  visual: {
1477
- iconOverrides: D,
1478
- showExpandIcons: k,
1473
+ iconOverrides: U,
1474
+ showExpandIcons: T,
1479
1475
  showDirectoryIcons: y,
1480
- showFileIcons: B,
1481
- useCanvasExpandIcons: w,
1482
- expandIconSize: C,
1483
- highlightStyles: Z,
1484
- entryClassName: Q,
1485
- entryStyle: oe,
1476
+ showFileIcons: K,
1477
+ useCanvasExpandIcons: I,
1478
+ expandIconSize: P,
1479
+ highlightStyles: $,
1480
+ entryClassName: F,
1481
+ entryStyle: X,
1486
1482
  nameClassName: re,
1487
- nameStyle: $,
1488
- directoryNameClassName: pe,
1489
- directoryNameStyle: ie,
1490
- fileNameClassName: ue,
1491
- fileNameStyle: z,
1492
- expandIconClassName: _,
1493
- expandIconStyle: o
1483
+ nameStyle: ae,
1484
+ directoryNameClassName: J,
1485
+ directoryNameStyle: de,
1486
+ fileNameClassName: me,
1487
+ fileNameStyle: W,
1488
+ expandIconClassName: le,
1489
+ expandIconStyle: n
1494
1490
  }
1495
1491
  },
1496
1492
  s.entry.absolutePath
@@ -1498,215 +1494,215 @@ const Wr = (e) => {
1498
1494
  }
1499
1495
  ),
1500
1496
  [
1501
- J.length,
1502
- cr,
1503
- Jt,
1497
+ q.length,
1498
+ ir,
1504
1499
  Zt,
1505
- Ht,
1500
+ qt,
1506
1501
  Bt,
1507
- ee,
1508
- fe,
1509
- Pe,
1502
+ Wt,
1503
+ ne,
1504
+ ue,
1505
+ _e,
1510
1506
  Ie,
1511
- Oe,
1512
- nr,
1507
+ De,
1513
1508
  or,
1509
+ sr,
1514
1510
  St,
1515
- Rt,
1516
- ae,
1517
- _e,
1518
- Yt,
1511
+ It,
1512
+ ce,
1513
+ Ae,
1519
1514
  Gt,
1520
- Ze,
1521
- He,
1522
- Ke,
1523
- ne,
1515
+ Vt,
1516
+ qe,
1517
+ Be,
1518
+ Ue,
1519
+ se,
1524
1520
  ur,
1525
- te,
1521
+ oe,
1526
1522
  kt,
1527
- Ue,
1523
+ Xe,
1528
1524
  Y,
1529
1525
  ge,
1530
- Ot,
1531
1526
  Lt,
1532
1527
  Dt,
1528
+ Ft,
1533
1529
  ht,
1534
- Wt,
1535
- g,
1536
- st,
1530
+ zt,
1531
+ m,
1532
+ at,
1537
1533
  be,
1538
- I,
1539
- Ae,
1534
+ R,
1535
+ Le,
1540
1536
  gt,
1537
+ h,
1541
1538
  p,
1542
- S,
1543
- E,
1539
+ x,
1544
1540
  t,
1545
1541
  yt,
1546
- dr,
1547
- D,
1548
- k,
1542
+ fr,
1543
+ U,
1544
+ T,
1549
1545
  y,
1550
- B,
1551
- w,
1552
- C,
1553
- Z,
1554
- Q,
1555
- oe,
1556
- re,
1546
+ K,
1547
+ I,
1548
+ P,
1557
1549
  $,
1558
- pe,
1559
- ie,
1560
- ue,
1561
- z,
1562
- _,
1563
- o
1550
+ F,
1551
+ X,
1552
+ re,
1553
+ ae,
1554
+ J,
1555
+ de,
1556
+ me,
1557
+ W,
1558
+ le,
1559
+ n
1564
1560
  ]
1565
1561
  );
1566
- if (!(g && te))
1567
- return /* @__PURE__ */ d.jsxs("div", { ref: X, className: Vt, style: Kt, onPointerDownCapture: rt, onMouseDownCapture: rt, children: [
1568
- Ne.length > 0 && !Gr && // biome-ignore lint/a11y/noNoninteractiveTabindex: 停止点の行が描画窓の外で DOM に無い間だけ Tab を受け、受けた瞬間にその行へ焦点を渡す。これが無いとツリーに Tab で入れない
1562
+ if (!(m && oe))
1563
+ return /* @__PURE__ */ u.jsxs("div", { ref: Q, className: Kt, style: Ut, onPointerDownCapture: nt, onMouseDownCapture: nt, children: [
1564
+ Te.length > 0 && !Vr && // biome-ignore lint/a11y/noNoninteractiveTabindex: 停止点の行が描画窓の外で DOM に無い間だけ Tab を受け、受けた瞬間にその行へ焦点を渡す。これが無いとツリーに Tab で入れない
1569
1565
  // biome-ignore lint/a11y/noStaticElementInteractions: 同上 (焦点の受け渡しだけを担い、要素自身は操作の対象ではない)
1570
- /* @__PURE__ */ d.jsx("span", { tabIndex: 0, "data-directory-tree-tab-stop": "", style: uo, onFocus: Vr }),
1571
- fr
1566
+ /* @__PURE__ */ u.jsx("span", { tabIndex: 0, "data-directory-tree-tab-stop": "", style: fo, onFocus: Kr }),
1567
+ hr
1572
1568
  ] });
1573
- const Ur = g.showHeader ?? !0, Xr = g.showFooter ?? !1, Jr = { ...Kt, "--dt-hscroll": `${Me}px` };
1574
- return /* @__PURE__ */ d.jsxs(
1569
+ const Xr = m.showHeader ?? !0, Jr = m.showFooter ?? !1, Zr = { ...Ut, "--dt-hscroll": `${$e}px` };
1570
+ return /* @__PURE__ */ u.jsxs(
1575
1571
  "div",
1576
1572
  {
1577
- ref: X,
1578
- className: O(Vt, "dt-grid"),
1579
- style: Jr,
1573
+ ref: Q,
1574
+ className: O(Kt, "dt-grid"),
1575
+ style: Zr,
1580
1576
  role: "treegrid",
1581
- "aria-label": R ? void 0 : v,
1582
- "aria-labelledby": R,
1583
- "aria-multiselectable": p === "multiple" ? !0 : void 0,
1584
- "aria-rowcount": J.length + (g.showHeader ?? !0 ? 1 : 0),
1585
- onPointerDownCapture: rt,
1586
- onMouseDownCapture: rt,
1577
+ "aria-label": S ? void 0 : w,
1578
+ "aria-labelledby": S,
1579
+ "aria-multiselectable": h === "multiple" ? !0 : void 0,
1580
+ "aria-rowcount": q.length + (m.showHeader ?? !0 ? 1 : 0),
1581
+ onPointerDownCapture: nt,
1582
+ onMouseDownCapture: nt,
1587
1583
  children: [
1588
- Ur && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
1589
- /* @__PURE__ */ d.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ d.jsx(Mn, { columns: g.columns, numericTemplate: st, numericTotal: te.numericTotal, nameWidth: te.nameWidth, scrollBarWidth: Le, className: g.headerClassName }) }),
1590
- /* @__PURE__ */ d.jsx("div", { ref: xe, className: "dt-grid-body", children: fr }),
1591
- De > 0 && /* @__PURE__ */ d.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1592
- /* @__PURE__ */ d.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: te.nameWidth }, "aria-hidden": "true" }),
1593
- /* @__PURE__ */ d.jsx(
1594
- on,
1584
+ Xr && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
1585
+ /* @__PURE__ */ u.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ u.jsx($n, { columns: m.columns, numericTemplate: at, numericTotal: oe.numericTotal, nameWidth: oe.nameWidth, scrollBarWidth: Fe, className: m.headerClassName }) }),
1586
+ /* @__PURE__ */ u.jsx("div", { ref: Re, className: "dt-grid-body", children: hr }),
1587
+ Me > 0 && /* @__PURE__ */ u.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1588
+ /* @__PURE__ */ u.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: oe.nameWidth }, "aria-hidden": "true" }),
1589
+ /* @__PURE__ */ u.jsx(
1590
+ sn,
1595
1591
  {
1596
1592
  horizontal: !0,
1597
- contentSize: te.numericTotal,
1598
- viewportSize: te.numericVisible,
1599
- scrollPosition: Me,
1600
- scrollBarWidth: Le,
1601
- locale: ee,
1602
- labels: fe,
1593
+ contentSize: oe.numericTotal,
1594
+ viewportSize: oe.numericVisible,
1595
+ scrollPosition: $e,
1596
+ scrollBarWidth: Fe,
1597
+ locale: ne,
1598
+ labels: ue,
1603
1599
  onScroll: (s) => {
1604
- const u = typeof s == "function" ? s(Me) : s, b = Nt(u, De);
1605
- return $e(b), b;
1600
+ const d = typeof s == "function" ? s($e) : s, v = Nt(d, Me);
1601
+ return He(v), v;
1606
1602
  }
1607
1603
  }
1608
1604
  ),
1609
- /* @__PURE__ */ d.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Le }, "aria-hidden": "true" })
1605
+ /* @__PURE__ */ u.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Fe }, "aria-hidden": "true" })
1610
1606
  ] }),
1611
- Xr && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
1612
- /* @__PURE__ */ d.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ d.jsx($n, { columns: g.columns, numericTemplate: st, numericTotal: te.numericTotal, nameWidth: te.nameWidth, scrollBarWidth: Le, allEntries: Kr, className: g.footerClassName }) })
1607
+ Jr && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
1608
+ /* @__PURE__ */ u.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ u.jsx(Hn, { columns: m.columns, numericTemplate: at, numericTotal: oe.numericTotal, nameWidth: oe.nameWidth, scrollBarWidth: Fe, allEntries: Ur, className: m.footerClassName }) })
1613
1609
  ]
1614
1610
  }
1615
1611
  );
1616
- }, wo = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1617
- const [r, n] = tn(), [a, l] = le(() => {
1612
+ }, xo = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1613
+ const [r, o] = rn(), [a, l] = ie(() => {
1618
1614
  if (typeof window < "u" && t)
1619
1615
  try {
1620
- const h = window.localStorage.getItem(t);
1621
- if (h) {
1622
- const v = JSON.parse(h);
1623
- return new Set(v);
1616
+ const f = window.localStorage.getItem(t);
1617
+ if (f) {
1618
+ const w = JSON.parse(f);
1619
+ return new Set(w);
1624
1620
  }
1625
- } catch (h) {
1626
- console.error("[useDirectoryTreeState] Error reading from localStorage", h);
1621
+ } catch (f) {
1622
+ console.error("[useDirectoryTreeState] Error reading from localStorage", f);
1627
1623
  }
1628
1624
  return e;
1629
- }), c = P((h) => {
1630
- n(() => {
1631
- l((v) => {
1632
- const R = new Set(v);
1633
- return h(R), R;
1625
+ }), c = j((f) => {
1626
+ o(() => {
1627
+ l((w) => {
1628
+ const S = new Set(w);
1629
+ return f(S), S;
1634
1630
  });
1635
1631
  });
1636
- }, []), i = P(
1637
- (h, v) => {
1638
- c((R) => {
1639
- for (const M of h)
1640
- v(R, M);
1632
+ }, []), i = j(
1633
+ (f, w) => {
1634
+ c((S) => {
1635
+ for (const M of f)
1636
+ w(S, M);
1641
1637
  });
1642
1638
  },
1643
1639
  [c]
1644
1640
  );
1645
- Re(() => {
1641
+ Se(() => {
1646
1642
  if (t && typeof window < "u")
1647
1643
  try {
1648
1644
  window.localStorage.setItem(t, JSON.stringify(Array.from(a)));
1649
- } catch (h) {
1650
- console.warn(`Error setting localStorage key "${t}":`, h);
1645
+ } catch (f) {
1646
+ console.warn(`Error setting localStorage key "${t}":`, f);
1651
1647
  }
1652
1648
  }, [a, t]);
1653
- const I = P(
1654
- (h) => {
1655
- i([h], (v, R) => {
1656
- v.has(R) ? v.delete(R) : v.add(R);
1649
+ const R = j(
1650
+ (f) => {
1651
+ i([f], (w, S) => {
1652
+ w.has(S) ? w.delete(S) : w.add(S);
1657
1653
  });
1658
1654
  },
1659
1655
  [i]
1660
- ), x = P(
1661
- (h) => {
1662
- i([h], (v, R) => {
1663
- v.add(R);
1656
+ ), E = j(
1657
+ (f) => {
1658
+ i([f], (w, S) => {
1659
+ w.add(S);
1664
1660
  });
1665
1661
  },
1666
1662
  [i]
1667
- ), f = P(
1668
- (h) => {
1669
- i([h], (v, R) => {
1670
- v.delete(R);
1663
+ ), g = j(
1664
+ (f) => {
1665
+ i([f], (w, S) => {
1666
+ w.delete(S);
1671
1667
  });
1672
1668
  },
1673
1669
  [i]
1674
- ), p = P(
1675
- (h) => {
1676
- i(h, (v, R) => {
1677
- v.delete(R);
1670
+ ), h = j(
1671
+ (f) => {
1672
+ i(f, (w, S) => {
1673
+ w.delete(S);
1678
1674
  });
1679
1675
  },
1680
1676
  [i]
1681
- ), S = P(
1682
- (h) => {
1683
- i(h, (v, R) => {
1684
- v.add(R);
1677
+ ), p = j(
1678
+ (f) => {
1679
+ i(f, (w, S) => {
1680
+ w.add(S);
1685
1681
  });
1686
1682
  },
1687
1683
  [i]
1688
- ), E = P(() => {
1689
- c((h) => {
1690
- h.clear();
1684
+ ), x = j(() => {
1685
+ c((f) => {
1686
+ f.clear();
1691
1687
  });
1692
- }, [c]), j = P((h) => a.has(h), [a]);
1688
+ }, [c]), N = j((f) => a.has(f), [a]);
1693
1689
  return {
1694
1690
  expanded: a,
1695
- toggle: I,
1696
- expand: x,
1697
- collapse: f,
1698
- collapseMultiple: p,
1699
- expandMultiple: S,
1700
- collapseAll: E,
1701
- isExpanded: j,
1691
+ toggle: R,
1692
+ expand: E,
1693
+ collapse: g,
1694
+ collapseMultiple: h,
1695
+ expandMultiple: p,
1696
+ collapseAll: x,
1697
+ isExpanded: N,
1702
1698
  isPending: r
1703
1699
  };
1704
1700
  };
1705
1701
  export {
1706
- Yn as DIRECTORY_TREE_LABEL_CATALOGS,
1707
- Er as DIRECTORY_TREE_LABEL_KEYS,
1708
- vo as DirectoryTree,
1709
- F as directoryTreeClasses,
1710
- Vn as resolveDirectoryTreeLabels,
1711
- wo as useDirectoryTreeState
1702
+ Gn as DIRECTORY_TREE_LABEL_CATALOGS,
1703
+ Sr as DIRECTORY_TREE_LABEL_KEYS,
1704
+ wo as DirectoryTree,
1705
+ D as directoryTreeClasses,
1706
+ Kn as resolveDirectoryTreeLabels,
1707
+ xo as useDirectoryTreeState
1712
1708
  };