@pstdio/workbench 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,82 @@
1
- import { jsxs as de, jsx as P } from "react/jsx-runtime";
2
- import { useRef as I, useState as He, useEffect as A, createElement as T } from "react";
3
- import { host as Ve } from "rimless";
4
- import { W as S } from "./icon-B9XolQG8.js";
5
- import { isLocalizedString as Fe, matchesResourceWhen as Le } from "@pstdio/sdk/extensions";
6
- import { w as Oe } from "./workbench-menu-paths-B_QJzcNU.js";
7
- const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ie = ["host.dispatchKeyboardEvent"], Ue = [...Ne, ...Ie], _e = new Set(Ue), ye = (e) => _e.has(e), qe = (e) => {
8
- const [t, r] = e.split("@"), o = r === void 0 ? X : Number(r);
1
+ import { jsxs as be, jsx as S } from "react/jsx-runtime";
2
+ import { useRef as I, useState as fe, useEffect as T, createElement as W } from "react";
3
+ import { host as _e } from "rimless";
4
+ import { W as j } from "./icon-B9XolQG8.js";
5
+ import { isLocalizedString as qe, matchesResourceWhen as ze } from "@pstdio/sdk/extensions";
6
+ import { w as Qe } from "./workbench-menu-paths-B_QJzcNU.js";
7
+ const te = 1, Ge = ["commands.execute", "resource.open", "notification.show", "notification.action", "notification.resolve", "notification.dismiss", "preferences.get", "preferences.set", "extension.settings.all", "extension.settings.get", "extension.settings.set", "extension.settings.delete", "terminal.session", "files.upload", "files.list", "files.delete"], Ee = ["host.dispatchKeyboardEvent"], Ye = [...Ge, ...Ee], Xe = new Set(Ye), xe = (e) => Xe.has(e), Je = (e) => {
8
+ const [t, r] = e.split("@"), n = r === void 0 ? te : Number(r);
9
9
  return {
10
10
  capability: e,
11
11
  name: t ?? "",
12
- version: o
12
+ version: n
13
13
  };
14
14
  }, V = (e) => ({
15
15
  capability: e,
16
16
  code: "unsupported_webview_capability",
17
17
  message: `Unsupported webview capability: ${e}`,
18
18
  severity: "error"
19
- }), ze = (e, t, r) => ({
19
+ }), Ze = (e, t, r) => ({
20
20
  capability: e,
21
21
  code: "unsupported_webview_capability_version",
22
- message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${X.toString()})`,
22
+ message: `Unsupported webview capability version: ${t}@${r.toString()} (supported: ${te.toString()})`,
23
23
  severity: "error"
24
- }), Qe = (e) => ({
24
+ }), et = (e) => ({
25
25
  capability: e,
26
26
  code: "undeclared_webview_capability",
27
27
  message: `Webview did not declare host capability: ${e}`,
28
28
  severity: "error"
29
- }), Ge = (e, t = {}) => {
30
- const r = [], o = /* @__PURE__ */ new Set();
31
- for (const n of Ie)
32
- t[n] && o.add(n);
33
- for (const n of e ?? []) {
34
- const s = qe(n);
35
- if (!ye(s.name)) {
36
- r.push(V(n));
29
+ }), tt = (e, t = {}) => {
30
+ const r = [], n = /* @__PURE__ */ new Set();
31
+ for (const o of Ee)
32
+ t[o] && n.add(o);
33
+ for (const o of e ?? []) {
34
+ const s = Je(o);
35
+ if (!xe(s.name)) {
36
+ r.push(V(o));
37
37
  continue;
38
38
  }
39
- if (s.version !== X) {
40
- r.push(ze(n, s.name, s.version));
39
+ if (s.version !== te) {
40
+ r.push(Ze(o, s.name, s.version));
41
41
  continue;
42
42
  }
43
43
  if (!t[s.name]) {
44
- r.push(V(n));
44
+ r.push(V(o));
45
45
  continue;
46
46
  }
47
- o.add(s.name);
47
+ n.add(s.name);
48
48
  }
49
49
  return {
50
- allowed: o,
50
+ allowed: n,
51
51
  diagnostics: r
52
52
  };
53
- }, Ye = (e) => {
53
+ }, rt = (e) => {
54
54
  const {
55
55
  allowed: t,
56
56
  diagnostics: r
57
- } = Ge(e.declaredCapabilities, e.capabilities), o = (n) => {
58
- e.onDiagnostic?.(n);
57
+ } = tt(e.declaredCapabilities, e.capabilities), n = (o) => {
58
+ e.onDiagnostic?.(o);
59
59
  };
60
60
  return {
61
61
  diagnostics: r,
62
- async call(n) {
63
- if (!ye(n.method)) {
64
- const a = V(n.method);
65
- throw o(a), new Error(a.message);
62
+ async call(o) {
63
+ if (!xe(o.method)) {
64
+ const i = V(o.method);
65
+ throw n(i), new Error(i.message);
66
66
  }
67
- if (!t.has(n.method)) {
68
- const a = Qe(n.method);
69
- throw o(a), new Error(a.message);
67
+ if (!t.has(o.method)) {
68
+ const i = et(o.method);
69
+ throw n(i), new Error(i.message);
70
70
  }
71
- const s = e.capabilities[n.method];
71
+ const s = e.capabilities[o.method];
72
72
  if (!s) {
73
- const a = V(n.method);
74
- throw o(a), new Error(a.message);
73
+ const i = V(o.method);
74
+ throw n(i), new Error(i.message);
75
75
  }
76
- return await s(n.params);
76
+ return await s(o.params);
77
77
  }
78
78
  };
79
- }, Xe = (e) => typeof e == "object" && e !== null, ce = (e) => {
79
+ }, nt = (e) => typeof e == "object" && e !== null, pe = (e) => {
80
80
  try {
81
81
  const t = JSON.stringify(e);
82
82
  if (typeof t == "string" && t.length > 0) return t;
@@ -87,7 +87,7 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
87
87
  } catch {
88
88
  return "Unknown error";
89
89
  }
90
- }, Je = (e) => {
90
+ }, ot = (e) => {
91
91
  if (e instanceof Error) return {
92
92
  message: e.message,
93
93
  stack: e.stack
@@ -95,7 +95,7 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
95
95
  if (typeof e == "string") return {
96
96
  message: e
97
97
  };
98
- if (Xe(e)) {
98
+ if (nt(e)) {
99
99
  const t = typeof e.message == "string" ? e.message : null, r = typeof e.stack == "string" ? e.stack : void 0;
100
100
  return t ? r ? {
101
101
  message: t,
@@ -103,42 +103,42 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
103
103
  } : {
104
104
  message: t
105
105
  } : {
106
- message: ce(e)
106
+ message: pe(e)
107
107
  };
108
108
  }
109
109
  return e == null ? {
110
110
  message: "Unknown error"
111
111
  } : {
112
- message: ce(e)
112
+ message: pe(e)
113
113
  };
114
- }, U = () => {
114
+ }, Q = () => {
115
115
  if (typeof document > "u") return {};
116
116
  const e = getComputedStyle(document.documentElement), t = {};
117
117
  for (let r = 0; r < e.length; r += 1) {
118
- const o = e.item(r);
119
- o.startsWith("--chakra-") && (t[o] = e.getPropertyValue(o).trim());
118
+ const n = e.item(r);
119
+ n.startsWith("--chakra-") && (t[n] = e.getPropertyValue(n).trim());
120
120
  }
121
121
  return t;
122
- }, _ = (e) => {
122
+ }, G = (e) => {
123
123
  if (typeof document > "u") return e;
124
124
  const t = document.documentElement.getAttribute("data-theme");
125
125
  if (t === "dark" || t === "light") return t;
126
126
  const r = document.documentElement.getAttribute("data-color-mode");
127
127
  return r === "dark" || r === "light" ? r : e;
128
- }, Ze = {
128
+ }, st = {
129
129
  border: 0,
130
130
  display: "block",
131
131
  flex: "1 1 0%",
132
132
  height: "100%",
133
133
  minHeight: 0,
134
134
  width: "100%"
135
- }, et = {
135
+ }, it = {
136
136
  display: "flex",
137
137
  height: "100%",
138
138
  minHeight: 0,
139
139
  position: "relative",
140
140
  width: "100%"
141
- }, tt = {
141
+ }, at = {
142
142
  alignItems: "center",
143
143
  background: "rgba(255, 255, 255, 0.92)",
144
144
  color: "#7a1f12",
@@ -149,151 +149,163 @@ const X = 1, Ne = ["commands.execute", "resource.open", "notification.show", "no
149
149
  position: "absolute",
150
150
  textAlign: "center",
151
151
  zIndex: 1
152
- }, rt = "allow-scripts allow-forms allow-popups", ot = (e) => {
152
+ }, dt = "allow-scripts allow-forms allow-popups", ct = (e) => {
153
153
  const {
154
154
  view: t,
155
155
  props: r,
156
- theme: o,
157
- capabilities: n,
156
+ theme: n,
157
+ capabilities: o,
158
158
  hostEvents: s,
159
- onReady: a,
159
+ onReady: i,
160
160
  onError: d,
161
161
  onDiagnostics: c,
162
162
  title: b
163
- } = e, i = I(null), l = I(null), u = I(!1), f = I(null), p = I(r), h = I(o), v = I(n), te = I(s), re = I(t.webview.capabilities), oe = I(a), B = I(d), ne = I(c), [se, D] = He(null);
164
- return p.current = r, h.current = o, v.current = n, te.current = s, re.current = t.webview.capabilities, oe.current = a, B.current = d, ne.current = c, A(() => {
165
- const w = i.current;
166
- if (!w) return;
167
- const C = `${t.webview.runtimeUrl}
163
+ } = e, a = I(null), l = I(null), m = I(!1), f = I(null), p = I(r), w = I(n), v = I(o), se = I(s), ie = I(t.webview.capabilities), ae = I(i), L = I(d), de = I(c), [ce, O] = fe(null), [q, le] = fe(0);
164
+ return p.current = r, w.current = n, v.current = o, se.current = s, ie.current = t.webview.capabilities, ae.current = i, L.current = d, de.current = c, T(() => {
165
+ const h = a.current;
166
+ if (!h) return;
167
+ const C = () => {
168
+ m.current && le((g) => g + 1);
169
+ };
170
+ h.addEventListener("load", C);
171
+ const E = () => h.removeEventListener("load", C), P = `${q}
172
+ ${t.webview.runtimeUrl}
168
173
  ${t.webview.moduleUrl}`;
169
- if (f.current === C) return;
170
- f.current = C, u.current = !1, l.current = null;
171
- const x = t.webview.styles, H = t.webview.moduleUrl, ie = (g) => {
172
- g.length > 0 && ne.current?.(g);
173
- }, ae = () => Ye({
174
+ if (f.current === P) return E;
175
+ f.current = P;
176
+ const Ve = t.webview.styles, Fe = t.webview.moduleUrl, me = (g) => {
177
+ g.length > 0 && de.current?.(g);
178
+ }, ue = () => rt({
174
179
  capabilities: v.current ?? {},
175
- declaredCapabilities: re.current,
176
- onDiagnostic: (g) => ie([g])
180
+ declaredCapabilities: ie.current,
181
+ onDiagnostic: (g) => me([g])
177
182
  });
178
- ie(ae().diagnostics);
179
- const $e = {
183
+ me(ue().diagnostics);
184
+ const Ne = {
180
185
  ready: () => {
181
186
  },
182
187
  runtimeError: (g) => {
183
- D(g.message), B.current?.(g);
188
+ O(g.message), L.current?.(g);
184
189
  },
185
- call: async (g) => await ae().call(g)
186
- }, Be = Ve.connect(w, $e);
187
- return w.contentWindow?.location.replace(t.webview.runtimeUrl), Be.then(async (g) => {
188
- const E = g.remote;
189
- l.current = E, te.current?.bind((De) => E.hostEvent?.(De)), await E.init({
190
- moduleUrl: H,
191
- styles: x,
192
- props: p.current,
193
- theme: _(h.current),
194
- themeVariables: U()
195
- }), u.current = !0, D(null), oe.current?.();
196
- }).catch((g) => {
197
- const E = Je(g);
198
- D(E.message), B.current?.(E);
199
- }), () => {
190
+ call: async (g) => await ue().call(g)
200
191
  };
201
- }, [t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), A(() => {
202
- const w = l.current;
203
- if (!(!w || !s))
204
- return s.bind((C) => w.hostEvent?.(C)), () => s.unbind();
205
- }, [s]), A(() => {
206
- u.current && l.current?.propsUpdate({
192
+ return (() => {
193
+ m.current = !1, l.current = null;
194
+ const g = _e.connect(h, Ne);
195
+ h.contentWindow?.location.replace(t.webview.runtimeUrl), g.then(async (z) => {
196
+ const x = z.remote;
197
+ l.current = x, se.current?.bind((Ue) => x.hostEvent?.(Ue)), await x.init({
198
+ moduleUrl: Fe,
199
+ styles: Ve,
200
+ props: p.current,
201
+ theme: G(w.current),
202
+ themeVariables: Q()
203
+ }), m.current = !0, O(null), ae.current?.();
204
+ }).catch((z) => {
205
+ const x = ot(z);
206
+ O(x.message), L.current?.(x);
207
+ });
208
+ })(), E;
209
+ }, [q, t.webview.runtimeUrl, t.webview.moduleUrl, t.webview.styles]), T(() => {
210
+ const h = l.current;
211
+ if (!(!h || !s))
212
+ return s.bind((C) => h.hostEvent?.(C)), () => s.unbind();
213
+ }, [s]), T(() => {
214
+ m.current && l.current?.propsUpdate({
207
215
  props: r
208
216
  });
209
- }, [r]), A(() => {
210
- u.current && l.current?.themeUpdate({
211
- theme: _(o),
212
- variables: U()
217
+ }, [r]), T(() => {
218
+ m.current && l.current?.themeUpdate({
219
+ theme: G(n),
220
+ variables: Q()
213
221
  });
214
- }, [o]), A(() => {
222
+ }, [n]), T(() => {
215
223
  if (typeof window > "u" || typeof MutationObserver > "u") return;
216
- let w = null;
224
+ let h = null;
217
225
  const C = () => {
218
- w !== null && cancelAnimationFrame(w), w = requestAnimationFrame(() => {
219
- w = null, u.current && l.current?.themeUpdate({
220
- theme: _(h.current),
221
- variables: U()
226
+ h !== null && cancelAnimationFrame(h), h = requestAnimationFrame(() => {
227
+ h = null, m.current && l.current?.themeUpdate({
228
+ theme: G(w.current),
229
+ variables: Q()
222
230
  });
223
231
  });
224
- }, x = new MutationObserver(C), H = {
232
+ }, E = new MutationObserver(C), P = {
225
233
  attributeFilter: ["class", "data-color-mode", "data-theme", "style"],
226
234
  attributes: !0
227
235
  };
228
- return x.observe(document.documentElement, H), x.observe(document.body, H), () => {
229
- x.disconnect(), w !== null && cancelAnimationFrame(w);
236
+ return E.observe(document.documentElement, P), E.observe(document.body, P), () => {
237
+ E.disconnect(), h !== null && cancelAnimationFrame(h);
230
238
  };
231
- }, []), /* @__PURE__ */ de("div", { style: et, children: [
232
- se ? /* @__PURE__ */ P("div", { role: "alert", style: tt, children: /* @__PURE__ */ de("div", { children: [
233
- /* @__PURE__ */ P("strong", { children: "Extension view failed to load." }),
234
- /* @__PURE__ */ P("div", { children: se })
239
+ }, []), /* @__PURE__ */ be("div", { style: it, children: [
240
+ ce ? /* @__PURE__ */ S("div", { role: "alert", style: at, children: /* @__PURE__ */ be("div", { children: [
241
+ /* @__PURE__ */ S("strong", { children: "Extension view failed to load." }),
242
+ /* @__PURE__ */ S("div", { children: ce })
235
243
  ] }) }) : null,
236
- /* @__PURE__ */ P(
244
+ /* @__PURE__ */ S(
237
245
  "iframe",
238
246
  {
239
- ref: i,
247
+ ref: a,
240
248
  title: b ?? t.label,
241
249
  allow: "fullscreen",
242
250
  allowFullScreen: !0,
243
- sandbox: rt,
251
+ sandbox: dt,
244
252
  style: {
245
- ...Ze,
246
- colorScheme: o
253
+ ...st,
254
+ colorScheme: n
255
+ },
256
+ onLoad: () => {
257
+ m.current && le((h) => h + 1);
247
258
  },
248
259
  onError: () => {
249
- const w = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
250
- D(w), B.current?.({
251
- message: w
260
+ const h = `Failed to load extension runtime at ${t.webview.runtimeUrl}`;
261
+ O(h), L.current?.({
262
+ message: h
252
263
  });
253
264
  }
254
- }
265
+ },
266
+ q
255
267
  )
256
268
  ] });
257
- }, nt = () => {
269
+ }, lt = () => {
258
270
  let e = null;
259
271
  const t = [], r = /* @__PURE__ */ new Set();
260
272
  return {
261
- emit(o) {
262
- e ? e(o) : t.push(o);
273
+ emit(n) {
274
+ e ? e(n) : t.push(n);
263
275
  },
264
- bind(o) {
265
- for (e = o; t.length > 0; ) o(t.shift());
276
+ bind(n) {
277
+ for (e = n; t.length > 0; ) n(t.shift());
266
278
  },
267
- onDisconnect(o) {
268
- return r.add(o), () => r.delete(o);
279
+ onDisconnect(n) {
280
+ return r.add(n), () => r.delete(n);
269
281
  },
270
282
  unbind() {
271
283
  e = null;
272
- for (const o of r) o();
284
+ for (const n of r) n();
273
285
  }
274
286
  };
275
- }, st = "terminal.session", it = (e) => {
287
+ }, mt = "terminal.session", ut = (e) => {
276
288
  const {
277
289
  terminal: t,
278
290
  hostEvents: r
279
- } = e, o = (n) => {
291
+ } = e, n = (o) => {
280
292
  r.emit({
281
- scope: st,
282
- payload: n
293
+ scope: mt,
294
+ payload: o
283
295
  });
284
296
  };
285
- return async (n) => {
286
- const s = n;
297
+ return async (o) => {
298
+ const s = o;
287
299
  switch (s.operation) {
288
300
  case "open": {
289
301
  const {
290
- sessionId: a
302
+ sessionId: i
291
303
  } = await t.open({
292
304
  request: s.request
293
305
  });
294
306
  return {
295
307
  operation: "open",
296
- sessionId: a
308
+ sessionId: i
297
309
  };
298
310
  }
299
311
  case "write":
@@ -323,36 +335,36 @@ ${t.webview.moduleUrl}`;
323
335
  };
324
336
  case "subscribe": {
325
337
  const {
326
- sessionId: a
338
+ sessionId: i
327
339
  } = s;
328
340
  let d = () => {
329
341
  }, c = () => {
330
342
  }, b = !1;
331
- const i = () => {
343
+ const a = () => {
332
344
  b || (b = !0, d(), c());
333
345
  };
334
- return d = t.subscribe(a, {
335
- onData: (l) => o({
336
- sessionId: a,
346
+ return d = t.subscribe(i, {
347
+ onData: (l) => n({
348
+ sessionId: i,
337
349
  kind: "data",
338
350
  chunk: l
339
351
  }),
340
352
  onExit: (l) => {
341
- o({
342
- sessionId: a,
353
+ n({
354
+ sessionId: i,
343
355
  kind: "exit",
344
356
  code: l.code,
345
357
  signal: l.signal
346
- }), i();
358
+ }), a();
347
359
  }
348
- }), c = r.onDisconnect(i), {
360
+ }), c = r.onDisconnect(a), {
349
361
  operation: "subscribe",
350
362
  accepted: !0
351
363
  };
352
364
  }
353
365
  }
354
366
  };
355
- }, at = (e) => {
367
+ }, bt = (e) => {
356
368
  if (typeof document > "u") return;
357
369
  const t = new KeyboardEvent("keydown", {
358
370
  ...e,
@@ -360,7 +372,7 @@ ${t.webview.moduleUrl}`;
360
372
  cancelable: !0
361
373
  });
362
374
  document.dispatchEvent(t);
363
- }, ve = (e) => ({
375
+ }, Ae = (e) => ({
364
376
  "commands.execute": (t) => {
365
377
  const r = t;
366
378
  return e.workbench.commands.executeCommand(r.commandId, r.params);
@@ -391,79 +403,79 @@ ${t.webview.moduleUrl}`;
391
403
  value: r.value
392
404
  };
393
405
  },
394
- "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? at)(t),
406
+ "host.dispatchKeyboardEvent": (t) => (e.dispatchKeyboardEvent ?? bt)(t),
395
407
  ...e.hostEvents ? {
396
- "terminal.session": it({
408
+ "terminal.session": ut({
397
409
  terminal: e.workbench.terminal,
398
410
  hostEvents: e.hostEvents
399
411
  })
400
412
  } : {}
401
- }), dt = (e, t) => {
413
+ }), ft = (e, t) => {
402
414
  for (const r of t)
403
415
  console.warn(`[workbench.webview:${e}] ${r.code}/${r.capability}: ${r.message}`);
404
- }, ct = (e, t) => {
416
+ }, pt = (e, t) => {
405
417
  console.error(`[workbench.webview:${e}] runtime error: ${t}`);
406
- }, W = "webview:bridge", lt = (e) => {
418
+ }, K = "webview:bridge", ht = (e) => {
407
419
  if (typeof e != "object" || e === null || Array.isArray(e)) return !1;
408
420
  const t = e;
409
421
  return typeof t.runtimeUrl == "string" && typeof t.moduleUrl == "string";
410
- }, mt = ({
422
+ }, wt = ({
411
423
  placement: e
412
424
  }) => ({
413
425
  placement: e,
414
426
  resource: e.resource
415
- }), ke = () => "light", le = /* @__PURE__ */ new WeakMap(), Re = (e, t) => {
416
- let r = le.get(e);
417
- r || (r = /* @__PURE__ */ new Map(), le.set(e, r));
418
- const o = t.instanceId;
419
- let n = r.get(o);
420
- return n || (n = nt(), r.set(o, n)), n;
421
- }, Ce = (e) => {
427
+ }), Pe = () => "light", he = /* @__PURE__ */ new WeakMap(), Te = (e, t) => {
428
+ let r = he.get(e);
429
+ r || (r = /* @__PURE__ */ new Map(), he.set(e, r));
430
+ const n = t.instanceId;
431
+ let o = r.get(n);
432
+ return o || (o = lt(), r.set(n, o)), o;
433
+ }, Se = (e) => {
422
434
  const {
423
435
  context: t,
424
436
  createHostCapabilities: r,
425
- createProps: o,
426
- createTheme: n = ke,
437
+ createProps: n,
438
+ createTheme: o = Pe,
427
439
  ownerId: s,
428
- title: a,
440
+ title: i,
429
441
  webview: d
430
442
  } = e;
431
- return /* @__PURE__ */ P(ot, { view: {
443
+ return /* @__PURE__ */ S(ct, { view: {
432
444
  extensionId: s ?? "workbench",
433
445
  id: t.webviewId,
434
- label: d.title ?? a,
446
+ label: d.title ?? i,
435
447
  webview: {
436
448
  capabilities: d.capabilities,
437
449
  moduleUrl: d.moduleUrl,
438
450
  runtimeUrl: d.runtimeUrl,
439
451
  styles: d.styles ?? []
440
452
  }
441
- }, props: o(t), theme: n(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (c) => dt(t.webviewId, c), onError: (c) => ct(t.webviewId, c.message) });
442
- }, ut = (e, t, r, o) => {
453
+ }, props: n(t), theme: o(t), capabilities: r(t), hostEvents: t.hostEvents, onDiagnostics: (c) => ft(t.webviewId, c), onError: (c) => pt(t.webviewId, c.message) });
454
+ }, gt = (e, t, r, n) => {
443
455
  const {
444
- workbench: n,
456
+ workbench: o,
445
457
  panel: s,
446
- instance: a
447
- } = e, d = lt(s.config) ? s.config : null;
448
- return d ? Ce({
458
+ instance: i
459
+ } = e, d = ht(s.config) ? s.config : null;
460
+ return d ? Se({
449
461
  context: {
450
- workbench: n,
451
- webviewId: a.panelId,
452
- placement: a,
453
- hostEvents: Re(n, a)
462
+ workbench: o,
463
+ webviewId: i.panelId,
464
+ placement: i,
465
+ hostEvents: Te(o, i)
454
466
  },
455
467
  createHostCapabilities: t,
456
468
  createProps: r,
457
- createTheme: o,
469
+ createTheme: n,
458
470
  ownerId: "ownerId" in s ? s.ownerId : void 0,
459
471
  title: s.title,
460
472
  webview: d
461
473
  }) : null;
462
- }, bt = (e = {}) => {
463
- const t = e.createHostCapabilities ?? ve, r = e.createProps ?? mt, o = e.createTheme ?? ke;
474
+ }, It = (e = {}) => {
475
+ const t = e.createHostCapabilities ?? Ae, r = e.createProps ?? wt, n = e.createTheme ?? Pe;
464
476
  return {
465
- id: W,
466
- render: (n) => ut(n, t, r, o)
477
+ id: K,
478
+ render: (o) => gt(o, t, r, n)
467
479
  };
468
480
  }, y = (e, t) => ({
469
481
  id: e,
@@ -495,12 +507,12 @@ y("workspace.headerPrimary", {
495
507
  }), y("workspace.sidenav", {
496
508
  kind: "panel"
497
509
  });
498
- const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", m = (e, t = "") => e === void 0 ? t : ft(e) ? e.default ?? e.$l10n : e, L = (e) => {
510
+ const yt = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e.$l10n == "string", u = (e, t = "") => e === void 0 ? t : yt(e) ? e.default ?? e.$l10n : e, N = (e) => {
499
511
  const t = e;
500
512
  if (!t?.outcome) return e;
501
513
  if (t.outcome.status === "success") return t.outcome.value;
502
514
  throw new Error(t.outcome.reason ?? t.outcome.error?.message ?? "Extension command failed.");
503
- }, J = (e) => {
515
+ }, re = (e) => {
504
516
  if (e)
505
517
  return {
506
518
  type: e.kind,
@@ -508,13 +520,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
508
520
  label: e.label,
509
521
  metadata: e.metadata
510
522
  };
511
- }, O = (e) => ({
523
+ }, U = (e) => ({
512
524
  kind: e.type,
513
525
  uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
514
526
  id: e.id,
515
527
  label: e.label,
516
528
  metadata: e.metadata
517
- }), j = (e) => ({
529
+ }), M = (e) => ({
518
530
  id: e.id,
519
531
  kind: e.kind,
520
532
  context: {
@@ -522,13 +534,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
522
534
  ...e.context ?? {}
523
535
  }
524
536
  }), k = async (e, t, r = {}) => {
525
- const o = J(r.resource), n = await e.executeCommand(t, {
537
+ const n = re(r.resource), o = await e.executeCommand(t, {
526
538
  projectId: e.projectId,
527
539
  ...r.params ? {
528
540
  params: r.params
529
541
  } : {},
530
- ...o ? {
531
- resource: o
542
+ ...n ? {
543
+ resource: n
532
544
  } : {},
533
545
  ...r.slot ? {
534
546
  slot: r.slot
@@ -538,168 +550,189 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
538
550
  metadata: r.metadata
539
551
  } : {}
540
552
  });
541
- return L(n);
542
- }, pt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), ht = (e) => typeof e == "string" ? e : e?.id, wt = async (e, t) => {
553
+ return N(o);
554
+ }, vt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), kt = (e) => typeof e == "string" ? e : e?.id, Rt = async (e, t) => {
543
555
  if (t.kind === "resource" && t.resource) {
544
- await e.workbench.resources.openResource(O(t.resource), {
556
+ await e.workbench.resources.openResource(U(t.resource), {
545
557
  replaceActive: !0
546
558
  }).catch(() => {
547
559
  });
548
560
  return;
549
561
  }
550
- const r = ht(t.command);
562
+ const r = kt(t.command);
551
563
  r && (await k(e, r, {
552
564
  params: t.params
553
565
  }), e.workbench.commandPaletteResources.refresh());
554
- }, gt = (e, t, r, o) => ({
555
- id: `${t.id}:${o.id}`,
556
- label: o.label,
557
- description: o.description,
558
- icon: o.icon,
559
- keywords: o.keywords,
566
+ }, Ct = (e, t, r, n) => ({
567
+ id: `${t.id}:${n.id}`,
568
+ label: n.label,
569
+ description: n.description,
570
+ icon: n.icon,
571
+ keywords: n.keywords,
560
572
  group: r,
561
- activate: () => wt(e, o.target)
562
- }), It = (e, t) => {
573
+ activate: () => Rt(e, n.target)
574
+ }), Et = (e, t) => {
563
575
  const r = [];
564
- for (const o of t) {
565
- const n = m(o.title, o.id);
576
+ for (const n of t) {
577
+ const o = u(n.title, n.id);
566
578
  r.push(e.workbench.commandPaletteResources.registerProvider({
567
- id: o.id,
568
- title: n,
569
- refreshEventIds: o.refreshEventIds,
579
+ id: n.id,
580
+ title: o,
581
+ refreshEventIds: n.refreshEventIds,
570
582
  query: async ({
571
583
  query: s,
572
- limit: a
584
+ limit: i
573
585
  }) => {
574
- const d = e.workbench.getActiveResource(), c = await k(e, o.queryCommandId, {
586
+ const d = e.workbench.getActiveResource(), c = await k(e, n.queryCommandId, {
575
587
  params: {
576
588
  projectId: e.projectId,
577
589
  modeId: e.workbench.modes.getActiveModeId(),
578
- activeResource: J(d),
579
- providerId: o.id,
590
+ activeResource: re(d),
591
+ providerId: n.id,
580
592
  query: s,
581
- limit: a
593
+ limit: i
582
594
  }
583
595
  });
584
- return pt(c) ? (c.items ?? []).map((b) => gt(e, o, n, b)) : [];
596
+ return vt(c) ? (c.items ?? []).map((b) => Ct(e, n, o, b)) : [];
585
597
  }
586
598
  }));
587
599
  }
588
600
  return {
589
601
  dispose() {
590
- for (let o = r.length - 1; o >= 0; o -= 1) r[o]?.dispose();
602
+ for (let n = r.length - 1; n >= 0; n -= 1) r[n]?.dispose();
591
603
  }
592
604
  };
593
- }, N = (e) => ({
594
- title: m(e.title),
605
+ }, _ = (e) => ({
606
+ title: u(e.title),
595
607
  runtimeUrl: e.runtimeUrl,
596
608
  moduleUrl: e.moduleUrl,
597
609
  styles: e.styles,
598
610
  capabilities: e.capabilities
599
- }), K = (e) => e ? {
611
+ }), D = (e) => e ? {
600
612
  resourceKinds: e.resourceKinds ? [...e.resourceKinds] : void 0
601
- } : void 0, yt = (e) => {
602
- const t = e.treeRendererId ?? e.fileRendererId ?? e.controlsRendererId ?? e.dataTableRendererId ?? (e.webview ? W : void 0);
613
+ } : void 0, xt = {
614
+ first: 1e6,
615
+ default: 0,
616
+ last: -1e6
617
+ }, A = (e) => ({
618
+ priority: xt[e.placement ?? "default"] - (e.declarationIndex ?? 0)
619
+ }), $ = (e) => {
620
+ const t = [];
621
+ let r = 0;
622
+ for (const n of e)
623
+ t.push(r), r += n.panelMenus?.length ?? 0;
624
+ return t;
625
+ }, At = (e) => {
626
+ const t = e.treeRendererId ?? e.fileRendererId ?? e.controlsRendererId ?? e.dataTableRendererId ?? (e.webview ? K : void 0);
603
627
  if (!t) throw new Error(`Panel Menu has no renderer: ${e.id}`);
604
628
  return t;
605
- }, M = (e) => e?.map((t) => ({
606
- id: t.id,
607
- title: m(t.title, t.id),
608
- side: t.side,
609
- rendererId: yt(t),
610
- config: t.webview ? N(t.webview) : void 0
611
- })), $ = (e) => e.workbench.layout.registerPanel(e.contribution), q = (e, t = "") => m(e, t), vt = (e) => !!e && typeof e == "object" && !Array.isArray(e), kt = (e, t, r) => {
612
- const o = (n, s, a) => n ? k(e, n, {
629
+ }, B = (e, t = 0) => e?.map((r, n) => ({
630
+ id: r.id,
631
+ title: u(r.title, r.id),
632
+ side: r.side,
633
+ rendererId: At(r),
634
+ config: r.webview ? _(r.webview) : void 0,
635
+ ...A({
636
+ placement: r.placement,
637
+ declarationIndex: t + n
638
+ })
639
+ })), H = (e) => e.workbench.layout.registerPanel(e.contribution), Y = (e, t = "") => u(e, t), Pt = (e) => !!e && typeof e == "object" && !Array.isArray(e), Tt = (e, t, r) => {
640
+ const n = (o, s, i) => o ? k(e, o, {
613
641
  params: s,
614
- resource: a
642
+ resource: i
615
643
  }) : Promise.resolve(void 0);
616
644
  return e.workbench.renderers.registerControlsRenderer({
617
645
  id: t.id,
618
- title: q(t.title, t.id),
619
- emptyTitle: q(t.emptyTitle, ""),
620
- emptyDescription: q(t.emptyDescription, ""),
646
+ title: Y(t.title, t.id),
647
+ emptyTitle: Y(t.emptyTitle, ""),
648
+ emptyDescription: Y(t.emptyDescription, ""),
621
649
  defaultValues: t.defaultValues,
622
- executeQuery: async (n) => {
623
- const s = await o(t.queryCommandId, {}, n ?? r.resolveResource?.(t));
624
- return vt(s) ? s : {};
650
+ executeQuery: async (o) => {
651
+ const s = await n(t.queryCommandId, {}, o ?? r.resolveResource?.(t));
652
+ return Pt(s) ? s : {};
625
653
  },
626
654
  updateValue: t.updateValueCommandId ? ({
627
- controlId: n,
655
+ controlId: o,
628
656
  value: s,
629
- values: a,
657
+ values: i,
630
658
  resource: d
631
- }) => o(t.updateValueCommandId, {
632
- controlId: n,
659
+ }) => n(t.updateValueCommandId, {
660
+ controlId: o,
633
661
  value: s,
634
- values: a
662
+ values: i
635
663
  }, d).then(() => {
636
664
  }) : void 0,
637
665
  apply: t.applyCommandId ? ({
638
- values: n,
666
+ values: o,
639
667
  resource: s
640
- }) => o(t.applyCommandId, {
641
- values: n
668
+ }) => n(t.applyCommandId, {
669
+ values: o
642
670
  }, s).then(() => {
643
671
  }) : void 0,
644
672
  reset: t.resetCommandId ? ({
645
- controlIds: n,
673
+ controlIds: o,
646
674
  resource: s
647
- }) => o(t.resetCommandId, {
648
- controlIds: n
675
+ }) => n(t.resetCommandId, {
676
+ controlIds: o
649
677
  }, s).then(() => {
650
678
  }) : void 0
651
679
  });
652
- }, Rt = (e, t) => {
680
+ }, St = (e, t, r, n) => {
653
681
  if (t.controlsRendererId)
654
- return $({
682
+ return H({
655
683
  workbench: e.workbench,
656
684
  contribution: {
657
685
  id: t.id,
658
- title: m(t.title, t.id),
686
+ title: u(t.title, t.id),
687
+ icon: t.icon,
659
688
  region: t.region,
660
689
  closable: t.closable,
661
690
  rendererId: t.controlsRendererId,
662
691
  singleton: !0,
663
692
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
664
- eligibleLocations: K(t.eligibleLocations),
665
- panelMenus: M(t.panelMenus)
693
+ eligibleLocations: D(t.eligibleLocations),
694
+ panelMenus: B(t.panelMenus, n),
695
+ ...A({
696
+ placement: t.placement,
697
+ declarationIndex: r
698
+ })
666
699
  }
667
700
  });
668
- }, oo = (e, t, r, o = {}) => {
669
- const n = [];
670
- for (const s of t) n.push(kt(e, s, o));
671
- for (const s of r) {
672
- const a = Rt(e, s);
673
- a && n.push(a);
674
- }
675
- return {
701
+ }, un = (e, t, r, n = {}) => {
702
+ const o = [];
703
+ for (const i of t) o.push(Tt(e, i, n));
704
+ const s = $(r);
705
+ return r.forEach((i, d) => {
706
+ const c = St(e, i, d, s[d]);
707
+ c && o.push(c);
708
+ }), {
676
709
  dispose() {
677
- for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
710
+ for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
678
711
  }
679
712
  };
680
- }, R = (e, t = "") => m(e, t), me = (e) => ({
713
+ }, R = (e, t = "") => u(e, t), we = (e) => ({
681
714
  ...e,
682
715
  label: R(e.label, e.id),
683
716
  description: e.description ? R(e.description) : void 0,
684
- icon: e.icon ? T(S, {
717
+ icon: e.icon ? W(j, {
685
718
  name: e.icon,
686
719
  size: 14
687
720
  }) : void 0
688
- }), Ct = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), Et = (e) => ({
721
+ }), Wt = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), jt = (e) => ({
689
722
  id: e.id,
690
723
  values: e.values,
691
- resource: e.resource ? O(e.resource) : void 0
692
- }), xt = (e, t) => {
693
- const r = j({
724
+ resource: e.resource ? U(e.resource) : void 0
725
+ }), Kt = (e, t) => {
726
+ const r = M({
694
727
  id: t.id,
695
728
  kind: "dataTableRenderer",
696
729
  projectId: e.projectId,
697
730
  context: {
698
731
  dataTableRendererId: t.id
699
732
  }
700
- }), o = (n, s, a) => k(e, n, {
733
+ }), n = (o, s, i) => k(e, o, {
701
734
  params: s,
702
- resource: a,
735
+ resource: i,
703
736
  slot: r,
704
737
  metadata: {
705
738
  dataTableRendererId: t.id
@@ -709,93 +742,98 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
709
742
  id: t.id,
710
743
  title: R(t.title, t.id),
711
744
  resourceKind: t.resourceKind,
712
- columns: t.columns?.map(me),
745
+ columns: t.columns?.map(we),
713
746
  initialPageSize: t.initialPageSize,
714
747
  pageSizeOptions: t.pageSizeOptions,
715
748
  selectionMode: t.selectionMode,
716
- selectionActions: t.selectionActions?.map((n) => ({
717
- id: n.id,
718
- label: R(n.label, n.id),
719
- icon: n.icon ? T(S, {
720
- name: n.icon,
749
+ selectionActions: t.selectionActions?.map((o) => ({
750
+ id: o.id,
751
+ label: R(o.label, o.id),
752
+ icon: o.icon ? W(j, {
753
+ name: o.icon,
721
754
  size: 16
722
755
  }) : void 0,
723
- destructive: n.destructive,
724
- run: (s) => o(n.commandId, {
725
- rowIds: s.map((a) => a.id)
756
+ destructive: o.destructive,
757
+ run: (s) => n(o.commandId, {
758
+ rowIds: s.map((i) => i.id)
726
759
  }).then(() => {
727
760
  })
728
761
  })),
729
762
  emptyTitle: t.emptyTitle ? R(t.emptyTitle) : void 0,
730
763
  emptyDescription: t.emptyDescription ? R(t.emptyDescription) : void 0,
731
764
  executeQuery: async ({
732
- resource: n,
765
+ resource: o,
733
766
  modeId: s
734
767
  }) => {
735
- const a = await o(t.queryCommandId, {
768
+ const i = await n(t.queryCommandId, {
736
769
  rendererId: t.id,
737
770
  projectId: e.projectId,
738
771
  modeId: s,
739
- resource: n ? {
740
- type: n.kind,
741
- id: n.id ?? n.uri,
742
- label: n.label,
743
- metadata: n.metadata
772
+ resource: o ? {
773
+ type: o.kind,
774
+ id: o.id ?? o.uri,
775
+ label: o.label,
776
+ metadata: o.metadata
744
777
  } : void 0
745
- }, n);
746
- return Ct(a) ? {
747
- rows: a.rows.map(Et),
748
- columns: a.columns?.map(me)
778
+ }, o);
779
+ return Wt(i) ? {
780
+ rows: i.rows.map(jt),
781
+ columns: i.columns?.map(we)
749
782
  } : {
750
783
  rows: []
751
784
  };
752
785
  },
753
- rowActions: t.rowActions?.map((n) => ({
754
- id: n.id,
755
- label: R(n.label, n.id),
756
- icon: n.icon ? T(S, {
757
- name: n.icon,
786
+ rowActions: t.rowActions?.map((o) => ({
787
+ id: o.id,
788
+ label: R(o.label, o.id),
789
+ icon: o.icon ? W(j, {
790
+ name: o.icon,
758
791
  size: 16
759
792
  }) : void 0,
760
- destructive: n.destructive,
761
- run: (s) => o(n.commandId, {
762
- rowId: s.id
763
- }, s.resource).then(() => {
764
- })
793
+ destructive: o.destructive,
794
+ run: async (s) => {
795
+ await n(o.commandId, {
796
+ rowId: s.id
797
+ }, s.resource), e.workbench.renderers.refreshDataTableRenderer(t.id);
798
+ }
765
799
  }))
766
800
  });
767
- }, At = (e, t) => {
801
+ }, Mt = (e, t, r, n) => {
768
802
  if (t.dataTableRendererId)
769
- return $({
803
+ return H({
770
804
  workbench: e.workbench,
771
805
  contribution: {
772
806
  id: t.id,
773
- title: m(t.title, t.id),
807
+ title: u(t.title, t.id),
808
+ icon: t.icon,
774
809
  region: t.region,
775
810
  closable: t.closable,
776
811
  rendererId: t.dataTableRendererId,
777
812
  singleton: !0,
778
813
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
779
- eligibleLocations: K(t.eligibleLocations),
780
- panelMenus: M(t.panelMenus)
814
+ eligibleLocations: D(t.eligibleLocations),
815
+ panelMenus: B(t.panelMenus, n),
816
+ ...A({
817
+ placement: t.placement,
818
+ declarationIndex: r
819
+ })
781
820
  }
782
821
  });
783
- }, Pt = (e, t, r) => {
784
- const o = t.map((n) => xt(e, n));
785
- for (const n of r) {
786
- const s = At(e, n);
787
- s && o.push(s);
788
- }
789
- return {
822
+ }, Dt = (e, t, r) => {
823
+ const n = t.map((s) => Kt(e, s)), o = $(r);
824
+ return r.forEach((s, i) => {
825
+ const d = Mt(e, s, i, o[i]);
826
+ d && n.push(d);
827
+ }), {
790
828
  dispose() {
791
- for (let n = o.length - 1; n >= 0; n -= 1) o[n]?.dispose();
829
+ for (let s = n.length - 1; s >= 0; s -= 1) n[s]?.dispose();
792
830
  }
793
831
  };
794
- }, Tt = {
832
+ }, $t = {
795
833
  first: 0,
796
834
  default: 1,
797
835
  last: 2
798
- }, no = {
836
+ }, bn = {
799
837
  commands: [],
800
838
  commandPaletteContributions: [],
801
839
  diagnostics: [],
@@ -812,112 +850,112 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
812
850
  settingsDefinitions: [],
813
851
  treeItems: [],
814
852
  panels: []
815
- }, St = (e) => `workbench.extension.menu.${e.id}`, Wt = (e) => `workbench.extension.palette.${e.id}`, Ee = (e, t) => Tt[e.placement ?? "default"] * 1e3 + t, xe = (e) => e === void 0 ? "" : Fe(e) ? e.default ?? e.$l10n : e, jt = (e) => {
853
+ }, Bt = (e) => `workbench.extension.menu.${e.id}`, Ht = (e) => `workbench.extension.palette.${e.id}`, We = (e, t) => $t[e.placement ?? "default"] * 1e3 + t, je = (e) => e === void 0 ? "" : qe(e) ? e.default ?? e.$l10n : e, Lt = (e) => {
816
854
  const {
817
855
  commandId: t,
818
856
  contribution: r,
819
- index: o,
820
- resolveString: n,
857
+ index: n,
858
+ resolveString: o,
821
859
  slot: s,
822
- when: a
860
+ when: i
823
861
  } = e;
824
862
  return {
825
863
  commandId: t,
826
864
  sourceCommandId: r.commandId,
827
- label: n(r.label, r.extensionId),
865
+ label: o(r.label, r.extensionId),
828
866
  icon: r.icon,
829
867
  group: s.group ?? r.group,
830
868
  overflowLabel: s.overflowLabel,
831
- order: Ee(r, o),
832
- when: a
869
+ order: We(r, n),
870
+ when: i
833
871
  };
834
- }, Kt = (e) => {
872
+ }, Ot = (e) => {
835
873
  const {
836
874
  commandId: t,
837
875
  contribution: r,
838
- index: o,
839
- resolveString: n
876
+ index: n,
877
+ resolveString: o
840
878
  } = e;
841
879
  return {
842
880
  commandId: t,
843
- label: n(r.label, r.extensionId),
881
+ label: o(r.label, r.extensionId),
844
882
  icon: r.icon,
845
883
  group: r.group,
846
- order: Ee(r, o)
884
+ order: We(r, n)
847
885
  };
848
- }, Mt = (e) => {
886
+ }, Vt = (e) => {
849
887
  const {
850
- createCommandId: t = St,
888
+ createCommandId: t = Bt,
851
889
  createWhenExpression: r,
852
- menuSlotsById: o,
853
- menuTargetsById: n,
890
+ menuSlotsById: n,
891
+ menuTargetsById: o,
854
892
  metadata: s,
855
- resolveString: a = xe
893
+ resolveString: i = je
856
894
  } = e, d = [];
857
895
  return s.menuContributions.forEach((c, b) => {
858
- const i = c.target ? n?.get(c.target) : o.get(c.slotId);
859
- if (!i) return;
860
- const l = t(c), u = s.commands.find((f) => f.id === c.commandId);
896
+ const a = c.target ? o?.get(c.target) : n.get(c.slotId);
897
+ if (!a) return;
898
+ const l = t(c), m = s.commands.find((f) => f.id === c.commandId);
861
899
  d.push({
862
900
  command: {
863
901
  id: l,
864
- label: a(c.label, c.extensionId),
902
+ label: i(c.label, c.extensionId),
865
903
  category: c.group,
866
- description: u ? a(u.description, u.extensionId) : void 0,
904
+ description: m ? i(m.description, m.extensionId) : void 0,
867
905
  icon: c.icon,
868
- params: u?.params
906
+ params: m?.params
869
907
  },
870
908
  contribution: c,
871
- menuItem: jt({
909
+ menuItem: Lt({
872
910
  commandId: l,
873
911
  contribution: c,
874
912
  index: b,
875
- resolveString: a,
876
- slot: i,
913
+ resolveString: i,
914
+ slot: a,
877
915
  when: r?.(c)
878
916
  }),
879
- menuPath: i.menuPath,
917
+ menuPath: a.menuPath,
880
918
  targetCommandId: c.commandId
881
919
  });
882
920
  }), d;
883
- }, $t = (e) => {
921
+ }, Ft = (e) => {
884
922
  const {
885
- createCommandId: t = Wt,
923
+ createCommandId: t = Ht,
886
924
  metadata: r,
887
- resolveString: o = xe
888
- } = e, n = [];
889
- return (r.commandPaletteContributions ?? []).forEach((s, a) => {
925
+ resolveString: n = je
926
+ } = e, o = [];
927
+ return (r.commandPaletteContributions ?? []).forEach((s, i) => {
890
928
  const d = t(s), c = r.commands.find((b) => b.id === s.commandId);
891
- n.push({
929
+ o.push({
892
930
  command: {
893
931
  id: d,
894
- label: o(s.label, s.extensionId),
932
+ label: n(s.label, s.extensionId),
895
933
  category: s.group,
896
- description: c ? o(c.description, c.extensionId) : void 0,
934
+ description: c ? n(c.description, c.extensionId) : void 0,
897
935
  icon: s.icon,
898
936
  params: c?.params
899
937
  },
900
938
  contribution: s,
901
- menuItem: Kt({
939
+ menuItem: Ot({
902
940
  commandId: d,
903
941
  contribution: s,
904
- index: a,
905
- resolveString: o
942
+ index: i,
943
+ resolveString: n
906
944
  }),
907
945
  targetCommandId: s.commandId
908
946
  });
909
- }), n;
910
- }, so = (e) => {
947
+ }), o;
948
+ }, fn = (e) => {
911
949
  const {
912
950
  createResource: t,
913
951
  metadata: r
914
952
  } = e;
915
- return r ? r.routes.map((o) => ({
953
+ return r ? r.routes.map((n) => ({
916
954
  resource: t({
917
- route: o
955
+ route: n
918
956
  })
919
957
  })) : [];
920
- }, Bt = (e) => {
958
+ }, Nt = (e) => {
921
959
  if (e)
922
960
  return {
923
961
  type: e.kind,
@@ -925,7 +963,7 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
925
963
  label: e.label,
926
964
  metadata: e.metadata
927
965
  };
928
- }, Dt = (e) => ({
966
+ }, Ut = (e) => ({
929
967
  id: e.rendererId,
930
968
  kind: "renderer",
931
969
  context: {
@@ -935,174 +973,179 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
935
973
  resourceId: e.resource.id
936
974
  } : {}
937
975
  }
938
- }), ue = async (e, t, r, o, n = {}) => {
939
- const s = Bt(o), a = await e.executeCommand(r, {
976
+ }), ge = async (e, t, r, n, o = {}) => {
977
+ const s = Nt(n), i = await e.executeCommand(r, {
940
978
  projectId: e.projectId,
941
979
  params: {
942
980
  projectId: e.projectId,
943
981
  resource: s,
944
- ...n
982
+ ...o
945
983
  },
946
984
  resource: s,
947
- slot: Dt({
985
+ slot: Ut({
948
986
  projectId: e.projectId,
949
987
  rendererId: t,
950
988
  resource: s
951
989
  }),
952
990
  source: "dashboard"
953
991
  });
954
- return L(a);
955
- }, Ht = (e, t) => e.workbench.renderers.registerFileRenderer({
992
+ return N(i);
993
+ }, _t = (e, t) => e.workbench.renderers.registerFileRenderer({
956
994
  id: t.id,
957
- title: m(t.title, t.id),
995
+ title: u(t.title, t.id),
958
996
  resourceKind: t.resourceKind,
959
- load: async (r) => await ue(e, t.id, t.loadCommandId, r) ?? {},
960
- save: t.saveCommandId ? async (r, o) => {
961
- await ue(e, t.id, t.saveCommandId, r, {
962
- content: o
997
+ load: async (r) => await ge(e, t.id, t.loadCommandId, r) ?? {},
998
+ save: t.saveCommandId ? async (r, n) => {
999
+ await ge(e, t.id, t.saveCommandId, r, {
1000
+ content: n
963
1001
  });
964
1002
  } : void 0
965
- }), Vt = (e, t) => {
1003
+ }), qt = (e, t, r, n) => {
966
1004
  if (t.fileRendererId)
967
- return $({
1005
+ return H({
968
1006
  workbench: e.workbench,
969
1007
  contribution: {
970
1008
  id: t.id,
971
- title: m(t.title, t.id),
1009
+ title: u(t.title, t.id),
1010
+ icon: t.icon,
972
1011
  region: t.region,
973
1012
  closable: t.closable,
974
1013
  rendererId: t.fileRendererId,
975
1014
  singleton: !0,
976
1015
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
977
- eligibleLocations: K(t.eligibleLocations),
978
- panelMenus: M(t.panelMenus)
1016
+ eligibleLocations: D(t.eligibleLocations),
1017
+ panelMenus: B(t.panelMenus, n),
1018
+ ...A({
1019
+ placement: t.placement,
1020
+ declarationIndex: r
1021
+ })
979
1022
  }
980
1023
  });
981
- }, Ft = (e) => {
1024
+ }, zt = (e) => {
982
1025
  const t = [];
983
- for (const r of e.metadata.fileRenderers ?? [])
984
- t.push(Ht(e, r));
985
- for (const r of e.metadata.panels) {
986
- const o = Vt(e, r);
987
- o && t.push(o);
988
- }
989
- return {
1026
+ for (const n of e.metadata.fileRenderers ?? [])
1027
+ t.push(_t(e, n));
1028
+ const r = $(e.metadata.panels);
1029
+ return e.metadata.panels.forEach((n, o) => {
1030
+ const s = qt(e, n, o, r[o]);
1031
+ s && t.push(s);
1032
+ }), {
990
1033
  dispose() {
991
- for (let r = t.length - 1; r >= 0; r -= 1) t[r]?.dispose();
1034
+ for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
992
1035
  }
993
1036
  };
994
- }, Lt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), be = (e, t, r, o) => (t ?? []).map((n) => {
1037
+ }, Qt = (e) => typeof e == "object" && e !== null && !Array.isArray(e), Ie = (e, t, r, n) => (t ?? []).map((o) => {
995
1038
  const s = {
996
- ...n,
997
- label: r(n.label, n.id),
998
- type: n.type.kind === "enum" || n.type.kind === "enum-multi" ? {
999
- ...n.type,
1000
- options: Array.isArray(n.type.options) ? n.type.options.map((a) => ({
1001
- ...a,
1002
- label: r(a.label, a.value)
1003
- })) : n.type.options
1004
- } : n.type
1039
+ ...o,
1040
+ label: r(o.label, o.id),
1041
+ type: o.type.kind === "enum" || o.type.kind === "enum-multi" ? {
1042
+ ...o.type,
1043
+ options: Array.isArray(o.type.options) ? o.type.options.map((i) => ({
1044
+ ...i,
1045
+ label: r(i.label, i.value)
1046
+ })) : o.type.options
1047
+ } : o.type
1005
1048
  };
1006
- return o(e, s);
1007
- }), Ot = (e, t, r, o) => {
1008
- let n = be(e, t, r, o);
1049
+ return n(e, s);
1050
+ }), Gt = (e, t, r, n) => {
1051
+ let o = Ie(e, t, r, n);
1009
1052
  const s = /* @__PURE__ */ new Set();
1010
1053
  return {
1011
1054
  source: {
1012
- getSnapshot: () => n,
1013
- subscribe: (a) => (s.add(a), () => s.delete(a))
1055
+ getSnapshot: () => o,
1056
+ subscribe: (i) => (s.add(i), () => s.delete(i))
1014
1057
  },
1015
- set(a) {
1016
- n = be(e, a, r, o);
1058
+ set(i) {
1059
+ o = Ie(e, i, r, n);
1017
1060
  for (const d of s) d();
1018
1061
  }
1019
1062
  };
1020
- }, Nt = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), Ut = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), _t = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Ae = (e, t) => {
1063
+ }, Yt = (e) => !!(e && typeof e == "object" && typeof e.kind == "string"), Xt = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Jt = (e, t) => `pstdio://extension-resource/${encodeURIComponent(e)}/${encodeURIComponent(t)}`, Ke = (e, t) => {
1021
1064
  const {
1022
1065
  resource: r
1023
1066
  } = t;
1024
- if (Nt(r)) return r;
1025
- if (Ut(r)) return O(r);
1026
- }, qt = (e, t) => {
1027
- const r = Ae(e, t);
1067
+ if (Yt(r)) return r;
1068
+ if (Xt(r)) return U(r);
1069
+ }, Zt = (e, t) => {
1070
+ const r = Ke(e, t);
1028
1071
  if (r) return r;
1029
1072
  if (e.resourceKind)
1030
1073
  return {
1031
1074
  kind: e.resourceKind,
1032
- uri: _t(e.resourceKind, t.id),
1075
+ uri: Jt(e.resourceKind, t.id),
1033
1076
  id: t.id,
1034
1077
  label: t.title
1035
1078
  };
1036
- }, fe = (e, t) => {
1037
- const r = e, o = t(r);
1038
- return o === void 0 ? r : {
1079
+ }, ye = (e, t) => {
1080
+ const r = e, n = t(r);
1081
+ return n === void 0 ? r : {
1039
1082
  ...r,
1040
- resource: o
1083
+ resource: n
1041
1084
  };
1042
- }, Pe = (...e) => Object.assign({}, ...e.filter((t) => !!t)), zt = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Qt = (e) => Object.keys(e ?? {}).length > 0, Gt = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), Yt = (e, t, r) => {
1043
- if (!Gt.has(t.type)) return;
1044
- const o = "options" in t && Array.isArray(t.options) ? t.options : [], n = t;
1085
+ }, Me = (...e) => Object.assign({}, ...e.filter((t) => !!t)), er = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, tr = (e) => Object.keys(e ?? {}).length > 0, rr = /* @__PURE__ */ new Set(["text", "longtext", "markdown", "number", "boolean", "select", "multi-select", "files"]), nr = (e, t, r) => {
1086
+ if (!rr.has(t.type)) return;
1087
+ const n = "options" in t && Array.isArray(t.options) ? t.options : [], o = t;
1045
1088
  return {
1046
1089
  id: e,
1047
1090
  label: r(t.label, e),
1048
1091
  description: t.description === void 0 ? void 0 : r(t.description),
1049
- placeholder: n.placeholder === void 0 ? void 0 : r(n.placeholder),
1092
+ placeholder: o.placeholder === void 0 ? void 0 : r(o.placeholder),
1050
1093
  type: t.type,
1051
1094
  required: t.required === !0,
1052
1095
  defaultValue: t.defaultValue,
1053
- options: t.type === "select" || t.type === "multi-select" ? o.map((s) => ({
1096
+ options: t.type === "select" || t.type === "multi-select" ? n.map((s) => ({
1054
1097
  value: s.value,
1055
1098
  label: r(s.label, s.value),
1056
1099
  icon: s.icon
1057
1100
  })) : void 0,
1058
- multiple: t.type === "files" ? n.multiple !== !1 : void 0,
1059
- accept: t.type === "files" && typeof n.accept == "string" ? n.accept : void 0
1101
+ multiple: t.type === "files" ? o.multiple !== !1 : void 0,
1102
+ accept: t.type === "files" && typeof o.accept == "string" ? o.accept : void 0
1060
1103
  };
1061
- }, Xt = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, o]) => {
1062
- const n = Yt(r, o, t);
1063
- return n ? [n] : [];
1064
- }), Jt = (e, t) => j({
1104
+ }, or = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([r, n]) => {
1105
+ const o = nr(r, n, t);
1106
+ return o ? [o] : [];
1107
+ }), sr = (e, t) => M({
1065
1108
  id: t.id,
1066
1109
  kind: "kanbanRenderer",
1067
1110
  projectId: e.projectId,
1068
1111
  context: {
1069
1112
  kanbanRendererId: t.id
1070
1113
  }
1071
- }), F = (e, t, r, o, n) => k(e, r, {
1072
- params: o,
1073
- resource: n ?? e.workbench.getPrimaryResource(),
1074
- slot: Jt(e, t),
1114
+ }), F = (e, t, r, n, o) => k(e, r, {
1115
+ params: n,
1116
+ resource: o ?? e.workbench.getPrimaryResource(),
1117
+ slot: sr(e, t),
1075
1118
  metadata: {
1076
1119
  kanbanRendererId: t.id
1077
1120
  }
1078
- }), Te = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Zt = (e, t, r) => (t.rowActions ?? []).map((o) => {
1079
- const n = e.workbench.commands.getCommand(o.commandId)?.command;
1121
+ }), De = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, ir = (e, t, r) => (t.rowActions ?? []).map((n) => {
1122
+ const o = e.workbench.commands.getCommand(n.commandId)?.command;
1080
1123
  return e.workbench.commands.registerCommand({
1081
- id: Te(t, o),
1082
- label: r(o.label, o.id),
1083
- icon: o.icon,
1084
- params: n?.params
1124
+ id: De(t, n),
1125
+ label: r(n.label, n.id),
1126
+ icon: n.icon,
1127
+ params: o?.params
1085
1128
  }, {
1086
- execute: (s, a) => F(e, t, o.commandId, Pe(zt(s)), a?.resource)
1129
+ execute: (s, i) => F(e, t, n.commandId, Me(er(s)), i?.resource)
1087
1130
  });
1088
- }), er = (e, t, r, o, n, s) => {
1089
- const a = Te(t, r), d = e.workbench.commands.getCommand(a), c = {
1090
- rowId: o.id
1091
- }, b = n ? {
1092
- resource: n
1093
- } : void 0, i = s(r.label, r.id);
1094
- return d && Qt(d.command.params) ? (e.workbench.commandPalette.requestParams({
1131
+ }), ar = (e, t, r, n, o, s) => {
1132
+ const i = De(t, r), d = e.workbench.commands.getCommand(i), c = {
1133
+ rowId: n.id
1134
+ }, b = o ? {
1135
+ resource: o
1136
+ } : void 0, a = s(r.label, r.id);
1137
+ return d && tr(d.command.params) ? (e.workbench.commandPalette.requestParams({
1095
1138
  record: d,
1096
- label: i,
1139
+ label: a,
1097
1140
  args: c,
1098
1141
  context: b
1099
1142
  }), Promise.resolve()) : d ? e.workbench.commands.executeCommand(d.command.id, c, b).then(() => {
1100
- }) : F(e, t, r.commandId, c, n).then(() => {
1143
+ }) : F(e, t, r.commandId, c, o).then(() => {
1101
1144
  });
1102
- }, tr = (e) => (r) => T(S, {
1145
+ }, dr = (e) => (r) => W(j, {
1103
1146
  name: e ?? "MoreHorizontal",
1104
1147
  ...r
1105
- }), rr = (e, t) => ({
1148
+ }), cr = (e, t) => ({
1106
1149
  color: e?.color,
1107
1150
  canDragIn: e?.canDragIn,
1108
1151
  canDragOut: e?.canDragOut,
@@ -1110,17 +1153,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1110
1153
  actions: e?.actions?.map((r) => ({
1111
1154
  id: r.id,
1112
1155
  label: t(r.label, r.id),
1113
- icon: tr(r.icon)
1156
+ icon: dr(r.icon)
1114
1157
  }))
1115
- }), or = (e) => e ? T(S, {
1158
+ }), lr = (e) => e ? W(j, {
1116
1159
  name: e,
1117
1160
  size: 16
1118
- }) : void 0, nr = (e, t) => {
1161
+ }) : void 0, mr = (e, t) => {
1119
1162
  if (e.createRow)
1120
1163
  return {
1121
1164
  title: t(e.createRow.title, "Create row"),
1122
1165
  submitLabel: t(e.createRow.submitLabel, "Create"),
1123
- fields: Xt(e, t),
1166
+ fields: or(e, t),
1124
1167
  labels: {
1125
1168
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
1126
1169
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -1128,161 +1171,166 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1128
1171
  removeFile: t(e.createRow.labels?.removeFile, "Remove file")
1129
1172
  }
1130
1173
  };
1131
- }, sr = (e, t, r) => {
1174
+ }, ur = (e, t, r) => {
1132
1175
  if (t.onRowClick)
1133
- return (o) => t.onRowClick?.({
1176
+ return (n) => t.onRowClick?.({
1134
1177
  record: e,
1135
- row: o,
1136
- resource: r(e, o)
1178
+ row: n,
1179
+ resource: r(e, n)
1137
1180
  });
1138
- }, ir = (e, t, r) => {
1139
- const o = e.createRow;
1140
- if (o)
1141
- return async (n) => {
1142
- const s = Pe(n.values, o.columnParam ? {
1143
- [o.columnParam]: n.columnId
1144
- } : void 0, o.attributesParam ? {
1145
- [o.attributesParam]: n.attributeValues
1146
- } : void 0), a = await r(e, o.commandId, s);
1181
+ }, br = (e, t, r) => {
1182
+ const n = e.createRow;
1183
+ if (n)
1184
+ return async (o) => {
1185
+ const s = Me(o.values, n.columnParam ? {
1186
+ [n.columnParam]: o.columnId
1187
+ } : void 0, n.attributesParam ? {
1188
+ [n.attributesParam]: o.attributeValues
1189
+ } : void 0), i = await r(e, n.commandId, s);
1147
1190
  await t.onAfterCreate?.({
1148
1191
  record: e,
1149
- created: a,
1150
- submission: n
1192
+ created: i,
1193
+ submission: o
1151
1194
  });
1152
1195
  };
1153
- }, ar = (e, t, r, o, n) => {
1196
+ }, fr = (e, t, r, n, o) => {
1154
1197
  const s = t.rowActions;
1155
1198
  if (s?.length)
1156
- return (a) => s.map((d) => {
1157
- const c = n(t, a), b = () => er(e, t, d, a, c, o);
1199
+ return (i) => s.map((d) => {
1200
+ const c = o(t, i), b = () => ar(e, t, d, i, c, n);
1158
1201
  return {
1159
1202
  key: d.id,
1160
- label: o(d.label, d.id),
1203
+ label: n(d.label, d.id),
1161
1204
  commandId: d.commandId,
1162
- icon: or(d.icon),
1205
+ icon: lr(d.icon),
1163
1206
  onClick: () => r.executeRowAction ? r.executeRowAction({
1164
1207
  record: t,
1165
1208
  action: d,
1166
- row: a,
1209
+ row: i,
1167
1210
  resource: c,
1168
1211
  runDefault: b
1169
1212
  }) : b()
1170
1213
  };
1171
1214
  });
1172
- }, dr = (e, t, r = {}) => {
1173
- const o = [], n = r.resolveLabel ?? ((i, l) => m(i, l)), s = r.decorateAttribute ?? ((i, l) => l), a = r.resolveRowResource ?? Ae, d = r.resolveRowActionResource ?? qt, c = r.onAfterMutation ?? (() => {
1174
- }), b = (i, l, u) => F(e, i, l, u).then((f) => (c(i), f));
1175
- for (const i of t) {
1176
- const l = Ot(i, i.attributes, n, s);
1177
- let u;
1178
- const f = (p) => a(i, p);
1179
- o.push(...Zt(e, i, n)), o.push(e.workbench.renderers.registerKanbanRenderer({
1180
- id: i.id,
1181
- title: n(i.title, i.id),
1182
- resourceKind: i.resourceKind,
1215
+ }, pr = (e, t, r = {}) => {
1216
+ const n = [], o = r.resolveLabel ?? ((a, l) => u(a, l)), s = r.decorateAttribute ?? ((a, l) => l), i = r.resolveRowResource ?? Ke, d = r.resolveRowActionResource ?? Zt, c = r.onAfterMutation ?? (() => {
1217
+ }), b = (a, l, m) => F(e, a, l, m).then((f) => (c(a), f));
1218
+ for (const a of t) {
1219
+ const l = Gt(a, a.attributes, o, s);
1220
+ let m;
1221
+ const f = (p) => i(a, p);
1222
+ n.push(...ir(e, a, o)), n.push(e.workbench.renderers.registerKanbanRenderer({
1223
+ id: a.id,
1224
+ title: o(a.title, a.id),
1225
+ resourceKind: a.resourceKind,
1183
1226
  attributes: l.source,
1184
- defaultSettings: i.defaultSettings,
1185
- defaultFilters: i.defaultFilters,
1186
- defaultViews: i.defaultViews?.map((p) => ({
1227
+ defaultSettings: a.defaultSettings,
1228
+ defaultFilters: a.defaultFilters,
1229
+ defaultViews: a.defaultViews?.map((p) => ({
1187
1230
  ...p,
1188
- title: n(p.title, p.id)
1231
+ title: o(p.title, p.id)
1189
1232
  })),
1190
- defaultActiveViewId: i.defaultActiveViewId,
1191
- emptyTitle: n(i.emptyTitle, ""),
1192
- emptyDescription: n(i.emptyDescription, ""),
1193
- hideToolbar: i.hideToolbar,
1194
- createRow: nr(i, n),
1195
- getBoardColumnConfig: (p) => rr(u?.[p], n),
1196
- onRowClick: sr(i, r, a),
1233
+ defaultActiveViewId: a.defaultActiveViewId,
1234
+ emptyTitle: o(a.emptyTitle, ""),
1235
+ emptyDescription: o(a.emptyDescription, ""),
1236
+ hideToolbar: a.hideToolbar,
1237
+ createRow: mr(a, o),
1238
+ getBoardColumnConfig: (p) => cr(m?.[p], o),
1239
+ onRowClick: ur(a, r, i),
1197
1240
  executeQuery: async (p) => {
1198
- const h = await F(e, i, i.queryCommandId, {
1241
+ const w = await F(e, a, a.queryCommandId, {
1199
1242
  settings: p.settings,
1200
1243
  filters: p.filters
1201
1244
  });
1202
- return Array.isArray(h) ? h.map((v) => fe(v, f)) : Lt(h) ? (l.set(h.attributes), u = h.boardColumnConfigs, (h.rows ?? []).map((v) => fe(v, f))) : [];
1245
+ return Array.isArray(w) ? w.map((v) => ye(v, f)) : Qt(w) ? (l.set(w.attributes), m = w.boardColumnConfigs, (w.rows ?? []).map((v) => ye(v, f))) : [];
1203
1246
  },
1204
- onAttributeChange: i.updateAttributeCommandId ? (p, h, v) => b(i, i.updateAttributeCommandId, {
1247
+ onAttributeChange: a.updateAttributeCommandId ? (p, w, v) => b(a, a.updateAttributeCommandId, {
1205
1248
  rowId: p,
1206
- attributeId: h,
1249
+ attributeId: w,
1207
1250
  value: v
1208
1251
  }).then(() => {
1209
1252
  }) : void 0,
1210
- onReorder: i.reorderCommandId ? (p, h) => b(i, i.reorderCommandId, {
1253
+ onReorder: a.reorderCommandId ? (p, w) => b(a, a.reorderCommandId, {
1211
1254
  rowId: p,
1212
- beforeRowId: h
1255
+ beforeRowId: w
1213
1256
  }).then(() => {
1214
1257
  }) : void 0,
1215
- onCreateRow: ir(i, r, b),
1216
- onColumnAction: i.columnActionCommandId ? async (p, h) => {
1217
- await b(i, i.columnActionCommandId, {
1258
+ onCreateRow: br(a, r, b),
1259
+ onColumnAction: a.columnActionCommandId ? async (p, w) => {
1260
+ await b(a, a.columnActionCommandId, {
1218
1261
  columnId: p,
1219
- actionId: h
1262
+ actionId: w
1220
1263
  });
1221
1264
  } : void 0,
1222
- getRowContextMenuActions: ar(e, i, r, n, d)
1223
- })), o.push(e.workbench.layout.registerPanel({
1265
+ getRowContextMenuActions: fr(e, a, r, o, d)
1266
+ })), n.push(e.workbench.layout.registerPanel({
1224
1267
  closable: !1,
1225
- id: i.id,
1226
- title: n(i.title, i.id),
1268
+ id: a.id,
1269
+ title: o(a.title, a.id),
1227
1270
  region: "main",
1228
- rendererId: i.id,
1271
+ rendererId: a.id,
1229
1272
  singleton: !0,
1230
- resourceKinds: i.resourceKind ? [i.resourceKind] : void 0
1273
+ resourceKinds: a.resourceKind ? [a.resourceKind] : void 0
1231
1274
  }));
1232
1275
  }
1233
1276
  return {
1234
1277
  dispose() {
1235
- for (let i = o.length - 1; i >= 0; i -= 1) o[i]?.dispose();
1278
+ for (let a = n.length - 1; a >= 0; a -= 1) n[a]?.dispose();
1236
1279
  }
1237
1280
  };
1238
- }, cr = (e, t) => {
1281
+ }, hr = (e, t) => {
1239
1282
  if (e)
1240
- return Object.fromEntries(Object.entries(e).map(([r, o]) => [r, {
1241
- ...o,
1242
- label: o.label === void 0 ? void 0 : t(o.label, r),
1243
- description: o.description === void 0 ? void 0 : t(o.description)
1283
+ return Object.fromEntries(Object.entries(e).map(([r, n]) => [r, {
1284
+ ...n,
1285
+ label: n.label === void 0 ? void 0 : t(n.label, r),
1286
+ description: n.description === void 0 ? void 0 : t(n.description)
1244
1287
  }]));
1245
- }, lr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.treeRendererId === t.id), Se = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, mr = async (e) => {
1288
+ }, wr = (e, t) => e.panels.flatMap((r) => [r, ...r.panelMenus ?? []]).filter((r) => r.treeRendererId === t.id), $e = (e, t) => t.viewId ? e.find((r) => r.id === t.viewId) : e.length === 1 ? e[0] : void 0, gr = async (e) => {
1246
1289
  const {
1247
1290
  ctx: t,
1248
1291
  getHostTreeHeaderNodes: r,
1249
- record: o,
1250
- treeViews: n
1251
- } = e, s = Se(n, t);
1292
+ record: n,
1293
+ treeViews: o
1294
+ } = e, s = $e(o, t);
1252
1295
  return !s || !("hostTreeHeader" in s) || s.hostTreeHeader !== "default" ? [] : await r?.({
1253
1296
  ctx: t,
1254
- record: o,
1297
+ record: n,
1255
1298
  panel: s
1256
1299
  }) ?? [];
1257
- }, ur = async (e) => {
1300
+ }, Ir = async (e) => {
1258
1301
  const {
1259
1302
  ctx: t,
1260
1303
  getHostTreeFooterNodes: r,
1261
- record: o,
1262
- treeViews: n
1263
- } = e, s = Se(n, t);
1304
+ record: n,
1305
+ treeViews: o
1306
+ } = e, s = $e(o, t);
1264
1307
  return !s || !("hostTreeFooter" in s) || s.hostTreeFooter !== "default" ? [] : await r?.({
1265
1308
  ctx: t,
1266
- record: o,
1309
+ record: n,
1267
1310
  panel: s
1268
1311
  }) ?? [];
1269
- }, br = (e, t) => {
1312
+ }, yr = (e, t, r, n) => {
1270
1313
  if (t.treeRendererId)
1271
- return $({
1314
+ return H({
1272
1315
  workbench: e.workbench,
1273
1316
  contribution: {
1274
1317
  id: t.id,
1275
- title: m(t.title, t.id),
1318
+ title: u(t.title, t.id),
1319
+ icon: t.icon,
1276
1320
  region: t.region,
1277
1321
  closable: t.closable,
1278
1322
  rendererId: t.treeRendererId,
1279
1323
  singleton: !0,
1280
1324
  resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
1281
- eligibleLocations: K(t.eligibleLocations),
1282
- panelMenus: M(t.panelMenus)
1325
+ eligibleLocations: D(t.eligibleLocations),
1326
+ panelMenus: B(t.panelMenus, n),
1327
+ ...A({
1328
+ placement: t.placement,
1329
+ declarationIndex: r
1330
+ })
1283
1331
  }
1284
1332
  });
1285
- }, G = (e) => {
1333
+ }, Z = (e) => {
1286
1334
  if (e)
1287
1335
  return {
1288
1336
  type: e.kind,
@@ -1290,13 +1338,13 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1290
1338
  label: e.label,
1291
1339
  metadata: e.metadata
1292
1340
  };
1293
- }, pe = (e) => ({
1341
+ }, ve = (e) => ({
1294
1342
  kind: e.type,
1295
1343
  uri: `pstdio://extension-resource/${encodeURIComponent(e.type)}/${encodeURIComponent(e.id)}`,
1296
1344
  id: e.id,
1297
1345
  label: e.label,
1298
1346
  metadata: e.metadata
1299
- }), We = (e) => ({
1347
+ }), Be = (e) => ({
1300
1348
  id: e.treeId,
1301
1349
  kind: "renderer",
1302
1350
  context: {
@@ -1310,46 +1358,46 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1310
1358
  resourceId: e.resource.id
1311
1359
  } : {}
1312
1360
  }
1313
- }), z = (e, t, r, o) => {
1314
- const n = G(r.resource);
1361
+ }), X = (e, t, r, n) => {
1362
+ const o = Z(r.resource);
1315
1363
  return {
1316
1364
  projectId: e.projectId,
1317
1365
  modeId: e.workbench.modes.getActiveModeId(),
1318
- resource: n,
1366
+ resource: o,
1319
1367
  treeId: t.id,
1320
1368
  state: e.workbench.renderers.getTreeState(t.id),
1321
1369
  ...r.filter ? {
1322
1370
  filter: r.filter
1323
1371
  } : {},
1324
- ...o ? {
1325
- node: o
1372
+ ...n ? {
1373
+ node: n
1326
1374
  } : {}
1327
1375
  };
1328
- }, Q = async (e, t, r) => {
1329
- const o = r.resource, n = await e.executeCommand(t, {
1376
+ }, J = async (e, t, r) => {
1377
+ const n = r.resource, o = await e.executeCommand(t, {
1330
1378
  projectId: e.projectId,
1331
1379
  params: r,
1332
- resource: o,
1333
- slot: We({
1380
+ resource: n,
1381
+ slot: Be({
1334
1382
  modeId: r.modeId,
1335
1383
  projectId: e.projectId,
1336
- resource: o,
1384
+ resource: n,
1337
1385
  treeId: r.treeId
1338
1386
  }),
1339
1387
  source: "dashboard"
1340
1388
  });
1341
- return L(n);
1342
- }, je = async (e, t, r, o, n) => {
1343
- const s = e.workbench.modes.getActiveModeId(), a = await e.executeCommand(r, {
1389
+ return N(o);
1390
+ }, He = async (e, t, r, n, o) => {
1391
+ const s = e.workbench.modes.getActiveModeId(), i = await e.executeCommand(r, {
1344
1392
  projectId: e.projectId,
1345
- ...o ? {
1346
- params: o
1393
+ ...n ? {
1394
+ params: n
1347
1395
  } : {},
1348
- resource: n,
1349
- slot: We({
1396
+ resource: o,
1397
+ slot: Be({
1350
1398
  modeId: s,
1351
1399
  projectId: e.projectId,
1352
- resource: n,
1400
+ resource: o,
1353
1401
  treeId: t.id
1354
1402
  }),
1355
1403
  source: "dashboard",
@@ -1357,190 +1405,190 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1357
1405
  treeId: t.id
1358
1406
  }
1359
1407
  });
1360
- return L(a);
1361
- }, fr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, pr = (e, t) => {
1362
- const r = /* @__PURE__ */ new WeakMap(), o = `workbench.extensionTreeRenderer.${t.id}.command`, n = (i) => {
1363
- if (i.emptyState)
1408
+ return N(i);
1409
+ }, vr = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, kr = (e, t) => {
1410
+ const r = /* @__PURE__ */ new WeakMap(), n = `workbench.extensionTreeRenderer.${t.id}.command`, o = (a) => {
1411
+ if (a.emptyState)
1364
1412
  return {
1365
- title: m(i.emptyState.title),
1366
- description: m(i.emptyState.description),
1367
- icon: i.emptyState.icon
1413
+ title: u(a.emptyState.title),
1414
+ description: u(a.emptyState.description),
1415
+ icon: a.emptyState.icon
1368
1416
  };
1369
- }, s = (i, l, u) => {
1370
- if (i) {
1371
- if (i.kind === "resource" && i.resource)
1417
+ }, s = (a, l, m) => {
1418
+ if (a) {
1419
+ if (a.kind === "resource" && a.resource)
1372
1420
  return {
1373
1421
  kind: "resource",
1374
- resource: pe(i.resource),
1422
+ resource: ve(a.resource),
1375
1423
  input: {
1376
1424
  replaceActive: !0
1377
1425
  }
1378
1426
  };
1379
- if (i.kind === "panel" && i.panelId) return {
1427
+ if (a.kind === "panel" && a.panelId) return {
1380
1428
  kind: "panel",
1381
- panelId: i.panelId
1429
+ panelId: a.panelId
1382
1430
  };
1383
- if (!(i.kind !== "command" || !i.commandId))
1431
+ if (!(a.kind !== "command" || !a.commandId))
1384
1432
  return {
1385
1433
  kind: "command",
1386
- commandId: o,
1434
+ commandId: n,
1387
1435
  args: {
1388
- commandId: i.commandId,
1436
+ commandId: a.commandId,
1389
1437
  nodeId: l.id,
1390
- params: i.args,
1391
- resource: l.resource ?? G(u.resource),
1438
+ params: a.args,
1439
+ resource: l.resource ?? Z(m.resource),
1392
1440
  treeId: t.id
1393
1441
  }
1394
1442
  };
1395
1443
  }
1396
- }, a = (i, l, u) => {
1397
- const f = i.commandId;
1444
+ }, i = (a, l, m) => {
1445
+ const f = a.commandId;
1398
1446
  return {
1399
- id: i.id,
1400
- label: m(i.label),
1401
- icon: i.icon,
1402
- args: i.args,
1403
- params: cr(i.params, m),
1404
- submitLabel: i.submitLabel,
1405
- when: i.when,
1406
- disabled: i.disabled,
1447
+ id: a.id,
1448
+ label: u(a.label),
1449
+ icon: a.icon,
1450
+ args: a.args,
1451
+ params: hr(a.params, u),
1452
+ submitLabel: a.submitLabel,
1453
+ when: a.when,
1454
+ disabled: a.disabled,
1407
1455
  // Actions mutate tree data (create/delete/...), so refresh afterwards. Plain
1408
1456
  // node-target navigation runs through the runner command and must not refetch.
1409
1457
  run: f ? async (p) => {
1410
- await je(e, t, f, fr(p, i.args), l?.resource ?? G(u.resource)), e.workbench.renderers.refresh(t.id);
1458
+ await He(e, t, f, vr(p, a.args), l?.resource ?? Z(m.resource)), e.workbench.renderers.refresh(t.id);
1411
1459
  } : void 0
1412
1460
  };
1413
- }, d = (i, l) => {
1414
- const u = {
1415
- id: i.id,
1416
- label: m(i.label),
1417
- icon: i.icon,
1418
- iconColor: i.iconColor,
1419
- iconTooltip: i.iconTooltip,
1420
- resource: i.resource ? pe(i.resource) : void 0,
1421
- target: s(i.target, i, l),
1422
- rowVariant: i.rowVariant,
1423
- actions: i.actions?.map((f) => a(f, i, l)),
1424
- contextMenuActions: i.contextMenuActions?.map((f) => a(f, i, l)),
1425
- collapsible: i.collapsible,
1426
- disabled: i.disabled,
1427
- children: i.children?.map((f) => d(f, l)),
1428
- description: i.description,
1429
- contextValue: i.contextValue,
1430
- hiddenByDefault: i.hiddenByDefault,
1431
- canHide: i.canHide
1461
+ }, d = (a, l) => {
1462
+ const m = {
1463
+ id: a.id,
1464
+ label: u(a.label),
1465
+ icon: a.icon,
1466
+ iconColor: a.iconColor,
1467
+ iconTooltip: a.iconTooltip,
1468
+ resource: a.resource ? ve(a.resource) : void 0,
1469
+ target: s(a.target, a, l),
1470
+ rowVariant: a.rowVariant,
1471
+ actions: a.actions?.map((f) => i(f, a, l)),
1472
+ contextMenuActions: a.contextMenuActions?.map((f) => i(f, a, l)),
1473
+ collapsible: a.collapsible,
1474
+ disabled: a.disabled,
1475
+ children: a.children?.map((f) => d(f, l)),
1476
+ description: a.description,
1477
+ contextValue: a.contextValue,
1478
+ hiddenByDefault: a.hiddenByDefault,
1479
+ canHide: a.canHide
1432
1480
  };
1433
- return r.set(u, i), u;
1481
+ return r.set(m, a), m;
1434
1482
  };
1435
1483
  return {
1436
- mapNodes: (i, l) => i.map((u) => d(u, l)),
1437
- mapSections: (i, l) => i.map((u) => ({
1438
- id: u.id,
1439
- label: m(u.label),
1440
- actions: u.actions?.map((f) => a(f, void 0, l)),
1441
- collapsible: u.collapsible,
1442
- emptyState: n(u),
1443
- nodes: u.nodes.map((f) => d(f, l)),
1444
- hiddenByDefault: u.hiddenByDefault,
1445
- canHide: u.canHide
1484
+ mapNodes: (a, l) => a.map((m) => d(m, l)),
1485
+ mapSections: (a, l) => a.map((m) => ({
1486
+ id: m.id,
1487
+ label: u(m.label),
1488
+ actions: m.actions?.map((f) => i(f, void 0, l)),
1489
+ collapsible: m.collapsible,
1490
+ emptyState: o(m),
1491
+ nodes: m.nodes.map((f) => d(f, l)),
1492
+ hiddenByDefault: m.hiddenByDefault,
1493
+ canHide: m.canHide
1446
1494
  })),
1447
1495
  originalNodes: r,
1448
- runnerCommandId: o
1496
+ runnerCommandId: n
1449
1497
  };
1450
- }, hr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), he = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), wr = (e) => {
1498
+ }, Rr = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "nodes" in t), ke = (e) => Array.isArray(e) && e.every((t) => t && typeof t == "object" && "id" in t), Cr = (e) => {
1451
1499
  for (const t of e)
1452
1500
  for (const r of t.nodes)
1453
1501
  if (r.selected) return r.id;
1454
- }, gr = (e, t) => {
1455
- const r = pr(e, t), o = lr(e.metadata, t), n = e.workbench.commands.registerCommand({
1502
+ }, Er = (e, t) => {
1503
+ const r = kr(e, t), n = wr(e.metadata, t), o = e.workbench.commands.registerCommand({
1456
1504
  id: r.runnerCommandId,
1457
- label: `${m(t.title, t.id)} tree command`
1505
+ label: `${u(t.title, t.id)} tree command`
1458
1506
  }, {
1459
- execute: async (a) => {
1460
- const d = a;
1507
+ execute: async (i) => {
1508
+ const d = i;
1461
1509
  d.nodeId && e.workbench.renderers.setSelectedNode(t.id, d.nodeId);
1462
- const c = await je(e, t, d.commandId, d.params, d.resource);
1510
+ const c = await He(e, t, d.commandId, d.params, d.resource);
1463
1511
  for (const b of e.workbench.renderers.listFileRenderers())
1464
1512
  e.workbench.renderers.refreshFileRenderer(b.id);
1465
1513
  return c;
1466
1514
  }
1467
1515
  }), s = e.workbench.renderers.registerTreeRenderer({
1468
1516
  id: t.id,
1469
- title: m(t.title, t.id),
1517
+ title: u(t.title, t.id),
1470
1518
  icon: t.icon,
1471
1519
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
1472
1520
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
1473
- getHeader: (a) => mr({
1474
- ctx: a,
1521
+ getHeader: (i) => gr({
1522
+ ctx: i,
1475
1523
  getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
1476
1524
  record: t,
1477
- treeViews: o
1525
+ treeViews: n
1478
1526
  }),
1479
- getBody: async (a) => {
1480
- const d = await Q(e, t.bodyCommandId, z(e, t, a));
1481
- if (!hr(d)) return [];
1482
- const c = wr(d);
1483
- return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d, a);
1527
+ getBody: async (i) => {
1528
+ const d = await J(e, t.bodyCommandId, X(e, t, i));
1529
+ if (!Rr(d)) return [];
1530
+ const c = Cr(d);
1531
+ return c && e.workbench.renderers.setSelectedNode(t.id, c), r.mapSections(d, i);
1484
1532
  },
1485
- getFooter: async (a) => {
1486
- const d = await ur({
1487
- ctx: a,
1533
+ getFooter: async (i) => {
1534
+ const d = await Ir({
1535
+ ctx: i,
1488
1536
  getHostTreeFooterNodes: e.getHostTreeFooterNodes,
1489
1537
  record: t,
1490
- treeViews: o
1538
+ treeViews: n
1491
1539
  });
1492
1540
  if (!t.footerCommandId) return d;
1493
- const c = await Q(e, t.footerCommandId, z(e, t, a));
1494
- return [...he(c) ? r.mapNodes(c, a) : [], ...d];
1541
+ const c = await J(e, t.footerCommandId, X(e, t, i));
1542
+ return [...ke(c) ? r.mapNodes(c, i) : [], ...d];
1495
1543
  },
1496
- getChildren: async (a, d) => {
1497
- if (!t.childrenCommandId) return a.children ?? [];
1498
- const c = r.originalNodes.get(a) ?? a, b = await Q(e, t.childrenCommandId, z(e, t, d, c));
1499
- return he(b) ? r.mapNodes(b, d) : [];
1544
+ getChildren: async (i, d) => {
1545
+ if (!t.childrenCommandId) return i.children ?? [];
1546
+ const c = r.originalNodes.get(i) ?? i, b = await J(e, t.childrenCommandId, X(e, t, d, c));
1547
+ return ke(b) ? r.mapNodes(b, d) : [];
1500
1548
  }
1501
1549
  });
1502
1550
  return {
1503
1551
  dispose() {
1504
- s.dispose(), n.dispose();
1552
+ s.dispose(), o.dispose();
1505
1553
  }
1506
1554
  };
1507
- }, Ir = (e) => {
1555
+ }, xr = (e) => {
1508
1556
  const t = [];
1509
- for (const r of e.metadata.treeRenderers ?? [])
1510
- t.push(gr(e, r));
1511
- for (const r of e.metadata.panels) {
1512
- const o = br(e, r);
1513
- o && t.push(o);
1514
- }
1515
- return {
1557
+ for (const n of e.metadata.treeRenderers ?? [])
1558
+ t.push(Er(e, n));
1559
+ const r = $(e.metadata.panels);
1560
+ return e.metadata.panels.forEach((n, o) => {
1561
+ const s = yr(e, n, o, r[o]);
1562
+ s && t.push(s);
1563
+ }), {
1516
1564
  dispose() {
1517
- for (let r = t.length - 1; r >= 0; r -= 1) t[r]?.dispose();
1565
+ for (let n = t.length - 1; n >= 0; n -= 1) t[n]?.dispose();
1518
1566
  }
1519
1567
  };
1520
- }, yr = (e) => (t) => ({
1521
- ...ve({
1568
+ }, Ar = (e) => (t) => ({
1569
+ ...Ae({
1522
1570
  workbench: t.workbench,
1523
1571
  hostEvents: t.hostEvents
1524
1572
  }),
1525
1573
  // Extension guests speak the SDK resource shape (`type`); normalize to the
1526
1574
  // workbench shape (`kind` + synthesized uri) the resource registry expects,
1527
1575
  // mirroring how commands.execute and tree targets normalize their resources.
1528
- "resource.open": (o) => {
1529
- const n = o;
1530
- if (!n.resource) throw new Error("resource.open requires a resource.");
1531
- return t.workbench.resources.openResource(O(n.resource), n.input);
1576
+ "resource.open": (n) => {
1577
+ const o = n;
1578
+ if (!o.resource) throw new Error("resource.open requires a resource.");
1579
+ return t.workbench.resources.openResource(U(o.resource), o.input);
1532
1580
  },
1533
- "commands.execute": async (o) => {
1534
- const n = o, s = n.resource ?? J(t.placement.resource);
1535
- return e.executeCommand(n.commandId, {
1581
+ "commands.execute": async (n) => {
1582
+ const o = n, s = o.resource ?? re(t.placement.resource);
1583
+ return e.executeCommand(o.commandId, {
1536
1584
  projectId: e.projectId,
1537
- ...n.params ? {
1538
- params: n.params
1585
+ ...o.params ? {
1586
+ params: o.params
1539
1587
  } : {},
1540
1588
  ...s ? {
1541
1589
  resource: s
1542
1590
  } : {},
1543
- slot: j({
1591
+ slot: M({
1544
1592
  id: t.webviewId,
1545
1593
  kind: e.slotKind,
1546
1594
  projectId: e.projectId,
@@ -1556,17 +1604,17 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1556
1604
  "files.list": e.files.list,
1557
1605
  "files.delete": e.files.delete
1558
1606
  } : {}
1559
- }), Z = (e, t) => ({
1607
+ }), ne = (e, t) => ({
1560
1608
  kind: t,
1561
1609
  uri: `workbench://extension-route/${encodeURIComponent(e.id)}`,
1562
1610
  id: e.id,
1563
- label: m(e.label, e.id),
1611
+ label: u(e.label, e.id),
1564
1612
  metadata: {
1565
1613
  extensionId: e.extensionId,
1566
1614
  extensionRouteId: e.id,
1567
1615
  path: e.path
1568
1616
  }
1569
- }), we = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), vr = (e) => {
1617
+ }), Re = (e, t) => e.routes.find((r) => t.id === r.id || t.metadata?.extensionRouteId === r.id), Pr = (e) => {
1570
1618
  if (e.metadata.routes.length === 0) return [];
1571
1619
  const t = [];
1572
1620
  e.workbench.resources.getKind(e.routeResourceKind) || t.push(e.workbench.resources.registerKind({
@@ -1578,48 +1626,48 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1578
1626
  t.push(e.workbench.layout.registerPanel({
1579
1627
  closable: !1,
1580
1628
  id: r.id,
1581
- title: m(r.label, r.id),
1629
+ title: u(r.label, r.id),
1582
1630
  region: "main",
1583
- rendererId: W,
1631
+ rendererId: K,
1584
1632
  singleton: !0,
1585
- config: N(r.webview)
1633
+ config: _(r.webview)
1586
1634
  }));
1587
1635
  return t.push(e.workbench.resources.registerProvider({
1588
1636
  id: "workbench.extension.routes",
1589
1637
  kind: e.routeResourceKind,
1590
1638
  list: () => e.metadata.routes.map((r) => ({
1591
- resource: Z(r, e.routeResourceKind)
1639
+ resource: ne(r, e.routeResourceKind)
1592
1640
  }))
1593
1641
  }), e.workbench.resources.registerPresenter({
1594
1642
  id: "workbench.extension.routes",
1595
- canOpen: (r) => r.kind === e.routeResourceKind && !!we(e.metadata, r),
1596
- open: (r, o) => {
1597
- const n = we(e.metadata, r);
1598
- return e.workbench.layout.openPanel(n.id, {
1599
- strategy: o.replaceActive ? {
1643
+ canOpen: (r) => r.kind === e.routeResourceKind && !!Re(e.metadata, r),
1644
+ open: (r, n) => {
1645
+ const o = Re(e.metadata, r);
1646
+ return e.workbench.layout.openPanel(o.id, {
1647
+ strategy: n.replaceActive ? {
1600
1648
  kind: "replace-active"
1601
1649
  } : {
1602
- kind: "activate-or-open"
1650
+ kind: "persistent"
1603
1651
  },
1604
- title: m(n.label, n.id)
1652
+ title: u(o.label, o.id)
1605
1653
  });
1606
1654
  }
1607
1655
  })), t;
1608
- }, kr = {
1656
+ }, Tr = {
1609
1657
  "workbench.left.tree": "sidenav",
1610
1658
  "workbench.main.left.tree": "main-left-menu",
1611
1659
  "workbench.main.right.tree": "main-right-menu"
1612
- }, Rr = (e) => e ? kr[e] ?? "sidenav" : "sidenav", Cr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Er = (e, t) => {
1660
+ }, Sr = (e) => e ? Tr[e] ?? "sidenav" : "sidenav", Wr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, jr = (e, t) => {
1613
1661
  if (t.action.kind === "kanbanRenderer") return {
1614
1662
  kind: "panel",
1615
1663
  panelId: t.action.kanbanRendererId
1616
1664
  };
1617
1665
  const r = t.action;
1618
1666
  if (r.kind === "route") {
1619
- const o = e.metadata.routes.find((n) => n.id === r.route);
1620
- return o ? {
1667
+ const n = e.metadata.routes.find((o) => o.id === r.route);
1668
+ return n ? {
1621
1669
  kind: "resource",
1622
- resource: Z(o, e.routeResourceKind)
1670
+ resource: ne(n, e.routeResourceKind)
1623
1671
  } : void 0;
1624
1672
  }
1625
1673
  return r.kind === "command" ? {
@@ -1633,15 +1681,15 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1633
1681
  href: r.href
1634
1682
  }
1635
1683
  };
1636
- }, xr = (e) => {
1684
+ }, Kr = (e) => {
1637
1685
  const t = e.metadata.treeItems ?? [];
1638
1686
  if (t.length === 0) return [];
1639
- const r = [], o = /* @__PURE__ */ new Map();
1640
- for (const n of t) o.set(n.target, [...o.get(n.target) ?? [], n]);
1641
- for (const [n, s] of o) {
1642
- const a = `workbench.extension.treeItems.${n}`;
1687
+ const r = [], n = /* @__PURE__ */ new Map();
1688
+ for (const o of t) n.set(o.target, [...n.get(o.target) ?? [], o]);
1689
+ for (const [o, s] of n) {
1690
+ const i = `workbench.extension.treeItems.${o}`;
1643
1691
  r.push(e.workbench.renderers.registerTreeRenderer({
1644
- id: a,
1692
+ id: i,
1645
1693
  title: "Extensions",
1646
1694
  getChildren: (d) => d.children ?? [],
1647
1695
  getBody: () => [{
@@ -1649,286 +1697,310 @@ const ft = (e) => typeof e == "object" && e !== null && "$l10n" in e && typeof e
1649
1697
  label: "Extensions",
1650
1698
  nodes: s.map((d) => ({
1651
1699
  id: d.id,
1652
- label: m(d.label, d.id),
1700
+ label: u(d.label, d.id),
1653
1701
  icon: d.icon,
1654
- target: Er(e, d)
1702
+ target: jr(e, d)
1655
1703
  }))
1656
1704
  }]
1657
1705
  }), e.workbench.layout.registerPanel({
1658
1706
  closable: !1,
1659
- id: a,
1707
+ id: i,
1660
1708
  title: "Extensions",
1661
- region: Rr(n),
1662
- rendererId: a,
1709
+ region: Sr(o),
1710
+ rendererId: i,
1663
1711
  singleton: !0
1664
1712
  }));
1665
1713
  }
1666
- for (const n of t.filter((s) => s.action.kind === "href")) {
1667
- const s = n.action;
1714
+ for (const o of t.filter((s) => s.action.kind === "href")) {
1715
+ const s = o.action;
1668
1716
  s.kind === "href" && r.push(e.workbench.commands.registerCommand({
1669
- id: `workbench.extension.href.${n.id}`,
1670
- label: m(n.label, n.id)
1717
+ id: `workbench.extension.href.${o.id}`,
1718
+ label: u(o.label, o.id)
1671
1719
  }, {
1672
- execute: (a) => e.openHref?.(Cr(a)?.href ?? s.href)
1720
+ execute: (i) => e.openHref?.(Wr(i)?.href ?? s.href)
1673
1721
  }));
1674
1722
  }
1675
1723
  return r;
1676
- }, Y = "extension-route", Ar = "extensions", Pr = (e) => {
1724
+ }, ee = "extension-route", Mr = "extensions", Dr = (e) => {
1677
1725
  for (let t = e.length - 1; t >= 0; t -= 1) e[t]?.dispose();
1678
- }, ee = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Tr = (e) => e === void 0 ? void 0 : e, Sr = (e) => e === "global" ? "user" : "project", Wr = (e, t) => t ? (r) => ({
1726
+ }, oe = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, $r = (e) => e === void 0 ? void 0 : e, Br = (e) => e === "global" ? "user" : "project", Hr = (e, t) => t ? (r) => ({
1679
1727
  ...e(r),
1680
1728
  ...t(r)
1681
- }) : e, Ke = (e, t) => {
1682
- const r = e.createWebviewHostCapabilities ?? yr({
1729
+ }) : e, Le = (e, t) => {
1730
+ const r = e.createWebviewHostCapabilities ?? Ar({
1683
1731
  executeCommand: e.executeCommand,
1684
1732
  files: e.webviewFiles,
1685
1733
  projectId: e.projectId,
1686
1734
  slotKind: t
1687
1735
  });
1688
- return Wr(r, e.createWebviewHostCapabilityOverrides);
1689
- }, jr = (e, t) => {
1690
- e.workbench.renderers.getRenderer(W) || t.push(e.workbench.renderers.registerRenderer(bt({
1691
- createHostCapabilities: Ke(e, "panel"),
1736
+ return Hr(r, e.createWebviewHostCapabilityOverrides);
1737
+ }, Lr = (e, t) => {
1738
+ e.workbench.renderers.getRenderer(K) || t.push(e.workbench.renderers.registerRenderer(It({
1739
+ createHostCapabilities: Le(e, "panel"),
1692
1740
  createProps: e.createWebviewProps,
1693
1741
  createTheme: e.createWebviewTheme
1694
1742
  })));
1695
- }, Kr = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
1743
+ }, Or = (e, t) => t.commands.map((r) => e.workbench.commands.registerCommand({
1696
1744
  id: r.id,
1697
- label: m(r.title, r.id),
1698
- description: m(r.description),
1745
+ label: u(r.title, r.id),
1746
+ description: u(r.description),
1699
1747
  params: r.params
1700
1748
  }, {
1701
- execute: (o, n) => k(e, r.id, {
1702
- params: ee(o),
1703
- resource: n?.resource
1749
+ execute: (n, o) => k(e, r.id, {
1750
+ params: oe(n),
1751
+ resource: o?.resource
1704
1752
  })
1705
- })), Me = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Mr = (e, t) => e.menuSlotsById ? Mt({
1753
+ })), Oe = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), Vr = (e, t) => e.menuSlotsById ? Vt({
1706
1754
  metadata: e.metadata,
1707
1755
  menuSlotsById: e.menuSlotsById,
1708
1756
  menuTargetsById: e.menuTargetsById,
1709
1757
  createWhenExpression: e.createMenuWhenExpression
1710
- }).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
1711
- execute: (n, s) => k(t, o.targetCommandId, {
1758
+ }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
1759
+ execute: (o, s) => k(t, n.targetCommandId, {
1712
1760
  params: {
1713
- ...o.contribution.params ?? {},
1714
- ...ee(n) ?? {}
1761
+ ...n.contribution.params ?? {},
1762
+ ...oe(o) ?? {}
1715
1763
  },
1716
- resource: Me(e, s),
1717
- slot: j({
1718
- id: o.contribution.slotId,
1764
+ resource: Oe(e, s),
1765
+ slot: M({
1766
+ id: n.contribution.slotId,
1719
1767
  kind: "menu",
1720
1768
  projectId: e.projectId,
1721
1769
  context: {
1722
- panelId: o.contribution.id
1770
+ panelId: n.contribution.id
1723
1771
  }
1724
1772
  })
1725
1773
  })
1726
- }), e.workbench.layout.registerMenuItem(o.menuPath, o.menuItem)]) : [], $r = (e, t) => $t({
1774
+ }), e.workbench.layout.registerMenuItem(n.menuPath, n.menuItem)]) : [], Fr = (e, t) => Ft({
1727
1775
  metadata: e.metadata
1728
- }).flatMap((o) => [e.workbench.commands.registerCommand(o.command, {
1729
- execute: (n, s) => k(t, o.targetCommandId, {
1776
+ }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
1777
+ execute: (o, s) => k(t, n.targetCommandId, {
1730
1778
  params: {
1731
- ...o.contribution.params ?? {},
1732
- ...ee(n) ?? {}
1779
+ ...n.contribution.params ?? {},
1780
+ ...oe(o) ?? {}
1733
1781
  },
1734
- resource: Me(e, s),
1735
- slot: j({
1782
+ resource: Oe(e, s),
1783
+ slot: M({
1736
1784
  id: "workbench.commandPalette",
1737
1785
  kind: "menu",
1738
1786
  projectId: e.projectId,
1739
1787
  context: {
1740
- panelId: o.contribution.id
1788
+ panelId: n.contribution.id
1741
1789
  }
1742
1790
  })
1743
1791
  }),
1744
- isVisible: () => Le(o.contribution.when, e.workbench.getPrimaryResource()?.kind)
1745
- }), e.workbench.layout.registerMenuItem(Oe, o.menuItem)]), Br = (e) => e.metadata.panels.flatMap((t) => t.webview ? [$({
1746
- workbench: e.workbench,
1747
- contribution: {
1748
- id: t.id,
1749
- title: m(t.title, t.id),
1750
- region: t.region,
1751
- closable: t.closable,
1752
- rendererId: W,
1753
- singleton: !0,
1754
- resourceKinds: t.resourceKind ? [t.resourceKind] : void 0,
1755
- eligibleLocations: K(t.eligibleLocations),
1756
- panelMenus: M(t.panelMenus),
1757
- config: {
1758
- ...N(t.webview),
1759
- ...t.region === "overlay" ? {
1760
- size: "lg",
1761
- scrollBehavior: "inside",
1762
- contentHeight: "min(560px, calc(100dvh - 48px))"
1763
- } : {}
1792
+ isVisible: () => ze(n.contribution.when, e.workbench.getPrimaryResource()?.kind)
1793
+ }), e.workbench.layout.registerMenuItem(Qe, n.menuItem)]), Nr = (e) => {
1794
+ const t = $(e.metadata.panels);
1795
+ return e.metadata.panels.flatMap((r, n) => r.webview ? [H({
1796
+ workbench: e.workbench,
1797
+ contribution: {
1798
+ id: r.id,
1799
+ title: u(r.title, r.id),
1800
+ region: r.region,
1801
+ closable: r.closable,
1802
+ rendererId: K,
1803
+ singleton: !0,
1804
+ resourceKinds: r.resourceKind ? [r.resourceKind] : void 0,
1805
+ eligibleLocations: D(r.eligibleLocations),
1806
+ panelMenus: B(r.panelMenus, t[n]),
1807
+ ...A({
1808
+ placement: r.placement,
1809
+ declarationIndex: n
1810
+ }),
1811
+ config: {
1812
+ ..._(r.webview),
1813
+ ...r.region === "overlay" ? {
1814
+ size: "lg",
1815
+ scrollBehavior: "inside",
1816
+ contentHeight: "min(560px, calc(100dvh - 48px))"
1817
+ } : {}
1818
+ }
1764
1819
  }
1765
- }
1766
- })] : []), Dr = (e) => {
1767
- const t = [], r = e.settingsSectionId ?? Ar;
1820
+ })] : []);
1821
+ }, Ur = (e) => {
1822
+ const t = [], r = e.settingsSectionId ?? Mr;
1768
1823
  e.workbench.settings.getSection(r) || t.push(e.workbench.settings.registerSection({
1769
1824
  id: r,
1770
1825
  title: e.settingsSectionTitle ?? "Extensions"
1771
1826
  }));
1772
- const o = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((n) => [n.key, {
1773
- type: n.type,
1774
- scope: Sr(n.scope),
1775
- default: Tr(n.default),
1776
- enum: n.enum,
1777
- description: m(n.description)
1827
+ const n = Object.fromEntries((e.metadata.settingsDefinitions ?? []).map((o) => [o.key, {
1828
+ type: o.type,
1829
+ scope: Br(o.scope),
1830
+ default: $r(o.default),
1831
+ enum: o.enum,
1832
+ description: u(o.description)
1778
1833
  }]));
1779
- Object.keys(o).length > 0 && t.push(e.workbench.preferences.registerSchema({
1780
- properties: o
1834
+ Object.keys(n).length > 0 && t.push(e.workbench.preferences.registerSchema({
1835
+ properties: n
1781
1836
  }));
1782
- for (const n of e.metadata.settingsPanels)
1837
+ for (const o of e.metadata.settingsPanels)
1783
1838
  t.push(e.workbench.settings.registerPanel({
1784
- id: n.id,
1785
- title: m(n.title, n.id),
1839
+ id: o.id,
1840
+ title: u(o.title, o.id),
1786
1841
  kind: "custom",
1787
1842
  section: r,
1788
- scope: n.scope,
1789
- render: (s) => Ce({
1843
+ scope: o.scope,
1844
+ render: (s) => Se({
1790
1845
  context: {
1791
1846
  workbench: s.workbench,
1792
- webviewId: n.id,
1847
+ webviewId: o.id,
1793
1848
  placement: {
1794
1849
  ...s.instance,
1795
- panelId: n.id
1850
+ panelId: o.id
1796
1851
  },
1797
- hostEvents: Re(s.workbench, s.instance)
1852
+ hostEvents: Te(s.workbench, s.instance)
1798
1853
  },
1799
- createHostCapabilities: Ke(e, "settings"),
1854
+ createHostCapabilities: Le(e, "settings"),
1800
1855
  createProps: e.createWebviewProps ?? (({
1801
- placement: a
1856
+ placement: i
1802
1857
  }) => ({
1803
- placement: a,
1804
- resource: a.resource
1858
+ placement: i,
1859
+ resource: i.resource
1805
1860
  })),
1806
1861
  createTheme: e.createWebviewTheme,
1807
- ownerId: n.extensionId,
1808
- title: m(n.title, n.id),
1809
- webview: N(n.webview)
1862
+ ownerId: o.extensionId,
1863
+ title: u(o.title, o.id),
1864
+ webview: _(o.webview)
1810
1865
  })
1811
1866
  }));
1812
1867
  return t;
1813
- }, Hr = (e) => {
1868
+ }, _r = (e) => {
1814
1869
  const t = /* @__PURE__ */ new Set();
1815
- for (const o of e.metadata.panels) o.resourceKind && t.add(o.resourceKind);
1816
- for (const o of e.metadata.kanbanRenderers ?? []) o.resourceKind && t.add(o.resourceKind);
1870
+ for (const n of e.metadata.panels) n.resourceKind && t.add(n.resourceKind);
1871
+ for (const n of e.metadata.kanbanRenderers ?? []) n.resourceKind && t.add(n.resourceKind);
1817
1872
  const r = [];
1818
- for (const o of t) {
1819
- e.workbench.resources.getKind(o) || r.push(e.workbench.resources.registerKind({
1820
- kind: o,
1821
- label: o,
1873
+ for (const n of t) {
1874
+ e.workbench.resources.getKind(n) || r.push(e.workbench.resources.registerKind({
1875
+ kind: n,
1876
+ label: n,
1822
1877
  icon: "FileText",
1823
1878
  surface: "primary"
1824
1879
  }));
1825
- const n = e.metadata.panels.filter((s) => s.resourceKind === o && s.region !== "overlay");
1826
- n.length > 0 && r.push(e.workbench.resources.registerPresenter({
1827
- id: `workbench.extension.resource.${o}`,
1828
- canOpen: (s) => s.kind === o,
1880
+ const o = e.metadata.panels.filter((s) => s.resourceKind === n && s.region !== "overlay");
1881
+ o.length > 0 && r.push(e.workbench.resources.registerPresenter({
1882
+ id: `workbench.extension.resource.${n}`,
1883
+ canOpen: (s) => s.kind === n,
1829
1884
  open: (s) => {
1830
- const a = n.map((d) => e.workbench.layout.openPanel(d.id, {
1885
+ const i = o.map((d) => e.workbench.layout.openPanel(d.id, {
1831
1886
  resource: s,
1832
- title: s.label ?? s.id ?? s.uri
1887
+ title: s.label ?? s.id ?? s.uri,
1888
+ strategy: {
1889
+ kind: "persistent"
1890
+ }
1833
1891
  }));
1834
- return a.find((d, c) => n[c]?.region === "main") ?? a[0];
1892
+ return i.find((d, c) => o[c]?.region === "main") ?? i[0];
1835
1893
  }
1836
1894
  }));
1837
1895
  }
1838
1896
  return r;
1839
- }, Vr = (e, t) => {
1840
- t.panel && e.layout.openPanel(t.panel, {
1897
+ }, qr = (e, t) => {
1898
+ if (!t.panel) return;
1899
+ e.layout.openPanel(t.panel, {
1841
1900
  region: t.region,
1842
1901
  pinned: t.pinned,
1843
- title: m(t.title)
1844
- });
1845
- }, Fr = (e, t, r) => {
1902
+ title: u(t.title),
1903
+ strategy: {
1904
+ kind: "persistent"
1905
+ }
1906
+ }), (t.region ?? e.layout.getPanel(t.panel)?.region) === "side" && e.shell.setSidePanelPresentation("attached");
1907
+ }, zr = (e, t, r) => {
1846
1908
  if (!r.resource) return;
1847
- const o = e.metadata.routes.find((n) => n.id === r.resource || n.path === r.resource);
1848
- o && t.resources.openResource(Z(o, e.routeResourceKind ?? Y));
1849
- }, Lr = (e, t, r) => {
1850
- for (const o of r.layout?.open ?? [])
1851
- Vr(t, o), Fr(e, t, o);
1852
- }, Or = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
1909
+ const n = e.metadata.routes.find((o) => o.id === r.resource || o.path === r.resource);
1910
+ n && t.resources.openResource(ne(n, e.routeResourceKind ?? ee));
1911
+ }, Qr = (e, t, r) => {
1912
+ for (const n of r.layout?.open ?? [])
1913
+ qr(t, n), zr(e, t, n);
1914
+ }, Gr = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
1853
1915
  id: t.modeId,
1854
- label: m(t.label, t.modeId),
1916
+ label: u(t.label, t.modeId),
1855
1917
  panels: t.layout?.panels,
1856
1918
  activate: () => {
1857
1919
  },
1858
1920
  seed: (r) => {
1859
- Lr(e, r, t);
1921
+ Qr(e, r, t);
1860
1922
  }
1861
- })), io = (e) => {
1923
+ })), pn = (e) => {
1862
1924
  const t = [], r = e;
1863
- return jr(e, t), t.push(...Kr(r, e.metadata)), t.push(...Mr(e, r)), t.push(...$r(e, r)), t.push(Ir(e)), t.push(Ft(e)), t.push(...Br(e)), t.push(dr(r, e.metadata.kanbanRenderers ?? [])), t.push(Pt(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels)), t.push(It(r, e.metadata.commandPaletteResources ?? [])), t.push(...Dr(e)), t.push(...vr({
1925
+ return Lr(e, t), t.push(...Or(r, e.metadata)), t.push(...Vr(e, r)), t.push(...Fr(e, r)), t.push(xr(e)), t.push(zt(e)), t.push(...Nr(e)), t.push(pr(r, e.metadata.kanbanRenderers ?? [])), t.push(Dt(r, e.metadata.dataTableRenderers ?? [], e.metadata.panels)), t.push(Et(r, e.metadata.commandPaletteResources ?? [])), t.push(...Ur(e)), t.push(...Pr({
1864
1926
  metadata: e.metadata,
1865
- routeResourceKind: e.routeResourceKind ?? Y,
1927
+ routeResourceKind: e.routeResourceKind ?? ee,
1866
1928
  workbench: e.workbench
1867
- })), t.push(...xr({
1929
+ })), t.push(...Kr({
1868
1930
  metadata: e.metadata,
1869
1931
  openHref: e.openHref,
1870
- routeResourceKind: e.routeResourceKind ?? Y,
1932
+ routeResourceKind: e.routeResourceKind ?? ee,
1871
1933
  workbench: e.workbench
1872
- })), t.push(...Hr(e)), t.push(...Or(e)), {
1934
+ })), t.push(..._r(e)), t.push(...Gr(e)), {
1873
1935
  dispose() {
1874
- Pr(t);
1936
+ Dr(t);
1875
1937
  }
1876
1938
  };
1877
- }, Nr = (e) => new Set((e.treeRenderers ?? []).flatMap((t) => [t.bodyCommandId, t.childrenCommandId, t.footerCommandId].filter((r) => r))), Ur = (e) => new Set((e.kanbanRenderers ?? []).map((t) => t.queryCommandId)), _r = (e) => new Set((e.dataTableRenderers ?? []).map((t) => t.queryCommandId)), ge = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), qr = (e, t) => {
1939
+ }, Yr = (e) => new Set((e.treeRenderers ?? []).flatMap((t) => [t.bodyCommandId, t.childrenCommandId, t.footerCommandId].filter((r) => r))), Xr = (e) => new Set((e.kanbanRenderers ?? []).map((t) => t.queryCommandId)), Jr = (e) => new Set((e.dataTableRenderers ?? []).map((t) => t.queryCommandId)), Ce = (e, t) => e.layout.listPanelInstances().find((r) => r.panelId === t), Zr = (e, t) => {
1878
1940
  if (t)
1879
1941
  try {
1880
1942
  e.layout.activatePanel(t);
1881
1943
  } catch {
1882
1944
  }
1883
- }, zr = (e, t) => !Nr(e).has(t), Qr = (e, t) => !Ur(e).has(t), Gr = (e, t) => !_r(e).has(t), Yr = (e, t) => {
1945
+ }, en = (e, t) => !Yr(e).has(t), tn = (e, t) => !Xr(e).has(t), rn = (e, t) => !Jr(e).has(t), nn = (e, t) => {
1884
1946
  const r = e.layout.getLayout().activeWidgetId;
1885
- for (const o of t.panels) {
1886
- if (!o.webview || o.region === "overlay") continue;
1887
- const n = ge(e, o.id);
1888
- n && e.layout.openPanel(o.id, {
1889
- resource: n.resource,
1890
- title: m(o.title, n.title)
1947
+ for (const n of t.panels) {
1948
+ if (!n.webview || n.region === "overlay") continue;
1949
+ const o = Ce(e, n.id);
1950
+ o && e.layout.openPanel(n.id, {
1951
+ resource: o.resource,
1952
+ title: u(n.title, o.title),
1953
+ strategy: {
1954
+ kind: "replace-panel",
1955
+ instanceId: o.instanceId
1956
+ }
1891
1957
  });
1892
1958
  }
1893
- for (const o of t.routes) {
1894
- if (!o.webview) continue;
1895
- const n = ge(e, o.id);
1896
- n && e.layout.openPanel(o.id, {
1897
- resource: n.resource,
1898
- title: m(o.label, n.title)
1959
+ for (const n of t.routes) {
1960
+ if (!n.webview) continue;
1961
+ const o = Ce(e, n.id);
1962
+ o && e.layout.openPanel(n.id, {
1963
+ resource: o.resource,
1964
+ title: u(n.label, o.title),
1965
+ strategy: {
1966
+ kind: "replace-panel",
1967
+ instanceId: o.instanceId
1968
+ }
1899
1969
  });
1900
1970
  }
1901
- qr(e, r);
1902
- }, ao = (e, t, r) => {
1903
- if (Yr(e, t), zr(t, r))
1904
- for (const o of t.treeRenderers ?? []) e.renderers.refresh(o.id);
1905
- if (Qr(t, r))
1906
- for (const o of t.kanbanRenderers ?? []) e.renderers.refreshKanbanRenderer(o.id);
1907
- if (Gr(t, r))
1908
- for (const o of t.dataTableRenderers ?? [])
1909
- e.renderers.refreshDataTableRenderer(o.id);
1971
+ Zr(e, r);
1972
+ }, hn = (e, t, r) => {
1973
+ if (nn(e, t), en(t, r))
1974
+ for (const n of t.treeRenderers ?? []) e.renderers.refresh(n.id);
1975
+ if (tn(t, r))
1976
+ for (const n of t.kanbanRenderers ?? []) e.renderers.refreshKanbanRenderer(n.id);
1977
+ if (rn(t, r))
1978
+ for (const n of t.dataTableRenderers ?? [])
1979
+ e.renderers.refreshDataTableRenderer(n.id);
1910
1980
  };
1911
1981
  export {
1912
- W as BRIDGE_WEBVIEW_RENDERER_ID,
1913
- $t as buildWorkbenchExtensionCommandPaletteRegistrations,
1914
- Mt as buildWorkbenchExtensionMenuRegistrations,
1915
- so as buildWorkbenchExtensionRouteEntries,
1916
- bt as createBridgeWebviewRenderer,
1917
- it as createTerminalSessionCapability,
1918
- ve as createWorkbenchWebviewHostCapabilities,
1919
- no as emptyWorkbenchExtensionMetadata,
1920
- Yr as refreshOpenWorkbenchExtensionWebviews,
1921
- ao as refreshWorkbenchExtensionContributions,
1922
- It as registerWorkbenchExtensionCommandPaletteResources,
1923
- io as registerWorkbenchExtensionContributions,
1924
- oo as registerWorkbenchExtensionControlsRenderers,
1925
- Pt as registerWorkbenchExtensionDataTableRenderers,
1926
- Ft as registerWorkbenchExtensionFileRenderers,
1927
- dr as registerWorkbenchExtensionKanbanRenderers,
1928
- $ as registerWorkbenchExtensionPanel,
1929
- Ir as registerWorkbenchExtensionTreeRenderers,
1930
- Ce as renderBridgeWebviewFrame,
1931
- Gr as shouldRefreshWorkbenchExtensionDataTableRenderers,
1932
- zr as shouldRefreshWorkbenchExtensionTrees
1982
+ K as BRIDGE_WEBVIEW_RENDERER_ID,
1983
+ Ft as buildWorkbenchExtensionCommandPaletteRegistrations,
1984
+ Vt as buildWorkbenchExtensionMenuRegistrations,
1985
+ fn as buildWorkbenchExtensionRouteEntries,
1986
+ It as createBridgeWebviewRenderer,
1987
+ ut as createTerminalSessionCapability,
1988
+ Ae as createWorkbenchWebviewHostCapabilities,
1989
+ bn as emptyWorkbenchExtensionMetadata,
1990
+ $ as panelMenuDeclarationOffsets,
1991
+ nn as refreshOpenWorkbenchExtensionWebviews,
1992
+ hn as refreshWorkbenchExtensionContributions,
1993
+ Et as registerWorkbenchExtensionCommandPaletteResources,
1994
+ pn as registerWorkbenchExtensionContributions,
1995
+ un as registerWorkbenchExtensionControlsRenderers,
1996
+ Dt as registerWorkbenchExtensionDataTableRenderers,
1997
+ zt as registerWorkbenchExtensionFileRenderers,
1998
+ pr as registerWorkbenchExtensionKanbanRenderers,
1999
+ H as registerWorkbenchExtensionPanel,
2000
+ xr as registerWorkbenchExtensionTreeRenderers,
2001
+ Se as renderBridgeWebviewFrame,
2002
+ rn as shouldRefreshWorkbenchExtensionDataTableRenderers,
2003
+ en as shouldRefreshWorkbenchExtensionTrees,
2004
+ A as toWorkbenchExtensionPlacementMetadata
1933
2005
  };
1934
2006
  //# sourceMappingURL=extensions.js.map