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