@dotdirfm/ui 0.1.3 → 0.1.5

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/dotdir.mjs CHANGED
@@ -184,14 +184,14 @@ function F(e, ...t) {
184
184
  }
185
185
  //#endregion
186
186
  //#region lib/styles/help-dialog.module.css
187
- var ee = {
187
+ var I = {
188
188
  "help-dialog": "_help-dialog_riri2_1",
189
189
  "help-dialog-header": "_help-dialog-header_riri2_16",
190
190
  "help-dialog-body": "_help-dialog-body_riri2_27",
191
191
  "help-dialog-buttons": "_help-dialog-buttons_riri2_82"
192
- }, te = "a[href],button,input,select,textarea,iframe,[tabindex]:not([tabindex=\"-1\"])";
193
- function I(e) {
194
- return Array.from(e.querySelectorAll(te)).filter((e) => !e.hasAttribute("disabled") && e.tabIndex !== -1);
192
+ }, ee = "a[href],button,input,select,textarea,iframe,[tabindex]:not([tabindex=\"-1\"])";
193
+ function te(e) {
194
+ return Array.from(e.querySelectorAll(ee)).filter((e) => !e.hasAttribute("disabled") && e.tabIndex !== -1);
195
195
  }
196
196
  function L({ className: e, children: t, onClose: n, onKeyDown: r, dismissible: i = !0, placement: a = "center", initialFocusRef: s }) {
197
197
  let c = u(null);
@@ -203,7 +203,7 @@ function L({ className: e, children: t, onClose: n, onKeyDown: r, dismissible: i
203
203
  return;
204
204
  }
205
205
  if (!t) return;
206
- let [n] = I(t);
206
+ let [n] = te(t);
207
207
  (n ?? t).focus();
208
208
  });
209
209
  return () => {
@@ -219,7 +219,7 @@ function L({ className: e, children: t, onClose: n, onKeyDown: r, dismissible: i
219
219
  if (e.key !== "Tab") return;
220
220
  let t = c.current;
221
221
  if (!t) return;
222
- let a = I(t);
222
+ let a = te(t);
223
223
  if (a.length === 0) {
224
224
  e.preventDefault(), t.focus();
225
225
  return;
@@ -257,22 +257,22 @@ function ne({ content: e, onClose: t }) {
257
257
  }, [t]);
258
258
  let r = h.parse(e);
259
259
  return /* @__PURE__ */ m(L, {
260
- className: ee["help-dialog"],
260
+ className: I["help-dialog"],
261
261
  onClose: t,
262
262
  initialFocusRef: n,
263
263
  children: [
264
264
  /* @__PURE__ */ p("div", {
265
- className: ee["help-dialog-header"],
265
+ className: I["help-dialog-header"],
266
266
  children: "Help"
267
267
  }),
268
268
  /* @__PURE__ */ p("div", {
269
269
  ref: n,
270
- className: ee["help-dialog-body"],
270
+ className: I["help-dialog-body"],
271
271
  tabIndex: 0,
272
272
  dangerouslySetInnerHTML: { __html: r }
273
273
  }),
274
274
  /* @__PURE__ */ p("div", {
275
- className: ee["help-dialog-buttons"],
275
+ className: I["help-dialog-buttons"],
276
276
  children: /* @__PURE__ */ p("button", {
277
277
  onClick: t,
278
278
  children: "Close"
@@ -284,7 +284,7 @@ function ne({ content: e, onClose: t }) {
284
284
  //#endregion
285
285
  //#region lib/dialogs/dialogHotkeys.tsx
286
286
  var re = n(null);
287
- function R(e) {
287
+ function ie(e) {
288
288
  let t = Array.from(e.entries()).sort(([, e], [, t]) => e.label.length - t.label.length), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
289
289
  for (let [e, { label: i }] of t) for (let t of i) {
290
290
  let i = t.toLowerCase();
@@ -295,7 +295,7 @@ function R(e) {
295
295
  }
296
296
  return r;
297
297
  }
298
- function ie(e, t) {
298
+ function R(e, t) {
299
299
  if (e.size !== t.size) return !1;
300
300
  for (let [n, r] of e) if (t.get(n) !== r) return !1;
301
301
  return !0;
@@ -312,8 +312,8 @@ function ae({ children: e, helpText: t }) {
312
312
  n.current.delete(e), v((e) => e + 1);
313
313
  }, []);
314
314
  c(() => {
315
- let e = R(n.current);
316
- ie(e, s.current) || (s.current = e, a(e));
315
+ let e = ie(n.current);
316
+ R(e, s.current) || (s.current = e, a(e));
317
317
  }, [_]), o(() => {
318
318
  let e = (e) => {
319
319
  if (e.key === "F1") {
@@ -393,12 +393,12 @@ function oe(e) {
393
393
  function se(e) {
394
394
  return e == null || !Number.isFinite(e) || e === 0 ? "—" : new Date(e).toLocaleString();
395
395
  }
396
- function B(e) {
396
+ function ce(e) {
397
397
  let t = e.lastIndexOf("/"), n = e.lastIndexOf("\\"), r = Math.max(t, n);
398
398
  return r >= 0 ? e.slice(r + 1) : e;
399
399
  }
400
- function V({ src: e, dest: t, srcSize: n, srcMtimeMs: r, destSize: i, destMtimeMs: a, onResolve: s }) {
401
- let c = u(null), l = u(null), f = u(null), [h, g] = d(!1), [_, v] = d(B(t)), { onKeyDown: y } = j(c, { defaultIndex: 0 }), { onKeyDown: b } = j(l, { defaultIndex: 1 });
400
+ function B({ src: e, dest: t, srcSize: n, srcMtimeMs: r, destSize: i, destMtimeMs: a, onResolve: s }) {
401
+ let c = u(null), l = u(null), f = u(null), [h, g] = d(!1), [_, v] = d(ce(t)), { onKeyDown: y } = j(c, { defaultIndex: 0 }), { onKeyDown: b } = j(l, { defaultIndex: 1 });
402
402
  return o(() => (A.push("modal"), () => {
403
403
  A.pop("modal");
404
404
  }), []), h ? /* @__PURE__ */ m(L, {
@@ -549,7 +549,7 @@ function V({ src: e, dest: t, srcSize: n, srcMtimeMs: r, destSize: i, destMtimeM
549
549
  }
550
550
  //#endregion
551
551
  //#region lib/dialogs/CopyConfigDialog.tsx
552
- function ce({ itemCount: e, destPath: t, onConfirm: n, onCancel: r }) {
552
+ function V({ itemCount: e, destPath: t, onConfirm: n, onCancel: r }) {
553
553
  let i = u(null), [a, s] = d(t), [c, l] = d("ask"), [f, h] = d("smart"), [g, _] = d(!0), [v, y] = d(!1), [b, x] = d(!1), [S, C] = d(!1), [w, T] = d(!1), { onKeyDown: E } = j(i, { defaultIndex: 1 });
554
554
  return o(() => (A.push("modal"), () => {
555
555
  A.pop("modal");
@@ -1569,7 +1569,7 @@ function we(e, t) {
1569
1569
  e.onCancel(), t.closeDialog();
1570
1570
  }
1571
1571
  });
1572
- case "copyConfig": return /* @__PURE__ */ p(ce, {
1572
+ case "copyConfig": return /* @__PURE__ */ p(V, {
1573
1573
  itemCount: e.itemCount,
1574
1574
  destPath: e.destPath,
1575
1575
  onConfirm: (t, n) => {
@@ -1587,7 +1587,7 @@ function we(e, t) {
1587
1587
  currentFile: e.currentFile,
1588
1588
  onCancel: e.onCancel
1589
1589
  });
1590
- case "copyConflict": return /* @__PURE__ */ p(V, {
1590
+ case "copyConflict": return /* @__PURE__ */ p(B, {
1591
1591
  src: e.src,
1592
1592
  dest: e.dest,
1593
1593
  srcSize: e.srcSize,
@@ -1631,7 +1631,7 @@ function we(e, t) {
1631
1631
  currentFile: e.currentFile,
1632
1632
  onCancel: e.onCancel
1633
1633
  });
1634
- case "moveConflict": return /* @__PURE__ */ p(V, {
1634
+ case "moveConflict": return /* @__PURE__ */ p(B, {
1635
1635
  src: e.src,
1636
1636
  dest: e.dest,
1637
1637
  srcSize: e.srcSize,
@@ -3605,8 +3605,17 @@ async function vn(e, t, n) {
3605
3605
  }, mn(), i) : i;
3606
3606
  }
3607
3607
  //#endregion
3608
+ //#region lib/fileListHandlers.ts
3609
+ var yn = null;
3610
+ function bn(e) {
3611
+ yn = e;
3612
+ }
3613
+ function J() {
3614
+ return yn;
3615
+ }
3616
+ //#endregion
3608
3617
  //#region lib/styles/viewers.module.css
3609
- var yn = {
3618
+ var xn = {
3610
3619
  "file-viewer": "_file-viewer_1gb4m_1",
3611
3620
  "file-viewer-inline": "_file-viewer-inline_1gb4m_17",
3612
3621
  "file-viewer-overlay": "_file-viewer-overlay_1gb4m_30",
@@ -3615,7 +3624,7 @@ var yn = {
3615
3624
  };
3616
3625
  //#endregion
3617
3626
  //#region lib/components/ExtensionContainer.tsx
3618
- async function bn(e, t, n, r) {
3627
+ async function Sn(e, t, n, r) {
3619
3628
  let { containerFile: i, innerPath: a } = Wt(t), o = rn.resolve(q(i));
3620
3629
  if (!o) throw Error(`No fsProvider registered for "${q(i)}"`);
3621
3630
  if (o.contribution.runtime === "backend" && e.fsProvider) {
@@ -3626,7 +3635,7 @@ async function bn(e, t, n, r) {
3626
3635
  if (!s.readFileRange) throw Error("Provider does not support readFileRange");
3627
3636
  return s.readFileRange(i, a, n, r);
3628
3637
  }
3629
- function xn(e) {
3638
+ function Cn(e) {
3630
3639
  let { extensionDirPath: t, entry: n, kind: r, props: a, onClose: s, className: c, style: l, active: f } = e, h = ke(), g = u(null), [_, v] = d(null), [y, b] = d(!0), x = u(s);
3631
3640
  x.current = s;
3632
3641
  let S = r === "viewer" && !!a.inline, C = r === "editor" || r === "viewer" && !S, w = u(null), T = u(!1), E = u(!1);
@@ -3695,11 +3704,11 @@ function xn(e) {
3695
3704
  let M = i(() => ({
3696
3705
  async readFile(e) {
3697
3706
  let t = W(e);
3698
- return Ut(t) ? bn(h, t, 0, 64 * 1024 * 1024) : h.fs.readFile(t);
3707
+ return Ut(t) ? Sn(h, t, 0, 64 * 1024 * 1024) : h.fs.readFile(t);
3699
3708
  },
3700
3709
  async readFileRange(e, t, n) {
3701
3710
  let r = W(e);
3702
- if (Ut(r)) return bn(h, r, t, n);
3711
+ if (Ut(r)) return Sn(h, r, t, n);
3703
3712
  let i = D.current, a = i;
3704
3713
  if (!a || a.path !== r) {
3705
3714
  if (i) try {
@@ -3725,7 +3734,7 @@ function xn(e) {
3725
3734
  async statFile(e) {
3726
3735
  let t = W(e);
3727
3736
  if (Ut(t)) return {
3728
- size: (await bn(h, t, 0, 64 * 1024 * 1024)).byteLength,
3737
+ size: (await Sn(h, t, 0, 64 * 1024 * 1024)).byteLength,
3729
3738
  mtimeMs: 0
3730
3739
  };
3731
3740
  let n = await h.fs.stat(t), r = D.current;
@@ -4090,37 +4099,43 @@ function xn(e) {
4090
4099
  })]
4091
4100
  });
4092
4101
  }
4093
- function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize: i, inline: a, visible: s, onClose: c, onExecuteCommand: d }) {
4094
- let f = u(!1), h = s ?? !0;
4102
+ function wn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize: a, inline: s, visible: c, onClose: d, onExecuteCommand: f }) {
4103
+ let h = u(!1), g = c ?? !0, _ = i(() => {
4104
+ requestAnimationFrame(() => {
4105
+ J()?.focus();
4106
+ });
4107
+ }, []), v = i(() => {
4108
+ d(), _();
4109
+ }, [d, _]);
4095
4110
  o(() => {
4096
- if (!a) {
4097
- if (h) f.current ||= (A.push("viewer"), !0);
4098
- else if (f.current) {
4111
+ if (!s) {
4112
+ if (g) h.current ||= (A.push("viewer"), !0);
4113
+ else if (h.current) {
4099
4114
  try {
4100
4115
  A.pop("viewer");
4101
4116
  } catch {}
4102
- f.current = !1;
4117
+ h.current = !1;
4103
4118
  }
4104
4119
  }
4105
- }, [a, h]), o(() => () => {
4106
- if (f.current) {
4120
+ }, [s, g]), o(() => () => {
4121
+ if (h.current) {
4107
4122
  try {
4108
4123
  A.pop("viewer");
4109
4124
  } catch {}
4110
- f.current = !1;
4125
+ h.current = !1;
4111
4126
  }
4112
4127
  }, []);
4113
- let g = l(() => ({
4128
+ let y = l(() => ({
4114
4129
  filePath: n,
4115
4130
  fileName: r,
4116
- fileSize: i,
4117
- inline: a
4131
+ fileSize: a,
4132
+ inline: s
4118
4133
  }), [
4119
4134
  n,
4120
4135
  r,
4121
- i,
4122
- a
4123
- ]), _ = /* @__PURE__ */ m("div", {
4136
+ a,
4137
+ s
4138
+ ]), b = /* @__PURE__ */ m("div", {
4124
4139
  style: {
4125
4140
  display: "flex",
4126
4141
  alignItems: "center",
@@ -4143,7 +4158,7 @@ function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
4143
4158
  }), /* @__PURE__ */ p("button", {
4144
4159
  type: "button",
4145
4160
  title: "Close (Esc)",
4146
- onClick: c,
4161
+ onClick: v,
4147
4162
  style: {
4148
4163
  background: "transparent",
4149
4164
  border: "none",
@@ -4156,21 +4171,21 @@ function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
4156
4171
  "aria-label": "Close",
4157
4172
  children: "×"
4158
4173
  })]
4159
- }), v = /* @__PURE__ */ p(xn, {
4174
+ }), x = /* @__PURE__ */ p(Cn, {
4160
4175
  kind: "viewer",
4161
4176
  extensionDirPath: e,
4162
4177
  entry: t,
4163
- props: g,
4164
- active: h,
4165
- onClose: c,
4166
- onExecuteCommand: d,
4178
+ props: y,
4179
+ active: g,
4180
+ onClose: v,
4181
+ onExecuteCommand: f,
4167
4182
  style: {
4168
4183
  width: "100%",
4169
4184
  height: "100%"
4170
4185
  }
4171
4186
  });
4172
- return a ? /* @__PURE__ */ p("div", {
4173
- className: `${yn["file-viewer"]} ${yn["file-viewer-inline"]}`,
4187
+ return s ? /* @__PURE__ */ p("div", {
4188
+ className: `${xn["file-viewer"]} ${xn["file-viewer-inline"]}`,
4174
4189
  style: {
4175
4190
  display: "flex",
4176
4191
  flexDirection: "column",
@@ -4181,75 +4196,81 @@ function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
4181
4196
  flex: 1,
4182
4197
  minHeight: 0
4183
4198
  },
4184
- children: v
4199
+ children: x
4185
4200
  })
4186
4201
  }) : /* @__PURE__ */ p("div", {
4187
- className: yn["file-viewer-overlay"],
4188
- style: { display: h ? "flex" : "none" },
4202
+ className: xn["file-viewer-overlay"],
4203
+ style: { display: g ? "flex" : "none" },
4189
4204
  children: /* @__PURE__ */ m("div", {
4190
- className: yn["file-viewer"],
4205
+ className: xn["file-viewer"],
4191
4206
  style: {
4192
4207
  display: "flex",
4193
4208
  flexDirection: "column",
4194
4209
  padding: 0
4195
4210
  },
4196
- children: [_, /* @__PURE__ */ p("div", {
4211
+ children: [b, /* @__PURE__ */ p("div", {
4197
4212
  style: {
4198
4213
  flex: 1,
4199
4214
  minHeight: 0
4200
4215
  },
4201
- children: v
4216
+ children: x
4202
4217
  })]
4203
4218
  })
4204
4219
  });
4205
4220
  }
4206
- function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i, visible: a, onClose: s, onDirtyChange: c, languages: h, grammars: g }) {
4207
- let [_, v] = d(i), y = u(!1), b = a ?? !0;
4221
+ function Tn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: a, visible: s, onClose: c, onDirtyChange: h, languages: g, grammars: _ }) {
4222
+ let [v, y] = d(a), b = u(!1), x = s ?? !0, S = i(() => {
4223
+ requestAnimationFrame(() => {
4224
+ J()?.focus();
4225
+ });
4226
+ }, []), C = i(() => {
4227
+ c(), S();
4228
+ }, [c, S]);
4208
4229
  o(() => {
4209
- v(i);
4210
- }, [i]), o(() => {
4211
- if (b) y.current ||= (A.push("editor"), !0);
4212
- else if (y.current) {
4230
+ y(a);
4231
+ }, [a]), o(() => {
4232
+ if (x) b.current ||= (A.push("editor"), !0);
4233
+ else if (b.current) {
4213
4234
  try {
4214
4235
  A.pop("editor");
4215
4236
  } catch {}
4216
- y.current = !1;
4237
+ b.current = !1;
4217
4238
  }
4218
- }, [b]), o(() => () => {
4219
- if (y.current) {
4239
+ }, [x]), o(() => () => {
4240
+ if (b.current) {
4220
4241
  try {
4221
4242
  A.pop("editor");
4222
4243
  } catch {}
4223
- y.current = !1;
4244
+ b.current = !1;
4224
4245
  }
4225
4246
  }, []);
4226
- let x = l(() => ({
4247
+ let w = l(() => ({
4227
4248
  filePath: n,
4228
4249
  fileName: r,
4229
- langId: _,
4250
+ langId: v,
4230
4251
  extensionDirPath: e,
4231
- languages: h,
4232
- grammars: g,
4252
+ languages: g,
4253
+ grammars: _,
4233
4254
  inline: !1
4234
4255
  }), [
4235
4256
  n,
4236
4257
  r,
4237
- _,
4258
+ v,
4238
4259
  e,
4239
- h,
4240
- g
4241
- ]), S = (e) => {
4260
+ g,
4261
+ _
4262
+ ]), T = (e) => {
4242
4263
  let t = e.target.value;
4243
- v(t);
4244
- }, C = l(() => {
4245
- let e = h ?? [], t = /* @__PURE__ */ new Set();
4264
+ y(t);
4265
+ }, E = l(() => {
4266
+ let e = g ?? [], t = /* @__PURE__ */ new Set();
4246
4267
  return e.filter((e) => t.has(e.id) ? !1 : (t.add(e.id), !0));
4247
- }, [h]), w = C.length > 0;
4268
+ }, [g]), D = E.length > 0;
4248
4269
  return /* @__PURE__ */ p("div", {
4249
- className: yn["file-editor-overlay"],
4250
- style: { display: b ? "flex" : "none" },
4270
+ className: xn["file-editor-overlay"],
4271
+ style: { display: x ? "flex" : "none" },
4251
4272
  children: /* @__PURE__ */ m("div", {
4252
- className: yn["file-editor"],
4273
+ className: xn["file-editor"],
4253
4274
  style: {
4254
4275
  display: "flex",
4255
4276
  flexDirection: "column",
@@ -4277,14 +4298,14 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
4277
4298
  title: r,
4278
4299
  children: r
4279
4300
  }),
4280
- w && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("label", {
4301
+ D && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("label", {
4281
4302
  htmlFor: "editor-lang-select",
4282
4303
  style: { whiteSpace: "nowrap" },
4283
4304
  children: "Language:"
4284
4305
  }), /* @__PURE__ */ m("select", {
4285
4306
  id: "editor-lang-select",
4286
- value: _,
4287
- onChange: S,
4307
+ value: v,
4308
+ onChange: T,
4288
4309
  style: {
4289
4310
  minWidth: 120,
4290
4311
  padding: "2px 6px"
@@ -4292,7 +4313,7 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
4292
4313
  children: [/* @__PURE__ */ p("option", {
4293
4314
  value: "plaintext",
4294
4315
  children: "Plain Text"
4295
- }), C.map((e) => /* @__PURE__ */ p("option", {
4316
+ }), E.map((e) => /* @__PURE__ */ p("option", {
4296
4317
  value: e.id,
4297
4318
  children: e.aliases?.[0] ?? e.id
4298
4319
  }, e.id))]
@@ -4300,7 +4321,7 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
4300
4321
  /* @__PURE__ */ p("button", {
4301
4322
  type: "button",
4302
4323
  title: "Close (Esc)",
4303
- onClick: s,
4324
+ onClick: C,
4304
4325
  style: {
4305
4326
  background: "transparent",
4306
4327
  border: "none",
@@ -4319,14 +4340,14 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
4319
4340
  flex: 1,
4320
4341
  minHeight: 0
4321
4342
  },
4322
- children: /* @__PURE__ */ p(xn, {
4343
+ children: /* @__PURE__ */ p(Cn, {
4323
4344
  kind: "editor",
4324
4345
  extensionDirPath: e,
4325
4346
  entry: t,
4326
- props: x,
4327
- active: b,
4328
- onClose: s,
4329
- onDirtyChange: c,
4347
+ props: w,
4348
+ active: x,
4349
+ onClose: C,
4350
+ onDirtyChange: h,
4330
4351
  style: {
4331
4352
  width: "100%",
4332
4353
  height: "100%"
@@ -4338,22 +4359,22 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
4338
4359
  }
4339
4360
  //#endregion
4340
4361
  //#region lib/features/extensions/extensionHost.worker.ts?worker&inline
4341
- var wn = "(function(){let e=/^[A-Za-z]:$/,t=/^[A-Za-z]:\\/$/;function n(e){return e.startsWith(`//`)}function r(e){return n(e)?`//${e.slice(2).replace(/\\/+/g,`/`)}`:e.replace(/\\/+/g,`/`)}function i(e){return e.startsWith(`/`)||n(e)||/^[A-Za-z]:\\//.test(e)}function a(n){if(!n)return n;let i=r(n.replace(/\\\\/g,`/`));return i=i.replace(/\\/\\.\\//g,`/`).replace(/^\\.\\//,``),i.endsWith(`/.`)&&(i=i.slice(0,-2)),e.test(i)&&(i=`${i}/`),i.length>1&&i.endsWith(`/`)&&!t.test(i)&&(i=i.replace(/\\/+$/,``)),i}function o(e){let t=a(e);return n(t)?t.slice(2).split(`/`).filter(Boolean).length===2:!1}function s(e){let n=a(e);return n===`/`||t.test(n)||o(n)}function c(t){let n=a(t);if(!n)return`.`;if(s(n))return n;let r=n.replace(/\\/+$/,``),i=r.lastIndexOf(`/`);if(i<0)return`.`;if(i===0)return`/`;let o=r.slice(0,i);return e.test(o)?`${o}/`:o||`/`}function l(...e){let t=``;for(let n of e){if(!n)continue;let e=a(n);if(!t||i(e)){t=e;continue}t=a(`${t.replace(/\\/+$/,``)}/${e.replace(/^\\/+/,``)}`)}return t}let u=0,d=new Map,f=new Map,p=new Map,m=new Map;function h(e){return new Promise((t,n)=>{let r=u++;d.set(r,{resolve:t,reject:n}),self.postMessage({type:`readFile`,id:r,path:e})})}function g(e){return`${e.ref.publisher}.${e.ref.name}.${e.ref.version}`}function _(e,t){let n=e.manifest.activationEvents??[];return n.length===0?t===`*`:n.includes(`*`)||n.includes(t)}async function v(e){let t=await h(e);if(t==null)throw Error(`Browser script not found: ${e}`);let n=URL.createObjectURL(new Blob([t],{type:`text/javascript`}));try{return await import(n)}finally{URL.revokeObjectURL(n)}}async function y(e){let t=g(e);if(p.has(t)||!e.manifest.browser)return;let n=a(e.manifest.browser).replace(/^\\/+/,``),r=await v(l(e.dirPath,n)),i=r.activate??r.default?.activate,o=r.deactivate??r.default?.deactivate;if(typeof i!=`function`){console.warn(`[ExtHost] ${t} browser entry has no activate() export`);return}let s=[],c={commands:{registerCommand:(e,t)=>{m.set(e,t);let n={dispose:()=>{m.get(e)===t&&m.delete(e)}};return s.push(n),n},registerKeybinding:e=>({dispose(){}})}},u={subscriptions:s,dotdir:c};self.dotdir=c,await i(u),p.set(t,{subscriptions:s,deactivate:o})}async function b(e){for(let t of f.values())if(t.manifest.browser&&_(t,e))try{await y(t)}catch(e){console.error(`[ExtHost] activate failed:`,g(t),e)}}async function x(e,t){await b(`onCommand:${e}`);let n=m.get(e);n&&await n(...t)}function S(e){return`${e.publisher}-${e.name}-${e.version}`}async function C(e){try{let t=await h(l(e,`package.json`));if(t===null)return null;let n=JSON.parse(t),r={publisher:n.publisher||`unknown`,name:n.name||`unknown`,version:n.version||`0.0.0`},i,a;if(n.contributes?.iconTheme?.path){let t=l(e,n.contributes.iconTheme.path);i=t,a=c(t)}let o=n.contributes?.languages,s;if(n.contributes?.grammars?.length){s=[];for(let t of n.contributes.grammars)try{let n=l(e,t.path);s.push({contribution:t,path:n})}catch{}}let u;n.contributes?.themes?.length&&(u=n.contributes.themes.map((t,n)=>({id:t.id||`${t.label}#${n}`,label:t.label,uiTheme:t.uiTheme,jsonPath:l(e,t.path)})));let d=n.contributes?.viewers,f=n.contributes?.editors,p=n.contributes?.commands,m=n.contributes?.keybindings,g=n.contributes?.fsProviders,_;if(n.contributes?.shellIntegrations?.length){_=[];for(let t of n.contributes.shellIntegrations){let n=await h(l(e,t.scriptPath));n!==null&&_.push({shell:t.shell,label:t.label,script:n,executableCandidates:t.executableCandidates??[],platforms:t.platforms,hiddenCdTemplate:t.hiddenCdTemplate,cwdEscape:t.cwdEscape,lineEnding:t.lineEnding,spawnArgs:t.spawnArgs,scriptArg:t.scriptArg})}}return{ref:r,manifest:n,dirPath:e,iconThemeFssPath:i,iconThemeBasePath:a,colorThemes:u,languages:o,grammarRefs:s,viewers:d,editors:f,commands:p,keybindings:m,fsProviders:g,shellIntegrations:_}}catch{return null}}async function w(e){let t=[],n=l(e,`.dotdir`,`extensions`),r;try{let e=await h(l(n,`extensions.json`));if(e===null)return t;let i=JSON.parse(e);r=Array.isArray(i)?i:[]}catch{return t}for(let e of r){if(!e.publisher||!e.name||!e.version)continue;let r=await C(e.path?a(e.path):l(n,S(e)));r&&t.push(r)}console.log(`[ExtHost] loaded`,t.length,`extensions; FSS:`,t.filter(e=>e.iconThemeFss).map(e=>`${e.ref.publisher}.${e.ref.name}`),`vscode:`,t.filter(e=>e.vscodeIconThemePath).map(e=>`${e.ref.publisher}.${e.ref.name}`)),f.clear();for(let e of t)f.set(g(e),e);return t}self.onmessage=e=>{let t=e.data;if(t.type===`start`)w(t.homePath).then(async e=>{await b(`*`),self.postMessage({type:`loaded`,extensions:e})}).catch(e=>{let t=e instanceof Error?e.message:e&&typeof e==`object`&&`message`in e?String(e.message):String(e);self.postMessage({type:`error`,message:t})});else if(t.type===`activateByEvent`){let e=Number(t.requestId);b(String(t.event??``)).then(()=>{self.postMessage({type:`requestResult`,requestId:e,result:null})}).catch(t=>{let n=t instanceof Error?t.message:String(t);self.postMessage({type:`requestResult`,requestId:e,error:n})})}else if(t.type===`executeCommand`){let e=Number(t.requestId);x(String(t.command??``),Array.isArray(t.args)?t.args:[]).then(()=>{self.postMessage({type:`requestResult`,requestId:e,result:null})}).catch(t=>{let n=t instanceof Error?t.message:String(t);self.postMessage({type:`requestResult`,requestId:e,error:n})})}else if(t.type===`readFileResult`){let e=d.get(t.id);e&&(d.delete(t.id),t.error?e.resolve(null):e.resolve(t.data))}}})();", Tn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", wn], { type: "text/javascript;charset=utf-8" });
4342
- function En(e) {
4362
+ var En = "(function(){let e=/^[A-Za-z]:$/,t=/^[A-Za-z]:\\/$/;function n(e){return e.startsWith(`//`)}function r(e){return n(e)?`//${e.slice(2).replace(/\\/+/g,`/`)}`:e.replace(/\\/+/g,`/`)}function i(e){return e.startsWith(`/`)||n(e)||/^[A-Za-z]:\\//.test(e)}function a(n){if(!n)return n;let i=r(n.replace(/\\\\/g,`/`));return i=i.replace(/\\/\\.\\//g,`/`).replace(/^\\.\\//,``),i.endsWith(`/.`)&&(i=i.slice(0,-2)),e.test(i)&&(i=`${i}/`),i.length>1&&i.endsWith(`/`)&&!t.test(i)&&(i=i.replace(/\\/+$/,``)),i}function o(e){let t=a(e);return n(t)?t.slice(2).split(`/`).filter(Boolean).length===2:!1}function s(e){let n=a(e);return n===`/`||t.test(n)||o(n)}function c(t){let n=a(t);if(!n)return`.`;if(s(n))return n;let r=n.replace(/\\/+$/,``),i=r.lastIndexOf(`/`);if(i<0)return`.`;if(i===0)return`/`;let o=r.slice(0,i);return e.test(o)?`${o}/`:o||`/`}function l(...e){let t=``;for(let n of e){if(!n)continue;let e=a(n);if(!t||i(e)){t=e;continue}t=a(`${t.replace(/\\/+$/,``)}/${e.replace(/^\\/+/,``)}`)}return t}let u=0,d=new Map,f=new Map,p=new Map,m=new Map;function h(e){return new Promise((t,n)=>{let r=u++;d.set(r,{resolve:t,reject:n}),self.postMessage({type:`readFile`,id:r,path:e})})}function g(e){return`${e.ref.publisher}.${e.ref.name}.${e.ref.version}`}function _(e,t){let n=e.manifest.activationEvents??[];return n.length===0?t===`*`:n.includes(`*`)||n.includes(t)}async function v(e){let t=await h(e);if(t==null)throw Error(`Browser script not found: ${e}`);let n=URL.createObjectURL(new Blob([t],{type:`text/javascript`}));try{return await import(n)}finally{URL.revokeObjectURL(n)}}async function y(e){let t=g(e);if(p.has(t)||!e.manifest.browser)return;let n=a(e.manifest.browser).replace(/^\\/+/,``),r=await v(l(e.dirPath,n)),i=r.activate??r.default?.activate,o=r.deactivate??r.default?.deactivate;if(typeof i!=`function`){console.warn(`[ExtHost] ${t} browser entry has no activate() export`);return}let s=[],c={commands:{registerCommand:(e,t)=>{m.set(e,t);let n={dispose:()=>{m.get(e)===t&&m.delete(e)}};return s.push(n),n},registerKeybinding:e=>({dispose(){}})}},u={subscriptions:s,dotdir:c};self.dotdir=c,await i(u),p.set(t,{subscriptions:s,deactivate:o})}async function b(e){for(let t of f.values())if(t.manifest.browser&&_(t,e))try{await y(t)}catch(e){console.error(`[ExtHost] activate failed:`,g(t),e)}}async function x(e,t){await b(`onCommand:${e}`);let n=m.get(e);n&&await n(...t)}function S(e){return`${e.publisher}-${e.name}-${e.version}`}async function C(e){try{let t=await h(l(e,`package.json`));if(t===null)return null;let n=JSON.parse(t),r={publisher:n.publisher||`unknown`,name:n.name||`unknown`,version:n.version||`0.0.0`},i,a;if(n.contributes?.iconTheme?.path){let t=l(e,n.contributes.iconTheme.path);i=t,a=c(t)}let o=n.contributes?.languages,s;if(n.contributes?.grammars?.length){s=[];for(let t of n.contributes.grammars)try{let n=l(e,t.path);s.push({contribution:t,path:n})}catch{}}let u;n.contributes?.themes?.length&&(u=n.contributes.themes.map((t,n)=>({id:t.id||`${t.label}#${n}`,label:t.label,uiTheme:t.uiTheme,jsonPath:l(e,t.path)})));let d=n.contributes?.viewers,f=n.contributes?.editors,p=n.contributes?.commands,m=n.contributes?.keybindings,g=n.contributes?.fsProviders,_;if(n.contributes?.shellIntegrations?.length){_=[];for(let t of n.contributes.shellIntegrations){let n=await h(l(e,t.scriptPath));n!==null&&_.push({shell:t.shell,label:t.label,script:n,executableCandidates:t.executableCandidates??[],platforms:t.platforms,hiddenCdTemplate:t.hiddenCdTemplate,cwdEscape:t.cwdEscape,lineEnding:t.lineEnding,spawnArgs:t.spawnArgs,scriptArg:t.scriptArg})}}return{ref:r,manifest:n,dirPath:e,iconThemeFssPath:i,iconThemeBasePath:a,colorThemes:u,languages:o,grammarRefs:s,viewers:d,editors:f,commands:p,keybindings:m,fsProviders:g,shellIntegrations:_}}catch{return null}}async function w(e){let t=[],n=l(e,`.dotdir`,`extensions`),r;try{let e=await h(l(n,`extensions.json`));if(e===null)return t;let i=JSON.parse(e);r=Array.isArray(i)?i:[]}catch{return t}for(let e of r){if(!e.publisher||!e.name||!e.version)continue;let r=await C(e.path?a(e.path):l(n,S(e)));r&&t.push(r)}console.log(`[ExtHost] loaded`,t.length,`extensions; FSS:`,t.filter(e=>e.iconThemeFss).map(e=>`${e.ref.publisher}.${e.ref.name}`),`vscode:`,t.filter(e=>e.vscodeIconThemePath).map(e=>`${e.ref.publisher}.${e.ref.name}`)),f.clear();for(let e of t)f.set(g(e),e);return t}self.onmessage=e=>{let t=e.data;if(t.type===`start`)w(t.homePath).then(async e=>{await b(`*`),self.postMessage({type:`loaded`,extensions:e})}).catch(e=>{let t=e instanceof Error?e.message:e&&typeof e==`object`&&`message`in e?String(e.message):String(e);self.postMessage({type:`error`,message:t})});else if(t.type===`activateByEvent`){let e=Number(t.requestId);b(String(t.event??``)).then(()=>{self.postMessage({type:`requestResult`,requestId:e,result:null})}).catch(t=>{let n=t instanceof Error?t.message:String(t);self.postMessage({type:`requestResult`,requestId:e,error:n})})}else if(t.type===`executeCommand`){let e=Number(t.requestId);x(String(t.command??``),Array.isArray(t.args)?t.args:[]).then(()=>{self.postMessage({type:`requestResult`,requestId:e,result:null})}).catch(t=>{let n=t instanceof Error?t.message:String(t);self.postMessage({type:`requestResult`,requestId:e,error:n})})}else if(t.type===`readFileResult`){let e=d.get(t.id);e&&(d.delete(t.id),t.error?e.resolve(null):e.resolve(t.data))}}})();", Dn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", En], { type: "text/javascript;charset=utf-8" });
4363
+ function On(e) {
4343
4364
  let t;
4344
4365
  try {
4345
- if (t = Tn && (self.URL || self.webkitURL).createObjectURL(Tn), !t) throw "";
4366
+ if (t = Dn && (self.URL || self.webkitURL).createObjectURL(Dn), !t) throw "";
4346
4367
  let n = new Worker(t, { name: e?.name });
4347
4368
  return n.addEventListener("error", () => {
4348
4369
  (self.URL || self.webkitURL).revokeObjectURL(t);
4349
4370
  }), n;
4350
4371
  } catch {
4351
- return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(wn), { name: e?.name });
4372
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(En), { name: e?.name });
4352
4373
  }
4353
4374
  }
4354
4375
  //#endregion
4355
4376
  //#region lib/features/extensions/extensionHostClient.ts
4356
- var Dn = class {
4377
+ var kn = class {
4357
4378
  worker = null;
4358
4379
  homePath = null;
4359
4380
  listeners = [];
@@ -4402,7 +4423,7 @@ var Dn = class {
4402
4423
  });
4403
4424
  }
4404
4425
  spawnWorker() {
4405
- let e = new En();
4426
+ let e = new On();
4406
4427
  e.onmessage = (t) => {
4407
4428
  let n = t.data;
4408
4429
  if (n.type === "readFile") this.handleFileRead(e, n.id, n.path);
@@ -4455,25 +4476,25 @@ var Dn = class {
4455
4476
  });
4456
4477
  }
4457
4478
  }
4458
- }, On = _((e) => {
4479
+ }, An = _((e) => {
4459
4480
  let t = e(Oe);
4460
4481
  if (!t) throw Error("Bridge not initialized.");
4461
- return new Dn(t);
4482
+ return new kn(t);
4462
4483
  });
4463
- function kn() {
4464
- return y(On);
4484
+ function jn() {
4485
+ return y(An);
4465
4486
  }
4466
4487
  //#endregion
4467
4488
  //#region lib/features/extensions/extensions.ts
4468
- var An = "https://dotdir.dev";
4469
- function jn(e) {
4489
+ var Mn = "https://dotdir.dev";
4490
+ function Nn(e) {
4470
4491
  return `${e.publisher}-${e.name}-${e.version}`;
4471
4492
  }
4472
- async function Mn(e) {
4493
+ async function Pn(e) {
4473
4494
  return K(await e.utils.getHomePath(), ".dotdir", "extensions");
4474
4495
  }
4475
- async function Nn(e) {
4476
- let t = await Mn(e);
4496
+ async function Fn(e) {
4497
+ let t = await Pn(e);
4477
4498
  try {
4478
4499
  let n = await Nt(e, K(t, "extensions.json")), r = JSON.parse(n);
4479
4500
  return Array.isArray(r) ? r : [];
@@ -4481,21 +4502,21 @@ async function Nn(e) {
4481
4502
  return [];
4482
4503
  }
4483
4504
  }
4484
- async function Pn(e, t) {
4485
- let n = await Mn(e);
4505
+ async function In(e, t) {
4506
+ let n = await Pn(e);
4486
4507
  await e.fs.writeFile(K(n, "extensions.json"), JSON.stringify(t, null, 2));
4487
4508
  }
4488
- async function Fn(e = "", t = 1) {
4509
+ async function Ln(e = "", t = 1) {
4489
4510
  let n = new URLSearchParams({
4490
4511
  page: String(t),
4491
4512
  pageSize: "30"
4492
4513
  });
4493
4514
  e && n.set("q", e);
4494
- let r = await fetch(`${An}/api/extensions/search?${n}`);
4515
+ let r = await fetch(`${Mn}/api/extensions/search?${n}`);
4495
4516
  if (!r.ok) throw Error("Failed to search marketplace");
4496
4517
  return r.json();
4497
4518
  }
4498
- async function In(e) {
4519
+ async function Rn(e) {
4499
4520
  let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
4500
4521
  n.write(e), n.close();
4501
4522
  let i = [];
@@ -4508,7 +4529,7 @@ async function In(e) {
4508
4529
  for (let e of i) o.set(e, s), s += e.length;
4509
4530
  return o;
4510
4531
  }
4511
- async function Ln(e) {
4532
+ async function zn(e) {
4512
4533
  let t = new Uint8Array(e), n = /* @__PURE__ */ new Map(), r = (e) => t[e] | t[e + 1] << 8, i = (e) => (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0, a = -1;
4513
4534
  for (let e = t.length - 22; e >= Math.max(0, t.length - 65557); e--) if (i(e) === 101010256) {
4514
4535
  a = e;
@@ -4521,13 +4542,13 @@ async function Ln(e) {
4521
4542
  if (c += 46 + o + s + l, d.endsWith("/")) continue;
4522
4543
  let f = r(u + 26), p = r(u + 28), m = u + 30 + f + p, h = t.slice(m, m + a), g;
4523
4544
  if (e === 0) g = h;
4524
- else if (e === 8) g = await In(h);
4545
+ else if (e === 8) g = await Rn(h);
4525
4546
  else continue;
4526
4547
  n.set(d, g);
4527
4548
  }
4528
4549
  return n;
4529
4550
  }
4530
- function Rn(e) {
4551
+ function Bn(e) {
4531
4552
  let t = [...e];
4532
4553
  if (t.length === 0) return "";
4533
4554
  let n = t[0], r = n.indexOf("/");
@@ -4535,22 +4556,22 @@ function Rn(e) {
4535
4556
  let i = n.slice(0, r + 1);
4536
4557
  return t.every((e) => e.startsWith(i)) ? i : "";
4537
4558
  }
4538
- async function zn(e, t, n, r) {
4539
- let i = `${An}/api/extensions/${t}/${n}/${r}/download`, a = await fetch(i);
4559
+ async function Vn(e, t, n, r) {
4560
+ let i = `${Mn}/api/extensions/${t}/${n}/${r}/download`, a = await fetch(i);
4540
4561
  if (!a.ok) throw Error(`Download failed: ${a.statusText}`);
4541
- let o = await Ln(await a.arrayBuffer()), s = await Mn(e), c = {
4562
+ let o = await zn(await a.arrayBuffer()), s = await Pn(e), c = {
4542
4563
  publisher: t,
4543
4564
  name: n,
4544
4565
  version: r
4545
- }, l = K(s, jn(c)), u = Rn(o.keys());
4566
+ }, l = K(s, Nn(c)), u = Bn(o.keys());
4546
4567
  for (let [t, n] of o) {
4547
4568
  let r = u ? t.slice(u.length) : t;
4548
4569
  r && await e.fs.writeBinaryFile(K(l, r), n);
4549
4570
  }
4550
- let d = (await Nn(e)).filter((e) => !(e.publisher === t && e.name === n));
4551
- d.push(c), await Pn(e, d);
4571
+ let d = (await Fn(e)).filter((e) => !(e.publisher === t && e.name === n));
4572
+ d.push(c), await In(e, d);
4552
4573
  }
4553
- async function Bn(e) {
4574
+ async function Hn(e) {
4554
4575
  let t = new Uint8Array(e), n = /* @__PURE__ */ new Map(), r = (e) => t[e] | t[e + 1] << 8, i = (e) => (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0, a = -1;
4555
4576
  for (let e = t.length - 22; e >= Math.max(0, t.length - 65557); e--) if (i(e) === 101010256) {
4556
4577
  a = e;
@@ -4563,14 +4584,14 @@ async function Bn(e) {
4563
4584
  if (c += 46 + o + s + l, d.endsWith("/") || !d.startsWith("extension/")) continue;
4564
4585
  let f = r(u + 26), p = r(u + 28), m = u + 30 + f + p, h = t.slice(m, m + a), g;
4565
4586
  if (e === 0) g = h;
4566
- else if (e === 8) g = await In(h);
4587
+ else if (e === 8) g = await Rn(h);
4567
4588
  else continue;
4568
4589
  let _ = d.slice(10);
4569
4590
  _ && n.set(_, g);
4570
4591
  }
4571
4592
  return n;
4572
4593
  }
4573
- async function Vn(e, t, n, r) {
4594
+ async function Un(e, t, n, r) {
4574
4595
  let i = new AbortController(), a = setTimeout(() => i.abort(), 3e4), o;
4575
4596
  try {
4576
4597
  o = await fetch(r, { signal: i.signal });
@@ -4580,13 +4601,13 @@ async function Vn(e, t, n, r) {
4580
4601
  throw Error(`Download failed: ${t}`);
4581
4602
  }
4582
4603
  if (clearTimeout(a), !o.ok) throw Error(`Download failed: ${o.status} ${o.statusText}`);
4583
- let s = await Bn(await o.arrayBuffer()), c = s.get("package.json");
4604
+ let s = await Hn(await o.arrayBuffer()), c = s.get("package.json");
4584
4605
  if (!c) throw Error("Invalid VSIX: no package.json");
4585
- let l = JSON.parse(new TextDecoder().decode(c)).version || "0.0.0", u = await Mn(e), d = {
4606
+ let l = JSON.parse(new TextDecoder().decode(c)).version || "0.0.0", u = await Pn(e), d = {
4586
4607
  publisher: t,
4587
4608
  name: n,
4588
4609
  version: l
4589
- }, f = K(u, jn(d));
4610
+ }, f = K(u, Nn(d));
4590
4611
  for (let [t, n] of s) {
4591
4612
  let r = K(f, t), i = t.split(".").pop()?.toLowerCase() ?? "";
4592
4613
  [
@@ -4604,10 +4625,10 @@ async function Vn(e, t, n, r) {
4604
4625
  "tmGrammar"
4605
4626
  ].includes(i) || t.endsWith(".tmLanguage.json") || t.endsWith(".language-configuration.json") ? await e.fs.writeFile(r, new TextDecoder().decode(n)) : await e.fs.writeBinaryFile(r, n);
4606
4627
  }
4607
- let p = (await Nn(e)).filter((e) => !(e.publisher === t && e.name === n));
4608
- p.push(d), await Pn(e, p);
4628
+ let p = (await Fn(e)).filter((e) => !(e.publisher === t && e.name === n));
4629
+ p.push(d), await In(e, p);
4609
4630
  }
4610
- async function Hn(e, t) {
4631
+ async function Wn(e, t) {
4611
4632
  if (!await e.fs.exists(t)) return;
4612
4633
  let n = await e.fs.delete.start([t]);
4613
4634
  await new Promise((t, r) => {
@@ -4618,19 +4639,19 @@ async function Hn(e, t) {
4618
4639
  });
4619
4640
  });
4620
4641
  }
4621
- async function Un(e, t, n) {
4622
- let r = await Nn(e), i = r.find((e) => e.publisher === t && e.name === n);
4623
- i && !i.path && await Hn(e, K(await Mn(e), jn(i))), await Pn(e, r.filter((e) => !(e.publisher === t && e.name === n)));
4642
+ async function Gn(e, t, n) {
4643
+ let r = await Fn(e), i = r.find((e) => e.publisher === t && e.name === n);
4644
+ i && !i.path && await Wn(e, K(await Pn(e), Nn(i))), await In(e, r.filter((e) => !(e.publisher === t && e.name === n)));
4624
4645
  }
4625
- function Wn(e) {
4646
+ function Kn(e) {
4626
4647
  return e.iconThemeFss || e.iconThemeFssPath || e.vscodeIconThemePath ? `${e.ref.publisher}.${e.ref.name}` : null;
4627
4648
  }
4628
- function Gn(e, t) {
4649
+ function qn(e, t) {
4629
4650
  return `${e.ref.publisher}.${e.ref.name}:${t}`;
4630
4651
  }
4631
- function Kn(e, t) {
4652
+ function Jn(e, t) {
4632
4653
  for (let n of e) if (n.colorThemes) {
4633
- for (let e of n.colorThemes) if (Gn(n, e.id) === t) return {
4654
+ for (let e of n.colorThemes) if (qn(n, e.id) === t) return {
4634
4655
  ext: n,
4635
4656
  theme: e
4636
4657
  };
@@ -4639,8 +4660,8 @@ function Kn(e, t) {
4639
4660
  }
4640
4661
  //#endregion
4641
4662
  //#region lib/features/marketplace/vscodeMarketplace.ts
4642
- var qn = "https://marketplace.visualstudio.com/_apis/public/gallery";
4643
- async function Jn(e, t = 1) {
4663
+ var Yn = "https://marketplace.visualstudio.com/_apis/public/gallery";
4664
+ async function Xn(e, t = 1) {
4644
4665
  let n = {
4645
4666
  filters: [{
4646
4667
  criteria: [{
@@ -4657,7 +4678,7 @@ async function Jn(e, t = 1) {
4657
4678
  }],
4658
4679
  assetTypes: [],
4659
4680
  flags: 914
4660
- }, r = await fetch(`${qn}/extensionquery`, {
4681
+ }, r = await fetch(`${Yn}/extensionquery`, {
4661
4682
  method: "POST",
4662
4683
  headers: {
4663
4684
  "Content-Type": "application/json",
@@ -4672,23 +4693,23 @@ async function Jn(e, t = 1) {
4672
4693
  total: i.length
4673
4694
  };
4674
4695
  }
4675
- function Yn(e) {
4696
+ function Zn(e) {
4676
4697
  return e.statistics?.find((e) => e.statisticName === "install")?.value ?? 0;
4677
4698
  }
4678
- function Xn(e) {
4699
+ function Qn(e) {
4679
4700
  return e.versions?.[0]?.version ?? null;
4680
4701
  }
4681
- function Zn(e) {
4702
+ function $n(e) {
4682
4703
  let t = e.versions?.[0];
4683
4704
  return t ? `${t.assetUri}/Microsoft.VisualStudio.Services.VSIXPackage` : null;
4684
4705
  }
4685
- function Qn(e) {
4706
+ function er(e) {
4686
4707
  let t = e.versions?.[0];
4687
4708
  return t ? `${t.assetUri}/Microsoft.VisualStudio.Services.Icons.Default` : null;
4688
4709
  }
4689
4710
  //#endregion
4690
4711
  //#region lib/jsoncFileWatcher.ts
4691
- async function $n(e, t) {
4712
+ async function tr(e, t) {
4692
4713
  let { name: n, getPath: r, validate: i, defaultValue: a, onLoad: o } = t, s = a, c = null, l = null, u = null, d = /* @__PURE__ */ new Set();
4693
4714
  function f() {
4694
4715
  for (let e of d) try {
@@ -4747,46 +4768,46 @@ async function $n(e, t) {
4747
4768
  }
4748
4769
  //#endregion
4749
4770
  //#region lib/features/settings/userSettings.ts
4750
- var er = null, tr = null, nr = null;
4751
- function rr(e) {
4771
+ var nr = null, rr = null, ir = null;
4772
+ function ar(e) {
4752
4773
  return typeof e != "object" || !e || Array.isArray(e) ? (console.error("[userSettings] settings.json must be an object"), null) : e;
4753
4774
  }
4754
- function ir(e, t) {
4755
- if (!er) return;
4775
+ function or(e, t) {
4776
+ if (!nr) return;
4756
4777
  let n = {
4757
- ...er.getValue(),
4778
+ ...nr.getValue(),
4758
4779
  ...t
4759
4780
  };
4760
- er.setValue(n), nr && clearTimeout(nr), nr = setTimeout(() => {
4761
- nr = null, ar(e, n);
4781
+ nr.setValue(n), ir && clearTimeout(ir), ir = setTimeout(() => {
4782
+ ir = null, sr(e, n);
4762
4783
  }, 500);
4763
4784
  }
4764
- async function ar(e, t) {
4785
+ async function sr(e, t) {
4765
4786
  try {
4766
- tr ||= K(await e.utils.getHomePath(), ".dotdir", "settings.json"), await e.fs.writeFile(tr, JSON.stringify(t, null, 2));
4787
+ rr ||= K(await e.utils.getHomePath(), ".dotdir", "settings.json"), await e.fs.writeFile(rr, JSON.stringify(t, null, 2));
4767
4788
  } catch (e) {
4768
4789
  console.error("[userSettings] Failed to save settings:", e);
4769
4790
  }
4770
4791
  }
4771
- function or(e) {
4772
- return er?.onChange(e) ?? (() => {});
4792
+ function cr(e) {
4793
+ return nr?.onChange(e) ?? (() => {});
4773
4794
  }
4774
- async function sr(e) {
4775
- return er = await $n(e, {
4795
+ async function lr(e) {
4796
+ return nr = await tr(e, {
4776
4797
  name: "userSettings",
4777
4798
  getPath: async () => K(await e.utils.getHomePath(), ".dotdir", "settings.json"),
4778
- validate: rr,
4799
+ validate: ar,
4779
4800
  defaultValue: {}
4780
- }), er.getValue();
4801
+ }), nr.getValue();
4781
4802
  }
4782
4803
  //#endregion
4783
4804
  //#region lib/features/settings/useUserSettings.ts
4784
- var cr = _({}), lr = _(!1), ur = null;
4785
- function dr() {
4786
- let e = y(cr), t = y(lr), n = b(cr), r = b(lr), a = ke();
4787
- return o(() => (ur ||= sr(a), ur.then((e) => {
4805
+ var ur = _({}), dr = _(!1), fr = null;
4806
+ function pr() {
4807
+ let e = y(ur), t = y(dr), n = b(ur), r = b(dr), a = ke();
4808
+ return o(() => (fr ||= lr(a), fr.then((e) => {
4788
4809
  n(e), r(!0);
4789
- }), or(n)), [
4810
+ }), cr(n)), [
4790
4811
  n,
4791
4812
  r,
4792
4813
  a
@@ -4797,20 +4818,20 @@ function dr() {
4797
4818
  n((t) => ({
4798
4819
  ...t,
4799
4820
  ...e
4800
- })), ir(a, e);
4821
+ })), or(a, e);
4801
4822
  }, [n])
4802
4823
  };
4803
4824
  }
4804
4825
  //#endregion
4805
4826
  //#region lib/styles/extensions.module.css
4806
- var fr = "_active_jpq35_71", pr = "_install_jpq35_261", mr = "_uninstall_jpq35_266", hr = "_installed_jpq35_276", J = {
4827
+ var mr = "_active_jpq35_71", hr = "_install_jpq35_261", gr = "_uninstall_jpq35_266", _r = "_installed_jpq35_276", Y = {
4807
4828
  "ext-panel": "_ext-panel_jpq35_1",
4808
4829
  "ext-panel-header": "_ext-panel-header_jpq35_17",
4809
4830
  "ext-panel-title": "_ext-panel-title_jpq35_28",
4810
4831
  "ext-panel-close": "_ext-panel-close_jpq35_34",
4811
4832
  "ext-panel-tabs": "_ext-panel-tabs_jpq35_49",
4812
4833
  "ext-tab": "_ext-tab_jpq35_55",
4813
- active: fr,
4834
+ active: mr,
4814
4835
  "ext-search": "_ext-search_jpq35_76",
4815
4836
  "ext-source-selector": "_ext-source-selector_jpq35_82",
4816
4837
  "ext-source-btn": "_ext-source-btn_jpq35_88",
@@ -4827,102 +4848,102 @@ var fr = "_active_jpq35_71", pr = "_install_jpq35_261", mr = "_uninstall_jpq35_2
4827
4848
  "ext-theme-badge": "_ext-theme-badge_jpq35_223",
4828
4849
  "ext-actions": "_ext-actions_jpq35_234",
4829
4850
  "ext-btn": "_ext-btn_jpq35_241",
4830
- install: pr,
4831
- uninstall: mr,
4832
- installed: hr,
4851
+ install: hr,
4852
+ uninstall: gr,
4853
+ installed: _r,
4833
4854
  "ext-color-themes": "_ext-color-themes_jpq35_281",
4834
4855
  "ext-color-theme-btn": "_ext-color-theme-btn_jpq35_288",
4835
4856
  "ext-color-theme-indicator": "_ext-color-theme-indicator_jpq35_296"
4836
4857
  };
4837
4858
  //#endregion
4838
4859
  //#region lib/components/ExtensionsPanel.tsx
4839
- function gr(e) {
4860
+ function vr(e) {
4840
4861
  return e instanceof Error ? e.message : e && typeof e == "object" && "message" in e ? String(e.message) : String(e);
4841
4862
  }
4842
- function _r() {
4843
- let e = ke(), t = b(Ne), [n, r] = v(Pe), [a, s] = v(Fe), c = y(Ie), l = u(null), f = kn(), [h, g] = d("marketplace"), [_, x] = d("vscode"), [S, C] = d(""), [w, T] = d([]), [E, D] = d([]), [O, k] = d(!1), [j, N] = d(null), [P, ee] = d(""), te = u(null), { settings: I, updateSettings: ne } = dr();
4863
+ function yr() {
4864
+ let e = ke(), t = b(Ne), [n, r] = v(Pe), [a, s] = v(Fe), c = y(Ie), l = u(null), f = jn(), [h, g] = d("marketplace"), [_, x] = d("vscode"), [S, C] = d(""), [w, T] = d([]), [E, D] = d([]), [O, k] = d(!1), [j, N] = d(null), [P, I] = d(""), ee = u(null), { settings: te, updateSettings: ne } = pr();
4844
4865
  o(() => (A.push("modal"), () => {
4845
4866
  A.pop("modal");
4846
4867
  }), [t]);
4847
4868
  let re = i(async (e, t) => {
4848
- k(!0), ee("");
4869
+ k(!0), I("");
4849
4870
  try {
4850
- t === "vscode" ? (D((await Jn(e)).extensions), T([])) : (T((await Fn(e)).extensions), D([]));
4871
+ t === "vscode" ? (D((await Xn(e)).extensions), T([])) : (T((await Ln(e)).extensions), D([]));
4851
4872
  } catch {
4852
- ee(`Could not reach ${t === "vscode" ? "VS Code" : ".dir"} marketplace`);
4873
+ I(`Could not reach ${t === "vscode" ? "VS Code" : ".dir"} marketplace`);
4853
4874
  }
4854
4875
  k(!1);
4855
4876
  }, []);
4856
4877
  o(() => {
4857
4878
  re("", _);
4858
4879
  }, [re, _]);
4859
- let R = (e) => {
4860
- C(e), te.current && clearTimeout(te.current), te.current = setTimeout(() => re(e, _), 300);
4861
- }, ie = async (t) => {
4862
- let n = Zn(t);
4880
+ let ie = (e) => {
4881
+ C(e), ee.current && clearTimeout(ee.current), ee.current = setTimeout(() => re(e, _), 300);
4882
+ }, R = async (t) => {
4883
+ let n = $n(t);
4863
4884
  if (n) {
4864
- N(`${t.publisher.publisherName}.${t.extensionName}`), ee("");
4885
+ N(`${t.publisher.publisherName}.${t.extensionName}`), I("");
4865
4886
  try {
4866
- await Vn(e, t.publisher.publisherName, t.extensionName, n), f.restart();
4887
+ await Un(e, t.publisher.publisherName, t.extensionName, n), f.restart();
4867
4888
  } catch (e) {
4868
- ee(`Install failed: ${gr(e)}`);
4889
+ I(`Install failed: ${vr(e)}`);
4869
4890
  }
4870
4891
  N(null);
4871
4892
  }
4872
4893
  }, ae = new Set(c.map((e) => `${e.ref.publisher}.${e.ref.name}`)), z = async (t) => {
4873
4894
  if (t.latest_version) {
4874
- N(`${t.publisher.username}.${t.name}`), ee("");
4895
+ N(`${t.publisher.username}.${t.name}`), I("");
4875
4896
  try {
4876
- await zn(e, t.publisher.username, t.name, t.latest_version.version), f.restart();
4897
+ await Vn(e, t.publisher.username, t.name, t.latest_version.version), f.restart();
4877
4898
  } catch (e) {
4878
- ee(`Install failed: ${gr(e)}`);
4899
+ I(`Install failed: ${vr(e)}`);
4879
4900
  }
4880
4901
  N(null);
4881
4902
  }
4882
4903
  }, oe = async (t) => {
4883
4904
  let i = `${t.publisher}.${t.name}`;
4884
- N(i), ee("");
4905
+ N(i), I("");
4885
4906
  try {
4886
- await Un(e, t.publisher, t.name);
4907
+ await Gn(e, t.publisher, t.name);
4887
4908
  let o = !1;
4888
- n === i && (delete I.iconTheme, r(void 0), o = !0), a?.startsWith(i + ":") && (delete I.colorTheme, s(void 0), o = !0), o && ne(I), f.restart();
4909
+ n === i && (delete te.iconTheme, r(void 0), o = !0), a?.startsWith(i + ":") && (delete te.colorTheme, s(void 0), o = !0), o && ne(te), f.restart();
4889
4910
  } catch (e) {
4890
- ee(`Uninstall failed: ${gr(e)}`);
4911
+ I(`Uninstall failed: ${vr(e)}`);
4891
4912
  }
4892
4913
  N(null);
4893
4914
  }, se = async (e) => {
4894
- let t = Wn(e);
4915
+ let t = Kn(e);
4895
4916
  if (!t) return;
4896
4917
  let i = t === n ? void 0 : t;
4897
- i ? I.iconTheme = i : delete I.iconTheme, ne(I), r(i);
4898
- }, B = async (e, t) => {
4899
- let n = Gn(e, t), r = n === a ? void 0 : n;
4900
- r ? I.colorTheme = r : delete I.colorTheme, ne(I), s(r);
4901
- }, V = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
4918
+ i ? te.iconTheme = i : delete te.iconTheme, ne(te), r(i);
4919
+ }, ce = async (e, t) => {
4920
+ let n = qn(e, t), r = n === a ? void 0 : n;
4921
+ r ? te.colorTheme = r : delete te.colorTheme, ne(te), s(r);
4922
+ }, B = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
4902
4923
  return /* @__PURE__ */ m(L, {
4903
- className: J["ext-panel"],
4924
+ className: Y["ext-panel"],
4904
4925
  onClose: () => t(!1),
4905
4926
  initialFocusRef: l,
4906
4927
  children: [
4907
4928
  /* @__PURE__ */ m("div", {
4908
- className: J["ext-panel-header"],
4929
+ className: Y["ext-panel-header"],
4909
4930
  children: [/* @__PURE__ */ p("span", {
4910
- className: J["ext-panel-title"],
4931
+ className: Y["ext-panel-title"],
4911
4932
  children: "Extensions"
4912
4933
  }), /* @__PURE__ */ p("button", {
4913
- className: J["ext-panel-close"],
4934
+ className: Y["ext-panel-close"],
4914
4935
  onClick: () => t(!1),
4915
4936
  children: "✕"
4916
4937
  })]
4917
4938
  }),
4918
4939
  /* @__PURE__ */ m("div", {
4919
- className: J["ext-panel-tabs"],
4940
+ className: Y["ext-panel-tabs"],
4920
4941
  children: [/* @__PURE__ */ p("button", {
4921
- className: F(J, "ext-tab", h === "marketplace" && "active"),
4942
+ className: F(Y, "ext-tab", h === "marketplace" && "active"),
4922
4943
  onClick: () => g("marketplace"),
4923
4944
  children: "Marketplace"
4924
4945
  }), /* @__PURE__ */ m("button", {
4925
- className: F(J, "ext-tab", h === "installed" && "active"),
4946
+ className: F(Y, "ext-tab", h === "installed" && "active"),
4926
4947
  onClick: () => g("installed"),
4927
4948
  children: [
4928
4949
  "Installed (",
@@ -4932,17 +4953,17 @@ function _r() {
4932
4953
  })]
4933
4954
  }),
4934
4955
  h === "marketplace" && /* @__PURE__ */ m("div", {
4935
- className: J["ext-search"],
4956
+ className: Y["ext-search"],
4936
4957
  children: [/* @__PURE__ */ m("div", {
4937
- className: J["ext-source-selector"],
4958
+ className: Y["ext-source-selector"],
4938
4959
  children: [/* @__PURE__ */ p("button", {
4939
- className: F(J, "ext-source-btn", _ === "vscode" && "active"),
4960
+ className: F(Y, "ext-source-btn", _ === "vscode" && "active"),
4940
4961
  onClick: () => {
4941
4962
  x("vscode"), C("");
4942
4963
  },
4943
4964
  children: "VS Code"
4944
4965
  }), /* @__PURE__ */ p("button", {
4945
- className: F(J, "ext-source-btn", _ === "dotdir" && "active"),
4966
+ className: F(Y, "ext-source-btn", _ === "dotdir" && "active"),
4946
4967
  onClick: () => {
4947
4968
  x("dotdir"), C("");
4948
4969
  },
@@ -4953,30 +4974,30 @@ function _r() {
4953
4974
  type: "text",
4954
4975
  placeholder: "Search extensions...",
4955
4976
  value: S,
4956
- onChange: (e) => R(e.target.value),
4977
+ onChange: (e) => ie(e.target.value),
4957
4978
  ...M
4958
4979
  })]
4959
4980
  }),
4960
4981
  P && /* @__PURE__ */ p("div", {
4961
- className: J["ext-error"],
4982
+ className: Y["ext-error"],
4962
4983
  children: P
4963
4984
  }),
4964
4985
  /* @__PURE__ */ m("div", {
4965
- className: J["ext-list"],
4986
+ className: Y["ext-list"],
4966
4987
  children: [
4967
4988
  h === "marketplace" && _ === "dotdir" && (O ? /* @__PURE__ */ p("div", {
4968
- className: J["ext-empty"],
4989
+ className: Y["ext-empty"],
4969
4990
  children: "Searching..."
4970
4991
  }) : w.length === 0 ? /* @__PURE__ */ p("div", {
4971
- className: J["ext-empty"],
4992
+ className: Y["ext-empty"],
4972
4993
  children: "No extensions found"
4973
4994
  }) : w.map((e) => {
4974
4995
  let t = `${e.publisher.username}.${e.name}`, n = ae.has(t), r = j === t;
4975
4996
  return /* @__PURE__ */ m("div", {
4976
- className: J["ext-item"],
4997
+ className: Y["ext-item"],
4977
4998
  children: [
4978
4999
  /* @__PURE__ */ p("div", {
4979
- className: J["ext-icon"],
5000
+ className: Y["ext-icon"],
4980
5001
  children: e.icon_url ? /* @__PURE__ */ p("img", {
4981
5002
  src: e.icon_url,
4982
5003
  width: 36,
@@ -4985,38 +5006,38 @@ function _r() {
4985
5006
  }) : e.display_name[0]?.toUpperCase() ?? "?"
4986
5007
  }),
4987
5008
  /* @__PURE__ */ m("div", {
4988
- className: J["ext-info"],
5009
+ className: Y["ext-info"],
4989
5010
  children: [
4990
5011
  /* @__PURE__ */ p("div", {
4991
- className: J["ext-name"],
5012
+ className: Y["ext-name"],
4992
5013
  children: e.display_name
4993
5014
  }),
4994
5015
  /* @__PURE__ */ p("div", {
4995
- className: J["ext-publisher"],
5016
+ className: Y["ext-publisher"],
4996
5017
  children: e.publisher.display_name || e.publisher.username
4997
5018
  }),
4998
5019
  /* @__PURE__ */ p("div", {
4999
- className: J["ext-desc"],
5020
+ className: Y["ext-desc"],
5000
5021
  children: e.description
5001
5022
  }),
5002
5023
  /* @__PURE__ */ m("div", {
5003
- className: J["ext-meta"],
5024
+ className: Y["ext-meta"],
5004
5025
  children: [
5005
5026
  e.latest_version && /* @__PURE__ */ m("span", { children: ["v", e.latest_version.version] }),
5006
- e.latest_version && /* @__PURE__ */ p("span", { children: V(e.latest_version.archive_size) }),
5027
+ e.latest_version && /* @__PURE__ */ p("span", { children: B(e.latest_version.archive_size) }),
5007
5028
  /* @__PURE__ */ m("span", { children: ["↓ ", e.total_downloads] })
5008
5029
  ]
5009
5030
  })
5010
5031
  ]
5011
5032
  }),
5012
5033
  /* @__PURE__ */ p("div", {
5013
- className: J["ext-actions"],
5034
+ className: Y["ext-actions"],
5014
5035
  children: n ? /* @__PURE__ */ p("button", {
5015
- className: F(J, "ext-btn", "installed"),
5036
+ className: F(Y, "ext-btn", "installed"),
5016
5037
  disabled: !0,
5017
5038
  children: "Installed"
5018
5039
  }) : /* @__PURE__ */ p("button", {
5019
- className: F(J, "ext-btn", "install"),
5040
+ className: F(Y, "ext-btn", "install"),
5020
5041
  disabled: r || !e.latest_version,
5021
5042
  onClick: () => z(e),
5022
5043
  children: r ? "Installing..." : "Install"
@@ -5026,18 +5047,18 @@ function _r() {
5026
5047
  }, e.id);
5027
5048
  })),
5028
5049
  h === "marketplace" && _ === "vscode" && (O ? /* @__PURE__ */ p("div", {
5029
- className: J["ext-empty"],
5050
+ className: Y["ext-empty"],
5030
5051
  children: "Searching..."
5031
5052
  }) : E.length === 0 ? /* @__PURE__ */ p("div", {
5032
- className: J["ext-empty"],
5053
+ className: Y["ext-empty"],
5033
5054
  children: "No extensions found"
5034
5055
  }) : E.map((e) => {
5035
- let t = `${e.publisher.publisherName}.${e.extensionName}`, n = ae.has(t), r = j === t, i = Xn(e), a = Qn(e), o = Yn(e);
5056
+ let t = `${e.publisher.publisherName}.${e.extensionName}`, n = ae.has(t), r = j === t, i = Qn(e), a = er(e), o = Zn(e);
5036
5057
  return /* @__PURE__ */ m("div", {
5037
- className: J["ext-item"],
5058
+ className: Y["ext-item"],
5038
5059
  children: [
5039
5060
  /* @__PURE__ */ p("div", {
5040
- className: J["ext-icon"],
5061
+ className: Y["ext-icon"],
5041
5062
  children: a ? /* @__PURE__ */ p("img", {
5042
5063
  src: a,
5043
5064
  width: 36,
@@ -5046,36 +5067,36 @@ function _r() {
5046
5067
  }) : e.displayName[0]?.toUpperCase() ?? "?"
5047
5068
  }),
5048
5069
  /* @__PURE__ */ m("div", {
5049
- className: J["ext-info"],
5070
+ className: Y["ext-info"],
5050
5071
  children: [
5051
5072
  /* @__PURE__ */ p("div", {
5052
- className: J["ext-name"],
5073
+ className: Y["ext-name"],
5053
5074
  children: e.displayName
5054
5075
  }),
5055
5076
  /* @__PURE__ */ p("div", {
5056
- className: J["ext-publisher"],
5077
+ className: Y["ext-publisher"],
5057
5078
  children: e.publisher.displayName || e.publisher.publisherName
5058
5079
  }),
5059
5080
  /* @__PURE__ */ p("div", {
5060
- className: J["ext-desc"],
5081
+ className: Y["ext-desc"],
5061
5082
  children: e.shortDescription
5062
5083
  }),
5063
5084
  /* @__PURE__ */ m("div", {
5064
- className: J["ext-meta"],
5085
+ className: Y["ext-meta"],
5065
5086
  children: [i && /* @__PURE__ */ m("span", { children: ["v", i] }), /* @__PURE__ */ m("span", { children: ["↓ ", o.toLocaleString()] })]
5066
5087
  })
5067
5088
  ]
5068
5089
  }),
5069
5090
  /* @__PURE__ */ p("div", {
5070
- className: J["ext-actions"],
5091
+ className: Y["ext-actions"],
5071
5092
  children: n ? /* @__PURE__ */ p("button", {
5072
- className: F(J, "ext-btn", "installed"),
5093
+ className: F(Y, "ext-btn", "installed"),
5073
5094
  disabled: !0,
5074
5095
  children: "Installed"
5075
5096
  }) : /* @__PURE__ */ p("button", {
5076
- className: F(J, "ext-btn", "install"),
5097
+ className: F(Y, "ext-btn", "install"),
5077
5098
  disabled: r || !i,
5078
- onClick: () => ie(e),
5099
+ onClick: () => R(e),
5079
5100
  children: r ? "Installing..." : "Install"
5080
5101
  })
5081
5102
  })
@@ -5083,15 +5104,15 @@ function _r() {
5083
5104
  }, t);
5084
5105
  })),
5085
5106
  h === "installed" && (c.length === 0 ? /* @__PURE__ */ p("div", {
5086
- className: J["ext-empty"],
5107
+ className: Y["ext-empty"],
5087
5108
  children: "No extensions installed"
5088
5109
  }) : c.map((e) => {
5089
- let t = `${e.ref.publisher}.${e.ref.name}`, r = j === t, i = Wn(e), o = i != null && i === n, s = e.colorThemes && e.colorThemes.length > 0;
5110
+ let t = `${e.ref.publisher}.${e.ref.name}`, r = j === t, i = Kn(e), o = i != null && i === n, s = e.colorThemes && e.colorThemes.length > 0;
5090
5111
  return /* @__PURE__ */ m("div", {
5091
- className: J["ext-item"],
5112
+ className: Y["ext-item"],
5092
5113
  children: [
5093
5114
  /* @__PURE__ */ p("div", {
5094
- className: J["ext-icon"],
5115
+ className: Y["ext-icon"],
5095
5116
  children: e.iconUrl ? /* @__PURE__ */ p("img", {
5096
5117
  src: e.iconUrl,
5097
5118
  width: 36,
@@ -5100,30 +5121,30 @@ function _r() {
5100
5121
  }) : (e.manifest.displayName || e.manifest.name)[0]?.toUpperCase() ?? "?"
5101
5122
  }),
5102
5123
  /* @__PURE__ */ m("div", {
5103
- className: J["ext-info"],
5124
+ className: Y["ext-info"],
5104
5125
  children: [
5105
5126
  /* @__PURE__ */ p("div", {
5106
- className: J["ext-name"],
5127
+ className: Y["ext-name"],
5107
5128
  children: e.manifest.displayName || e.manifest.name
5108
5129
  }),
5109
5130
  /* @__PURE__ */ p("div", {
5110
- className: J["ext-publisher"],
5131
+ className: Y["ext-publisher"],
5111
5132
  children: e.manifest.publisher
5112
5133
  }),
5113
5134
  /* @__PURE__ */ p("div", {
5114
- className: J["ext-desc"],
5135
+ className: Y["ext-desc"],
5115
5136
  children: e.manifest.description || ""
5116
5137
  }),
5117
5138
  /* @__PURE__ */ m("div", {
5118
- className: J["ext-meta"],
5139
+ className: Y["ext-meta"],
5119
5140
  children: [
5120
5141
  /* @__PURE__ */ m("span", { children: ["v", e.ref.version] }),
5121
5142
  i && /* @__PURE__ */ p("span", {
5122
- className: F(J, "ext-theme-badge", o && "active"),
5143
+ className: F(Y, "ext-theme-badge", o && "active"),
5123
5144
  children: o ? "● Icon theme" : "Icon theme"
5124
5145
  }),
5125
5146
  s && /* @__PURE__ */ m("span", {
5126
- className: J["ext-theme-badge"],
5147
+ className: Y["ext-theme-badge"],
5127
5148
  children: [
5128
5149
  e.colorThemes.length,
5129
5150
  " color theme",
@@ -5131,7 +5152,7 @@ function _r() {
5131
5152
  ]
5132
5153
  }),
5133
5154
  e.languages && e.languages.length > 0 && /* @__PURE__ */ m("span", {
5134
- className: J["ext-theme-badge"],
5155
+ className: Y["ext-theme-badge"],
5135
5156
  children: [
5136
5157
  e.languages.length,
5137
5158
  " language",
@@ -5139,7 +5160,7 @@ function _r() {
5139
5160
  ]
5140
5161
  }),
5141
5162
  e.grammarRefs && e.grammarRefs.length > 0 && /* @__PURE__ */ m("span", {
5142
- className: J["ext-theme-badge"],
5163
+ className: Y["ext-theme-badge"],
5143
5164
  children: [
5144
5165
  e.grammarRefs.length,
5145
5166
  " grammar",
@@ -5149,15 +5170,15 @@ function _r() {
5149
5170
  ]
5150
5171
  }),
5151
5172
  s && /* @__PURE__ */ p("div", {
5152
- className: J["ext-color-themes"],
5173
+ className: Y["ext-color-themes"],
5153
5174
  children: e.colorThemes.map((t) => {
5154
- let n = Gn(e, t.id) === a;
5175
+ let n = qn(e, t.id) === a;
5155
5176
  return /* @__PURE__ */ m("button", {
5156
- className: F(J, "ext-btn", "ext-color-theme-btn", n ? "installed" : "install"),
5157
- onClick: () => B(e, t.id),
5177
+ className: F(Y, "ext-btn", "ext-color-theme-btn", n ? "installed" : "install"),
5178
+ onClick: () => ce(e, t.id),
5158
5179
  children: [
5159
5180
  /* @__PURE__ */ p("span", {
5160
- className: J["ext-color-theme-indicator"],
5181
+ className: Y["ext-color-theme-indicator"],
5161
5182
  "data-ui-theme": t.uiTheme
5162
5183
  }),
5163
5184
  t.label,
@@ -5169,13 +5190,13 @@ function _r() {
5169
5190
  ]
5170
5191
  }),
5171
5192
  /* @__PURE__ */ m("div", {
5172
- className: J["ext-actions"],
5193
+ className: Y["ext-actions"],
5173
5194
  children: [i && /* @__PURE__ */ p("button", {
5174
- className: F(J, "ext-btn", o ? "installed" : "install"),
5195
+ className: F(Y, "ext-btn", o ? "installed" : "install"),
5175
5196
  onClick: () => se(e),
5176
5197
  children: o ? "Deactivate" : "Activate"
5177
5198
  }), /* @__PURE__ */ p("button", {
5178
- className: F(J, "ext-btn", "uninstall"),
5199
+ className: F(Y, "ext-btn", "uninstall"),
5179
5200
  disabled: r,
5180
5201
  onClick: () => oe(e.ref),
5181
5202
  children: r ? "Removing..." : "Uninstall"
@@ -5189,7 +5210,7 @@ function _r() {
5189
5210
  ]
5190
5211
  });
5191
5212
  }
5192
- var Y = new class {
5213
+ var X = new class {
5193
5214
  tail = Promise.resolve();
5194
5215
  enqueue(e) {
5195
5216
  this.tail = this.tail.then(async () => {
@@ -5199,72 +5220,72 @@ var Y = new class {
5199
5220
  } catch {}
5200
5221
  });
5201
5222
  }
5202
- }(), vr = 200, yr = /* @__PURE__ */ new Map(), br = /* @__PURE__ */ new Map();
5203
- function xr(e) {
5223
+ }(), br = 200, xr = /* @__PURE__ */ new Map(), Sr = /* @__PURE__ */ new Map();
5224
+ function Cr(e) {
5204
5225
  return e.startsWith("/") || /^[A-Za-z]:/.test(e);
5205
5226
  }
5206
- function Sr(e) {
5227
+ function wr(e) {
5207
5228
  return `data:image/svg+xml,${encodeURIComponent(e)}`;
5208
5229
  }
5209
- function Cr(e) {
5210
- let t = yr.get(e);
5211
- t !== void 0 && (yr.delete(e), yr.set(e, t));
5230
+ function Tr(e) {
5231
+ let t = xr.get(e);
5232
+ t !== void 0 && (xr.delete(e), xr.set(e, t));
5212
5233
  }
5213
- function wr() {
5214
- for (; yr.size > vr;) {
5215
- let e = yr.keys().next().value;
5216
- yr.delete(e);
5234
+ function Er() {
5235
+ for (; xr.size > br;) {
5236
+ let e = xr.keys().next().value;
5237
+ xr.delete(e);
5217
5238
  }
5218
5239
  }
5219
- async function Tr(e, t) {
5240
+ async function Dr(e, t) {
5220
5241
  let n = W(t);
5221
5242
  try {
5222
5243
  let r = await Nt(e, n);
5223
- yr.set(t, Sr(r)), wr();
5244
+ xr.set(t, wr(r)), Er();
5224
5245
  } catch (e) {
5225
5246
  throw console.warn("[IconCache] loadIconAbsolute failed", n, e), e;
5226
5247
  }
5227
5248
  }
5228
- async function Er(e) {
5249
+ async function Or(e) {
5229
5250
  let t = await fetch(`/icons/${e}`);
5230
5251
  if (!t.ok) return;
5231
5252
  let n = await t.text();
5232
- yr.set(e, Sr(n)), wr();
5253
+ xr.set(e, wr(n)), Er();
5233
5254
  }
5234
- function Dr(e) {
5255
+ function kr(e) {
5235
5256
  return e === "_default" || e.startsWith("_default_");
5236
5257
  }
5237
- async function Or(e, t) {
5258
+ async function Ar(e, t) {
5238
5259
  let n = [];
5239
5260
  for (let r of t) {
5240
- if (Dr(r) || yr.has(r)) continue;
5241
- if (br.has(r)) {
5242
- n.push(br.get(r));
5261
+ if (kr(r) || xr.has(r)) continue;
5262
+ if (Sr.has(r)) {
5263
+ n.push(Sr.get(r));
5243
5264
  continue;
5244
5265
  }
5245
5266
  let t = (async () => {
5246
5267
  try {
5247
- xr(r) ? await Tr(e, r) : await Er(r);
5268
+ Cr(r) ? await Dr(e, r) : await Or(r);
5248
5269
  } catch (e) {
5249
5270
  console.warn("[IconCache] loadIcons failed for", r.slice(-60), e);
5250
5271
  } finally {
5251
- br.delete(r);
5272
+ Sr.delete(r);
5252
5273
  }
5253
5274
  })();
5254
- br.set(r, t), n.push(t);
5275
+ Sr.set(r, t), n.push(t);
5255
5276
  }
5256
5277
  await Promise.all(n);
5257
5278
  }
5258
- function kr(e) {
5259
- let t = yr.get(e);
5260
- return t !== void 0 && Cr(e), t;
5279
+ function jr(e) {
5280
+ let t = xr.get(e);
5281
+ return t !== void 0 && Tr(e), t;
5261
5282
  }
5262
5283
  //#endregion
5263
5284
  //#region lib/features/file-icons/vscodeIconTheme.ts
5264
- function Ar(e) {
5285
+ function Mr(e) {
5265
5286
  return `data:image/svg+xml,${encodeURIComponent(e)}`;
5266
5287
  }
5267
- var jr = class {
5288
+ var Nr = class {
5268
5289
  theme = null;
5269
5290
  loadingIcons = /* @__PURE__ */ new Map();
5270
5291
  themeKind = "dark";
@@ -5329,7 +5350,7 @@ var jr = class {
5329
5350
  let r = (async () => {
5330
5351
  try {
5331
5352
  let t = await Mt(this.bridge, e), n = e.split(".").pop()?.toLowerCase() ?? "", r;
5332
- if (n === "svg") r = Ar(new TextDecoder().decode(t));
5353
+ if (n === "svg") r = Mr(new TextDecoder().decode(t));
5333
5354
  else {
5334
5355
  let e = n === "png" ? "image/png" : n === "jpg" || n === "jpeg" ? "image/jpeg" : n === "webp" ? "image/webp" : "application/octet-stream", i = new Blob([t], { type: e });
5335
5356
  r = URL.createObjectURL(i);
@@ -5349,51 +5370,51 @@ var jr = class {
5349
5370
  getCachedIcon(e) {
5350
5371
  return this.theme?.iconCache.get(e) ?? null;
5351
5372
  }
5352
- }, Mr = _((e) => {
5373
+ }, Pr = _((e) => {
5353
5374
  let t = e(Oe);
5354
5375
  if (!t) throw Error("Bridge not initialized.");
5355
- return new jr(t);
5376
+ return new Nr(t);
5356
5377
  });
5357
- function Nr() {
5358
- return y(Mr);
5378
+ function Fr() {
5379
+ return y(Pr);
5359
5380
  }
5360
5381
  //#endregion
5361
5382
  //#region lib/features/file-icons/iconResolver.ts
5362
- var Pr = {
5383
+ var Ir = {
5363
5384
  folder: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%2390a4ae%22%3E%3Cpath%20d%3D%22M10%204H4c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V8c0-1.1-.9-2-2-2h-8l-2-2z%22%2F%3E%3C%2Fsvg%3E",
5364
5385
  folderOpen: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%2390a4ae%22%3E%3Cpath%20d%3D%22M20%206h-8l-2-2H4c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V8c0-1.1-.9-2-2-2zm0%2012H4V8h16v10z%22%2F%3E%3C%2Fsvg%3E",
5365
5386
  file: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%2390a4ae%22%3E%3Cpath%20d%3D%22M14%202H6c-1.1%200-2%20.9-2%202v16c0%201.1.9%202%202%202h12c1.1%200%202-.9%202-2V8l-6-6zm4%2018H6V4h7v5h5v11z%22%2F%3E%3C%2Fsvg%3E"
5366
- }, Fr = "fss", Ir = [];
5367
- function Lr() {
5368
- let e = Nr();
5387
+ }, Lr = "fss", Rr = [];
5388
+ function zr() {
5389
+ let e = Fr();
5369
5390
  return { setIconTheme: async (t, n) => {
5370
- if (Fr = t, t === "vscode" && n) try {
5371
- await e.load(n), Br();
5391
+ if (Lr = t, t === "vscode" && n) try {
5392
+ await e.load(n), Hr();
5372
5393
  } catch {
5373
- Fr = "none", Br();
5394
+ Lr = "none", Hr();
5374
5395
  }
5375
- else e.clear(), Br();
5396
+ else e.clear(), Hr();
5376
5397
  } };
5377
5398
  }
5378
- function Rr() {
5379
- let e = Nr();
5399
+ function Br() {
5400
+ let e = Fr();
5380
5401
  return { setIconThemeKind: (t) => {
5381
5402
  e.setTheme(t);
5382
5403
  } };
5383
5404
  }
5384
- function zr(e) {
5385
- return Ir.push(e), () => {
5386
- Ir = Ir.filter((t) => t !== e);
5405
+ function Vr(e) {
5406
+ return Rr.push(e), () => {
5407
+ Rr = Rr.filter((t) => t !== e);
5387
5408
  };
5388
5409
  }
5389
- function Br() {
5390
- for (let e of Ir) e();
5410
+ function Hr() {
5411
+ for (let e of Rr) e();
5391
5412
  }
5392
- function Vr() {
5393
- let e = Nr();
5413
+ function Ur() {
5414
+ let e = Fr();
5394
5415
  return (t, n, r, i, a, o) => {
5395
- let s = n ? r ? Pr.folderOpen : Pr.folder : Pr.file;
5396
- if (Fr === "vscode" && e.isLoaded()) {
5416
+ let s = n ? r ? Ir.folderOpen : Ir.folder : Ir.file;
5417
+ if (Lr === "vscode" && e.isLoaded()) {
5397
5418
  let o = e.resolveIcon(t, n, r, i, a);
5398
5419
  return o ? {
5399
5420
  path: o,
@@ -5405,9 +5426,9 @@ function Vr() {
5405
5426
  fallbackUrl: s
5406
5427
  };
5407
5428
  }
5408
- return Fr === "fss" && o ? {
5429
+ return Lr === "fss" && o ? {
5409
5430
  path: o,
5410
- url: kr(o) ?? null,
5431
+ url: jr(o) ?? null,
5411
5432
  fallbackUrl: s
5412
5433
  } : {
5413
5434
  path: "_default",
@@ -5416,33 +5437,24 @@ function Vr() {
5416
5437
  };
5417
5438
  };
5418
5439
  }
5419
- function Hr() {
5420
- let e = Nr(), t = ke();
5440
+ function Wr() {
5441
+ let e = Fr(), t = ke();
5421
5442
  return async (n) => {
5422
- Fr === "vscode" && e.isLoaded() ? await e.preloadIcons(n) : await Or(t, n);
5443
+ Lr === "vscode" && e.isLoaded() ? await e.preloadIcons(n) : await Ar(t, n);
5423
5444
  };
5424
5445
  }
5425
- function Ur() {
5426
- let e = Nr();
5427
- return (t) => t === "_default_folder" ? Pr.folder : t === "_default_folder_open" ? Pr.folderOpen : t === "_default_file" ? Pr.file : Fr === "vscode" && e.isLoaded() ? e.getCachedIcon(t) : kr(t) ?? null;
5446
+ function Gr() {
5447
+ let e = Fr();
5448
+ return (t) => t === "_default_folder" ? Ir.folder : t === "_default_folder_open" ? Ir.folderOpen : t === "_default_file" ? Ir.file : Lr === "vscode" && e.isLoaded() ? e.getCachedIcon(t) : jr(t) ?? null;
5428
5449
  }
5429
5450
  //#endregion
5430
5451
  //#region lib/features/file-ops/model/fileOperationHandlers.ts
5431
- var Wr = null;
5432
- function Gr(e) {
5433
- Wr = e;
5434
- }
5435
- function Kr() {
5436
- return Wr;
5437
- }
5438
- //#endregion
5439
- //#region lib/fileListHandlers.ts
5440
- var qr = null;
5441
- function Jr(e) {
5442
- qr = e;
5452
+ var Kr = null;
5453
+ function qr(e) {
5454
+ Kr = e;
5443
5455
  }
5444
- function X() {
5445
- return qr;
5456
+ function Jr() {
5457
+ return Kr;
5446
5458
  }
5447
5459
  //#endregion
5448
5460
  //#region lib/fss.ts
@@ -5640,7 +5652,7 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
5640
5652
  let n = d.current + e;
5641
5653
  n = Math.min(n, t), n = Math.max(0, n), d.current !== n && (d.current = n, f.current(n));
5642
5654
  }, p = navigator.platform.startsWith("Win"), h = (e) => {
5643
- u(r && p ? Math.sign(e.deltaY) * r : e.deltaY);
5655
+ e.preventDefault(), e.stopPropagation(), u(r && p ? Math.sign(e.deltaY) * r : e.deltaY);
5644
5656
  }, g = (e) => {
5645
5657
  n = e.clientY, o = performance.now(), c = !1, s = 0;
5646
5658
  }, _ = (t) => {
@@ -5658,7 +5670,7 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
5658
5670
  };
5659
5671
  c || (c = !0, requestAnimationFrame(r));
5660
5672
  };
5661
- return e.addEventListener("wheel", h, { passive: !0 }), m && (e.addEventListener("pointerdown", g), e.addEventListener("pointermove", _), e.addEventListener("pointerup", v), e.addEventListener("pointercancel", v)), () => {
5673
+ return e.addEventListener("wheel", h, { passive: !1 }), m && (e.addEventListener("pointerdown", g), e.addEventListener("pointermove", _), e.addEventListener("pointerup", v), e.addEventListener("pointercancel", v)), () => {
5662
5674
  e.removeEventListener("wheel", h), m && (e.removeEventListener("pointerdown", g), e.removeEventListener("pointermove", _), e.removeEventListener("pointerup", v), e.removeEventListener("pointercancel", v));
5663
5675
  };
5664
5676
  }, [
@@ -5792,31 +5804,31 @@ function vi(e, t, n) {
5792
5804
  return Math.max(t, Math.min(n, e));
5793
5805
  }
5794
5806
  var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r, selectionKey: a, active: s, resolver: c, requestedActiveName: f, requestedTopmostName: h, onStateChange: g }) {
5795
- let [_, v] = d(0), [y, b] = d(0), [x, S] = d(1), [C, w] = d(1), [T, E] = d(0), [D, O] = d(/* @__PURE__ */ new Set()), [k, A] = d(!1), j = u(k);
5796
- j.current = k;
5797
- let M = ai("(pointer: coarse)"), N = u(D);
5798
- N.current = D;
5799
- let P = u(void 0), ee = u(e), te = u([]), I = u(_);
5800
- I.current = _;
5801
- let L = u(y);
5802
- L.current = y;
5803
- let ne = u(e);
5804
- ne.current = e;
5805
- let re = u(r);
5806
- re.current = r;
5807
+ let _ = u(null), [v, y] = d(0), [b, x] = d(0), [S, C] = d(1), [w, T] = d(1), [E, D] = d(0), [O, k] = d(/* @__PURE__ */ new Set()), [A, j] = d(!1), M = u(A);
5808
+ M.current = A;
5809
+ let N = ai("(pointer: coarse)"), P = u(O);
5810
+ P.current = O;
5811
+ let I = u(void 0), ee = u(e), te = u([]), L = u(v);
5812
+ L.current = v;
5813
+ let ne = u(b);
5814
+ ne.current = b;
5815
+ let re = u(e);
5816
+ re.current = e;
5817
+ let ie = u(r);
5818
+ ie.current = r;
5807
5819
  let R = i(() => {
5808
- j.current || A(!0);
5809
- }, []), ie = i(() => {
5810
- j.current && A(!1);
5811
- }, []), ae = Ur(), z = i((e) => {
5812
- if (e) return ae(e) ?? void 0;
5813
- }, [ae]), oe = Vr(), se = l(() => {
5820
+ M.current || j(!0);
5821
+ }, []), ae = i(() => {
5822
+ M.current && j(!1);
5823
+ }, []), z = Gr(), oe = i((e) => {
5824
+ if (e) return z(e) ?? void 0;
5825
+ }, [z]), se = Ur(), ce = l(() => {
5814
5826
  let e = n.map((e) => {
5815
5827
  e = {
5816
5828
  ...e,
5817
5829
  parent: t
5818
5830
  };
5819
- let n = ii(c, e), r = e.type === "folder", i = oe(e.name, r, !1, !1, e.lang, n.icon);
5831
+ let n = ii(c, e), r = e.type === "folder", i = se(e.name, r, !1, !1, e.lang, n.icon);
5820
5832
  return {
5821
5833
  entry: e,
5822
5834
  style: n,
@@ -5831,7 +5843,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
5831
5843
  let n = {
5832
5844
  ...t,
5833
5845
  stateFlags: 1
5834
- }, r = ii(c, n), i = oe("..", !0, !0, !1, "", r.icon);
5846
+ }, r = ii(c, n), i = se("..", !0, !0, !1, "", r.icon);
5835
5847
  e.push({
5836
5848
  entry: {
5837
5849
  ...n,
@@ -5842,28 +5854,28 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
5842
5854
  iconFallbackUrl: i.fallbackUrl
5843
5855
  });
5844
5856
  }
5845
- for (let t of se) e.push(t);
5857
+ for (let t of ce) e.push(t);
5846
5858
  return e;
5847
- }, [se, t]), V = u(B);
5859
+ }, [ce, t]), V = u(B);
5848
5860
  V.current = B;
5849
- let ce = l(() => {
5861
+ let le = l(() => {
5850
5862
  let e = /* @__PURE__ */ new Set();
5851
5863
  for (let { iconPath: t } of B) t && e.add(t);
5852
5864
  return [...e];
5853
- }, [B]), le = Hr();
5865
+ }, [B]), ue = Wr();
5854
5866
  o(() => {
5855
5867
  let e = !1;
5856
- return le(ce).then(() => {
5857
- e || E((e) => e + 1);
5868
+ return ue(le).then(() => {
5869
+ e || D((e) => e + 1);
5858
5870
  }), () => {
5859
5871
  e = !0;
5860
5872
  };
5861
- }, [ce]), o(() => zr(() => {
5862
- E((e) => e + 1);
5873
+ }, [le]), o(() => Vr(() => {
5874
+ D((e) => e + 1);
5863
5875
  }), []), o(() => {
5864
5876
  let t = ee.current;
5865
5877
  if (ee.current = e, t === e) {
5866
- v((e) => Math.min(e, B.length - 1));
5878
+ y((e) => Math.min(e, B.length - 1));
5867
5879
  return;
5868
5880
  }
5869
5881
  if (t.startsWith(e)) {
@@ -5872,55 +5884,55 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
5872
5884
  let r = n.pop();
5873
5885
  if (r) {
5874
5886
  let e = B.findIndex((e) => e.entry.name === r.selectedName), t = B.findIndex((e) => e.entry.name === r.topmostName);
5875
- v(e >= 0 ? e : 0), b(t >= 0 ? t : 0);
5887
+ y(e >= 0 ? e : 0), x(t >= 0 ? t : 0);
5876
5888
  return;
5877
5889
  }
5878
5890
  let i = t.slice(e.length).replace(/^\//, "").split("/")[0].replace(/\0.*$/, "");
5879
5891
  if (i) {
5880
5892
  let e = B.findIndex((e) => e.entry.name === i);
5881
5893
  if (e >= 0) {
5882
- v(e), b(Math.max(0, e - 5));
5894
+ y(e), x(Math.max(0, e - 5));
5883
5895
  return;
5884
5896
  }
5885
5897
  }
5886
5898
  }
5887
- v(0), b(0);
5899
+ y(0), x(0);
5888
5900
  }, [e, B]), o(() => {
5889
5901
  if (!f) return;
5890
5902
  let e = V.current.findIndex((e) => e.entry.name === f);
5891
- e >= 0 && v(e);
5903
+ e >= 0 && y(e);
5892
5904
  }, [f]), o(() => {
5893
5905
  if (!h) return;
5894
5906
  let e = V.current.findIndex((e) => e.entry.name === h);
5895
- e >= 0 && b(e);
5907
+ e >= 0 && x(e);
5896
5908
  }, [h]);
5897
- let ue = u(g);
5898
- ue.current = g;
5899
- let de = u(void 0);
5909
+ let de = u(g);
5910
+ de.current = g;
5911
+ let fe = u(void 0);
5900
5912
  o(() => {
5901
- ue.current && (clearTimeout(de.current), de.current = setTimeout(() => {
5902
- let e = V.current[I.current]?.entry.name, t = V.current[L.current]?.entry.name;
5903
- ue.current?.(e, t);
5913
+ de.current && (clearTimeout(fe.current), fe.current = setTimeout(() => {
5914
+ let e = V.current[L.current]?.entry.name, t = V.current[ne.current]?.entry.name;
5915
+ de.current?.(e, t);
5904
5916
  }, 150));
5905
5917
  }, [
5906
- _,
5907
- y,
5918
+ v,
5919
+ b,
5908
5920
  B
5909
5921
  ]), o(() => () => {
5910
- if (clearTimeout(de.current), !ue.current) return;
5911
- let e = V.current[I.current]?.entry.name, t = V.current[L.current]?.entry.name;
5912
- ue.current(e, t);
5922
+ if (clearTimeout(fe.current), !de.current) return;
5923
+ let e = V.current[L.current]?.entry.name, t = V.current[ne.current]?.entry.name;
5924
+ de.current(e, t);
5913
5925
  }, []);
5914
- let fe = i((e) => {
5915
- re.current(e);
5916
- }, []), pe = i((e, t, n) => {
5926
+ let pe = i((e) => {
5927
+ ie.current(e);
5928
+ }, []), me = i((e, t, n) => {
5917
5929
  let r = V.current;
5918
- if (P.current === void 0) {
5930
+ if (I.current === void 0) {
5919
5931
  let t = r[e]?.entry.name;
5920
- P.current = t ? !N.current.has(t) : !0;
5932
+ I.current = t ? !P.current.has(t) : !0;
5921
5933
  }
5922
- let i = P.current, a = Math.min(e, t), o = Math.max(e, t);
5923
- O((e) => {
5934
+ let i = I.current, a = Math.min(e, t), o = Math.max(e, t);
5935
+ k((e) => {
5924
5936
  let s = new Set(e);
5925
5937
  for (let e = a; e <= o; e++) {
5926
5938
  if (n === "exclude-active" && e === t) continue;
@@ -5928,216 +5940,219 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
5928
5940
  a && (i ? s.add(a) : s.delete(a));
5929
5941
  }
5930
5942
  return s;
5931
- }), v(vi(t, 0, r.length - 1));
5943
+ }), y(vi(t, 0, r.length - 1));
5932
5944
  }, []);
5933
5945
  o(() => {
5934
5946
  if (!s) return;
5935
5947
  let e = (e) => {
5936
- !e.shiftKey && P.current !== void 0 && (P.current = void 0);
5948
+ !e.shiftKey && I.current !== void 0 && (I.current = void 0);
5937
5949
  };
5938
5950
  return window.addEventListener("keyup", e), () => window.removeEventListener("keyup", e);
5939
5951
  }, [s]), o(() => {
5940
- O(/* @__PURE__ */ new Set()), P.current = void 0;
5952
+ k(/* @__PURE__ */ new Set()), I.current = void 0;
5941
5953
  }, [e, a]);
5942
- let me = i(async (e) => {
5943
- if (e.name === "..") await re.current(G(ne.current));
5954
+ let he = i(async (e) => {
5955
+ if (e.name === "..") await ie.current(G(re.current));
5944
5956
  else if (e.type === "folder") {
5945
- let t = V.current[I.current]?.entry.name, n = V.current[L.current]?.entry.name;
5957
+ let t = V.current[L.current]?.entry.name, n = V.current[ne.current]?.entry.name;
5946
5958
  t && te.current.push({
5947
- path: ne.current,
5959
+ path: re.current,
5948
5960
  selectedName: t,
5949
5961
  topmostName: n ?? t
5950
- }), await re.current(K(ne.current, e.name));
5962
+ }), await ie.current(K(re.current, e.name));
5951
5963
  } else e.type === "file" && H.executeCommand("dotdir.viewFile", e.path, e.name, Number(e.meta.size));
5952
- }, []), he = Math.min(B.length, x * C), ge = u(x);
5953
- ge.current = x;
5954
- let _e = u(he);
5955
- _e.current = he, o(() => {
5956
- b((e) => {
5957
- let t = x * C;
5958
- return _ < e ? _ : _ > e + t - 1 ? _ - t + 1 : e;
5964
+ }, []), ge = Math.min(B.length, S * w), _e = u(S);
5965
+ _e.current = S;
5966
+ let ve = u(ge);
5967
+ ve.current = ge, o(() => {
5968
+ x((e) => {
5969
+ let t = S * w;
5970
+ return v < e ? v : v > e + t - 1 ? v - t + 1 : e;
5959
5971
  });
5960
5972
  }, [
5961
- _,
5962
- x,
5963
- C
5973
+ v,
5974
+ S,
5975
+ w
5964
5976
  ]);
5965
- let ve = i(() => {
5966
- let e = V.current[I.current], t = e?.entry.type === "file", n = t && e != null && !!e.entry.meta.executable, r = e?.entry.name ?? "";
5977
+ let ye = i(() => {
5978
+ let e = V.current[L.current], t = e?.entry.type === "file", n = t && e != null && !!e.entry.meta.executable, r = e?.entry.name ?? "";
5967
5979
  H.beginBatch(), H.setContext("listItemIsFile", t), H.setContext("listItemIsFolder", !t && e != null), H.setContext("listItemIsExecutable", n), H.setContext("listItemHasViewer", t && tn.resolve(r) !== null), H.setContext("listItemHasEditor", t && nn.resolve(r) !== null), H.endBatch();
5968
5980
  }, []);
5969
5981
  o(() => {
5970
- s && ve();
5982
+ s && ye();
5971
5983
  }, [
5972
5984
  s,
5973
- _,
5985
+ v,
5974
5986
  B,
5975
- ve
5987
+ ye
5976
5988
  ]), o(() => {
5977
5989
  if (!s) return;
5978
- let e = tn.onChange(ve), t = nn.onChange(ve);
5990
+ let e = tn.onChange(ye), t = nn.onChange(ye);
5979
5991
  return () => {
5980
5992
  e(), t();
5981
5993
  };
5982
- }, [s, ve]), o(() => {
5983
- if (s) return Jr({
5984
- cursorUp: () => Y.enqueue(() => {
5985
- R(), v((e) => Math.max(0, e - 1));
5994
+ }, [s, ye]), o(() => {
5995
+ if (s) return bn({
5996
+ focus: () => {
5997
+ _.current?.focus({ preventScroll: !0 });
5998
+ },
5999
+ cursorUp: () => X.enqueue(() => {
6000
+ R(), y((e) => Math.max(0, e - 1));
5986
6001
  }),
5987
- cursorDown: () => Y.enqueue(() => {
5988
- R(), v((e) => Math.min(V.current.length - 1, e + 1));
6002
+ cursorDown: () => X.enqueue(() => {
6003
+ R(), y((e) => Math.min(V.current.length - 1, e + 1));
5989
6004
  }),
5990
- cursorLeft: () => Y.enqueue(() => {
5991
- R(), v((e) => Math.max(0, e - ge.current));
6005
+ cursorLeft: () => X.enqueue(() => {
6006
+ R(), y((e) => Math.max(0, e - _e.current));
5992
6007
  }),
5993
- cursorRight: () => Y.enqueue(() => {
5994
- R(), v((e) => Math.min(V.current.length - 1, e + ge.current));
6008
+ cursorRight: () => X.enqueue(() => {
6009
+ R(), y((e) => Math.min(V.current.length - 1, e + _e.current));
5995
6010
  }),
5996
- cursorHome: () => Y.enqueue(() => {
5997
- R(), v(0);
6011
+ cursorHome: () => X.enqueue(() => {
6012
+ R(), y(0);
5998
6013
  }),
5999
- cursorEnd: () => Y.enqueue(() => {
6000
- R(), v(V.current.length - 1);
6014
+ cursorEnd: () => X.enqueue(() => {
6015
+ R(), y(V.current.length - 1);
6001
6016
  }),
6002
- cursorPageUp: () => Y.enqueue(() => {
6003
- R(), v((e) => Math.max(0, e - _e.current + 1));
6017
+ cursorPageUp: () => X.enqueue(() => {
6018
+ R(), y((e) => Math.max(0, e - ve.current + 1));
6004
6019
  }),
6005
- cursorPageDown: () => Y.enqueue(() => {
6006
- R(), v((e) => Math.min(V.current.length - 1, e + _e.current - 1));
6020
+ cursorPageDown: () => X.enqueue(() => {
6021
+ R(), y((e) => Math.min(V.current.length - 1, e + ve.current - 1));
6007
6022
  }),
6008
- selectUp: () => Y.enqueue(() => {
6023
+ selectUp: () => X.enqueue(() => {
6009
6024
  R();
6010
- let e = I.current;
6011
- pe(e, Math.max(0, e - 1), e === 0 ? "include-active" : "exclude-active");
6025
+ let e = L.current;
6026
+ me(e, Math.max(0, e - 1), e === 0 ? "include-active" : "exclude-active");
6012
6027
  }),
6013
- selectDown: () => Y.enqueue(() => {
6028
+ selectDown: () => X.enqueue(() => {
6014
6029
  R();
6015
- let e = I.current, t = V.current.length - 1;
6016
- pe(e, Math.min(t, e + 1), e === t ? "include-active" : "exclude-active");
6030
+ let e = L.current, t = V.current.length - 1;
6031
+ me(e, Math.min(t, e + 1), e === t ? "include-active" : "exclude-active");
6017
6032
  }),
6018
- selectLeft: () => Y.enqueue(() => {
6033
+ selectLeft: () => X.enqueue(() => {
6019
6034
  R();
6020
- let e = I.current;
6021
- pe(e, Math.max(0, e - ge.current), "include-active");
6035
+ let e = L.current;
6036
+ me(e, Math.max(0, e - _e.current), "include-active");
6022
6037
  }),
6023
- selectRight: () => Y.enqueue(() => {
6038
+ selectRight: () => X.enqueue(() => {
6024
6039
  R();
6025
- let e = I.current;
6026
- pe(e, Math.min(V.current.length - 1, e + ge.current), "include-active");
6040
+ let e = L.current;
6041
+ me(e, Math.min(V.current.length - 1, e + _e.current), "include-active");
6027
6042
  }),
6028
- selectHome: () => Y.enqueue(() => {
6029
- R(), pe(I.current, 0, "include-active");
6043
+ selectHome: () => X.enqueue(() => {
6044
+ R(), me(L.current, 0, "include-active");
6030
6045
  }),
6031
- selectEnd: () => Y.enqueue(() => {
6032
- R(), pe(I.current, V.current.length - 1, "include-active");
6046
+ selectEnd: () => X.enqueue(() => {
6047
+ R(), me(L.current, V.current.length - 1, "include-active");
6033
6048
  }),
6034
- selectPageUp: () => Y.enqueue(() => {
6049
+ selectPageUp: () => X.enqueue(() => {
6035
6050
  R();
6036
- let e = I.current;
6037
- pe(e, Math.max(0, e - _e.current + 1), "include-active");
6051
+ let e = L.current;
6052
+ me(e, Math.max(0, e - ve.current + 1), "include-active");
6038
6053
  }),
6039
- selectPageDown: () => Y.enqueue(() => {
6054
+ selectPageDown: () => X.enqueue(() => {
6040
6055
  R();
6041
- let e = I.current;
6042
- pe(e, Math.min(V.current.length - 1, e + _e.current - 1), "include-active");
6056
+ let e = L.current;
6057
+ me(e, Math.min(V.current.length - 1, e + ve.current - 1), "include-active");
6043
6058
  }),
6044
- execute: () => Y.enqueue(async () => {
6045
- let e = V.current[I.current];
6059
+ execute: () => X.enqueue(async () => {
6060
+ let e = V.current[L.current];
6046
6061
  !e || e.entry.type !== "file" || e.entry.meta.executable && H.executeCommand("terminal.execute", e.entry.path);
6047
6062
  }),
6048
- open: () => Y.enqueue(async () => {
6049
- let e = V.current[I.current];
6050
- e && await me(e.entry);
6063
+ open: () => X.enqueue(async () => {
6064
+ let e = V.current[L.current];
6065
+ e && await he(e.entry);
6051
6066
  }),
6052
- viewFile: () => Y.enqueue(() => {
6053
- let e = V.current[I.current];
6067
+ viewFile: () => X.enqueue(() => {
6068
+ let e = V.current[L.current];
6054
6069
  e && e.entry.type === "file" && H.executeCommand("dotdir.viewFile", e.entry.path, e.entry.name, Number(e.entry.meta.size));
6055
6070
  }),
6056
- editFile: () => Y.enqueue(() => {
6057
- let e = V.current[I.current];
6071
+ editFile: () => X.enqueue(() => {
6072
+ let e = V.current[L.current];
6058
6073
  if (e && e.entry.type === "file") {
6059
6074
  let t = typeof e.entry.lang == "string" && e.entry.lang ? e.entry.lang : "plaintext";
6060
6075
  H.executeCommand("dotdir.editFile", e.entry.path, e.entry.name, Number(e.entry.meta.size), t);
6061
6076
  }
6062
6077
  }),
6063
- moveToTrash: () => Y.enqueue(() => {
6064
- let e = Kr();
6078
+ moveToTrash: () => X.enqueue(() => {
6079
+ let e = Jr();
6065
6080
  if (!e) return;
6066
- let t = N.current, n = V.current, r = () => re.current(ne.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6067
- let e = n[I.current];
6081
+ let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6082
+ let e = n[L.current];
6068
6083
  return e ? [e.entry.path] : [];
6069
6084
  })();
6070
6085
  i.length !== 0 && e.moveToTrash(i, r);
6071
6086
  }),
6072
- permanentDelete: () => Y.enqueue(() => {
6073
- let e = Kr();
6087
+ permanentDelete: () => X.enqueue(() => {
6088
+ let e = Jr();
6074
6089
  if (!e) return;
6075
- let t = N.current, n = V.current, r = () => re.current(ne.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6076
- let e = n[I.current];
6090
+ let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6091
+ let e = n[L.current];
6077
6092
  return e ? [e.entry.path] : [];
6078
6093
  })();
6079
6094
  i.length !== 0 && e.permanentDelete(i, r);
6080
6095
  }),
6081
- copy: () => Y.enqueue(() => {
6082
- let e = Kr();
6096
+ copy: () => X.enqueue(() => {
6097
+ let e = Jr();
6083
6098
  if (!e) return;
6084
- let t = N.current, n = V.current, r = () => re.current(ne.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6085
- let e = n[I.current];
6099
+ let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6100
+ let e = n[L.current];
6086
6101
  return e ? [e.entry.path] : [];
6087
6102
  })();
6088
6103
  i.length !== 0 && e.copy(i, r);
6089
6104
  }),
6090
- move: () => Y.enqueue(() => {
6091
- let e = Kr();
6105
+ move: () => X.enqueue(() => {
6106
+ let e = Jr();
6092
6107
  if (!e) return;
6093
- let t = N.current, n = V.current, r = () => re.current(ne.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6094
- let e = n[I.current];
6108
+ let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
6109
+ let e = n[L.current];
6095
6110
  return e ? [e.entry.path] : [];
6096
6111
  })();
6097
6112
  i.length !== 0 && e.move(i, r);
6098
6113
  }),
6099
- rename: () => Y.enqueue(() => {
6100
- let e = Kr();
6114
+ rename: () => X.enqueue(() => {
6115
+ let e = Jr();
6101
6116
  if (!e) return;
6102
- let t = V.current[I.current];
6103
- t && e.rename(t.entry.path, t.entry.name, () => re.current(ne.current));
6117
+ let t = V.current[L.current];
6118
+ t && e.rename(t.entry.path, t.entry.name, () => ie.current(re.current));
6104
6119
  }),
6105
- pasteFilename: () => Y.enqueue(() => {
6106
- let e = V.current[I.current];
6120
+ pasteFilename: () => X.enqueue(() => {
6121
+ let e = V.current[L.current];
6107
6122
  if (!e) return;
6108
- let t = Kr();
6123
+ let t = Jr();
6109
6124
  if (!t) return;
6110
6125
  let n = e.entry.name, r = /^[a-zA-Z0-9._+-]+$/.test(n) ? n : JSON.stringify(n);
6111
6126
  t.pasteToCommandLine(r);
6112
6127
  }),
6113
- pastePath: () => Y.enqueue(() => {
6114
- let e = V.current[I.current];
6128
+ pastePath: () => X.enqueue(() => {
6129
+ let e = V.current[L.current];
6115
6130
  if (!e) return;
6116
- let t = Kr();
6131
+ let t = Jr();
6117
6132
  if (!t) return;
6118
6133
  let n = (e.entry.path ?? "").split("\0")[0], r = /^[a-zA-Z0-9._+/:-]+$/.test(n) ? n : JSON.stringify(n);
6119
6134
  t.pasteToCommandLine(r);
6120
6135
  })
6121
- }), () => Jr(null);
6136
+ }), () => bn(null);
6122
6137
  }, [
6123
6138
  s,
6124
6139
  R,
6125
- me,
6126
- pe
6140
+ he,
6141
+ me
6127
6142
  ]);
6128
- let ye = u(C);
6129
- ye.current = C;
6130
- let be = i((e) => {
6131
- S(e), b((t) => Math.max(0, Math.min(t, V.current.length - e * ye.current)));
6132
- }, []), xe = i((e) => {
6133
- w(e);
6134
- }, []), Se = i((e, t) => {
6143
+ let be = u(w);
6144
+ be.current = w;
6145
+ let xe = i((e) => {
6146
+ C(e), x((t) => Math.max(0, Math.min(t, V.current.length - e * be.current)));
6147
+ }, []), Se = i((e) => {
6148
+ T(e);
6149
+ }, []), Ce = i((e, t) => {
6135
6150
  let n = V.current.length;
6136
- v(vi(t, 0, n - 1)), b(vi(e, 0, n - 1));
6137
- }, []), Ce = i((e) => V.current[e]?.entry.name ?? e, []), we = u(0), Te = i((e, t, n) => {
6151
+ y(vi(t, 0, n - 1)), x(vi(e, 0, n - 1));
6152
+ }, []), we = i((e) => V.current[e]?.entry.name ?? e, []), Te = u(0), Ee = i((e, t, n) => {
6138
6153
  let r = V.current[e];
6139
6154
  if (!r) return null;
6140
- let { entry: i, style: a, iconPath: o, iconFallbackUrl: s } = r, c = z(o) ?? s, l = i.type === "file" && !!i.meta.executable;
6155
+ let { entry: i, style: a, iconPath: o, iconFallbackUrl: s } = r, c = oe(o) ?? s, l = i.type === "file" && !!i.meta.executable;
6141
6156
  return /* @__PURE__ */ m("div", {
6142
6157
  className: F(Z, "entry", t && "selected", n && "marked"),
6143
6158
  style: {
@@ -6145,9 +6160,9 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
6145
6160
  opacity: a.opacity
6146
6161
  },
6147
6162
  onMouseDown: (t) => {
6148
- t.stopPropagation(), ie();
6163
+ t.stopPropagation(), ae();
6149
6164
  let n = Date.now();
6150
- n - we.current < 300 ? (we.current = 0, l ? Y.enqueue(() => H.executeCommand("terminal.execute", i.path)) : Y.enqueue(() => me(i))) : (we.current = n, Y.enqueue(() => v(e)));
6165
+ n - Te.current < 300 ? (Te.current = 0, l ? X.enqueue(() => H.executeCommand("terminal.execute", i.path)) : X.enqueue(() => he(i))) : (Te.current = n, X.enqueue(() => y(e)));
6151
6166
  },
6152
6167
  children: [
6153
6168
  /* @__PURE__ */ p("span", {
@@ -6178,12 +6193,12 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
6178
6193
  ]
6179
6194
  });
6180
6195
  }, [
6181
- me,
6182
- T,
6183
- ie
6184
- ]), Ee = B[_], De = Ee?.entry.name ?? "", Oe = Ee ? _i(Number(Ee.entry.meta.mtimeMs ?? 0)) : "", ke = (() => {
6185
- if (!Ee) return "";
6186
- let e = Ee.entry;
6196
+ he,
6197
+ E,
6198
+ ae
6199
+ ]), De = B[v], Oe = De?.entry.name ?? "", ke = De ? _i(Number(De.entry.meta.mtimeMs ?? 0)) : "", Ae = (() => {
6200
+ if (!De) return "";
6201
+ let e = De.entry;
6187
6202
  if (e.name === "..") return "Up";
6188
6203
  let t = e.meta.entryKind ?? (e.type === "folder" ? "directory" : "file"), n = e.meta.nlink ?? 1;
6189
6204
  switch (t) {
@@ -6202,42 +6217,46 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
6202
6217
  return n > 1 ? `${t} [${n}]` : t;
6203
6218
  }
6204
6219
  }
6205
- })(), Ae = !Ee || (Ee.entry.meta.entryKind ?? "") !== "symlink" ? "" : `\u2192 ${Ee.entry.meta.linkTarget ?? "?"}`, je = l(() => B.filter((e) => e.entry.type === "file").length, [B]), Me = l(() => B.reduce((e, t) => t.entry.type === "file" && typeof t.entry.meta.size == "number" ? e + t.entry.meta.size : e, 0), [B]), Ne = l(() => {
6206
- if (D.size === 0) return null;
6220
+ })(), je = !De || (De.entry.meta.entryKind ?? "") !== "symlink" ? "" : `\u2192 ${De.entry.meta.linkTarget ?? "?"}`, Me = l(() => B.filter((e) => e.entry.type === "file").length, [B]), Ne = l(() => B.reduce((e, t) => t.entry.type === "file" && typeof t.entry.meta.size == "number" ? e + t.entry.meta.size : e, 0), [B]), Pe = l(() => {
6221
+ if (O.size === 0) return null;
6207
6222
  let e = 0, t = 0;
6208
- for (let n of B) D.has(n.entry.name) && (e++, n.entry.type === "file" && typeof n.entry.meta.size == "number" && (t += n.entry.meta.size));
6223
+ for (let n of B) O.has(n.entry.name) && (e++, n.entry.type === "file" && typeof n.entry.meta.size == "number" && (t += n.entry.meta.size));
6209
6224
  return {
6210
6225
  count: e,
6211
6226
  size: t
6212
6227
  };
6213
- }, [D, B]);
6228
+ }, [O, B]);
6214
6229
  return /* @__PURE__ */ m("div", {
6215
- className: F(Z, "file-list", M || k ? "no-hover" : null, s ? "active-panel" : "inactive-panel"),
6216
- onMouseMoveCapture: ie,
6217
- onMouseDownCapture: ie,
6230
+ ref: _,
6231
+ tabIndex: 0,
6232
+ className: F(Z, "file-list", N || A ? "no-hover" : null, s ? "active-panel" : "inactive-panel"),
6233
+ onMouseMoveCapture: ae,
6234
+ onMouseDownCapture: () => {
6235
+ ae(), _.current?.focus({ preventScroll: !0 });
6236
+ },
6218
6237
  children: [
6219
6238
  /* @__PURE__ */ p("div", {
6220
6239
  className: Z["path-bar"],
6221
6240
  children: /* @__PURE__ */ p(ui, {
6222
6241
  currentPath: e,
6223
- onNavigate: fe
6242
+ onNavigate: pe
6224
6243
  })
6225
6244
  }),
6226
6245
  /* @__PURE__ */ p("div", {
6227
6246
  className: Z["file-list-body"],
6228
6247
  children: /* @__PURE__ */ p(mi, {
6229
- topmostIndex: y,
6230
- activeIndex: _,
6248
+ topmostIndex: b,
6249
+ activeIndex: v,
6231
6250
  totalCount: B.length,
6232
6251
  itemHeight: hi,
6233
6252
  minColumnWidth: 250,
6234
6253
  far: !0,
6235
- selectedKeys: D,
6236
- getItemKey: Ce,
6237
- renderItem: Te,
6238
- onPosChange: Se,
6239
- onItemsPerColumnChanged: be,
6240
- onColumnCountChanged: xe
6254
+ selectedKeys: O,
6255
+ getItemKey: we,
6256
+ renderItem: Ee,
6257
+ onPosChange: Ce,
6258
+ onItemsPerColumnChanged: xe,
6259
+ onColumnCountChanged: Se
6241
6260
  })
6242
6261
  }),
6243
6262
  /* @__PURE__ */ m("div", {
@@ -6245,25 +6264,25 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
6245
6264
  children: [
6246
6265
  /* @__PURE__ */ p("span", {
6247
6266
  className: Z["file-info-name"],
6248
- children: De
6267
+ children: Oe
6249
6268
  }),
6250
- Ae && /* @__PURE__ */ p("span", {
6269
+ je && /* @__PURE__ */ p("span", {
6251
6270
  className: Z["file-info-link"],
6252
- children: Ae
6271
+ children: je
6253
6272
  }),
6254
6273
  /* @__PURE__ */ p("span", {
6255
6274
  className: Z["file-info-size"],
6256
- children: ke
6275
+ children: Ae
6257
6276
  }),
6258
6277
  /* @__PURE__ */ p("span", {
6259
6278
  className: Z["file-info-date"],
6260
- children: Oe
6279
+ children: ke
6261
6280
  })
6262
6281
  ]
6263
6282
  }),
6264
6283
  /* @__PURE__ */ p("div", {
6265
6284
  className: Z["panel-summary"],
6266
- children: Ne ? `${Ne.count} selected, ${gi(Ne.size)}` : `${je.toLocaleString()} file${je === 1 ? "" : "s"}, ${gi(Me)}`
6285
+ children: Pe ? `${Pe.count} selected, ${gi(Pe.size)}` : `${Me.toLocaleString()} file${Me === 1 ? "" : "s"}, ${gi(Ne)}`
6267
6286
  })
6268
6287
  ]
6269
6288
  });
@@ -6441,23 +6460,23 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
6441
6460
  }
6442
6461
  let n = await ke().utils.getHomePath(), r = ki(n);
6443
6462
  x([r]), C(r.id), k.current.navigateTo(n);
6444
- }, []), ee = i((e, t) => {
6463
+ }, []), I = i((e, t) => {
6445
6464
  x((n) => {
6446
6465
  let r = [...n], [i] = r.splice(e, 1);
6447
6466
  return r.splice(t, 0, i), r;
6448
6467
  });
6449
- }, []), te = i(() => {
6468
+ }, []), ee = i(() => {
6450
6469
  let e = k.current.currentPath, t = ki(e);
6451
6470
  x((e) => [...e, t]), C(t.id), k.current.navigateTo(e);
6452
6471
  }, [x, C]);
6453
6472
  return o(() => {
6454
6473
  if (g) return Hi({
6455
- newTab: te,
6474
+ newTab: ee,
6456
6475
  closeActiveTab: () => P(j.current)
6457
6476
  }), () => Hi(null);
6458
6477
  }, [
6459
6478
  g,
6460
- te,
6479
+ ee,
6461
6480
  P
6462
6481
  ]), /* @__PURE__ */ m("div", {
6463
6482
  className: F(wi, "panel", g && "active"),
@@ -6470,8 +6489,8 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
6470
6489
  onSelectTab: M,
6471
6490
  onDoubleClickTab: N,
6472
6491
  onCloseTab: P,
6473
- onNewTab: te,
6474
- onReorderTabs: ee
6492
+ onNewTab: ee,
6493
+ onReorderTabs: I
6475
6494
  }),
6476
6495
  /* @__PURE__ */ p("div", {
6477
6496
  className: wi["panel-content"],
@@ -6490,7 +6509,7 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
6490
6509
  let e = T;
6491
6510
  if (e.type !== "preview") return null;
6492
6511
  let t = tn.resolve(e.name);
6493
- return t ? /* @__PURE__ */ p(Sn, {
6512
+ return t ? /* @__PURE__ */ p(wn, {
6494
6513
  extensionDirPath: t.extensionDirPath,
6495
6514
  entry: t.contribution.entry,
6496
6515
  filePath: e.path,
@@ -7152,7 +7171,7 @@ async function ma(e, t, n) {
7152
7171
  //#endregion
7153
7172
  //#region lib/features/extensions/useExtensionHost.ts
7154
7173
  function ha({ settingsLoaded: e, onRefreshPanels: t }) {
7155
- let n = ke(), r = kn(), a = y(Pe), s = y(Fe), c = y(Be), l = b(Ie), d = b(Le), f = b(Re), p = b(ze), { setIconTheme: m } = Lr(), { setIconThemeKind: h } = Rr(), g = u(a);
7174
+ let n = ke(), r = jn(), a = y(Pe), s = y(Fe), c = y(Be), l = b(Ie), d = b(Le), f = b(Re), p = b(ze), { setIconTheme: m } = zr(), { setIconThemeKind: h } = Br(), g = u(a);
7156
7175
  g.current = a;
7157
7176
  let _ = u(s);
7158
7177
  _.current = s;
@@ -7160,7 +7179,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
7160
7179
  v.current = t;
7161
7180
  let x = u([]), S = u([]), C = u(!1);
7162
7181
  o(() => {
7163
- let e = s ? Kn(x.current, s) : null, t = e ? _n(e.theme.uiTheme) : c === "light" || c === "high-contrast-light" ? "light" : "dark";
7182
+ let e = s ? Jn(x.current, s) : null, t = e ? _n(e.theme.uiTheme) : c === "light" || c === "high-contrast-light" ? "light" : "dark";
7164
7183
  Ht().dataset.theme = t, h(t);
7165
7184
  }, [c, s]);
7166
7185
  let w = i(async (e, t) => {
@@ -7183,7 +7202,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
7183
7202
  }, [a, w]), o(() => {
7184
7203
  if (C.current) if (!s) gn();
7185
7204
  else {
7186
- let e = Kn(x.current, s);
7205
+ let e = Jn(x.current, s);
7187
7206
  e && vn(n, e.theme.jsonPath, e.theme.uiTheme).catch(() => gn());
7188
7207
  }
7189
7208
  }, [s]), o(() => {
@@ -7205,7 +7224,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
7205
7224
  gn();
7206
7225
  return;
7207
7226
  }
7208
- let r = Kn(e, t);
7227
+ let r = Jn(e, t);
7209
7228
  if (r) {
7210
7229
  let e = _n(r.theme.uiTheme);
7211
7230
  Ht().dataset.theme = e, h(e);
@@ -8434,7 +8453,7 @@ function $a(e) {
8434
8453
  n.current = e;
8435
8454
  let r = y(Ie), i = u(r);
8436
8455
  i.current = r;
8437
- let { updateSettings: a } = dr(), [s, c] = v(We), l = b(Ge), d = b(Ve), f = b(Ne), p = b(qe), m = b(Je), h = b(Ke), g = u(s);
8456
+ let { updateSettings: a } = pr(), [s, c] = v(We), l = b(Ge), d = b(Ve), f = b(Ne), p = b(qe), m = b(Je), h = b(Ke), g = u(s);
8438
8457
  g.current = s, o(() => {
8439
8458
  let e = [];
8440
8459
  return e.push(H.registerCommand("dotdir.toggleHiddenFiles", () => l((e) => {
@@ -8504,7 +8523,7 @@ function $a(e) {
8504
8523
  })), e.push(H.registerCommand("dotdir.editFile", (e, t, r, i) => {
8505
8524
  let a = n.current.editorFileSizeLimit;
8506
8525
  a > 0 && r > a || n.current.onEditFile(e, t, r, i);
8507
- })), e.push(H.registerCommand("list.cursorUp", () => X()?.cursorUp())), e.push(H.registerCommand("list.cursorDown", () => X()?.cursorDown())), e.push(H.registerCommand("list.cursorLeft", () => X()?.cursorLeft())), e.push(H.registerCommand("list.cursorRight", () => X()?.cursorRight())), e.push(H.registerCommand("list.cursorHome", () => X()?.cursorHome())), e.push(H.registerCommand("list.cursorEnd", () => X()?.cursorEnd())), e.push(H.registerCommand("list.cursorPageUp", () => X()?.cursorPageUp())), e.push(H.registerCommand("list.cursorPageDown", () => X()?.cursorPageDown())), e.push(H.registerCommand("list.selectUp", () => X()?.selectUp())), e.push(H.registerCommand("list.selectDown", () => X()?.selectDown())), e.push(H.registerCommand("list.selectLeft", () => X()?.selectLeft())), e.push(H.registerCommand("list.selectRight", () => X()?.selectRight())), e.push(H.registerCommand("list.selectHome", () => X()?.selectHome())), e.push(H.registerCommand("list.selectEnd", () => X()?.selectEnd())), e.push(H.registerCommand("list.selectPageUp", () => X()?.selectPageUp())), e.push(H.registerCommand("list.selectPageDown", () => X()?.selectPageDown())), e.push(H.registerCommand("list.execute", () => X()?.execute())), e.push(H.registerCommand("list.open", () => X()?.open())), e.push(H.registerCommand("list.viewFile", () => X()?.viewFile())), e.push(H.registerCommand("list.editFile", () => X()?.editFile())), e.push(H.registerCommand("list.moveToTrash", () => X()?.moveToTrash())), e.push(H.registerCommand("list.permanentDelete", () => X()?.permanentDelete())), e.push(H.registerCommand("list.copy", () => X()?.copy())), e.push(H.registerCommand("list.move", () => X()?.move())), e.push(H.registerCommand("list.rename", () => X()?.rename())), e.push(H.registerCommand("list.pasteFilename", () => X()?.pasteFilename())), e.push(H.registerCommand("list.pastePath", () => X()?.pastePath())), e.push(...ot(H)), e.push(...ct(H)), () => {
8526
+ })), e.push(H.registerCommand("list.cursorUp", () => J()?.cursorUp())), e.push(H.registerCommand("list.cursorDown", () => J()?.cursorDown())), e.push(H.registerCommand("list.cursorLeft", () => J()?.cursorLeft())), e.push(H.registerCommand("list.cursorRight", () => J()?.cursorRight())), e.push(H.registerCommand("list.cursorHome", () => J()?.cursorHome())), e.push(H.registerCommand("list.cursorEnd", () => J()?.cursorEnd())), e.push(H.registerCommand("list.cursorPageUp", () => J()?.cursorPageUp())), e.push(H.registerCommand("list.cursorPageDown", () => J()?.cursorPageDown())), e.push(H.registerCommand("list.selectUp", () => J()?.selectUp())), e.push(H.registerCommand("list.selectDown", () => J()?.selectDown())), e.push(H.registerCommand("list.selectLeft", () => J()?.selectLeft())), e.push(H.registerCommand("list.selectRight", () => J()?.selectRight())), e.push(H.registerCommand("list.selectHome", () => J()?.selectHome())), e.push(H.registerCommand("list.selectEnd", () => J()?.selectEnd())), e.push(H.registerCommand("list.selectPageUp", () => J()?.selectPageUp())), e.push(H.registerCommand("list.selectPageDown", () => J()?.selectPageDown())), e.push(H.registerCommand("list.execute", () => J()?.execute())), e.push(H.registerCommand("list.open", () => J()?.open())), e.push(H.registerCommand("list.viewFile", () => J()?.viewFile())), e.push(H.registerCommand("list.editFile", () => J()?.editFile())), e.push(H.registerCommand("list.moveToTrash", () => J()?.moveToTrash())), e.push(H.registerCommand("list.permanentDelete", () => J()?.permanentDelete())), e.push(H.registerCommand("list.copy", () => J()?.copy())), e.push(H.registerCommand("list.move", () => J()?.move())), e.push(H.registerCommand("list.rename", () => J()?.rename())), e.push(H.registerCommand("list.pasteFilename", () => J()?.pasteFilename())), e.push(H.registerCommand("list.pastePath", () => J()?.pastePath())), e.push(...ot(H)), e.push(...ct(H)), () => {
8508
8527
  for (let t of e) t();
8509
8528
  };
8510
8529
  }, [
@@ -8987,7 +9006,7 @@ function xo(e) {
8987
9006
  })) : (console.error("[userKeybindings] keybindings.json must be an array"), null);
8988
9007
  }
8989
9008
  async function So(e) {
8990
- await $n(e, {
9009
+ await tr(e, {
8991
9010
  name: "userKeybindings",
8992
9011
  getPath: async () => K(await e.utils.getHomePath(), ".dotdir", "keybindings.json"),
8993
9012
  validate: xo,
@@ -9043,85 +9062,85 @@ var ko = "_app_4bfa7_56", Ao = "_loading_4bfa7_69", jo = {
9043
9062
  //#endregion
9044
9063
  //#region lib/app.tsx
9045
9064
  function Mo({ widget: e }) {
9046
- let t = ke(), { settings: n, ready: r, updateSettings: a } = dr(), s = u(n);
9047
- s.current = n;
9048
- let c = b(Be), { dialog: l, showDialog: h } = De(), [g, _] = v(Ge), x = i((e) => {
9049
- h({
9065
+ let t = u(null), n = ke(), { settings: r, ready: a, updateSettings: s } = pr(), c = u(r);
9066
+ c.current = r;
9067
+ let l = b(Be), { dialog: h, showDialog: g } = De(), [_, x] = v(Ge), S = i((e) => {
9068
+ g({
9050
9069
  type: "message",
9051
9070
  title: "Error",
9052
9071
  message: e,
9053
9072
  variant: "error"
9054
9073
  });
9055
- }, [h]), S = co(x), C = co(x), [w, T] = v(We), E = y(Ve), [D, O] = v(qe), [k, A] = v(Je), [j, M] = d(null), [N, P] = d(null), ee = y(Ne), te = b(Pe), I = b(Fe), [L, ne] = d(0), [re, R] = v(Ni), [ie, ae] = v(Pi), [z, oe] = v(Fi), [se, B] = v(Ii), V = u(void 0), ce = u(void 0), le = u({}), ue = u({}), de = u(z), fe = u(se), me = y(Ie), he = y(Le), ge = u(re);
9056
- ge.current = re;
9057
- let _e = u(ie);
9058
- _e.current = ie;
9059
- let ve = u(z);
9060
- ve.current = z;
9061
- let ye = u(se);
9062
- ye.current = se;
9063
- let [be, xe] = d(0), Se = _t(), Ce = b(Xe), we = y(Ze), Te = u(() => {});
9064
- we && (Te.current = we), o(() => {
9065
- r && (n.iconTheme && te(n.iconTheme), n.colorTheme !== void 0 && I(n.colorTheme || void 0), n.editorFileSizeLimit !== void 0 && ne(n.editorFileSizeLimit), n.showHidden !== void 0 && _(n.showHidden));
9066
- }, [n, r]);
9067
- let { settingsLoaded: Oe, initialLeftPanel: Ae, initialRightPanel: je, initialActivePanel: Me, setInitialLeftPanel: Re, setInitialRightPanel: ze, setInitialActivePanel: He } = yo({
9068
- ready: r,
9069
- setLeftTabs: R,
9070
- setRightTabs: ae,
9071
- setLeftActiveTabId: oe,
9072
- setRightActiveTabId: B,
9073
- leftTabSelectionRef: le,
9074
- rightTabSelectionRef: ue,
9075
- prevLeftActiveTabIdRef: de,
9076
- prevRightActiveTabIdRef: fe,
9074
+ }, [g]), C = co(S), w = co(S), [T, E] = v(We), D = y(Ve), [O, k] = v(qe), [j, M] = v(Je), [N, P] = d(null), [I, ee] = d(null), te = y(Ne), L = b(Pe), ne = b(Fe), [re, ie] = d(0), [R, ae] = v(Ni), [z, oe] = v(Pi), [se, ce] = v(Fi), [B, V] = v(Ii), le = u(void 0), ue = u(void 0), de = u({}), fe = u({}), me = u(se), he = u(B), ge = y(Ie), _e = y(Le), ve = u(R);
9075
+ ve.current = R;
9076
+ let ye = u(z);
9077
+ ye.current = z;
9078
+ let be = u(se);
9079
+ be.current = se;
9080
+ let xe = u(B);
9081
+ xe.current = B;
9082
+ let [Se, Ce] = d(0), we = _t(), Te = b(Xe), Oe = y(Ze), Ae = u(() => {});
9083
+ Oe && (Ae.current = Oe), o(() => {
9084
+ a && (r.iconTheme && L(r.iconTheme), r.colorTheme !== void 0 && ne(r.colorTheme || void 0), r.editorFileSizeLimit !== void 0 && ie(r.editorFileSizeLimit), r.showHidden !== void 0 && x(r.showHidden));
9085
+ }, [r, a]);
9086
+ let { settingsLoaded: je, initialLeftPanel: Me, initialRightPanel: Re, initialActivePanel: ze, setInitialLeftPanel: He, setInitialRightPanel: Ue, setInitialActivePanel: Ke } = yo({
9087
+ ready: a,
9088
+ setLeftTabs: ae,
9089
+ setRightTabs: oe,
9090
+ setLeftActiveTabId: ce,
9091
+ setRightActiveTabId: V,
9092
+ leftTabSelectionRef: de,
9093
+ rightTabSelectionRef: fe,
9094
+ prevLeftActiveTabIdRef: me,
9095
+ prevRightActiveTabIdRef: he,
9077
9096
  onAfterRestore: i(() => {
9078
- So(t);
9079
- }, [t])
9080
- }), Ue = u(w);
9081
- Ue.current = w;
9082
- let Ke = u(S.navigateTo);
9083
- Ke.current = w === "left" ? S.navigateTo : C.navigateTo;
9084
- let Ye = u(S);
9085
- Ye.current = S;
9086
- let Qe = u(C);
9087
- Qe.current = C;
9088
- let $e = u(""), et = i(async (e) => {
9089
- let n = va(e);
9090
- if (!n) {
9091
- Mt.runCommand(e, $e.current);
9097
+ So(n);
9098
+ }, [n])
9099
+ }), Ye = u(T);
9100
+ Ye.current = T;
9101
+ let Qe = u(C.navigateTo);
9102
+ Qe.current = T === "left" ? C.navigateTo : w.navigateTo;
9103
+ let $e = u(C);
9104
+ $e.current = C;
9105
+ let et = u(w);
9106
+ et.current = w;
9107
+ let nt = u(""), rt = i(async (e) => {
9108
+ let t = va(e);
9109
+ if (!t) {
9110
+ Pt.runCommand(e, nt.current);
9092
9111
  return;
9093
9112
  }
9094
- if (n.kind === "error") {
9095
- h({
9113
+ if (t.kind === "error") {
9114
+ g({
9096
9115
  type: "message",
9097
9116
  title: "cd",
9098
- message: n.message,
9117
+ message: t.message,
9099
9118
  variant: "error"
9100
9119
  });
9101
9120
  return;
9102
9121
  }
9103
- let r = Ue.current === "left" ? Ye.current : Qe.current, i = r.currentPath;
9104
- if (n.kind === "setAlias") {
9105
- a({ pathAliases: {
9106
- ...s.current.pathAliases,
9107
- [n.alias]: Q(i)
9122
+ let r = Ye.current === "left" ? $e.current : et.current, i = r.currentPath;
9123
+ if (t.kind === "setAlias") {
9124
+ s({ pathAliases: {
9125
+ ...c.current.pathAliases,
9126
+ [t.alias]: Q(i)
9108
9127
  } });
9109
9128
  return;
9110
9129
  }
9111
- if (n.kind === "goAlias") {
9112
- let e = s.current.pathAliases?.[n.alias];
9130
+ if (t.kind === "goAlias") {
9131
+ let e = c.current.pathAliases?.[t.alias];
9113
9132
  if (!e) {
9114
- h({
9133
+ g({
9115
9134
  type: "message",
9116
9135
  title: "cd",
9117
- message: `Unknown alias: ${n.alias}`,
9136
+ message: `Unknown alias: ${t.alias}`,
9118
9137
  variant: "error"
9119
9138
  });
9120
9139
  return;
9121
9140
  }
9122
9141
  let i = Q(Tt(W(e)));
9123
- if (!await ba(t, i)) {
9124
- h({
9142
+ if (!await ba(n, i)) {
9143
+ g({
9125
9144
  type: "message",
9126
9145
  title: "cd",
9127
9146
  message: `Folder not found: ${i}`,
@@ -9132,10 +9151,10 @@ function Mo({ widget: e }) {
9132
9151
  await r.navigateTo(i);
9133
9152
  return;
9134
9153
  }
9135
- if (n.kind === "chdir") {
9136
- let e = await ya(t, n.pathArg, i);
9137
- if (!await ba(t, e)) {
9138
- h({
9154
+ if (t.kind === "chdir") {
9155
+ let e = await ya(n, t.pathArg, i);
9156
+ if (!await ba(n, e)) {
9157
+ g({
9139
9158
  type: "message",
9140
9159
  title: "cd",
9141
9160
  message: `Path not found: ${e}`,
@@ -9145,80 +9164,80 @@ function Mo({ widget: e }) {
9145
9164
  }
9146
9165
  await r.navigateTo(e);
9147
9166
  }
9148
- }, [h]);
9167
+ }, [g]);
9149
9168
  o(() => {
9150
- Ce(() => et);
9151
- }, [et, Ce]);
9152
- let { handleCopy: nt, handleMove: rt, handleMoveToTrash: it, handlePermanentDelete: at, handleRename: ot } = _a(Ue, Ye, Qe, xe);
9169
+ Te(() => rt);
9170
+ }, [rt, Te]);
9171
+ let { handleCopy: it, handleMove: at, handleMoveToTrash: ot, handlePermanentDelete: st, handleRename: ct } = _a(Ye, $e, et, Ce);
9153
9172
  o(() => {
9154
- Gr({
9155
- moveToTrash: it,
9156
- permanentDelete: at,
9157
- copy: nt,
9158
- move: rt,
9159
- rename: ot,
9160
- pasteToCommandLine: (e) => Te.current(e)
9173
+ qr({
9174
+ moveToTrash: ot,
9175
+ permanentDelete: st,
9176
+ copy: it,
9177
+ move: at,
9178
+ rename: ct,
9179
+ pasteToCommandLine: (e) => Ae.current(e)
9161
9180
  });
9162
9181
  }, [
9182
+ ot,
9183
+ st,
9163
9184
  it,
9164
9185
  at,
9165
- nt,
9166
- rt,
9167
- ot
9186
+ ct
9168
9187
  ]), o(() => {
9169
- H.setContext("leftPanelActive", w === "left"), H.setContext("rightPanelActive", w === "right");
9170
- }, [w]), o(() => {
9171
- H.setContext("dialogOpen", l !== null);
9172
- }, [l]);
9173
- let st = i((e, t, n) => {
9188
+ H.setContext("leftPanelActive", T === "left"), H.setContext("rightPanelActive", T === "right");
9189
+ }, [T]), o(() => {
9190
+ H.setContext("dialogOpen", h !== null);
9191
+ }, [h]);
9192
+ let lt = i((e, t, n) => {
9174
9193
  if (rn.resolve(q(e))) {
9175
- Ke.current(e + "\0");
9194
+ Qe.current(e + "\0");
9176
9195
  return;
9177
9196
  }
9178
- O({
9197
+ k({
9179
9198
  path: e,
9180
9199
  name: t,
9181
9200
  size: n,
9182
- panel: Ue.current
9201
+ panel: Ye.current
9183
9202
  });
9184
- }, []), ct = i((e, t, n, r) => {
9185
- A({
9203
+ }, []), ut = i((e, t, n, r) => {
9204
+ M({
9186
9205
  path: e,
9187
9206
  name: t,
9188
9207
  size: n,
9189
9208
  langId: r
9190
9209
  });
9191
- }, []), lt = i(async (e, n, r) => {
9192
- let i = await t.fs.exists(e);
9193
- i || await t.fs.writeFile(e, ""), A({
9210
+ }, []), dt = i(async (e, t, r) => {
9211
+ let i = await n.fs.exists(e);
9212
+ i || await n.fs.writeFile(e, ""), M({
9194
9213
  path: e,
9195
- name: n,
9196
- size: i ? (await t.fs.stat(e)).size : 0,
9214
+ name: t,
9215
+ size: i ? (await n.fs.stat(e)).size : 0,
9197
9216
  langId: r
9198
9217
  });
9199
- }, []), ut = D ? D.panel === "left" ? S.entries : C.entries : [], dt = i((e, t) => t.some((t) => {
9218
+ }, []), ft = O ? O.panel === "left" ? C.entries : w.entries : [], pt = i((e, t) => t.some((t) => {
9200
9219
  if (t.startsWith("*.")) {
9201
9220
  let n = t.slice(1).toLowerCase();
9202
9221
  return e.toLowerCase().endsWith(n);
9203
9222
  }
9204
9223
  return e.toLowerCase() === t.toLowerCase();
9205
- }), []), ft = i((e) => D ? (g ? ut : ut.filter((e) => !e.meta.hidden)).filter((t) => t.type === "file" && dt(t.name, e)).map((e) => ({
9224
+ }), []), ht = i((e) => O ? (_ ? ft : ft.filter((e) => !e.meta.hidden)).filter((t) => t.type === "file" && pt(t.name, e)).map((e) => ({
9206
9225
  path: e.path,
9207
9226
  name: e.name,
9208
9227
  size: Number(e.meta.size)
9209
9228
  })).sort((e, t) => e.name.localeCompare(t.name)) : [], [
9210
- D,
9211
- ut,
9212
- g,
9213
- dt
9214
- ]), pt = i(async (e, t) => {
9229
+ O,
9230
+ ft,
9231
+ _,
9232
+ pt
9233
+ ]), vt = i(async (e, t) => {
9215
9234
  let { patterns: n } = t ?? {};
9216
- if (!n || !D) return;
9217
- let r = ft(n), i = r.findIndex((e) => e.path === D.path);
9235
+ if (!n || !O) return;
9236
+ let r = ht(n), i = r.findIndex((e) => e.path === O.path);
9218
9237
  if (e === "navigatePrev") {
9219
9238
  if (i > 0) {
9220
9239
  let e = r[i - 1];
9221
- O((t) => t ? {
9240
+ k((t) => t ? {
9222
9241
  ...e,
9223
9242
  panel: t.panel
9224
9243
  } : null);
@@ -9228,7 +9247,7 @@ function Mo({ widget: e }) {
9228
9247
  if (e === "navigateNext") {
9229
9248
  if (i >= 0 && i < r.length - 1) {
9230
9249
  let e = r[i + 1];
9231
- O((t) => t ? {
9250
+ k((t) => t ? {
9232
9251
  ...e,
9233
9252
  panel: t.panel
9234
9253
  } : null);
@@ -9239,81 +9258,81 @@ function Mo({ widget: e }) {
9239
9258
  index: i,
9240
9259
  total: r.length
9241
9260
  };
9242
- }, [D, ft]), ht = D ? tn.resolve(D.name) : null, vt = k ? nn.resolve(k.name) : null;
9261
+ }, [O, ht]), yt = O ? tn.resolve(O.name) : null, bt = j ? nn.resolve(j.name) : null;
9243
9262
  o(() => {
9244
- ht && M((e) => e?.dirPath === ht.extensionDirPath && e?.entry === ht.contribution.entry ? e : {
9245
- dirPath: ht.extensionDirPath,
9246
- entry: ht.contribution.entry
9263
+ yt && P((e) => e?.dirPath === yt.extensionDirPath && e?.entry === yt.contribution.entry ? e : {
9264
+ dirPath: yt.extensionDirPath,
9265
+ entry: yt.contribution.entry
9247
9266
  });
9248
- }, [ht?.extensionDirPath, ht?.contribution.entry]), o(() => {
9249
- vt && P((e) => e?.dirPath === vt.extensionDirPath && e?.entry === vt.contribution.entry ? e : {
9250
- dirPath: vt.extensionDirPath,
9251
- entry: vt.contribution.entry
9267
+ }, [yt?.extensionDirPath, yt?.contribution.entry]), o(() => {
9268
+ bt && ee((e) => e?.dirPath === bt.extensionDirPath && e?.entry === bt.contribution.entry ? e : {
9269
+ dirPath: bt.extensionDirPath,
9270
+ entry: bt.contribution.entry
9252
9271
  });
9253
- }, [vt?.extensionDirPath, vt?.contribution.entry]);
9254
- let yt = D && Oo(D.name) ? D.name : void 0, bt = S.requestedCursor ?? (D?.panel === "left" ? yt : void 0), xt = C.requestedCursor ?? (D?.panel === "right" ? yt : void 0), { handlePanelStateChange: St } = bo({
9255
- activePanel: w,
9256
- settingsLoaded: Oe,
9257
- left: S,
9258
- right: C,
9259
- leftTabsRef: ge,
9260
- rightTabsRef: _e,
9261
- leftActiveTabIdRef: ve,
9262
- rightActiveTabIdRef: ye,
9263
- leftTabSelectionRef: le,
9264
- rightTabSelectionRef: ue,
9265
- leftSelectedNameRef: V,
9266
- rightSelectedNameRef: ce,
9267
- setLeftTabs: R,
9268
- setRightTabs: ae,
9269
- setLeftActiveTabId: oe,
9270
- setRightActiveTabId: B
9271
- }), Ct = i(() => {
9272
- let e = Ue.current, t = sa[e], n = e === "left" ? S.currentPath : C.currentPath, r = (t === "left" ? ve : ye).current, i = t === "left" ? R : ae, a = t === "left" ? S : C;
9272
+ }, [bt?.extensionDirPath, bt?.contribution.entry]);
9273
+ let xt = O && Oo(O.name) ? O.name : void 0, St = C.requestedCursor ?? (O?.panel === "left" ? xt : void 0), Ct = w.requestedCursor ?? (O?.panel === "right" ? xt : void 0), { handlePanelStateChange: wt } = bo({
9274
+ activePanel: T,
9275
+ settingsLoaded: je,
9276
+ left: C,
9277
+ right: w,
9278
+ leftTabsRef: ve,
9279
+ rightTabsRef: ye,
9280
+ leftActiveTabIdRef: be,
9281
+ rightActiveTabIdRef: xe,
9282
+ leftTabSelectionRef: de,
9283
+ rightTabSelectionRef: fe,
9284
+ leftSelectedNameRef: le,
9285
+ rightSelectedNameRef: ue,
9286
+ setLeftTabs: ae,
9287
+ setRightTabs: oe,
9288
+ setLeftActiveTabId: ce,
9289
+ setRightActiveTabId: V
9290
+ }), G = i(() => {
9291
+ let e = Ye.current, t = sa[e], n = e === "left" ? C.currentPath : w.currentPath, r = (t === "left" ? be : xe).current, i = t === "left" ? ae : oe, a = t === "left" ? C : w;
9273
9292
  i((e) => e.map((e) => e.id === r && e.type === "filelist" ? {
9274
9293
  ...e,
9275
9294
  path: n
9276
- } : e)), a.navigateTo(n), T(t);
9295
+ } : e)), a.navigateTo(n), E(t);
9277
9296
  }, [
9278
- S.currentPath,
9279
9297
  C.currentPath,
9280
- S,
9281
- C
9282
- ]), wt = i(() => {
9283
- let e = Ue.current, t = sa[e], n = e === "left" ? S.currentPath : C.currentPath, r = ki(n), i = t === "left" ? R : ae, a = t === "left" ? oe : B, o = t === "left" ? S : C;
9284
- i((e) => [...e, r]), a(r.id), o.navigateTo(n), T(t);
9298
+ w.currentPath,
9299
+ C,
9300
+ w
9301
+ ]), K = i(() => {
9302
+ let e = Ye.current, t = sa[e], n = e === "left" ? C.currentPath : w.currentPath, r = ki(n), i = t === "left" ? ae : oe, a = t === "left" ? ce : V, o = t === "left" ? C : w;
9303
+ i((e) => [...e, r]), a(r.id), o.navigateTo(n), E(t);
9285
9304
  }, [
9286
- S.currentPath,
9287
9305
  C.currentPath,
9288
- S,
9289
- C
9290
- ]), G = i(() => {
9291
- let e = Ue.current, t = e === "left" ? S.entries : C.entries, n = e === "left" ? V.current : ce.current, r = n ? t.find((e) => e.name === n) : void 0;
9306
+ w.currentPath,
9307
+ C,
9308
+ w
9309
+ ]), Et = i(() => {
9310
+ let e = Ye.current, t = e === "left" ? C.entries : w.entries, n = e === "left" ? le.current : ue.current, r = n ? t.find((e) => e.name === n) : void 0;
9292
9311
  if (!r || r.type !== "folder") return;
9293
- let i = r.path, a = sa[e], o = (a === "left" ? ve : ye).current, s = a === "left" ? R : ae, c = a === "left" ? S : C;
9312
+ let i = r.path, a = sa[e], o = (a === "left" ? be : xe).current, s = a === "left" ? ae : oe, c = a === "left" ? C : w;
9294
9313
  s((e) => e.map((e) => e.id === o && e.type === "filelist" ? {
9295
9314
  ...e,
9296
9315
  path: i
9297
- } : e)), c.navigateTo(i), T(a);
9316
+ } : e)), c.navigateTo(i), E(a);
9298
9317
  }, [
9299
- S.entries,
9300
9318
  C.entries,
9301
- S,
9302
- C
9303
- ]), K = i(() => {
9304
- let e = Ue.current, t = e === "left" ? S.entries : C.entries, n = e === "left" ? V.current : ce.current, r = n ? t.find((e) => e.name === n) : void 0;
9319
+ w.entries,
9320
+ C,
9321
+ w
9322
+ ]), Dt = i(() => {
9323
+ let e = Ye.current, t = e === "left" ? C.entries : w.entries, n = e === "left" ? le.current : ue.current, r = n ? t.find((e) => e.name === n) : void 0;
9305
9324
  if (!r || r.type !== "folder") return;
9306
- let i = r.path, a = sa[e], o = ki(i), s = a === "left" ? R : ae, c = a === "left" ? oe : B, l = a === "left" ? S : C;
9307
- s((e) => [...e, o]), c(o.id), l.navigateTo(i), T(a);
9325
+ let i = r.path, a = sa[e], o = ki(i), s = a === "left" ? ae : oe, c = a === "left" ? ce : V, l = a === "left" ? C : w;
9326
+ s((e) => [...e, o]), c(o.id), l.navigateTo(i), E(a);
9308
9327
  }, [
9309
- S.entries,
9310
9328
  C.entries,
9311
- S,
9312
- C
9313
- ]), Et = i(() => {
9314
- let e = Ue.current, t = e === "left" ? S.entries : C.entries, n = e === "left" ? V.current : ce.current, r = n ? t.find((e) => e.name === n) : void 0;
9329
+ w.entries,
9330
+ C,
9331
+ w
9332
+ ]), Ot = i(() => {
9333
+ let e = Ye.current, t = e === "left" ? C.entries : w.entries, n = e === "left" ? le.current : ue.current, r = n ? t.find((e) => e.name === n) : void 0;
9315
9334
  if (!r || r.type !== "file") return;
9316
- let i = r.path, a = r.name, o = Number(r.meta.size), s = e, c = sa[e], l = (c === "left" ? ge : _e).current, u = c === "left" ? R : ae, d = c === "left" ? oe : B, f = l.find((e) => e.type === "preview" && e.isTemp);
9335
+ let i = r.path, a = r.name, o = Number(r.meta.size), s = e, c = sa[e], l = (c === "left" ? ve : ye).current, u = c === "left" ? ae : oe, d = c === "left" ? ce : V, f = l.find((e) => e.type === "preview" && e.isTemp);
9317
9336
  if (f && f.type === "preview") u((e) => e.map((e) => e.id === f.id ? {
9318
9337
  ...e,
9319
9338
  path: i,
@@ -9325,91 +9344,105 @@ function Mo({ widget: e }) {
9325
9344
  let e = Ai(i, a, o, s);
9326
9345
  u((t) => [...t, e]), d(e.id);
9327
9346
  }
9328
- T(c);
9329
- }, [S.entries, C.entries]);
9330
- o(() => (t.theme.get().then((e) => c(e)), t.theme.onChange((e) => c(e))), []);
9331
- let Dt = u(S.currentPath);
9332
- Dt.current = S.currentPath;
9333
- let Ot = u(C.currentPath);
9334
- Ot.current = C.currentPath, o(() => {
9335
- if (de.current === z) return;
9336
- de.current = z;
9337
- let e = ge.current.find((e) => e.id === z);
9338
- e?.type === "filelist" && e.path != null && S.navigateTo(e.path);
9339
- }, [z]), o(() => {
9340
- if (fe.current === se) return;
9341
- fe.current = se;
9342
- let e = _e.current.find((e) => e.id === se);
9347
+ E(c);
9348
+ }, [C.entries, w.entries]);
9349
+ o(() => (n.theme.get().then((e) => l(e)), n.theme.onChange((e) => l(e))), []);
9350
+ let kt = u(C.currentPath);
9351
+ kt.current = C.currentPath;
9352
+ let At = u(w.currentPath);
9353
+ At.current = w.currentPath, o(() => {
9354
+ if (me.current === se) return;
9355
+ me.current = se;
9356
+ let e = ve.current.find((e) => e.id === se);
9343
9357
  e?.type === "filelist" && e.path != null && C.navigateTo(e.path);
9344
- }, [se]);
9345
- let kt = u(S.currentPath), At = u(C.currentPath);
9358
+ }, [se]), o(() => {
9359
+ if (he.current === B) return;
9360
+ he.current = B;
9361
+ let e = ye.current.find((e) => e.id === B);
9362
+ e?.type === "filelist" && e.path != null && w.navigateTo(e.path);
9363
+ }, [B]);
9364
+ let jt = u(C.currentPath), Mt = u(w.currentPath);
9346
9365
  o(() => {
9347
- kt.current !== S.currentPath && (kt.current = S.currentPath, R((e) => {
9348
- let t = e.findIndex((e) => e.id === z);
9366
+ jt.current !== C.currentPath && (jt.current = C.currentPath, ae((e) => {
9367
+ let t = e.findIndex((e) => e.id === se);
9349
9368
  if (t < 0) return e;
9350
9369
  let n = e[t];
9351
- if (n?.type !== "filelist" || n.path === S.currentPath) return e;
9370
+ if (n?.type !== "filelist" || n.path === C.currentPath) return e;
9352
9371
  let r = [...e];
9353
9372
  return r[t] = {
9354
9373
  ...n,
9355
- path: S.currentPath
9374
+ path: C.currentPath
9356
9375
  }, r;
9357
9376
  }));
9358
- }, [S.currentPath, z]), o(() => {
9359
- At.current !== C.currentPath && (At.current = C.currentPath, ae((e) => {
9360
- let t = e.findIndex((e) => e.id === se);
9377
+ }, [C.currentPath, se]), o(() => {
9378
+ Mt.current !== w.currentPath && (Mt.current = w.currentPath, oe((e) => {
9379
+ let t = e.findIndex((e) => e.id === B);
9361
9380
  if (t < 0) return e;
9362
9381
  let n = e[t];
9363
- if (n?.type !== "filelist" || n.path === C.currentPath) return e;
9382
+ if (n?.type !== "filelist" || n.path === w.currentPath) return e;
9364
9383
  let r = [...e];
9365
9384
  return r[t] = {
9366
9385
  ...n,
9367
- path: C.currentPath
9386
+ path: w.currentPath
9368
9387
  }, r;
9369
9388
  }));
9370
- }, [C.currentPath, se]), o(() => {
9371
- if (!Oe) return;
9372
- let e = async (e, n, r) => {
9373
- let i = n?.currentPath ?? r;
9374
- i && (await t.fs.exists(i) || (i = await ao(t, i))), i ||= await t.utils.getHomePath(), await e.navigateTo(i);
9389
+ }, [w.currentPath, B]), o(() => {
9390
+ if (!je) return;
9391
+ let e = async (e, t, r) => {
9392
+ let i = t?.currentPath ?? r;
9393
+ i && (await n.fs.exists(i) || (i = await ao(n, i))), i ||= await n.utils.getHomePath(), await e.navigateTo(i);
9375
9394
  };
9376
- e(S, Ae), e(C, je), Me && T(Me), setTimeout(() => {
9377
- Re(void 0), ze(void 0), He(void 0);
9395
+ e(C, Me), e(w, Re), ze && E(ze), setTimeout(() => {
9396
+ He(void 0), Ue(void 0), Ke(void 0);
9378
9397
  }, 500);
9379
- }, [Oe]), ha({
9380
- settingsLoaded: Oe,
9398
+ }, [je]), ha({
9399
+ settingsLoaded: je,
9381
9400
  onRefreshPanels: () => {
9382
- Ye.current.refresh(), Qe.current.refresh();
9401
+ $e.current.refresh(), et.current.refresh();
9383
9402
  }
9384
9403
  });
9385
- let jt = i((e) => {
9386
- (Ue.current === "left" ? Ye.current : Qe.current).navigateTo(e);
9387
- }, []), Mt = lo({
9388
- activePanelCwd: w === "left" ? S.currentPath : C.currentPath,
9389
- onNavigatePanel: jt
9404
+ let Nt = i((e) => {
9405
+ (Ye.current === "left" ? $e.current : et.current).navigateTo(e);
9406
+ }, []), Pt = lo({
9407
+ activePanelCwd: T === "left" ? C.currentPath : w.currentPath,
9408
+ onNavigatePanel: Nt
9390
9409
  });
9391
- return $e.current = Mt.activeCwd, $a({
9392
- leftRef: Ye,
9393
- rightRef: Qe,
9394
- onPreviewInOppositePanel: Et,
9395
- onOpenCurrentFolderInOppositeCurrentTab: Ct,
9396
- onOpenCurrentFolderInOppositeNewTab: wt,
9397
- onOpenSelectedFolderInOppositeCurrentTab: G,
9398
- onOpenSelectedFolderInOppositeNewTab: K,
9399
- onOpenCreateFileConfirm: lt,
9400
- showDialog: h,
9401
- onViewFile: st,
9402
- onEditFile: ct,
9403
- onExecuteInTerminal: (e) => Mt.writeToTerminal(e),
9404
- editorFileSizeLimit: L
9410
+ return nt.current = Pt.activeCwd, $a({
9411
+ leftRef: $e,
9412
+ rightRef: et,
9413
+ onPreviewInOppositePanel: Ot,
9414
+ onOpenCurrentFolderInOppositeCurrentTab: G,
9415
+ onOpenCurrentFolderInOppositeNewTab: K,
9416
+ onOpenSelectedFolderInOppositeCurrentTab: Et,
9417
+ onOpenSelectedFolderInOppositeNewTab: Dt,
9418
+ onOpenCreateFileConfirm: dt,
9419
+ showDialog: g,
9420
+ onViewFile: lt,
9421
+ onEditFile: ut,
9422
+ onExecuteInTerminal: (e) => Pt.writeToTerminal(e),
9423
+ editorFileSizeLimit: re
9405
9424
  }), o(() => {
9406
- if (t.onReconnect) return t.onReconnect(() => {
9407
- Ye.current.navigateTo(Dt.current), Qe.current.navigateTo(Ot.current);
9425
+ let e = (e) => {
9426
+ let t = e;
9427
+ if (!t) return !1;
9428
+ let n = t.tagName?.toLowerCase();
9429
+ return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
9430
+ }, n = (n) => {
9431
+ let r = t.current, i = n.target;
9432
+ if (!r || !i || !r.contains(i) || e(i)) return;
9433
+ let a = A.current;
9434
+ a !== "panel" && a !== "viewer" && a !== "editor" || H.handleKeyboardEvent(n);
9435
+ };
9436
+ return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
9437
+ }, []), o(() => {
9438
+ if (n.onReconnect) return n.onReconnect(() => {
9439
+ $e.current.navigateTo(kt.current), et.current.navigateTo(At.current);
9408
9440
  });
9409
- }, []), !S.currentPath || !C.currentPath || !he ? /* @__PURE__ */ p("div", {
9441
+ }, []), !C.currentPath || !w.currentPath || !_e ? /* @__PURE__ */ p("div", {
9410
9442
  className: jo.loading,
9411
9443
  children: "Loading..."
9412
9444
  }) : /* @__PURE__ */ m("div", {
9445
+ ref: t,
9413
9446
  className: jo.app,
9414
9447
  children: [
9415
9448
  /* @__PURE__ */ m(f, { children: [
@@ -9419,23 +9452,23 @@ function Mo({ widget: e }) {
9419
9452
  className: U["terminal-background"],
9420
9453
  children: /* @__PURE__ */ p(oa, {})
9421
9454
  }), /* @__PURE__ */ m("div", {
9422
- className: F(wi, "panels-overlay", !E && "hidden"),
9455
+ className: F(wi, "panels-overlay", !D && "hidden"),
9423
9456
  children: [/* @__PURE__ */ p(Wi, {
9424
9457
  side: "left",
9425
- panel: S,
9426
- onRememberExpectedTerminalCwd: Mt.rememberExpectedTerminalCwd,
9427
- selectionKey: be,
9428
- requestedActiveName: bt,
9429
- initialPanelState: Ae,
9430
- onStateChange: (e, t) => St("left", e, t)
9458
+ panel: C,
9459
+ onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
9460
+ selectionKey: Se,
9461
+ requestedActiveName: St,
9462
+ initialPanelState: Me,
9463
+ onStateChange: (e, t) => wt("left", e, t)
9431
9464
  }), /* @__PURE__ */ p(Wi, {
9432
9465
  side: "right",
9433
- panel: C,
9434
- onRememberExpectedTerminalCwd: Mt.rememberExpectedTerminalCwd,
9435
- selectionKey: be,
9436
- requestedActiveName: xt,
9437
- initialPanelState: je,
9438
- onStateChange: (e, t) => St("right", e, t)
9466
+ panel: w,
9467
+ onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
9468
+ selectionKey: Se,
9469
+ requestedActiveName: Ct,
9470
+ initialPanelState: Re,
9471
+ onStateChange: (e, t) => wt("right", e, t)
9439
9472
  })]
9440
9473
  })]
9441
9474
  }),
@@ -9446,48 +9479,48 @@ function Mo({ widget: e }) {
9446
9479
  className: jo["status-bar"],
9447
9480
  children: [/* @__PURE__ */ p(tt, {}), e]
9448
9481
  }),
9449
- D && !ht && /* @__PURE__ */ p(pe, {
9482
+ O && !yt && /* @__PURE__ */ p(pe, {
9450
9483
  title: "No viewer",
9451
9484
  message: "No viewer extension found for this file type. Install viewer extensions (e.g. Image Viewer, File Viewer) from the extensions panel.",
9452
- onClose: () => O(null)
9485
+ onClose: () => k(null)
9453
9486
  }),
9454
- j && /* @__PURE__ */ p(Sn, {
9455
- extensionDirPath: j.dirPath,
9456
- entry: j.entry,
9457
- filePath: D?.path ?? "",
9458
- fileName: D?.name ?? "",
9459
- fileSize: D?.size ?? 0,
9460
- visible: D != null && ht != null,
9461
- onClose: () => O(null),
9462
- onExecuteCommand: pt
9463
- }, `viewer:${j.dirPath}:${j.entry}`),
9464
- k && !vt && /* @__PURE__ */ p(pe, {
9487
+ N && /* @__PURE__ */ p(wn, {
9488
+ extensionDirPath: N.dirPath,
9489
+ entry: N.entry,
9490
+ filePath: O?.path ?? "",
9491
+ fileName: O?.name ?? "",
9492
+ fileSize: O?.size ?? 0,
9493
+ visible: O != null && yt != null,
9494
+ onClose: () => k(null),
9495
+ onExecuteCommand: vt
9496
+ }, `viewer:${N.dirPath}:${N.entry}`),
9497
+ j && !bt && /* @__PURE__ */ p(pe, {
9465
9498
  title: "No editor",
9466
9499
  message: "No editor extension found for this file type. Install an editor extension (e.g. Monaco Editor) from the extensions panel.",
9467
- onClose: () => A(null)
9500
+ onClose: () => M(null)
9468
9501
  }),
9469
- N && (() => {
9470
- let e = me.flatMap((e) => e.languages ?? []), t = me.flatMap((e) => e.grammarRefs ?? []).map((e) => ({
9502
+ I && (() => {
9503
+ let e = ge.flatMap((e) => e.languages ?? []), t = ge.flatMap((e) => e.grammarRefs ?? []).map((e) => ({
9471
9504
  contribution: e.contribution,
9472
9505
  path: e.path
9473
9506
  }));
9474
- return /* @__PURE__ */ p(Cn, {
9475
- extensionDirPath: N.dirPath,
9476
- entry: N.entry,
9477
- filePath: k?.path ?? "",
9478
- fileName: k?.name ?? "",
9479
- langId: k?.langId ?? "plaintext",
9480
- visible: k != null && vt != null,
9481
- onClose: () => A(null),
9507
+ return /* @__PURE__ */ p(Tn, {
9508
+ extensionDirPath: I.dirPath,
9509
+ entry: I.entry,
9510
+ filePath: j?.path ?? "",
9511
+ fileName: j?.name ?? "",
9512
+ langId: j?.langId ?? "plaintext",
9513
+ visible: j != null && bt != null,
9514
+ onClose: () => M(null),
9482
9515
  languages: e,
9483
9516
  grammars: t
9484
- }, `editor:${N.dirPath}:${N.entry}`);
9517
+ }, `editor:${I.dirPath}:${I.entry}`);
9485
9518
  })(),
9486
- ee && /* @__PURE__ */ p(_r, {}),
9519
+ te && /* @__PURE__ */ p(yr, {}),
9487
9520
  /* @__PURE__ */ p(Ee, {}),
9488
9521
  /* @__PURE__ */ p(gt, {
9489
- open: Se.open,
9490
- onOpenChange: Se.setOpen
9522
+ open: we.open,
9523
+ onOpenChange: we.setOpen
9491
9524
  })
9492
9525
  ]
9493
9526
  });