@pstdio/workbench 0.46.0-nightly.20261031030226 → 0.46.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,13 +1,14 @@
1
- import { Ct as e, Et as t, G as n, J as r, St as i, Tt as a, a as o, dt as s, ft as c, lt as l, o as u, ut as d, vt as f, wt as p, xt as m, z as h } from "./react-ipVtdoJh.js";
2
- import { n as g, r as _ } from "./navigation-tree-registry-CKvYht0r.js";
3
- import { br as v, ht as y, m as b, yr as ee } from "./shortcut-menu-DiihUISb.js";
4
- import { z as x } from "zod";
5
- import { CommandOutcomeError as S, commandRefId as C, contributionRefId as w, getCommandValue as T, isLocalizedString as E, isNavigationTarget as D, matchesResourceWhen as te, resourceKey as ne } from "@pstdio/sdk/extensions";
6
- import { normalizeHotkey as re } from "@tanstack/hotkeys";
7
- import { c as ie } from "react/compiler-runtime";
8
- import { Box as ae, Center as oe, Stack as se, Text as ce } from "@chakra-ui/react";
9
- import { createElement as O, useEffect as le, useState as ue } from "react";
10
- import { jsx as k, jsxs as de } from "react/jsx-runtime";
1
+ import { Ct as e, Et as t, G as n, J as r, St as i, Tt as a, a as o, dt as s, ft as c, lt as l, o as u, ut as d, vt as f, wt as p, xt as m, z as h } from "./react-CkvfnPLG.js";
2
+ import { n as g, r as _ } from "./navigation-tree-registry-BntKl6QC.js";
3
+ import { br as ee, ht as v, m as y, yr as te } from "./shortcut-menu-BtehFEA6.js";
4
+ import { z as b } from "zod";
5
+ import { CommandOutcomeError as ne, commandRefId as x, contributionRefId as S, getCommandValue as C, isLocalizedString as w, isNavigationTarget as T, matchesResourceWhen as E, resourceKey as D } from "@pstdio/sdk/extensions";
6
+ import { normalizeHotkey as O } from "@tanstack/hotkeys";
7
+ import { c as re } from "react/compiler-runtime";
8
+ import { Box as ie, Center as ae, Stack as oe, Text as se } from "@chakra-ui/react";
9
+ import { useUiScope as ce } from "@pstdio/ui";
10
+ import { createElement as k, useEffect as le, useState as ue } from "react";
11
+ import { jsx as A, jsxs as de } from "react/jsx-runtime";
11
12
  import { renderBadgeListDisplay as fe } from "@pstdio/ui/kanban-renderer";
12
13
  // ../pstdio-api-contracts/src/extension-kernel/workbench-targets.ts
13
14
  var pe = ["workbench.nav.actions", "workbench.nav.overflow"], me = [
@@ -37,17 +38,17 @@ var pe = ["workbench.nav.actions", "workbench.nav.overflow"], me = [
37
38
  "workbench.main",
38
39
  "workbench.main.right",
39
40
  "workbench.secondary"
40
- ], be = x.enum(pe), xe = x.enum(me);
41
- x.enum(he);
42
- var Se = x.enum(ge), Ce = x.enum(_e);
43
- x.enum(ye);
44
- var we = x.union([
41
+ ], be = b.enum(pe), xe = b.enum(me);
42
+ b.enum(he);
43
+ var Se = b.enum(ge), Ce = b.enum(_e);
44
+ b.enum(ye);
45
+ var we = b.union([
45
46
  be,
46
47
  xe,
47
48
  Se,
48
49
  Ce
49
50
  ]);
50
- x.enum(ve);
51
+ b.enum(ve);
51
52
  // ../pstdio-api-contracts/src/extension-kernel/types/composition.ts
52
53
  var Te = [
53
54
  "main",
@@ -61,33 +62,33 @@ var Te = [
61
62
  } catch {
62
63
  return !1;
63
64
  }
64
- }, De = x.union([
65
- x.string(),
66
- x.number(),
67
- x.boolean(),
68
- x.array(x.string())
65
+ }, De = b.union([
66
+ b.string(),
67
+ b.number(),
68
+ b.boolean(),
69
+ b.array(b.string())
69
70
  ]);
70
- x.record(x.string(), x.discriminatedUnion("type", [
71
- x.object({
72
- type: x.literal("string"),
73
- default: x.string().optional(),
74
- values: x.array(x.string()).readonly().optional()
71
+ b.record(b.string(), b.discriminatedUnion("type", [
72
+ b.object({
73
+ type: b.literal("string"),
74
+ default: b.string().optional(),
75
+ values: b.array(b.string()).readonly().optional()
75
76
  }).strict(),
76
- x.object({
77
- type: x.literal("number"),
78
- default: x.number().optional()
77
+ b.object({
78
+ type: b.literal("number"),
79
+ default: b.number().optional()
79
80
  }).strict(),
80
- x.object({
81
- type: x.literal("boolean"),
82
- default: x.boolean().optional()
81
+ b.object({
82
+ type: b.literal("boolean"),
83
+ default: b.boolean().optional()
83
84
  }).strict(),
84
- x.object({
85
- type: x.literal("string[]"),
86
- default: x.array(x.string()).readonly().optional()
85
+ b.object({
86
+ type: b.literal("string[]"),
87
+ default: b.array(b.string()).readonly().optional()
87
88
  }).strict()
88
89
  ])).superRefine((e, t) => {
89
90
  try {
90
- v(e);
91
+ ee(e);
91
92
  } catch (e) {
92
93
  t.addIssue({
93
94
  code: "custom",
@@ -96,216 +97,216 @@ x.record(x.string(), x.discriminatedUnion("type", [
96
97
  }
97
98
  });
98
99
  // ../pstdio-api-contracts/src/extensions/workbench-refs-metadata.ts
99
- var A = (e) => x.object({
100
- extensionId: x.string(),
101
- kind: x.literal(e),
102
- id: x.string()
103
- }), Oe = A("page"), ke = A("placement");
104
- A("mode"), A("view"), A("resource-kind");
105
- var Ae = x.object({
106
- kind: x.literal("page-slot"),
100
+ var j = (e) => b.object({
101
+ extensionId: b.string(),
102
+ kind: b.literal(e),
103
+ id: b.string()
104
+ }), Oe = j("page"), ke = j("placement");
105
+ j("mode"), j("view"), j("resource-kind");
106
+ var Ae = b.object({
107
+ kind: b.literal("page-slot"),
107
108
  page: Oe,
108
- id: x.string()
109
- }), je = x.union([ke, Ae]), Me = x.object({
110
- command: A("command"),
109
+ id: b.string()
110
+ }), je = b.union([ke, Ae]), Me = b.object({
111
+ command: j("command"),
111
112
  params: t.optional()
112
- }), Ne = x.object({
113
- line: x.number().int().positive(),
114
- column: x.number().int().positive().optional(),
115
- endLine: x.number().int().positive().optional(),
116
- endColumn: x.number().int().positive().optional()
117
- }).refine(_, "Expected ordered source coordinates"), Pe = x.object({ anchors: x.array(x.object({
118
- id: x.string(),
119
- heading: x.string(),
120
- occurrence: x.number().int().nonnegative().optional()
121
- })) }), Fe = x.lazy(() => x.object({
122
- kind: x.literal("page"),
113
+ }), Ne = b.object({
114
+ line: b.number().int().positive(),
115
+ column: b.number().int().positive().optional(),
116
+ endLine: b.number().int().positive().optional(),
117
+ endColumn: b.number().int().positive().optional()
118
+ }).refine(_, "Expected ordered source coordinates"), Pe = b.object({ anchors: b.array(b.object({
119
+ id: b.string(),
120
+ heading: b.string(),
121
+ occurrence: b.number().int().nonnegative().optional()
122
+ })) }), Fe = b.lazy(() => b.object({
123
+ kind: b.literal("page"),
123
124
  page: Oe,
124
125
  resource: i.optional(),
125
- open: x.enum(["preview", "pin"]).optional(),
126
+ open: b.enum(["preview", "pin"]).optional(),
126
127
  section: Pe.optional(),
127
128
  position: Ne.optional(),
128
- params: x.record(x.string(), De).optional(),
129
+ params: b.record(b.string(), De).optional(),
129
130
  parent: Fe.optional(),
130
- intent: x.enum(["open", "restore"]).optional()
131
- }).refine((e) => !(e.position && e.section), "Choose a source position or a heading section")).meta({ id: "WorkbenchMetadataPageTarget" }), Ie = x.union([Fe, x.object({
132
- kind: x.literal("panel"),
131
+ intent: b.enum(["open", "restore"]).optional()
132
+ }).refine((e) => !(e.position && e.section), "Choose a source position or a heading section")).meta({ id: "WorkbenchMetadataPageTarget" }), Ie = b.union([Fe, b.object({
133
+ kind: b.literal("panel"),
133
134
  panel: je,
134
135
  resource: i.optional(),
135
- open: x.enum(["preview", "pin"]).optional()
136
- })]), Le = x.union([
136
+ open: b.enum(["preview", "pin"]).optional()
137
+ })]), Le = b.union([
137
138
  Ie,
138
- x.object({
139
- kind: x.literal("viewer"),
140
- operation: x.enum(["switch", "replace"]),
139
+ b.object({
140
+ kind: b.literal("viewer"),
141
+ operation: b.enum(["switch", "replace"]),
141
142
  from: i.optional(),
142
143
  resource: i,
143
144
  page: Oe.optional(),
144
145
  section: Pe.optional(),
145
146
  position: Ne.optional()
146
147
  }).strict().refine((e) => e.from !== void 0 || e.page !== void 0, "A resource-free landing requires its destination page").refine((e) => !(e.position && e.section), "Choose a source position or a heading section"),
147
- x.object({
148
- kind: x.literal("command"),
148
+ b.object({
149
+ kind: b.literal("command"),
149
150
  target: Me
150
151
  }),
151
- x.object({
152
- kind: x.literal("href"),
153
- href: x.string().refine(Ee, "Expected an HTTP or HTTPS URL")
152
+ b.object({
153
+ kind: b.literal("href"),
154
+ href: b.string().refine(Ee, "Expected an HTTP or HTTPS URL")
154
155
  }),
155
- x.object({
156
- kind: x.literal("compound"),
157
- targets: x.array(Ie).min(1)
156
+ b.object({
157
+ kind: b.literal("compound"),
158
+ targets: b.array(Ie).min(1)
158
159
  })
159
- ]), Re = x.object({
160
- type: x.enum([
160
+ ]), Re = b.object({
161
+ type: b.enum([
161
162
  "info",
162
163
  "success",
163
164
  "warning",
164
165
  "error"
165
166
  ]),
166
- title: x.string().optional(),
167
- message: x.string(),
167
+ title: b.string().optional(),
168
+ message: b.string(),
168
169
  metadata: t.optional()
169
- }), ze = x.object({
170
- code: x.string(),
171
- message: x.string(),
172
- severity: x.enum([
170
+ }), ze = b.object({
171
+ code: b.string(),
172
+ message: b.string(),
173
+ severity: b.enum([
173
174
  "info",
174
175
  "warning",
175
176
  "error"
176
177
  ]),
177
- extensionId: x.string().optional(),
178
- commandId: x.string().optional(),
178
+ extensionId: b.string().optional(),
179
+ commandId: b.string().optional(),
179
180
  metadata: t.optional()
180
181
  }), Be = (e) => {
181
- let n = x.object({
182
- name: x.string().optional(),
183
- message: x.string(),
184
- stack: x.string().optional(),
182
+ let n = b.object({
183
+ name: b.string().optional(),
184
+ message: b.string(),
185
+ stack: b.string().optional(),
185
186
  cause: e.optional()
186
187
  }), r = {
187
- notices: x.array(Re).optional(),
188
- diagnostics: x.array(ze).optional()
188
+ notices: b.array(Re).optional(),
189
+ diagnostics: b.array(ze).optional()
189
190
  }, i = {
190
191
  ...r,
191
- ok: x.literal(!1),
192
- code: x.string().optional(),
193
- reason: x.string(),
192
+ ok: b.literal(!1),
193
+ code: b.string().optional(),
194
+ reason: b.string(),
194
195
  data: t.optional(),
195
196
  cause: e.optional(),
196
197
  error: n.optional()
197
198
  }, a = Le;
198
- return x.discriminatedUnion("status", [
199
- x.object({
199
+ return b.discriminatedUnion("status", [
200
+ b.object({
200
201
  ...r,
201
- ok: x.literal(!0),
202
- status: x.literal("success"),
203
- value: x.unknown().optional(),
204
- navigationRequests: x.array(a).optional()
202
+ ok: b.literal(!0),
203
+ status: b.literal("success"),
204
+ value: b.unknown().optional(),
205
+ navigationRequests: b.array(a).optional()
205
206
  }).transform((e) => ({
206
207
  ...e,
207
208
  value: e.value
208
209
  })),
209
- x.object({
210
+ b.object({
210
211
  ...i,
211
- status: x.literal("rejected")
212
+ status: b.literal("rejected")
212
213
  }),
213
- x.object({
214
+ b.object({
214
215
  ...i,
215
- status: x.literal("error")
216
+ status: b.literal("error")
216
217
  })
217
218
  ]);
218
- }, Ve = Be(x.json()), He = x.object({
219
- id: x.string(),
219
+ }, Ve = Be(b.json()), He = b.object({
220
+ id: b.string(),
220
221
  kind: p,
221
222
  context: a
222
- }), Ue = x.object({
223
+ }), Ue = b.object({
223
224
  target: we,
224
- mode: x.string().optional(),
225
- projectId: x.string().optional(),
225
+ mode: b.string().optional(),
226
+ projectId: b.string().optional(),
226
227
  resource: i.optional()
227
228
  });
228
- x.object({
229
- rendererId: x.string(),
230
- pageParams: x.record(x.string(), De).optional(),
231
- projectId: x.string().optional(),
232
- modeId: x.string().optional(),
229
+ b.object({
230
+ rendererId: b.string(),
231
+ pageParams: b.record(b.string(), De).optional(),
232
+ projectId: b.string().optional(),
233
+ modeId: b.string().optional(),
233
234
  resource: i.optional(),
234
- invocation: x.object({ placement: x.enum(["visible", "background"]) }).optional()
235
- }), x.object({
236
- projectId: x.string().min(1),
237
- workspaceId: x.string().optional(),
235
+ invocation: b.object({ placement: b.enum(["visible", "background"]) }).optional()
236
+ }), b.object({
237
+ projectId: b.string().min(1),
238
+ workspaceId: b.string().optional(),
238
239
  params: a.optional(),
239
240
  resource: i.optional(),
240
241
  attachment: Ue.optional(),
241
242
  slot: He.optional(),
242
243
  source: e.optional(),
243
244
  metadata: a.optional()
244
- }), x.object({
245
- workspaceId: x.string().optional(),
245
+ }), b.object({
246
+ workspaceId: b.string().optional(),
246
247
  params: a.optional(),
247
248
  resource: i.optional(),
248
249
  attachment: Ue.optional(),
249
250
  slot: He.optional(),
250
251
  source: e.optional(),
251
252
  metadata: a.optional()
252
- }), x.object({
253
- eventId: x.string().min(1),
253
+ }), b.object({
254
+ eventId: b.string().min(1),
254
255
  payload: a
255
256
  }).strict();
256
- var We = Le, Ge = x.object({
257
- ok: x.boolean(),
258
- status: x.enum([
257
+ var We = Le, Ge = b.object({
258
+ ok: b.boolean(),
259
+ status: b.enum([
259
260
  "success",
260
261
  "rejected",
261
262
  "error"
262
263
  ]),
263
- value: x.unknown().optional(),
264
- navigationRequests: x.array(We).optional(),
265
- code: x.string().optional(),
266
- reason: x.string().optional(),
264
+ value: b.unknown().optional(),
265
+ navigationRequests: b.array(We).optional(),
266
+ code: b.string().optional(),
267
+ reason: b.string().optional(),
267
268
  data: a.optional(),
268
- error: x.object({
269
- name: x.string().optional(),
270
- message: x.string(),
271
- stack: x.string().optional()
269
+ error: b.object({
270
+ name: b.string().optional(),
271
+ message: b.string(),
272
+ stack: b.string().optional()
272
273
  }).optional(),
273
- notices: x.array(x.object({
274
- type: x.enum([
274
+ notices: b.array(b.object({
275
+ type: b.enum([
275
276
  "info",
276
277
  "success",
277
278
  "warning",
278
279
  "error"
279
280
  ]),
280
- title: x.string().optional(),
281
- message: x.string(),
281
+ title: b.string().optional(),
282
+ message: b.string(),
282
283
  metadata: a.optional()
283
284
  })).optional(),
284
- diagnostics: x.array(x.object({
285
- code: x.string(),
286
- message: x.string(),
287
- severity: x.enum([
285
+ diagnostics: b.array(b.object({
286
+ code: b.string(),
287
+ message: b.string(),
288
+ severity: b.enum([
288
289
  "info",
289
290
  "warning",
290
291
  "error"
291
292
  ]),
292
- extensionId: x.string().optional(),
293
- commandId: x.string().optional(),
293
+ extensionId: b.string().optional(),
294
+ commandId: b.string().optional(),
294
295
  metadata: a.optional()
295
296
  })).optional()
296
297
  }), Ke = {
297
- commandId: x.string(),
298
- extensionId: x.string(),
299
- eventIds: x.array(x.string()).optional()
298
+ commandId: b.string(),
299
+ extensionId: b.string(),
300
+ eventIds: b.array(b.string()).optional()
300
301
  };
301
- x.object({
302
+ b.object({
302
303
  ...Ke,
303
304
  outcome: Ge
304
305
  });
305
- var qe = ((e) => x.object({
306
+ var qe = ((e) => b.object({
306
307
  ...Ke,
307
308
  outcome: Be(e)
308
- }))(x.json()), Je = [
309
+ }))(b.json()), Je = [
309
310
  "is-any-of",
310
311
  "is-none-of",
311
312
  "is-empty",
@@ -357,25 +358,25 @@ var qe = ((e) => x.object({
357
358
  }, Xe = {
358
359
  conjunction: "and",
359
360
  rules: []
360
- }, Ze = [...new Set(Object.values(Ye).flat())], Qe = x.enum(Ze), $e = x.object({
361
- attributeId: x.string().min(1),
361
+ }, Ze = [...new Set(Object.values(Ye).flat())], Qe = b.enum(Ze), $e = b.object({
362
+ attributeId: b.string().min(1),
362
363
  condition: Qe,
363
- value: x.union([
364
- x.boolean(),
365
- x.string(),
366
- x.number(),
367
- x.array(x.string())
364
+ value: b.union([
365
+ b.boolean(),
366
+ b.string(),
367
+ b.number(),
368
+ b.array(b.string())
368
369
  ]).optional()
369
- }), et = x.strictObject({
370
- conjunction: x.enum(["and", "or"]),
371
- rules: x.array($e)
370
+ }), et = b.strictObject({
371
+ conjunction: b.enum(["and", "or"]),
372
+ rules: b.array($e)
372
373
  });
373
- et.extend({ groups: x.array(et).optional() }).refine((e) => !e.groups?.length || e.conjunction === "and", { message: "Normal rules and advanced groups combine using AND" });
374
- var tt = x.object({
375
- attributeId: x.string().min(1),
376
- direction: x.enum(["asc", "desc"])
374
+ et.extend({ groups: b.array(et).optional() }).refine((e) => !e.groups?.length || e.conjunction === "and", { message: "Normal rules and advanced groups combine using AND" });
375
+ var tt = b.object({
376
+ attributeId: b.string().min(1),
377
+ direction: b.enum(["asc", "desc"])
377
378
  });
378
- x.array(tt).max(1, "A view allows only one sort");
379
+ b.array(tt).max(1, "A view allows only one sort");
379
380
  // ../pstdio-api-contracts/src/extension-kernel/types/data-table-renderer.ts
380
381
  var nt = {
381
382
  grouping: "none",
@@ -417,12 +418,12 @@ var nt = {
417
418
  builtIn: !0
418
419
  }]
419
420
  };
420
- }, at = (e) => it(rt, e), ot = (e) => it(nt, e), st = x.object({
421
+ }, at = (e) => it(rt, e), ot = (e) => it(nt, e), st = b.object({
421
422
  resource: i,
422
- autoOpen: x.boolean().optional(),
423
- region: x.enum(Te),
424
- open: x.enum(["preview", "pin"]).optional()
425
- }), j = (e) => typeof e == "object" && !!e && !Array.isArray(e), ct = (e, t, n = []) => {
423
+ autoOpen: b.boolean().optional(),
424
+ region: b.enum(Te),
425
+ open: b.enum(["preview", "pin"]).optional()
426
+ }), ct = (e) => typeof e == "object" && !!e && !Array.isArray(e), lt = (e, t, n = []) => {
426
427
  let r = [];
427
428
  if (Object.keys(e).some((e) => !Object.hasOwn(t, e))) return [{
428
429
  path: n,
@@ -432,7 +433,7 @@ var nt = {
432
433
  let t = e[i];
433
434
  if (JSON.stringify(t) === JSON.stringify(a)) continue;
434
435
  let o = [...n, i];
435
- t !== void 0 && j(t) && j(a) ? r.push(...ct(t, a, o)) : r.push({
436
+ t !== void 0 && ct(t) && ct(a) ? r.push(...lt(t, a, o)) : r.push({
436
437
  path: o,
437
438
  value: a
438
439
  });
@@ -447,19 +448,19 @@ var nt = {
447
448
  "prototype"
448
449
  ].includes(e))) throw Error("Invalid editing path");
449
450
  if (e.path.length === 0) {
450
- if (!j(e.value)) throw Error("The editing state root must be an object");
451
+ if (!ct(e.value)) throw Error("The editing state root must be an object");
451
452
  n = structuredClone(e.value);
452
453
  continue;
453
454
  }
454
455
  let t = n;
455
456
  for (let n of e.path.slice(0, -1)) {
456
- if (t[n] === void 0 && (t[n] = {}), !j(t[n])) throw Error("Editing paths must traverse objects");
457
+ if (t[n] === void 0 && (t[n] = {}), !ct(t[n])) throw Error("Editing paths must traverse objects");
457
458
  t = t[n];
458
459
  }
459
460
  t[e.path.at(-1)] = structuredClone(e.value);
460
461
  }
461
462
  return n;
462
- }, lt = (e, t) => {
463
+ }, ut = (e, t) => {
463
464
  let n = e, r = /* @__PURE__ */ new Map();
464
465
  for (let [e, i] of t) try {
465
466
  n = M(n, i), r.set(e, i);
@@ -468,16 +469,16 @@ var nt = {
468
469
  value: n,
469
470
  drafts: r
470
471
  };
471
- }, ut = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", N = (e) => !(!e || typeof e != "object" || Array.isArray(e)), P = (e, t) => N(e) && e.kind === t && typeof e.id == "string", dt = (e) => N(e) && typeof e.type == "string" && typeof e.id == "string", ft = (e) => e === void 0 || e === "preview" || e === "pin", pt = (e, t = /* @__PURE__ */ new Set()) => {
472
- if (!N(e) || e.kind !== "page" || !P(e.page, "page") || t.has(e) || e.resource !== void 0 && !dt(e.resource) || e.section !== void 0 && !N(e.section) || e.position !== void 0 && (!_(e.position) || e.section !== void 0) || !ft(e.open) || e.intent !== void 0 && e.intent !== "open" && e.intent !== "restore") return !1;
472
+ }, dt = (e) => typeof e == "object" && !!e && "$l10n" in e && typeof e.$l10n == "string", N = (e) => !(!e || typeof e != "object" || Array.isArray(e)), P = (e, t) => N(e) && e.kind === t && typeof e.id == "string", ft = (e) => N(e) && typeof e.type == "string" && typeof e.id == "string", pt = (e) => e === void 0 || e === "preview" || e === "pin", mt = (e, t = /* @__PURE__ */ new Set()) => {
473
+ if (!N(e) || e.kind !== "page" || !P(e.page, "page") || t.has(e) || e.resource !== void 0 && !ft(e.resource) || e.section !== void 0 && !N(e.section) || e.position !== void 0 && (!_(e.position) || e.section !== void 0) || !pt(e.open) || e.intent !== void 0 && e.intent !== "open" && e.intent !== "restore") return !1;
473
474
  if (e.parent === void 0) return !0;
474
475
  let n = new Set(t);
475
- return n.add(e), pt(e.parent, n);
476
- }, mt = (e) => {
476
+ return n.add(e), mt(e.parent, n);
477
+ }, ht = (e) => {
477
478
  if (!N(e) || e.kind !== "panel" || !N(e.panel)) return !1;
478
479
  let t = e.panel;
479
- return (P(t, "placement") || t.kind === "page-slot" && P(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || dt(e.resource)) && ft(e.open);
480
- }, ht = (e) => N(e) ? e.kind === "page" ? pt(e) : e.kind === "panel" ? mt(e) : e.kind === "viewer" ? (e.operation === "switch" || e.operation === "replace") && (e.from === void 0 ? P(e.page, "page") : dt(e.from)) && dt(e.resource) && (e.page === void 0 || P(e.page, "page")) && (e.section === void 0 || N(e.section)) && (e.position === void 0 || _(e.position) && e.section === void 0) && Object.keys(e).every((e) => [
480
+ return (P(t, "placement") || t.kind === "page-slot" && P(t.page, "page") && typeof t.id == "string") && (e.resource === void 0 || ft(e.resource)) && pt(e.open);
481
+ }, gt = (e) => N(e) ? e.kind === "page" ? mt(e) : e.kind === "panel" ? ht(e) : e.kind === "viewer" ? (e.operation === "switch" || e.operation === "replace") && (e.from === void 0 ? P(e.page, "page") : ft(e.from)) && ft(e.resource) && (e.page === void 0 || P(e.page, "page")) && (e.section === void 0 || N(e.section)) && (e.position === void 0 || _(e.position) && e.section === void 0) && Object.keys(e).every((e) => [
481
482
  "kind",
482
483
  "operation",
483
484
  "from",
@@ -485,24 +486,24 @@ var nt = {
485
486
  "page",
486
487
  "section",
487
488
  "position"
488
- ].includes(e)) : e.kind === "href" ? Ee(e.href) : e.kind === "command" && N(e.target) && P(e.target.command, "command") && (e.target.params === void 0 || N(e.target.params)) : !1, gt = (e) => ht(e) ? !0 : !N(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((e) => pt(e) || mt(e)), F = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
489
+ ].includes(e)) : e.kind === "href" ? Ee(e.href) : e.kind === "command" && N(e.target) && P(e.target.command, "command") && (e.target.params === void 0 || N(e.target.params)) : !1, _t = (e) => gt(e) ? !0 : !N(e) || e.kind !== "compound" || !Array.isArray(e.targets) || e.targets.length === 0 ? !1 : e.targets.every((e) => mt(e) || ht(e)), F = (e, t) => e.extensionId !== void 0 || t === void 0 ? e : {
489
490
  ...e,
490
491
  extensionId: t
491
- }, _t = (e, t, n) => ({
492
+ }, vt = (e, t, n) => ({
492
493
  ...e,
493
494
  page: F(e.page, t),
494
- ...e.resource ? { resource: vt(e.resource, t, n) } : {},
495
- ...e.parent ? { parent: _t(e.parent, t, n) } : {}
496
- }), vt = (e, t, n) => ({
495
+ ...e.resource ? { resource: yt(e.resource, t, n) } : {},
496
+ ...e.parent ? { parent: vt(e.parent, t, n) } : {}
497
+ }), yt = (e, t, n) => ({
497
498
  ...e,
498
499
  extensionId: e.extensionId ?? t,
499
500
  projectId: e.projectId ?? n
500
- }), yt = (e, t, n) => {
501
- if (!gt(e)) throw Error("Invalid navigation target.");
502
- return e.kind === "page" ? _t(e, t, n) : e.kind === "viewer" ? {
501
+ }), bt = (e, t, n) => {
502
+ if (!_t(e)) throw Error("Invalid navigation target.");
503
+ return e.kind === "page" ? vt(e, t, n) : e.kind === "viewer" ? {
503
504
  ...e,
504
- ...e.from ? { from: vt(e.from, t, n) } : {},
505
- resource: vt(e.resource, t, n),
505
+ ...e.from ? { from: yt(e.from, t, n) } : {},
506
+ resource: yt(e.resource, t, n),
506
507
  ...e.page ? { page: F(e.page, t) } : {}
507
508
  } : e.kind === "panel" ? {
508
509
  ...e,
@@ -510,7 +511,7 @@ var nt = {
510
511
  ...e.panel,
511
512
  page: F(e.panel.page, t)
512
513
  } : F(e.panel, t),
513
- ...e.resource ? { resource: vt(e.resource, t, n) } : {}
514
+ ...e.resource ? { resource: yt(e.resource, t, n) } : {}
514
515
  } : e.kind === "command" ? {
515
516
  ...e,
516
517
  target: {
@@ -519,9 +520,9 @@ var nt = {
519
520
  }
520
521
  } : e.kind === "href" ? e : {
521
522
  ...e,
522
- targets: e.targets.map((e) => yt(e, t, n))
523
+ targets: e.targets.map((e) => bt(e, t, n))
523
524
  };
524
- }, bt = (e) => {
525
+ }, xt = (e) => {
525
526
  let t = [], n = (e) => ({
526
527
  ...e,
527
528
  name: e.name,
@@ -544,10 +545,10 @@ var nt = {
544
545
  }
545
546
  return r;
546
547
  }));
547
- }, xt = "resources.actions", St = "[pstdio.extension-host] ", Ct = (e, t = console.info) => {
548
- t(`${St}${JSON.stringify(e)}`);
549
- }, wt = (e, t) => {
550
- let n = (n) => Ct({
548
+ }, St = "resources.actions", Ct = "[pstdio.extension-host] ", wt = (e, t = console.info) => {
549
+ t(`${Ct}${JSON.stringify(e)}`);
550
+ }, Tt = (e, t) => {
551
+ let n = (n) => wt({
551
552
  extensionId: e.extensionId,
552
553
  contributionId: e.id,
553
554
  ...n
@@ -565,7 +566,7 @@ var nt = {
565
566
  });
566
567
  }
567
568
  };
568
- }, Tt = () => {
569
+ }, Et = () => {
569
570
  let e = null, t = [], n = /* @__PURE__ */ new Set();
570
571
  return {
571
572
  emit(n) {
@@ -582,81 +583,93 @@ var nt = {
582
583
  for (let e of n) e();
583
584
  }
584
585
  };
585
- }, Et = (e) => {
586
- let t = ie(40), i, a, o;
586
+ }, Dt = (e) => {
587
+ let t = re(47), i, a, o;
587
588
  t[0] === e ? (i = t[1], a = t[2], o = t[3]) : ({view: a, workbench: o, ...i} = e, t[0] = e, t[1] = i, t[2] = a, t[3] = o);
588
- let s = n(o), [c, l] = ue(o.pages.store.getState), u;
589
- t[4] === o.pages.store ? u = t[5] : (u = () => o.pages.store.subscribe((e) => l(e)), t[4] = o.pages.store, t[5] = u);
590
- let d;
591
- t[6] === o ? d = t[7] : (d = [o], t[6] = o, t[7] = d), le(u, d);
592
- let f, p;
593
- if (t[8] !== c.activePageId || t[9] !== c.location || t[10] !== o.pages) {
594
- let e = c.activePageId ? o.pages.getPage(c.activePageId) : void 0;
595
- f = c.location, p = ee(e?.params, c.location?.params), t[8] = c.activePageId, t[9] = c.location, t[10] = o.pages, t[11] = f, t[12] = p;
596
- } else f = t[11], p = t[12];
597
- let m;
598
- t[13] !== f || t[14] !== p ? (m = {
599
- pageLocation: f,
600
- pageParams: p
601
- }, t[13] = f, t[14] = p, t[15] = m) : m = t[15];
602
- let h = m, [g, _] = ue(null), v;
603
- t[16] === a ? v = t[17] : (v = wt(a), t[16] = a, t[17] = v);
604
- let y = v, b = e.sizing === "content-width" ? "max-content" : "full", x = e.sizing === "content-height" ? "auto" : "full", S;
605
- t[18] === g ? S = t[19] : (S = g ? /* @__PURE__ */ k(oe, {
589
+ let s = ce(), c = n(o), [l, u] = ue(o.pages.store.getState), d;
590
+ t[4] === o.pages.store ? d = t[5] : (d = () => o.pages.store.subscribe((e) => u(e)), t[4] = o.pages.store, t[5] = d);
591
+ let f;
592
+ t[6] === o ? f = t[7] : (f = [o], t[6] = o, t[7] = f), le(d, f);
593
+ let p, m;
594
+ if (t[8] !== l.activePageId || t[9] !== l.location || t[10] !== o.pages) {
595
+ let e = l.activePageId ? o.pages.getPage(l.activePageId) : void 0;
596
+ p = l.location, m = te(e?.params, l.location?.params), t[8] = l.activePageId, t[9] = l.location, t[10] = o.pages, t[11] = p, t[12] = m;
597
+ } else p = t[11], m = t[12];
598
+ let h;
599
+ t[13] !== p || t[14] !== m ? (h = {
600
+ pageLocation: p,
601
+ pageParams: m
602
+ }, t[13] = p, t[14] = m, t[15] = h) : h = t[15];
603
+ let g = h, [_, ee] = ue(null), v;
604
+ t[16] === a ? v = t[17] : (v = Tt(a), t[16] = a, t[17] = v);
605
+ let y = v, b = e.sizing === "content-width" ? "max-content" : "full", ne = e.sizing === "content-height" ? "auto" : "full", x;
606
+ t[18] === _ ? x = t[19] : (x = _ ? /* @__PURE__ */ A(ae, {
606
607
  position: "absolute",
607
608
  inset: "0",
608
609
  px: "md",
609
610
  zIndex: 1,
610
611
  bg: "bg",
611
- children: /* @__PURE__ */ de(se, {
612
+ children: /* @__PURE__ */ de(oe, {
612
613
  gap: "xs",
613
614
  maxW: "md",
614
615
  textAlign: "center",
615
- children: [/* @__PURE__ */ k(ce, {
616
+ children: [/* @__PURE__ */ A(se, {
616
617
  textStyle: "paragraph/S/medium",
617
618
  color: "fg.error",
618
619
  children: "Extension view failed to load."
619
- }), /* @__PURE__ */ k(ce, {
620
+ }), /* @__PURE__ */ A(se, {
620
621
  textStyle: "paragraph/XS/regular",
621
622
  color: "fg.muted",
622
- children: g
623
+ children: _
623
624
  })]
624
625
  })
625
- }) : null, t[18] = g, t[19] = S);
626
+ }) : null, t[18] = _, t[19] = x);
627
+ let S;
628
+ t[20] === s?.root.current ? S = t[21] : (S = () => s?.root.current ?? null, t[20] = s?.root.current, t[21] = S);
626
629
  let C;
627
- t[20] !== i.props || t[21] !== h ? (C = {
628
- ...i.props,
629
- ...h
630
- }, t[20] = i.props, t[21] = h, t[22] = C) : C = t[22];
630
+ t[22] !== i || t[23] !== o.activation ? (C = (e) => {
631
+ o.activation.isActive() && (i.onKeyboardEvent ? i.onKeyboardEvent(e) : document.dispatchEvent(new KeyboardEvent("keydown", {
632
+ ...e,
633
+ bubbles: !0,
634
+ cancelable: !0
635
+ })));
636
+ }, t[22] = i, t[23] = o.activation, t[24] = C) : C = t[24];
631
637
  let w;
632
- t[23] === y ? w = t[24] : (w = () => {
633
- y.onReady(), _(null);
634
- }, t[23] = y, t[24] = w);
638
+ t[25] !== i.props || t[26] !== g ? (w = {
639
+ ...i.props,
640
+ ...g
641
+ }, t[25] = i.props, t[26] = g, t[27] = w) : w = t[27];
635
642
  let T;
636
- t[25] === y ? T = t[26] : (T = (e) => {
637
- y.onError(e), _(e.message);
638
- }, t[25] = y, t[26] = T);
643
+ t[28] === y ? T = t[29] : (T = () => {
644
+ y.onReady(), ee(null);
645
+ }, t[28] = y, t[29] = T);
639
646
  let E;
640
- t[27] !== y.onDiagnostics || t[28] !== i || t[29] !== s || t[30] !== w || t[31] !== T || t[32] !== C || t[33] !== a ? (E = /* @__PURE__ */ k(r, {
647
+ t[30] === y ? E = t[31] : (E = (e) => {
648
+ y.onError(e), ee(e.message);
649
+ }, t[30] = y, t[31] = E);
650
+ let D;
651
+ t[32] !== y.onDiagnostics || t[33] !== i || t[34] !== c || t[35] !== C || t[36] !== w || t[37] !== T || t[38] !== E || t[39] !== S || t[40] !== a ? (D = /* @__PURE__ */ A(r, {
641
652
  view: a,
642
653
  ...i,
643
- ...s,
644
- props: C,
645
- onReady: w,
654
+ ...c,
655
+ themeRoot: S,
656
+ onKeyboardEvent: C,
657
+ props: w,
658
+ onReady: T,
646
659
  onDiagnostics: y.onDiagnostics,
647
- onError: T
648
- }), t[27] = y.onDiagnostics, t[28] = i, t[29] = s, t[30] = w, t[31] = T, t[32] = C, t[33] = a, t[34] = E) : E = t[34];
649
- let D;
650
- return t[35] !== E || t[36] !== b || t[37] !== x || t[38] !== S ? (D = /* @__PURE__ */ de(ae, {
660
+ onError: E
661
+ }), t[32] = y.onDiagnostics, t[33] = i, t[34] = c, t[35] = C, t[36] = w, t[37] = T, t[38] = E, t[39] = S, t[40] = a, t[41] = D) : D = t[41];
662
+ let O;
663
+ return t[42] !== D || t[43] !== b || t[44] !== ne || t[45] !== x ? (O = /* @__PURE__ */ de(ie, {
651
664
  position: "relative",
652
665
  width: b,
653
- height: x,
666
+ height: ne,
654
667
  minH: "0",
655
668
  display: "flex",
656
669
  flexDirection: "column",
657
- children: [S, E]
658
- }), t[35] = E, t[36] = b, t[37] = x, t[38] = S, t[39] = D) : D = t[39], D;
659
- }, Dt = (e, t) => {
670
+ children: [x, D]
671
+ }), t[42] = D, t[43] = b, t[44] = ne, t[45] = x, t[46] = O) : O = t[46], O;
672
+ }, Ot = (e, t) => {
660
673
  switch (t.op) {
661
674
  case "status": return e.status();
662
675
  case "loginStatus": return e.loginStatus(t.id);
@@ -670,14 +683,14 @@ var nt = {
670
683
  case "syncProject": return e.syncProject(t.projectId);
671
684
  case "stopProjectSync": return e.stopProjectSync(t.projectId);
672
685
  }
673
- }, Ot = (e) => e && ((t) => Dt(e, t)), kt = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), At = async (e, t) => {
674
- if (kt.has(t)) return;
686
+ }, kt = (e) => e && ((t) => Ot(e, t)), I = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), At = async (e, t) => {
687
+ if (I.has(t)) return;
675
688
  let n = e.retain(), r = !1, i = async () => {
676
- r || (r = !0, a(), kt.delete(t), await (await n)());
689
+ r || (r = !0, a(), I.delete(t), await (await n)());
677
690
  }, a = t.onDisconnect(() => {
678
691
  i().catch(() => {});
679
692
  });
680
- kt.set(t, i);
693
+ I.set(t, i);
681
694
  try {
682
695
  await n;
683
696
  } catch (e) {
@@ -690,7 +703,7 @@ var nt = {
690
703
  if (n.operation === "snapshot") return e.snapshot();
691
704
  if (!t) throw Error("Performance subscriptions are unavailable in this host");
692
705
  if (n.operation === "dispose") {
693
- await kt.get(t)?.();
706
+ await I.get(t)?.();
694
707
  return;
695
708
  }
696
709
  if (n.operation === "retain") {
@@ -698,17 +711,17 @@ var nt = {
698
711
  return;
699
712
  }
700
713
  if (n.operation === "unsubscribe") {
701
- I.get(t)?.();
714
+ L.get(t)?.();
702
715
  return;
703
716
  }
704
- if (I.has(t)) return;
717
+ if (L.has(t)) return;
705
718
  let r = e.subscribe((e) => t.emit({
706
719
  scope: "performance.read",
707
720
  payload: e
708
721
  })), i = t.onDisconnect(() => a()), a = () => {
709
- r(), i(), I.delete(t);
722
+ r(), i(), L.delete(t);
710
723
  };
711
- I.set(t, a);
724
+ L.set(t, a);
712
725
  };
713
726
  }, Mt = "terminal.session", Nt = (e) => {
714
727
  let { terminal: t, hostEvents: n } = e, r = (e) => {
@@ -774,78 +787,78 @@ var nt = {
774
787
  }
775
788
  }
776
789
  };
777
- }, Pt = x.string().min(1), L = { sessionId: Pt }, Ft = x.array(x.object({
778
- path: x.array(x.string()),
779
- value: x.json()
790
+ }, Pt = b.string().min(1), R = { sessionId: Pt }, Ft = b.array(b.object({
791
+ path: b.array(b.string()),
792
+ value: b.json()
780
793
  })), It = {
781
- ...L,
782
- sequence: x.number().int().positive(),
794
+ ...R,
795
+ sequence: b.number().int().positive(),
783
796
  changes: Ft
784
- }, Lt = x.discriminatedUnion("operation", [
785
- x.object({
786
- ...L,
787
- operation: x.literal("open"),
797
+ }, Lt = b.discriminatedUnion("operation", [
798
+ b.object({
799
+ ...R,
800
+ operation: b.literal("open"),
788
801
  key: Pt,
789
802
  initial: t,
790
- save: x.object({
803
+ save: b.object({
791
804
  commandId: Pt,
792
805
  params: t.optional()
793
806
  }).strict()
794
807
  }),
795
- x.object({
808
+ b.object({
796
809
  ...It,
797
- operation: x.literal("commit")
810
+ operation: b.literal("commit")
798
811
  }),
799
- x.object({
812
+ b.object({
800
813
  ...It,
801
- operation: x.literal("preview")
814
+ operation: b.literal("preview")
802
815
  }),
803
- x.object({
804
- ...L,
805
- operation: x.literal("cancel")
816
+ b.object({
817
+ ...R,
818
+ operation: b.literal("cancel")
806
819
  }),
807
- x.object({
808
- ...L,
809
- operation: x.literal("close")
820
+ b.object({
821
+ ...R,
822
+ operation: b.literal("close")
810
823
  }),
811
- x.object({
812
- ...L,
813
- operation: x.literal("save")
824
+ b.object({
825
+ ...R,
826
+ operation: b.literal("save")
814
827
  }),
815
- x.object({
816
- ...L,
817
- operation: x.literal("refresh"),
828
+ b.object({
829
+ ...R,
830
+ operation: b.literal("refresh"),
818
831
  value: t,
819
- expectedVersion: x.number().int().nonnegative()
832
+ expectedVersion: b.number().int().nonnegative()
820
833
  })
821
- ]), Rt = x.discriminatedUnion("kind", [
822
- x.object({
823
- kind: x.literal("navigate"),
824
- id: x.string(),
825
- label: x.string(),
826
- target: x.custom(gt, "Invalid navigation target."),
827
- primary: x.boolean().optional()
834
+ ]), Rt = b.discriminatedUnion("kind", [
835
+ b.object({
836
+ kind: b.literal("navigate"),
837
+ id: b.string(),
838
+ label: b.string(),
839
+ target: b.custom(_t, "Invalid navigation target."),
840
+ primary: b.boolean().optional()
828
841
  }),
829
- x.object({
830
- kind: x.literal("command"),
831
- id: x.string(),
832
- label: x.string(),
833
- command: x.string(),
842
+ b.object({
843
+ kind: b.literal("command"),
844
+ id: b.string(),
845
+ label: b.string(),
846
+ command: b.string(),
834
847
  params: a.optional(),
835
- primary: x.boolean().optional(),
836
- destructive: x.boolean().optional()
848
+ primary: b.boolean().optional(),
849
+ destructive: b.boolean().optional()
837
850
  }),
838
- x.object({
839
- kind: x.literal("url"),
840
- id: x.string(),
841
- label: x.string(),
842
- href: x.string(),
843
- primary: x.boolean().optional()
851
+ b.object({
852
+ kind: b.literal("url"),
853
+ id: b.string(),
854
+ label: b.string(),
855
+ href: b.string(),
856
+ primary: b.boolean().optional()
844
857
  })
845
- ]), zt = x.object({
846
- title: x.string().min(1),
847
- body: x.string().optional(),
848
- kind: x.enum([
858
+ ]), zt = b.object({
859
+ title: b.string().min(1),
860
+ body: b.string().optional(),
861
+ kind: b.enum([
849
862
  "needs_review",
850
863
  "ready_to_merge",
851
864
  "blocked",
@@ -853,33 +866,33 @@ var nt = {
853
866
  "failed",
854
867
  "info"
855
868
  ]),
856
- priority: x.enum([
869
+ priority: b.enum([
857
870
  "low",
858
871
  "normal",
859
872
  "high",
860
873
  "urgent"
861
874
  ]).optional(),
862
875
  target: i.optional(),
863
- related: x.array(i).optional(),
864
- actions: x.array(Rt).optional(),
865
- dedupeKey: x.string().optional(),
866
- expiresAt: x.string().optional(),
867
- snoozedUntil: x.string().optional(),
876
+ related: b.array(i).optional(),
877
+ actions: b.array(Rt).optional(),
878
+ dedupeKey: b.string().optional(),
879
+ expiresAt: b.string().optional(),
880
+ snoozedUntil: b.string().optional(),
868
881
  metadata: a.optional()
869
- }), R = class extends Error {
882
+ }), z = class extends Error {
870
883
  code;
871
884
  data;
872
885
  constructor(e, t, n) {
873
886
  super(t), this.code = e, this.data = n, this.name = "WebviewHostCapabilityError";
874
887
  }
875
- }, z = x.string().min(1), Bt = x.object({}).strict().optional(), Vt = x.object({
876
- commandId: z,
888
+ }, B = b.string().min(1), Bt = b.object({}).strict().optional(), Vt = b.object({
889
+ commandId: B,
877
890
  params: a.optional(),
878
- workspaceId: z.optional(),
891
+ workspaceId: B.optional(),
879
892
  resource: i.optional(),
880
893
  metadata: a.optional()
881
- }), Ht = { streamId: z }, Ut = x.object({
882
- scope: x.enum([
894
+ }), Ht = { streamId: B }, Ut = b.object({
895
+ scope: b.enum([
883
896
  "default",
884
897
  "user",
885
898
  "project",
@@ -887,29 +900,29 @@ var nt = {
887
900
  "extension",
888
901
  "session"
889
902
  ]),
890
- scopeId: x.string().optional()
891
- }), Wt = x.object({
892
- name: z,
903
+ scopeId: b.string().optional()
904
+ }), Wt = b.object({
905
+ name: B,
893
906
  scope: Ut.optional()
894
- }), Gt = x.object({
895
- id: z.optional(),
896
- dedupeKey: x.string().optional(),
897
- status: x.enum([
907
+ }), Gt = b.object({
908
+ id: B.optional(),
909
+ dedupeKey: b.string().optional(),
910
+ status: b.enum([
898
911
  "done",
899
912
  "dismissed",
900
913
  "expired"
901
914
  ]).optional()
902
- }).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."), Kt = x.union([x.instanceof(Uint8Array), x.instanceof(ArrayBuffer)]), qt = x.object({
903
- type: z,
904
- id: x.string().optional()
905
- }), B = { sessionId: z }, Jt = x.object({
906
- cols: x.number().int().positive(),
907
- rows: x.number().int().positive(),
908
- command: x.array(x.string()).optional(),
909
- cwd: x.string().optional(),
910
- env: x.record(x.string(), x.string()).optional()
911
- }), Yt = { projectId: z.optional() }, Xt = {
912
- "performance.read": x.strictObject({ operation: x.enum([
915
+ }).refine((e) => e.id !== void 0 || e.dedupeKey !== void 0, "Provide a notification ID or dedupe key."), Kt = b.union([b.instanceof(Uint8Array), b.instanceof(ArrayBuffer)]), qt = b.object({
916
+ type: B,
917
+ id: b.string().optional()
918
+ }), Jt = { sessionId: B }, Yt = b.object({
919
+ cols: b.number().int().positive(),
920
+ rows: b.number().int().positive(),
921
+ command: b.array(b.string()).optional(),
922
+ cwd: b.string().optional(),
923
+ env: b.record(b.string(), b.string()).optional()
924
+ }), Xt = { projectId: B.optional() }, Zt = {
925
+ "performance.read": b.strictObject({ operation: b.enum([
913
926
  "state",
914
927
  "snapshot",
915
928
  "subscribe",
@@ -918,179 +931,179 @@ var nt = {
918
931
  "retain",
919
932
  "dispose"
920
933
  ]) }),
921
- "performance.control": x.discriminatedUnion("operation", [x.strictObject({
922
- operation: x.literal("set-enabled"),
923
- enabled: x.boolean()
924
- }), x.strictObject({
925
- operation: x.enum(["pause-extension", "resume-extension"]),
926
- installedExtensionId: z
934
+ "performance.control": b.discriminatedUnion("operation", [b.strictObject({
935
+ operation: b.literal("set-enabled"),
936
+ enabled: b.boolean()
937
+ }), b.strictObject({
938
+ operation: b.enum(["pause-extension", "resume-extension"]),
939
+ installedExtensionId: B
927
940
  })]),
928
- "harnesses.read": x.object({
929
- harnessId: z.optional(),
930
- model: x.string().optional()
941
+ "harnesses.read": b.object({
942
+ harnessId: B.optional(),
943
+ model: b.string().optional()
931
944
  }),
932
- "resources.actions": x.discriminatedUnion("operation", [x.object({
933
- operation: x.literal("list"),
945
+ "resources.actions": b.discriminatedUnion("operation", [b.object({
946
+ operation: b.literal("list"),
934
947
  resource: i
935
- }), x.object({
936
- operation: x.literal("execute"),
948
+ }), b.object({
949
+ operation: b.literal("execute"),
937
950
  resource: i,
938
- key: z
951
+ key: B
939
952
  })]),
940
953
  "commands.execute": Vt,
941
954
  "editing.session": Lt,
942
- "commands.stream": x.discriminatedUnion("operation", [
955
+ "commands.stream": b.discriminatedUnion("operation", [
943
956
  Vt.extend({
944
957
  ...Ht,
945
- operation: x.literal("start")
958
+ operation: b.literal("start")
946
959
  }),
947
- x.object({
960
+ b.object({
948
961
  ...Ht,
949
- operation: x.literal("cancel")
962
+ operation: b.literal("cancel")
950
963
  }),
951
- x.object({
964
+ b.object({
952
965
  ...Ht,
953
- operation: x.literal("ack"),
954
- bytes: x.number().int().positive()
966
+ operation: b.literal("ack"),
967
+ bytes: b.number().int().positive()
955
968
  })
956
969
  ]),
957
- "navigation.open": x.object({ target: x.custom(gt, "Invalid navigation target.") }),
958
- "page.params.update": x.object({ params: x.record(x.string(), De.nullable()) }),
970
+ "navigation.open": b.object({ target: b.custom(_t, "Invalid navigation target.") }),
971
+ "page.params.update": b.object({ params: b.record(b.string(), De.nullable()) }),
959
972
  "placement.close": Bt,
960
- "notification.show": x.union([x.object({
961
- type: x.enum([
973
+ "notification.show": b.union([b.object({
974
+ type: b.enum([
962
975
  "info",
963
976
  "success",
964
977
  "warning",
965
978
  "error"
966
979
  ]),
967
- title: x.string().optional(),
968
- message: x.string(),
980
+ title: b.string().optional(),
981
+ message: b.string(),
969
982
  metadata: a.optional()
970
- }), x.object({
971
- level: x.enum([
983
+ }), b.object({
984
+ level: b.enum([
972
985
  "info",
973
986
  "success",
974
987
  "warning",
975
988
  "error"
976
989
  ]),
977
- title: x.string().optional(),
978
- message: x.string().optional()
990
+ title: b.string().optional(),
991
+ message: b.string().optional()
979
992
  })]),
980
993
  "notification.action": zt,
981
994
  "notification.resolve": Gt,
982
995
  "notification.dismiss": Gt,
983
996
  "preferences.get": Wt,
984
- "preferences.set": Wt.extend({ value: x.union([
985
- x.boolean(),
986
- x.number(),
987
- x.string(),
988
- x.array(x.string()),
989
- x.array(x.number()),
990
- x.array(x.boolean()),
997
+ "preferences.set": Wt.extend({ value: b.union([
998
+ b.boolean(),
999
+ b.number(),
1000
+ b.string(),
1001
+ b.array(b.string()),
1002
+ b.array(b.number()),
1003
+ b.array(b.boolean()),
991
1004
  a
992
1005
  ]) }),
993
1006
  "extension.settings.all": Bt,
994
- "extension.settings.get": x.object({ key: z }),
995
- "extension.settings.set": x.object({
996
- key: z,
997
- value: x.unknown()
1007
+ "extension.settings.get": b.object({ key: B }),
1008
+ "extension.settings.set": b.object({
1009
+ key: B,
1010
+ value: b.unknown()
998
1011
  }),
999
- "extension.settings.delete": x.object({ key: z }),
1000
- "terminal.session": x.discriminatedUnion("operation", [
1001
- x.object({
1002
- operation: x.literal("open"),
1003
- request: Jt
1012
+ "extension.settings.delete": b.object({ key: B }),
1013
+ "terminal.session": b.discriminatedUnion("operation", [
1014
+ b.object({
1015
+ operation: b.literal("open"),
1016
+ request: Yt
1004
1017
  }),
1005
- x.object({
1006
- ...B,
1007
- operation: x.literal("write"),
1008
- data: x.union([x.string(), x.instanceof(Uint8Array)])
1018
+ b.object({
1019
+ ...Jt,
1020
+ operation: b.literal("write"),
1021
+ data: b.union([b.string(), b.instanceof(Uint8Array)])
1009
1022
  }),
1010
- x.object({
1011
- ...B,
1012
- operation: x.literal("resize"),
1013
- cols: x.number().int().positive(),
1014
- rows: x.number().int().positive()
1023
+ b.object({
1024
+ ...Jt,
1025
+ operation: b.literal("resize"),
1026
+ cols: b.number().int().positive(),
1027
+ rows: b.number().int().positive()
1015
1028
  }),
1016
- x.object({
1017
- ...B,
1018
- operation: x.literal("kill"),
1019
- signal: x.string().optional()
1029
+ b.object({
1030
+ ...Jt,
1031
+ operation: b.literal("kill"),
1032
+ signal: b.string().optional()
1020
1033
  }),
1021
- x.object({
1022
- ...B,
1023
- operation: x.literal("subscribe")
1034
+ b.object({
1035
+ ...Jt,
1036
+ operation: b.literal("subscribe")
1024
1037
  })
1025
1038
  ]),
1026
- "files.upload": x.object({
1027
- name: z,
1039
+ "files.upload": b.object({
1040
+ name: B,
1028
1041
  data: Kt,
1029
- mimeType: x.string().optional(),
1042
+ mimeType: b.string().optional(),
1030
1043
  scope: qt.optional()
1031
1044
  }),
1032
- "files.list": x.object({ scope: qt.optional() }),
1033
- "files.delete": x.object({ id: z }),
1034
- "artifacts.read": x.discriminatedUnion("op", [
1035
- x.object({
1036
- op: x.literal("list"),
1037
- mount: z,
1038
- prefix: x.string().optional()
1045
+ "files.list": b.object({ scope: qt.optional() }),
1046
+ "files.delete": b.object({ id: B }),
1047
+ "artifacts.read": b.discriminatedUnion("op", [
1048
+ b.object({
1049
+ op: b.literal("list"),
1050
+ mount: B,
1051
+ prefix: b.string().optional()
1039
1052
  }),
1040
- x.object({
1041
- op: x.literal("readText"),
1042
- mount: z,
1043
- path: x.string()
1053
+ b.object({
1054
+ op: b.literal("readText"),
1055
+ mount: B,
1056
+ path: b.string()
1044
1057
  }),
1045
- x.object({
1046
- op: x.literal("imageUrl"),
1047
- mount: z,
1048
- path: x.string()
1058
+ b.object({
1059
+ op: b.literal("imageUrl"),
1060
+ mount: B,
1061
+ path: b.string()
1049
1062
  })
1050
1063
  ]),
1051
- "account.read": x.discriminatedUnion("op", [
1052
- x.object({ op: x.literal("status") }),
1053
- x.object({
1054
- op: x.literal("loginStatus"),
1055
- id: z
1064
+ "account.read": b.discriminatedUnion("op", [
1065
+ b.object({ op: b.literal("status") }),
1066
+ b.object({
1067
+ op: b.literal("loginStatus"),
1068
+ id: B
1056
1069
  }),
1057
- x.object({ op: x.literal("devices") }),
1058
- x.object({
1059
- op: x.literal("projectSyncStatus"),
1060
- ...Yt
1070
+ b.object({ op: b.literal("devices") }),
1071
+ b.object({
1072
+ op: b.literal("projectSyncStatus"),
1073
+ ...Xt
1061
1074
  })
1062
1075
  ]),
1063
- "account.manage": x.discriminatedUnion("op", [
1064
- x.object({
1065
- op: x.literal("login"),
1066
- managerOrigin: z.optional()
1076
+ "account.manage": b.discriminatedUnion("op", [
1077
+ b.object({
1078
+ op: b.literal("login"),
1079
+ managerOrigin: B.optional()
1067
1080
  }),
1068
- x.object({
1069
- op: x.literal("cancelLogin"),
1070
- id: z
1081
+ b.object({
1082
+ op: b.literal("cancelLogin"),
1083
+ id: B
1071
1084
  }),
1072
- x.object({ op: x.literal("logout") }),
1073
- x.object({
1074
- op: x.literal("renameDevice"),
1075
- id: z,
1076
- name: x.string()
1085
+ b.object({ op: b.literal("logout") }),
1086
+ b.object({
1087
+ op: b.literal("renameDevice"),
1088
+ id: B,
1089
+ name: b.string()
1077
1090
  }),
1078
- x.object({
1079
- op: x.literal("removeDevice"),
1080
- id: z
1091
+ b.object({
1092
+ op: b.literal("removeDevice"),
1093
+ id: B
1081
1094
  }),
1082
- x.object({
1083
- op: x.literal("syncProject"),
1084
- ...Yt
1095
+ b.object({
1096
+ op: b.literal("syncProject"),
1097
+ ...Xt
1085
1098
  }),
1086
- x.object({
1087
- op: x.literal("stopProjectSync"),
1088
- ...Yt
1099
+ b.object({
1100
+ op: b.literal("stopProjectSync"),
1101
+ ...Xt
1089
1102
  })
1090
1103
  ])
1091
- }, Zt = (e, t) => {
1092
- let n = Xt[e].safeParse(t);
1093
- if (!n.success) throw new R("invalid_params", `Invalid parameters for ${e}.`, {
1104
+ }, Qt = (e, t) => {
1105
+ let n = Zt[e].safeParse(t);
1106
+ if (!n.success) throw new z("invalid_params", `Invalid parameters for ${e}.`, {
1094
1107
  capability: e,
1095
1108
  issues: n.error.issues.map((e) => ({
1096
1109
  path: e.path.map(String),
@@ -1098,13 +1111,13 @@ var nt = {
1098
1111
  }))
1099
1112
  });
1100
1113
  return n.data;
1101
- }, Qt = (e, t = e) => ({
1114
+ }, $t = (e, t = e) => ({
1102
1115
  ok: !1,
1103
1116
  status: "error",
1104
1117
  code: e,
1105
1118
  reason: t
1106
- }), $t = (e) => {
1107
- let t = bt(e);
1119
+ }), en = (e) => {
1120
+ let t = xt(e);
1108
1121
  return {
1109
1122
  ok: !1,
1110
1123
  status: "error",
@@ -1113,14 +1126,14 @@ var nt = {
1113
1126
  error: t,
1114
1127
  ...t.cause === void 0 ? {} : { cause: t.cause }
1115
1128
  };
1116
- }, en = (e) => Object.assign(Error(e), { code: e }), tn = 16, nn = 8388608, rn = async (e, t) => {
1129
+ }, tn = (e) => Object.assign(Error(e), { code: e }), nn = 16, rn = 8388608, an = async (e, t) => {
1117
1130
  let n = new AbortController(), r = e.onDisconnect(() => n.abort());
1118
1131
  try {
1119
1132
  return await t(n.signal);
1120
1133
  } finally {
1121
1134
  r();
1122
1135
  }
1123
- }, an = (e) => {
1136
+ }, on = (e) => {
1124
1137
  let t = /* @__PURE__ */ new Map();
1125
1138
  return async (n, r) => {
1126
1139
  let { streamId: i } = n;
@@ -1129,8 +1142,8 @@ var nt = {
1129
1142
  let e = t.get(i);
1130
1143
  e && Number.isSafeInteger(n.bytes) && n.bytes > 0 && n.bytes <= e.unread && (e.unread -= n.bytes);
1131
1144
  } else {
1132
- if (t.has(i)) throw en("command_stream_duplicate");
1133
- if (t.size >= tn) throw en("command_stream_limit");
1145
+ if (t.has(i)) throw tn("command_stream_duplicate");
1146
+ if (t.size >= nn) throw tn("command_stream_limit");
1134
1147
  let a = new AbortController(), o = !1, s = () => {}, c = (t) => e.emit({
1135
1148
  scope: "commands.stream",
1136
1149
  payload: {
@@ -1144,14 +1157,14 @@ var nt = {
1144
1157
  }));
1145
1158
  }, u = {
1146
1159
  unread: 0,
1147
- stop: (e, t = !0) => l(Qt(e), t)
1160
+ stop: (e, t = !0) => l($t(e), t)
1148
1161
  };
1149
1162
  t.set(i, u), s = e.onDisconnect(() => u.stop("command_stream_cancelled", !1));
1150
1163
  let { operation: d, streamId: f, commandId: p, ...m } = n, h = (e) => {
1151
1164
  if (e.type === "end") {
1152
1165
  let t = qe.parse(e.response);
1153
1166
  r.publish?.(t), l(t.outcome);
1154
- } else u.unread += new TextEncoder().encode(JSON.stringify(e.data)).byteLength, u.unread > nn ? u.stop("command_stream_overflow") : c(e);
1167
+ } else u.unread += new TextEncoder().encode(JSON.stringify(e.data)).byteLength, u.unread > rn ? u.stop("command_stream_overflow") : c(e);
1155
1168
  };
1156
1169
  (async () => {
1157
1170
  try {
@@ -1164,7 +1177,7 @@ var nt = {
1164
1177
  }
1165
1178
  o || u.stop("command_stream_disconnected");
1166
1179
  } catch (e) {
1167
- l($t(e));
1180
+ l(en(e));
1168
1181
  }
1169
1182
  })();
1170
1183
  }
@@ -1173,53 +1186,53 @@ var nt = {
1173
1186
  accepted: !0
1174
1187
  };
1175
1188
  };
1176
- }, on = x.object({ outcome: Ve }).passthrough(), sn = /* @__PURE__ */ new WeakMap(), cn = (e) => {
1177
- let t = sn.get(e);
1178
- return t || (t = an(e), sn.set(e, t)), t;
1179
- }, ln = (e, t) => e instanceof Promise ? e.then(t) : t(), V = (e, t) => (n) => {
1180
- if (!t) throw new R("unsupported", `The host does not support ${e}.`, { capability: e });
1181
- return t(Zt(e, n));
1182
- }, un = (e) => {
1189
+ }, sn = b.object({ outcome: Ve }).passthrough(), cn = /* @__PURE__ */ new WeakMap(), ln = (e) => {
1190
+ let t = cn.get(e);
1191
+ return t || (t = on(e), cn.set(e, t)), t;
1192
+ }, un = (e, t) => e instanceof Promise ? e.then(t) : t(), V = (e, t) => (n) => {
1193
+ if (!t) throw new z("unsupported", `The host does not support ${e}.`, { capability: e });
1194
+ return t(Qt(e, n));
1195
+ }, dn = (e) => {
1183
1196
  let { executeCommand: t, hostEvents: n } = e;
1184
1197
  if (t) return async (e) => {
1185
1198
  try {
1186
- let r = n ? await rn(n, (n) => Promise.resolve(t(e, n))) : await t(e);
1187
- return on.parse(r);
1199
+ let r = n ? await an(n, (n) => Promise.resolve(t(e, n))) : await t(e);
1200
+ return sn.parse(r);
1188
1201
  } catch (e) {
1189
- if (e instanceof S) return on.parse({ outcome: e.outcome });
1202
+ if (e instanceof ne) return sn.parse({ outcome: e.outcome });
1190
1203
  throw e;
1191
1204
  }
1192
1205
  };
1193
- }, dn = (e) => {
1206
+ }, fn = (e) => {
1194
1207
  let { streamCommand: t, hostEvents: n } = e;
1195
- if (t && n) return (r) => cn(n)(r, {
1208
+ if (t && n) return (r) => ln(n)(r, {
1196
1209
  stream: t,
1197
1210
  publish: e.commandCompleted
1198
1211
  });
1199
- }, fn = (e) => {
1212
+ }, pn = (e) => {
1200
1213
  let { editing: t, executeCommand: n } = e;
1201
1214
  if (t && n) return (e) => t.request(e, async (e) => {
1202
- let t = on.parse(await n(e));
1203
- return T(t.outcome);
1215
+ let t = sn.parse(await n(e));
1216
+ return C(t.outcome);
1204
1217
  });
1205
- }, pn = (e) => {
1218
+ }, mn = (e) => {
1206
1219
  let { hostEvents: t, navigation: n, pageParams: r, placement: i, notifications: a, settings: o, preferences: s, files: c, artifacts: l, terminal: u } = e, d = u && t ? Nt({
1207
1220
  terminal: u,
1208
1221
  hostEvents: t
1209
- }) : void 0, f = e.harnesses?.read.bind(e.harnesses), p = Ot(e.account);
1222
+ }) : void 0, f = e.harnesses?.read.bind(e.harnesses), p = kt(e.account);
1210
1223
  return {
1211
1224
  "harnesses.read": V("harnesses.read", f),
1212
1225
  "resources.actions": V("resources.actions", e.resourceActions),
1213
- "commands.execute": V("commands.execute", un(e)),
1214
- "commands.stream": V("commands.stream", dn(e)),
1215
- "editing.session": V("editing.session", fn(e)),
1216
- "navigation.open": V("navigation.open", n && ((e) => ln(n.open(e.target), () => void 0))),
1226
+ "commands.execute": V("commands.execute", dn(e)),
1227
+ "commands.stream": V("commands.stream", fn(e)),
1228
+ "editing.session": V("editing.session", pn(e)),
1229
+ "navigation.open": V("navigation.open", n && ((e) => un(n.open(e.target), () => void 0))),
1217
1230
  "page.params.update": V("page.params.update", r && ((e) => {
1218
1231
  let t = r.update(e.params);
1219
1232
  return t instanceof Promise ? t.then((e) => ({ location: e })) : { location: t };
1220
1233
  })),
1221
1234
  "placement.close": V("placement.close", i && (() => i.close())),
1222
- "notification.show": V("notification.show", a?.show && ((e) => ln(a.show("type" in e ? e : {
1235
+ "notification.show": V("notification.show", a?.show && ((e) => un(a.show("type" in e ? e : {
1223
1236
  type: e.level,
1224
1237
  ...e.title === void 0 ? {} : { title: e.title },
1225
1238
  message: e.message ?? ""
@@ -1236,8 +1249,8 @@ var nt = {
1236
1249
  "preferences.get": V("preferences.get", s && ((e) => s.get(e.name, e.scope))),
1237
1250
  "preferences.set": V("preferences.set", s && ((e) => {
1238
1251
  let t = e.scope ?? { scope: "user" };
1239
- if (t.scope === "default") throw new R("preference_scope_read_only", "Default preferences are read-only.", {});
1240
- return ln(s.set(e.name, e.value, t), () => ({
1252
+ if (t.scope === "default") throw new z("preference_scope_read_only", "Default preferences are read-only.", {});
1253
+ return un(s.set(e.name, e.value, t), () => ({
1241
1254
  name: e.name,
1242
1255
  value: e.value
1243
1256
  }));
@@ -1259,7 +1272,7 @@ var nt = {
1259
1272
  "account.read": V("account.read", p),
1260
1273
  "account.manage": V("account.manage", p)
1261
1274
  };
1262
- }, mn = (e, t) => {
1275
+ }, hn = (e, t) => {
1263
1276
  let n = t.commandTargetOf?.(e);
1264
1277
  if (n) return {
1265
1278
  ...n,
@@ -1274,8 +1287,8 @@ var nt = {
1274
1287
  };
1275
1288
  };
1276
1289
  function H(e, t = {}) {
1277
- if (!D(e)) throw Error("Invalid navigation target.");
1278
- return t.extensionId && (e = yt(e, t.extensionId, t.projectId)), e.kind === "command" ? mn(e, t) : e.kind === "href" || e.kind === "page" || e.kind === "viewer" ? e : e.kind === "panel" ? {
1290
+ if (!T(e)) throw Error("Invalid navigation target.");
1291
+ return t.extensionId && (e = bt(e, t.extensionId, t.projectId)), e.kind === "command" ? hn(e, t) : e.kind === "href" || e.kind === "page" || e.kind === "viewer" ? e : e.kind === "panel" ? {
1279
1292
  ...e,
1280
1293
  ...t.region ? { region: t.region } : {}
1281
1294
  } : {
@@ -1284,14 +1297,14 @@ function H(e, t = {}) {
1284
1297
  };
1285
1298
  }
1286
1299
  // src/extensions/bridge/webview-editing-session.ts
1287
- var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify([e.projectId, e.extensionId]), _n = (e) => ({
1300
+ var gn = (e) => Object.assign(Error(e), { code: e }), _n = (e) => JSON.stringify([e.projectId, e.extensionId]), vn = (e) => ({
1288
1301
  value: M(e.value, [...e.previews.values()].flat()),
1289
1302
  version: e.version,
1290
1303
  revision: e.revision,
1291
1304
  savedRevision: e.savedRevision
1292
1305
  }), U = (e, t) => {
1293
1306
  e.version++;
1294
- let n = _n(e);
1307
+ let n = vn(e);
1295
1308
  for (let r of e.members) r.events.emit({
1296
1309
  scope: "editing.session",
1297
1310
  payload: {
@@ -1300,32 +1313,32 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1300
1313
  ...t?.member === r ? { appliedSequence: t.sequence } : {}
1301
1314
  }
1302
1315
  });
1303
- }, vn = (e, t) => {
1316
+ }, yn = (e, t) => {
1304
1317
  let n = e.document, r = M(M(n.value, n.previews.get(e) ?? []), t.changes), i = new Map(n.previews);
1305
- i.delete(e), i.set(e, ct(n.value, r)), M(n.value, [...i.values()].flat()), n.previews = i, U(n, {
1318
+ i.delete(e), i.set(e, lt(n.value, r)), M(n.value, [...i.values()].flat()), n.previews = i, U(n, {
1306
1319
  member: e,
1307
1320
  sequence: t.sequence
1308
1321
  });
1309
- }, yn = (e, t) => {
1322
+ }, bn = (e, t) => {
1310
1323
  let n = e.document, r = [...n.previews.get(e) ?? [], ...t.changes], i = M(n.value, r), a = new Map(n.previews);
1311
1324
  a.delete(e);
1312
- let o = lt(i, a);
1325
+ let o = ut(i, a);
1313
1326
  n.value = i, n.previews = o.drafts, r.length && n.revision++, U(n, {
1314
1327
  member: e,
1315
1328
  sequence: t.sequence
1316
1329
  });
1317
- }, bn = (e) => {
1330
+ }, xn = (e) => {
1318
1331
  let t = e.document;
1319
1332
  if (!t.previews.has(e)) return;
1320
1333
  let n = new Map(t.previews);
1321
- n.delete(e), t.previews = lt(t.value, n).drafts, U(t);
1322
- }, xn = (e, t) => {
1334
+ n.delete(e), t.previews = ut(t.value, n).drafts, U(t);
1335
+ }, Sn = (e, t) => {
1323
1336
  if (t.expectedVersion !== e.version || e.savedRevision !== e.revision) return;
1324
- let n = structuredClone(t.value), r = lt(n, e.previews);
1325
- return e.value = n, e.saved = structuredClone(n), e.previews = r.drafts, U(e), _n(e);
1326
- }, Sn = (e, t, n, r) => ({
1337
+ let n = structuredClone(t.value), r = ut(n, e.previews);
1338
+ return e.value = n, e.saved = structuredClone(n), e.previews = r.drafts, U(e), vn(e);
1339
+ }, Cn = (e, t, n, r) => ({
1327
1340
  key: t,
1328
- scope: gn(e),
1341
+ scope: _n(e),
1329
1342
  value: structuredClone(n.initial),
1330
1343
  saved: structuredClone(n.initial),
1331
1344
  version: 0,
@@ -1336,15 +1349,15 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1336
1349
  members: /* @__PURE__ */ new Set(),
1337
1350
  previews: /* @__PURE__ */ new Map(),
1338
1351
  writing: null
1339
- }), Cn = () => {
1352
+ }), wn = () => {
1340
1353
  let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new WeakMap(), n = (t) => {
1341
1354
  !t.members.size && !t.writing && t.savedRevision === t.revision && e.delete(t.key);
1342
1355
  }, r = (e) => {
1343
1356
  let r = e.document;
1344
- r.members.delete(e), t.get(e.events)?.delete(e.id), bn(e), n(r);
1357
+ r.members.delete(e), t.get(e.events)?.delete(e.id), xn(e), n(r);
1345
1358
  }, i = (e) => (e.writing ||= Promise.resolve().then(async () => {
1346
1359
  for (; e.savedRevision < e.revision;) {
1347
- let t = structuredClone(e.value), n = e.revision, r = ct(e.saved, t);
1360
+ let t = structuredClone(e.value), n = e.revision, r = lt(e.saved, t);
1348
1361
  r.length && await e.execute({
1349
1362
  ...e.save,
1350
1363
  params: {
@@ -1366,16 +1379,16 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1366
1379
  for (let e of i.values()) r(e);
1367
1380
  }), i;
1368
1381
  }, o = (t, n, r) => {
1369
- if (!n.save.commandId.startsWith(`${t.extensionId}.command.`)) throw hn("editing_save_not_owner");
1382
+ if (!n.save.commandId.startsWith(`${t.extensionId}.command.`)) throw gn("editing_save_not_owner");
1370
1383
  let i = JSON.stringify([
1371
1384
  t.projectId,
1372
1385
  t.extensionId,
1373
1386
  n.key
1374
1387
  ]), o = e.get(i);
1375
- if (o && (o.save.commandId !== n.save.commandId || ct(o.save.params ?? {}, n.save.params ?? {}).length)) throw hn("editing_save_mismatch");
1388
+ if (o && (o.save.commandId !== n.save.commandId || lt(o.save.params ?? {}, n.save.params ?? {}).length)) throw gn("editing_save_mismatch");
1376
1389
  let s = a(t.events), c = s.get(n.sessionId);
1377
- if (c && c.document !== o) throw hn("editing_session_duplicate");
1378
- if (o || (o = Sn(t, i, n, r), e.set(i, o)), !c) {
1390
+ if (c && c.document !== o) throw gn("editing_session_duplicate");
1391
+ if (o || (o = Cn(t, i, n, r), e.set(i, o)), !c) {
1379
1392
  let e = {
1380
1393
  id: n.sessionId,
1381
1394
  events: t.events,
@@ -1383,42 +1396,42 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1383
1396
  };
1384
1397
  s.set(n.sessionId, e), o.members.add(e);
1385
1398
  }
1386
- return _n(o);
1399
+ return vn(o);
1387
1400
  };
1388
1401
  return (e) => ({ async request(t, n) {
1389
1402
  if (t.operation === "open") return o(e, t, n);
1390
1403
  let s = a(e.events).get(t.sessionId);
1391
1404
  if (!s && t.operation === "close") return;
1392
- if (!s || s.document.scope !== gn(e)) throw hn("editing_session_closed");
1405
+ if (!s || s.document.scope !== _n(e)) throw gn("editing_session_closed");
1393
1406
  let c = s.document;
1394
1407
  if (t.operation === "close") r(s);
1395
1408
  else {
1396
1409
  switch (t.operation) {
1397
1410
  case "preview":
1398
- vn(s, t);
1411
+ yn(s, t);
1399
1412
  break;
1400
1413
  case "cancel":
1401
- bn(s);
1414
+ xn(s);
1402
1415
  break;
1403
- case "refresh": return xn(c, t);
1416
+ case "refresh": return Sn(c, t);
1404
1417
  case "commit":
1405
- yn(s, t), await i(c);
1418
+ bn(s, t), await i(c);
1406
1419
  break;
1407
1420
  case "save": await i(c);
1408
1421
  }
1409
- return _n(c);
1422
+ return vn(c);
1410
1423
  }
1411
1424
  } });
1412
- }, wn = /* @__PURE__ */ new WeakMap(), Tn = (e) => {
1425
+ }, Tn = /* @__PURE__ */ new WeakMap(), En = (e) => {
1413
1426
  let { workbench: t, extensionId: n, projectId: r, hostEvents: i } = e;
1414
1427
  if (!n || !r || !i) return;
1415
- let a = wn.get(t);
1416
- return a || (a = Cn(), wn.set(t, a)), a({
1428
+ let a = Tn.get(t);
1429
+ return a || (a = wn(), Tn.set(t, a)), a({
1417
1430
  extensionId: n,
1418
1431
  projectId: r,
1419
1432
  events: i
1420
1433
  });
1421
- }, En = (e) => {
1434
+ }, Dn = (e) => {
1422
1435
  let t = e.workbench.preferences, n = () => {
1423
1436
  if (!e.extensionId) throw Error("Preferences require the calling extension identity");
1424
1437
  return e.extensionId;
@@ -1433,11 +1446,11 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1433
1446
  return r(i) ? t.setValue(i, a, o) : (n(), e.ownedPreferences ? e.ownedPreferences.set(i, a, o) : t.setOwnedValue(n(), i, a, o));
1434
1447
  }
1435
1448
  };
1436
- }, Dn = (e, t) => {
1449
+ }, On = (e, t) => {
1437
1450
  let n, r = !1, i = () => {
1438
1451
  r || (r = !0, queueMicrotask(() => {
1439
1452
  r = !1, t?.emit({
1440
- scope: xt,
1453
+ scope: St,
1441
1454
  payload: { type: "changed" }
1442
1455
  });
1443
1456
  }));
@@ -1449,8 +1462,8 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1449
1462
  r(), a(), n = void 0;
1450
1463
  };
1451
1464
  };
1452
- }, On = (e, t, n, r) => {
1453
- let i = Dn(e, n);
1465
+ }, kn = (e, t, n, r) => {
1466
+ let i = On(e, n);
1454
1467
  return async (n) => {
1455
1468
  let a = l(e, t ? {
1456
1469
  ...n.resource,
@@ -1480,15 +1493,15 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1480
1493
  group: e.group ?? a?.group
1481
1494
  }));
1482
1495
  };
1483
- }, kn = (e) => {
1496
+ }, An = (e) => {
1484
1497
  let { workbench: t, placement: n, extensionId: r, projectId: i, hostEvents: a } = e, o = t.viewers.captureContext(n?.placementIdentity), s = () => {
1485
1498
  if (i && i !== t.pages.store.getState().projectId) throw Error("The calling view belongs to another project");
1486
1499
  if (o.isViewerCurrent?.() === !1) throw Error("The calling viewer is no longer open");
1487
- }, c = On(t, i, a, n?.placementIdentity);
1500
+ }, c = kn(t, i, a, n?.placementIdentity);
1488
1501
  return {
1489
1502
  resourceActions: async (e) => (s(), c(e)),
1490
1503
  hostEvents: a,
1491
- editing: Tn(e),
1504
+ editing: En(e),
1492
1505
  executeCommand: async (e, r) => (s(), { outcome: {
1493
1506
  ok: !0,
1494
1507
  status: "success",
@@ -1524,17 +1537,17 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1524
1537
  message: e.title === void 0 ? void 0 : e.message
1525
1538
  });
1526
1539
  } },
1527
- preferences: En(e),
1540
+ preferences: Dn(e),
1528
1541
  terminal: t.terminal
1529
1542
  };
1530
- }, An = (e) => pn(kn(e)), jn = () => "light", Mn = /* @__PURE__ */ new WeakMap(), Nn = (e, t) => {
1531
- let n = Mn.get(e);
1532
- n || (n = /* @__PURE__ */ new Map(), Mn.set(e, n));
1543
+ }, jn = (e) => mn(An(e)), Mn = () => "light", Nn = /* @__PURE__ */ new WeakMap(), Pn = (e, t) => {
1544
+ let n = Nn.get(e);
1545
+ n || (n = /* @__PURE__ */ new Map(), Nn.set(e, n));
1533
1546
  let r = t.instanceId, i = n.get(r);
1534
- return i || (i = Tt(), n.set(r, i)), i;
1535
- }, Pn = (e) => {
1536
- let { context: t, createHostAdapters: n, createProps: r, createTheme: i = jn, ownerId: a, title: o, webview: s } = e;
1537
- return /* @__PURE__ */ k(Et, {
1547
+ return i || (i = Et(), n.set(r, i)), i;
1548
+ }, Fn = (e) => {
1549
+ let { context: t, createHostAdapters: n, createProps: r, createTheme: i = Mn, ownerId: a, title: o, webview: s } = e;
1550
+ return /* @__PURE__ */ A(Dt, {
1538
1551
  sizing: e.sizing,
1539
1552
  view: {
1540
1553
  extensionId: a ?? "workbench",
@@ -1557,21 +1570,21 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1557
1570
  },
1558
1571
  workbench: t.workbench,
1559
1572
  theme: i(t),
1560
- capabilities: pn(n({
1573
+ capabilities: mn(n({
1561
1574
  ...t,
1562
1575
  extensionId: a ?? t.extensionId
1563
1576
  })),
1564
1577
  hostEvents: t.hostEvents
1565
1578
  });
1566
- }, Fn = {
1579
+ }, In = {
1567
1580
  linux: "linux",
1568
1581
  mac: "mac",
1569
1582
  win: "windows"
1570
- }, In = [
1583
+ }, Ln = [
1571
1584
  "mac",
1572
1585
  "linux",
1573
1586
  "win"
1574
- ], Ln = [
1587
+ ], Rn = [
1575
1588
  {
1576
1589
  chord: "Mod+T",
1577
1590
  reason: "browser_new_tab",
@@ -1741,24 +1754,24 @@ var hn = (e) => Object.assign(Error(e), { code: e }), gn = (e) => JSON.stringify
1741
1754
  reason: "browser_zoom",
1742
1755
  description: "Zoom in"
1743
1756
  }
1744
- ], Rn = (e, t) => re(e, Fn[t]);
1757
+ ], zn = (e, t) => O(e, In[t]);
1745
1758
  (() => {
1746
1759
  let e = /* @__PURE__ */ new Map();
1747
- for (let t of In) e.set(t, /* @__PURE__ */ new Map());
1748
- for (let t of Ln) {
1749
- let n = t.platforms ?? In;
1760
+ for (let t of Ln) e.set(t, /* @__PURE__ */ new Map());
1761
+ for (let t of Rn) {
1762
+ let n = t.platforms ?? Ln;
1750
1763
  for (let r of n) {
1751
- let n = Rn(t.chord, r);
1764
+ let n = zn(t.chord, r);
1752
1765
  e.get(r)?.set(n, t);
1753
1766
  }
1754
1767
  }
1755
1768
  return e;
1756
1769
  })();
1757
1770
  // ../pstdio-extensions/src/workbench/shared/localization.ts
1758
- var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn = (e) => {
1771
+ var W = (e, t = "") => e === void 0 ? t : dt(e) ? e.default ?? e.$l10n : e, Bn = (e) => {
1759
1772
  let t = e;
1760
- return t?.outcome ? T(t.outcome) : e;
1761
- }, Bn = async (e, t, n, r, i) => {
1773
+ return t?.outcome ? C(t.outcome) : e;
1774
+ }, Vn = async (e, t, n, r, i) => {
1762
1775
  let a = t.resourceMutation;
1763
1776
  if (!a) return i();
1764
1777
  let o = n?.[a.idParam] ?? r?.resource?.id;
@@ -1786,7 +1799,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1786
1799
  projectId: e.projectId,
1787
1800
  ...e.context ?? {}
1788
1801
  }
1789
- }), Vn = async (e, t, n = {}) => {
1802
+ }), Hn = async (e, t, n = {}) => {
1790
1803
  let r = n.resource, i = e.workbench.viewers.captureContext(n.placement), a = {
1791
1804
  ...i,
1792
1805
  removalVersion: n.removalVersion ?? i.removalVersion,
@@ -1814,23 +1827,23 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1814
1827
  return s;
1815
1828
  }, K = async (e, t, n = {}) => {
1816
1829
  let r = e.metadata?.commands.find((e) => e.id === t), i = r ? {
1817
- ...b(r.params, n.params, { resource: n.resource }),
1830
+ ...y(r.params, n.params, { resource: n.resource }),
1818
1831
  ...n.params
1819
- } : n.params, a = async () => zn(await Vn(e, t, {
1832
+ } : n.params, a = async () => Bn(await Hn(e, t, {
1820
1833
  ...n,
1821
1834
  params: i
1822
1835
  }));
1823
- return r ? Bn(e, r, i, { resource: n.resource }, a) : a();
1824
- }, Hn = (e) => typeof e == "object" && !!e && !Array.isArray(e), Un = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Wn = async (e, t, n) => {
1836
+ return r ? Vn(e, r, i, { resource: n.resource }, a) : a();
1837
+ }, Un = (e) => typeof e == "object" && !!e && !Array.isArray(e), Wn = (e, t) => `${e.extensionId ?? t}.command.${e.id}`, Gn = async (e, t, n) => {
1825
1838
  let { target: r } = n;
1826
- r.kind === "command" ? (await K(e, Un(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh()) : await e.workbench.navigation.openTarget(H(r, { extensionId: t.extensionId }));
1827
- }, Gn = (e) => {
1839
+ r.kind === "command" ? (await K(e, Wn(r.target.command, t.extensionId), { params: r.target.params }), e.workbench.commandPaletteResources.refresh()) : await e.workbench.navigation.openTarget(H(r, { extensionId: t.extensionId }));
1840
+ }, Kn = (e) => {
1828
1841
  if (e.kind === "page" || e.kind === "panel") return e.resource;
1829
1842
  if (e.kind === "compound") return e.targets.find((e) => e.resource)?.resource;
1830
- }, Kn = (e, t, n, r) => ({
1843
+ }, qn = (e, t, n, r) => ({
1831
1844
  id: `${t.id}:${r.id}`,
1832
1845
  resource: (() => {
1833
- let n = Gn(r.target);
1846
+ let n = Kn(r.target);
1834
1847
  return n ? {
1835
1848
  ...n,
1836
1849
  projectId: n.projectId ?? e.projectId,
@@ -1842,8 +1855,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1842
1855
  icon: r.icon,
1843
1856
  keywords: r.keywords,
1844
1857
  group: n,
1845
- activate: () => Wn(e, t, r)
1846
- }), qn = (e, t) => {
1858
+ activate: () => Gn(e, t, r)
1859
+ }), Jn = (e, t) => {
1847
1860
  let n = [];
1848
1861
  for (let r of t) {
1849
1862
  let t = W(r.title, r.id);
@@ -1863,14 +1876,14 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1863
1876
  limit: i
1864
1877
  }
1865
1878
  });
1866
- return Hn(s) ? (s.items ?? []).map((n) => Kn(e, r, t, n)) : [];
1879
+ return Un(s) ? (s.items ?? []).map((n) => qn(e, r, t, n)) : [];
1867
1880
  }
1868
1881
  }));
1869
1882
  }
1870
1883
  return { dispose() {
1871
1884
  for (let e = n.length - 1; e >= 0; --e) n[e]?.dispose();
1872
1885
  } };
1873
- }, Jn = (e, t = "") => W(e, t), Yn = (e, t, n) => {
1886
+ }, Yn = (e, t = "") => W(e, t), Xn = (e, t, n) => {
1874
1887
  let r = G({
1875
1888
  id: t.id,
1876
1889
  kind: "renderer",
@@ -1894,12 +1907,12 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1894
1907
  }) : Promise.resolve(void 0);
1895
1908
  return e.workbench.views.registerView({
1896
1909
  id: t.id,
1897
- title: Jn(t.title, t.id),
1910
+ title: Yn(t.title, t.id),
1898
1911
  icon: t.icon,
1899
1912
  body: {
1900
1913
  kind: "controls",
1901
- emptyTitle: Jn(t.emptyTitle, ""),
1902
- emptyDescription: Jn(t.emptyDescription, ""),
1914
+ emptyTitle: Yn(t.emptyTitle, ""),
1915
+ emptyDescription: Yn(t.emptyDescription, ""),
1903
1916
  defaultValues: t.defaultValues,
1904
1917
  executeQuery: async (e, r, a) => {
1905
1918
  let o = await i(t.queryHandlerId, {}, e ?? n.resolveResource?.(t), r, a), s = m.safeParse(o);
@@ -1918,31 +1931,31 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1918
1931
  reset: t.resetHandlerId ? ({ controlIds: e, resource: n }) => i(t.resetHandlerId, { controlIds: e }, n).then(() => void 0) : void 0
1919
1932
  }
1920
1933
  });
1921
- }, Xn = (e, t, n = {}) => {
1934
+ }, Zn = (e, t, n = {}) => {
1922
1935
  let r = [];
1923
- for (let i of t) r.push(Yn(e, i, n));
1936
+ for (let i of t) r.push(Xn(e, i, n));
1924
1937
  return { dispose() {
1925
1938
  for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
1926
1939
  } };
1927
1940
  }, q = (e, t, n) => {
1928
1941
  if (e) return Object.fromEntries(Object.entries(e).map(([e, r]) => [e, {
1929
1942
  ...r,
1930
- ...r.options && !Array.isArray(r.options) ? { options: Zn(r.options, n) } : {},
1943
+ ...r.options && !Array.isArray(r.options) ? { options: Qn(r.options, n) } : {},
1931
1944
  label: r.label === void 0 ? void 0 : t(r.label, e),
1932
1945
  description: r.description === void 0 ? void 0 : t(r.description)
1933
1946
  }]));
1934
- }, Zn = (e, t) => {
1947
+ }, Qn = (e, t) => {
1935
1948
  let n = e;
1936
1949
  return {
1937
1950
  valueField: n.valueField,
1938
1951
  labelField: n.labelField,
1939
1952
  params: n.params,
1940
- commandId: C({
1953
+ commandId: x({
1941
1954
  id: n.command.id,
1942
1955
  extensionId: n.command.extensionId ?? t ?? "pstdio"
1943
1956
  })
1944
1957
  };
1945
- }, Qn = (e) => e.toolbarActions?.map((t) => ({
1958
+ }, $n = (e) => e.toolbarActions?.map((t) => ({
1946
1959
  id: t.id,
1947
1960
  label: W(t.label, t.id),
1948
1961
  icon: t.icon,
@@ -1953,19 +1966,19 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1953
1966
  submitLabel: t.submitLabel,
1954
1967
  disabled: t.disabled,
1955
1968
  when: t.when
1956
- })), J = (e, t = "") => W(e, t), $n = (e) => ({
1969
+ })), J = (e, t = "") => W(e, t), er = (e) => ({
1957
1970
  ...e,
1958
1971
  label: J(e.label, e.id),
1959
1972
  description: e.description ? J(e.description) : void 0,
1960
- icon: e.icon ? O(f, {
1973
+ icon: e.icon ? k(f, {
1961
1974
  name: e.icon,
1962
1975
  size: 14
1963
1976
  }) : void 0
1964
- }), er = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), tr = (e) => ({
1977
+ }), tr = (e) => !!(e && typeof e == "object" && Array.isArray(e.rows)), nr = (e) => ({
1965
1978
  id: e.id,
1966
1979
  values: e.values,
1967
1980
  resource: e.resource ? e.resource : void 0
1968
- }), nr = (e, t, n) => {
1981
+ }), rr = (e, t, n) => {
1969
1982
  let r = ot(t), i = /* @__PURE__ */ new WeakMap(), a = G({
1970
1983
  id: t.id,
1971
1984
  kind: "dataTableRenderer",
@@ -1996,8 +2009,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
1996
2009
  kind: "dataTable",
1997
2010
  queryMode: t.queryMode,
1998
2011
  resourceKind: t.resourceKind,
1999
- toolbarActions: Qn(t),
2000
- columns: t.columns?.map($n),
2012
+ toolbarActions: $n(t),
2013
+ columns: t.columns?.map(er),
2001
2014
  initialPageSize: t.initialPageSize,
2002
2015
  pageSizeOptions: t.pageSizeOptions,
2003
2016
  defaultSettings: r.settings,
@@ -2014,7 +2027,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2014
2027
  id: e.id,
2015
2028
  commandId: e.commandId,
2016
2029
  label: J(e.label, e.id),
2017
- icon: e.icon ? O(f, {
2030
+ icon: e.icon ? k(f, {
2018
2031
  name: e.icon,
2019
2032
  size: 16
2020
2033
  }) : void 0,
@@ -2030,17 +2043,17 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2030
2043
  settings: c,
2031
2044
  ...u && { page: u }
2032
2045
  }, e, r, d, l);
2033
- if (!er(f)) {
2046
+ if (!tr(f)) {
2034
2047
  if (t.queryMode === "paged") throw Error("A paged provider must return rows and page metadata");
2035
2048
  return { rows: [] };
2036
2049
  }
2037
2050
  let p = f.rows.map((e) => {
2038
- let r = tr(e);
2051
+ let r = nr(e);
2039
2052
  return n.resolveRowResource && (r.resource = n.resolveRowResource(t, e)), i.set(r, e), r;
2040
2053
  });
2041
2054
  return {
2042
2055
  rows: p,
2043
- columns: f.columns?.map($n),
2056
+ columns: f.columns?.map(er),
2044
2057
  ...t.queryMode === "paged" && u ? h({
2045
2058
  rows: p,
2046
2059
  page: f.page
@@ -2051,7 +2064,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2051
2064
  id: n.id,
2052
2065
  commandId: n.commandId,
2053
2066
  label: J(n.label, n.id),
2054
- icon: n.icon ? O(f, {
2067
+ icon: n.icon ? k(f, {
2055
2068
  name: n.icon,
2056
2069
  size: 16
2057
2070
  }) : void 0,
@@ -2065,16 +2078,16 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2065
2078
  } : void 0
2066
2079
  }
2067
2080
  });
2068
- }, rr = (e, t, n = {}) => {
2069
- let r = t.map((t) => nr(e, t, n));
2081
+ }, ir = (e, t, n = {}) => {
2082
+ let r = t.map((t) => rr(e, t, n));
2070
2083
  return { dispose() {
2071
2084
  for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
2072
2085
  } };
2073
- }, ir = {
2086
+ }, ar = {
2074
2087
  first: 0,
2075
2088
  default: 1,
2076
2089
  last: 2
2077
- }, ar = {
2090
+ }, or = {
2078
2091
  commands: [],
2079
2092
  commandPaletteContributions: [],
2080
2093
  diagnostics: [],
@@ -2091,7 +2104,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2091
2104
  statusBarItems: [],
2092
2105
  settingsPanels: [],
2093
2106
  settingsDefinitions: []
2094
- }, or = (e) => `workbench.extension.menu.${e.id}`, sr = (e) => `workbench.extension.palette.${e.id}`, cr = (e, t) => ir[e.placement ?? "default"] * 1e3 + t, lr = (e) => e === void 0 ? "" : E(e) ? e.default ?? e.$l10n : e, ur = (e) => {
2107
+ }, sr = (e) => `workbench.extension.menu.${e.id}`, cr = (e) => `workbench.extension.palette.${e.id}`, lr = (e, t) => ar[e.placement ?? "default"] * 1e3 + t, ur = (e) => e === void 0 ? "" : w(e) ? e.default ?? e.$l10n : e, dr = (e) => {
2095
2108
  let { commandId: t, contribution: n, index: r, resolveString: i, slot: a, when: o, disabledWhen: s } = e;
2096
2109
  return {
2097
2110
  commandId: t,
@@ -2103,12 +2116,12 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2103
2116
  resourceGroup: a.resourceGroup,
2104
2117
  args: n.params,
2105
2118
  overflowLabel: a.overflowLabel,
2106
- order: cr(n, r),
2119
+ order: lr(n, r),
2107
2120
  when: o,
2108
2121
  disabledWhen: s,
2109
2122
  disabledReason: i(n.disabledReason, n.extensionId)
2110
2123
  };
2111
- }, dr = (e) => {
2124
+ }, fr = (e) => {
2112
2125
  let { commandId: t, contribution: n, index: r, resolveString: i } = e;
2113
2126
  return {
2114
2127
  commandId: t,
@@ -2117,10 +2130,10 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2117
2130
  icon: n.icon,
2118
2131
  group: n.group,
2119
2132
  args: n.params,
2120
- order: cr(n, r)
2133
+ order: lr(n, r)
2121
2134
  };
2122
- }, fr = (e) => {
2123
- let { createCommandId: t = or, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = lr } = e, s = [], c = [];
2135
+ }, pr = (e) => {
2136
+ let { createCommandId: t = sr, createWhenExpression: n, menuSlotsById: r, menuTargetsById: i, metadata: a, resolveString: o = ur } = e, s = [], c = [];
2124
2137
  return a.menuContributions.forEach((e, l) => {
2125
2138
  let u = e.target ? i?.get(e.target) : r.get(e.slotId);
2126
2139
  if (!u) {
@@ -2142,7 +2155,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2142
2155
  params: q(f?.params, (t) => o(t, f?.extensionId ?? e.extensionId), f?.extensionId)
2143
2156
  },
2144
2157
  contribution: e,
2145
- menuItem: ur({
2158
+ menuItem: dr({
2146
2159
  commandId: d,
2147
2160
  contribution: e,
2148
2161
  index: l,
@@ -2161,8 +2174,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2161
2174
  registrations: s,
2162
2175
  unresolved: c
2163
2176
  };
2164
- }, pr = (e) => {
2165
- let { createCommandId: t = sr, metadata: n, resolveString: r = lr } = e, i = [];
2177
+ }, mr = (e) => {
2178
+ let { createCommandId: t = cr, metadata: n, resolveString: r = ur } = e, i = [];
2166
2179
  return (n.commandPaletteContributions ?? []).forEach((e, a) => {
2167
2180
  let o = t(e), s = n.commands.find((t) => t.id === e.commandId);
2168
2181
  i.push({
@@ -2175,7 +2188,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2175
2188
  params: q(s?.params, (t) => r(t, s?.extensionId ?? e.extensionId), s?.extensionId)
2176
2189
  },
2177
2190
  contribution: e,
2178
- menuItem: dr({
2191
+ menuItem: fr({
2179
2192
  commandId: o,
2180
2193
  contribution: e,
2181
2194
  index: a,
@@ -2184,7 +2197,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2184
2197
  targetCommandId: e.commandId
2185
2198
  });
2186
2199
  }), i;
2187
- }, mr = (e) => ({
2200
+ }, hr = (e) => ({
2188
2201
  id: e.rendererId,
2189
2202
  kind: "renderer",
2190
2203
  context: {
@@ -2194,9 +2207,9 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2194
2207
  resourceId: e.resource.id
2195
2208
  } : {}
2196
2209
  }
2197
- }), hr = async (e, t, n, r, i = {}, a, o, s) => {
2210
+ }), gr = async (e, t, n, r, i = {}, a, o, s) => {
2198
2211
  let c = r;
2199
- return Vn(e, n, {
2212
+ return Hn(e, n, {
2200
2213
  params: {
2201
2214
  renderer: {
2202
2215
  rendererId: t,
@@ -2209,23 +2222,23 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2209
2222
  },
2210
2223
  resource: c,
2211
2224
  signal: o,
2212
- slot: mr({
2225
+ slot: hr({
2213
2226
  projectId: e.projectId,
2214
2227
  rendererId: t,
2215
2228
  resource: c
2216
2229
  }),
2217
2230
  ...a ? { metadata: a } : {}
2218
2231
  });
2219
- }, gr = (e) => {
2232
+ }, _r = (e) => {
2220
2233
  if (!e || typeof e != "object") return;
2221
2234
  let t = e.revision;
2222
2235
  return typeof t == "string" ? t : void 0;
2223
- }, _r = (e, t) => {
2236
+ }, vr = (e, t) => {
2224
2237
  let n = e.metadata, r = n?.fileRendererOrigin;
2225
2238
  if (!r || typeof r != "object") return;
2226
2239
  let i = r;
2227
2240
  if (typeof i.rendererId != "string" || typeof i.instanceId != "string" || typeof i.operationId != "string") return;
2228
- let a = n?.fileRendererResourceKey, o = t.outcome.ok ? gr(t.outcome.value) : void 0;
2241
+ let a = n?.fileRendererResourceKey, o = t.outcome.ok ? _r(t.outcome.value) : void 0;
2229
2242
  return {
2230
2243
  origin: {
2231
2244
  rendererId: i.rendererId,
@@ -2235,7 +2248,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2235
2248
  ...typeof a == "string" ? { resourceKey: a } : {},
2236
2249
  ...o ? { revision: o } : {}
2237
2250
  };
2238
- }, vr = (e, t) => e.workbench.views.registerView({
2251
+ }, yr = (e, t) => e.workbench.views.registerView({
2239
2252
  id: t.id,
2240
2253
  title: W(t.title, t.id),
2241
2254
  icon: t.icon,
@@ -2243,42 +2256,42 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2243
2256
  kind: "file",
2244
2257
  resourceKind: t.resourceKind,
2245
2258
  load: async (n, r, i) => {
2246
- let a = await hr(e, t.id, t.loadHandlerId, n, {}, { fileStorageVersions: {} }, r, i);
2247
- return o(zn(a) ?? {}, a);
2259
+ let a = await gr(e, t.id, t.loadHandlerId, n, {}, { fileStorageVersions: {} }, r, i);
2260
+ return o(Bn(a) ?? {}, a);
2248
2261
  },
2249
2262
  save: t.saveHandlerId ? async (n, r, i, a) => {
2250
- let s = await hr(e, t.id, t.saveHandlerId, n, { content: r }, {
2263
+ let s = await gr(e, t.id, t.saveHandlerId, n, { content: r }, {
2251
2264
  fileStorageVersions: u(a),
2252
2265
  ...i ? { fileRendererOrigin: i } : {},
2253
- ...ne(n) ? { fileRendererResourceKey: ne(n) } : {}
2254
- }), c = gr(zn(s));
2266
+ ...D(n) ? { fileRendererResourceKey: D(n) } : {}
2267
+ }), c = _r(Bn(s));
2255
2268
  return o(c ? { revision: c } : {}, s);
2256
2269
  } : void 0
2257
2270
  }
2258
- }), yr = (e) => {
2271
+ }), br = (e) => {
2259
2272
  let t = [];
2260
- for (let n of e.metadata.fileRenderers ?? []) t.push(vr(e, n));
2273
+ for (let n of e.metadata.fileRenderers ?? []) t.push(yr(e, n));
2261
2274
  return { dispose() {
2262
2275
  for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
2263
2276
  } };
2264
- }, br = (e, t, n, r, i) => {
2277
+ }, xr = (e, t, n, r, i) => {
2265
2278
  let a = e.attributes[t]?.find((e) => e.id === n), o = a?.action ?? a?.target;
2266
2279
  return o ? H(o, {
2267
2280
  extensionId: r,
2268
2281
  projectId: i
2269
2282
  }) : void 0;
2270
- }, xr = (e) => (t) => O(f, {
2283
+ }, Sr = (e) => (t) => k(f, {
2271
2284
  name: e ?? "MoreHorizontal",
2272
2285
  ...t
2273
- }), Sr = (e, t) => ({
2286
+ }), Cr = (e, t) => ({
2274
2287
  color: e?.color,
2275
2288
  canCreate: e?.canCreate,
2276
2289
  actions: e?.actions?.map((e) => ({
2277
2290
  id: e.id,
2278
2291
  label: t(e.label, e.id),
2279
- icon: xr(e.icon)
2292
+ icon: Sr(e.icon)
2280
2293
  }))
2281
- }), Cr = (e) => typeof e == "object" && !!e && !Array.isArray(e), wr = (e, t, n, r, i) => (t ?? []).map((t) => {
2294
+ }), wr = (e) => typeof e == "object" && !!e && !Array.isArray(e), Tr = (e, t, n, r, i) => (t ?? []).map((t) => {
2282
2295
  let a = t.display, o = a?.kind === "badge-list" && typeof a.itemsAttributeId == "string" ? {
2283
2296
  kind: "badge-list",
2284
2297
  itemsAttributeId: a.itemsAttributeId
@@ -2300,8 +2313,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2300
2313
  type: s(),
2301
2314
  display: o
2302
2315
  });
2303
- }), Tr = (e, t, n, r, i) => {
2304
- let a = wr(e, t, n, r, i), o = /* @__PURE__ */ new Set(), s = JSON.stringify(t);
2316
+ }), Er = (e, t, n, r, i) => {
2317
+ let a = Tr(e, t, n, r, i), o = /* @__PURE__ */ new Set(), s = JSON.stringify(t);
2305
2318
  return {
2306
2319
  source: {
2307
2320
  getSnapshot: () => a,
@@ -2310,29 +2323,29 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2310
2323
  set(t) {
2311
2324
  let c = JSON.stringify(t);
2312
2325
  if (c !== s) {
2313
- s = c, a = wr(e, t, n, r, i);
2326
+ s = c, a = Tr(e, t, n, r, i);
2314
2327
  for (let e of o) e();
2315
2328
  }
2316
2329
  }
2317
2330
  };
2318
- }, Er = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Dr = (e, t) => {
2331
+ }, Dr = (e) => !!(e && typeof e == "object" && typeof e.type == "string" && typeof e.id == "string"), Or = (e, t) => {
2319
2332
  let { resource: n } = t;
2320
- if (Er(n)) return n;
2321
- }, Or = (e, t) => {
2322
- let n = Dr(e, t);
2333
+ if (Dr(n)) return n;
2334
+ }, kr = (e, t) => {
2335
+ let n = Or(e, t);
2323
2336
  if (n) return n;
2324
2337
  if (e.resourceKind) return {
2325
2338
  type: e.resourceKind,
2326
2339
  id: t.id,
2327
2340
  label: t.title
2328
2341
  };
2329
- }, kr = (e, t) => {
2342
+ }, Ar = (e, t) => {
2330
2343
  let n = e, r = t(n);
2331
2344
  return r === void 0 ? n : {
2332
2345
  ...n,
2333
2346
  resource: r
2334
2347
  };
2335
- }, Ar = (...e) => Object.assign({}, ...e.filter((e) => !!e)), jr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Mr = (e) => Object.keys(e ?? {}).length > 0, Nr = /* @__PURE__ */ new Set([
2348
+ }, jr = (...e) => Object.assign({}, ...e.filter((e) => !!e)), Mr = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, Nr = (e) => Object.keys(e ?? {}).length > 0, Pr = /* @__PURE__ */ new Set([
2336
2349
  "text",
2337
2350
  "longtext",
2338
2351
  "markdown",
@@ -2341,8 +2354,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2341
2354
  "select",
2342
2355
  "multi-select",
2343
2356
  "files"
2344
- ]), Pr = (e, t, n) => {
2345
- if (!Nr.has(t.type)) return;
2357
+ ]), Fr = (e, t, n) => {
2358
+ if (!Pr.has(t.type)) return;
2346
2359
  let r = "options" in t && Array.isArray(t.options) ? t.options : [], i = t;
2347
2360
  return {
2348
2361
  id: e,
@@ -2360,10 +2373,10 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2360
2373
  multiple: t.type === "files" ? i.multiple !== !1 : void 0,
2361
2374
  accept: t.type === "files" && typeof i.accept == "string" ? i.accept : void 0
2362
2375
  };
2363
- }, Fr = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
2364
- let r = Pr(e, n, t);
2376
+ }, Ir = (e, t) => Object.entries(e.createRow?.params ?? {}).flatMap(([e, n]) => {
2377
+ let r = Fr(e, n, t);
2365
2378
  return r ? [r] : [];
2366
- }), Ir = (e, t) => G({
2379
+ }), Lr = (e, t) => G({
2367
2380
  id: t.id,
2368
2381
  kind: "kanbanRenderer",
2369
2382
  projectId: e.projectId,
@@ -2383,26 +2396,26 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2383
2396
  },
2384
2397
  resource: s,
2385
2398
  signal: a,
2386
- slot: Ir(e, t),
2399
+ slot: Lr(e, t),
2387
2400
  metadata: { kanbanRendererId: t.id }
2388
2401
  });
2389
- }, Lr = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, Rr = (e, t, n) => (t.rowActions ?? []).map((r) => {
2402
+ }, Rr = (e, t) => `workbench.extension.kanbanRenderer.${e.id}.rowAction.${t.id}`, zr = (e, t, n) => (t.rowActions ?? []).map((r) => {
2390
2403
  let i = e.workbench.commands.getCommand(r.commandId)?.command;
2391
2404
  return e.workbench.commands.registerCommand({
2392
- id: Lr(t, r),
2405
+ id: Rr(t, r),
2393
2406
  label: n(r.label, r.id),
2394
2407
  icon: r.icon,
2395
2408
  params: i?.params
2396
- }, { execute: (n, i) => Y(e, t, r.commandId, Ar(jr(n)), i?.resource) });
2397
- }), zr = (e, t, n, r, i, a) => {
2398
- let o = Lr(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
2399
- return s && Mr(s.command.params) ? (e.workbench.commandPalette.requestParams({
2409
+ }, { execute: (n, i) => Y(e, t, r.commandId, jr(Mr(n)), i?.resource) });
2410
+ }), Br = (e, t, n, r, i, a) => {
2411
+ let o = Rr(t, n), s = e.workbench.commands.getCommand(o), c = { rowId: r.id }, l = i ? { resource: i } : void 0, u = a(n.label, n.id);
2412
+ return s && Nr(s.command.params) ? (e.workbench.commandPalette.requestParams({
2400
2413
  record: s,
2401
2414
  label: u,
2402
2415
  args: c,
2403
2416
  context: l
2404
2417
  }), Promise.resolve()) : s ? e.workbench.commands.executeCommand(s.command.id, c, l).then(() => void 0) : Y(e, t, n.commandId, c, i).then(() => void 0);
2405
- }, Br = (e) => {
2418
+ }, Vr = (e) => {
2406
2419
  let { context: t, record: n, rowResource: r, onMetadata: i } = e, a = /* @__PURE__ */ new WeakMap(), o = 0, s = /* @__PURE__ */ new Map();
2407
2420
  return {
2408
2421
  original: (e) => a.get(e) ?? e,
@@ -2413,10 +2426,10 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2413
2426
  sorts: e.sorts,
2414
2427
  ...e.page && { page: e.page }
2415
2428
  }, void 0, c, e.pageParams), d = [];
2416
- Array.isArray(u) ? d = u : Cr(u) && (d = u.rows ?? []);
2429
+ Array.isArray(u) ? d = u : wr(u) && (d = u.rows ?? []);
2417
2430
  let f = /* @__PURE__ */ new Map(), p = d.map((e) => {
2418
2431
  let i = e, o = JSON.stringify(e), c = s.get(i.id), l = e.target, u = c?.signature === o ? c.row : {
2419
- ...kr(e, r),
2432
+ ...Ar(e, r),
2420
2433
  ...l ? { target: H(l, {
2421
2434
  extensionId: n.extensionId,
2422
2435
  projectId: t.projectId
@@ -2427,20 +2440,20 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2427
2440
  row: u
2428
2441
  }), u;
2429
2442
  });
2430
- return l === o && (s = f, Cr(u) && i(u)), {
2443
+ return l === o && (s = f, wr(u) && i(u)), {
2431
2444
  rows: p,
2432
- page: Cr(u) ? u.page : void 0
2445
+ page: wr(u) ? u.page : void 0
2433
2446
  };
2434
2447
  }
2435
2448
  };
2436
- }, Vr = (e) => e ? O(f, {
2449
+ }, Hr = (e) => e ? k(f, {
2437
2450
  name: e,
2438
2451
  size: 16
2439
- }) : void 0, Hr = (e, t) => {
2452
+ }) : void 0, Ur = (e, t) => {
2440
2453
  if (e.createRow) return {
2441
2454
  title: t(e.createRow.title, "Create row"),
2442
2455
  submitLabel: t(e.createRow.submitLabel, "Create"),
2443
- fields: Fr(e, t),
2456
+ fields: Ir(e, t),
2444
2457
  labels: {
2445
2458
  cancel: t(e.createRow.labels?.cancel, "Cancel"),
2446
2459
  properties: t(e.createRow.labels?.properties, "Properties"),
@@ -2449,7 +2462,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2449
2462
  submitWithoutOpening: t(void 0, "Create without opening")
2450
2463
  }
2451
2464
  };
2452
- }, Ur = (e, t, n, r, i) => {
2465
+ }, Wr = (e, t, n, r, i) => {
2453
2466
  if (t.rowActivationHandlerId) return async (n) => {
2454
2467
  let a = r(t, n);
2455
2468
  await Y(e, t, t.rowActivationHandlerId, { row: i(n) }, a);
@@ -2459,10 +2472,10 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2459
2472
  row: e,
2460
2473
  resource: r(t, e)
2461
2474
  });
2462
- }, Wr = (e, t, n, r) => {
2475
+ }, Gr = (e, t, n, r) => {
2463
2476
  let i = e.createRow;
2464
2477
  if (i) return async (a) => {
2465
- let o = Ar(a.values, i.columnParam && a.columnId ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
2478
+ let o = jr(a.values, i.columnParam && a.columnId ? { [i.columnParam]: a.columnId } : void 0, i.attributesParam ? { [i.attributesParam]: a.attributeValues } : void 0), s = await n(e, i.commandId, o);
2466
2479
  if (await t.onAfterCreate?.({
2467
2480
  record: e,
2468
2481
  created: s,
@@ -2476,15 +2489,15 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2476
2489
  attributes: c.attributes ?? {}
2477
2490
  });
2478
2491
  };
2479
- }, Gr = (e, t, n, r, i) => {
2492
+ }, Kr = (e, t, n, r, i) => {
2480
2493
  let a = t.rowActions;
2481
2494
  if (a?.length) return (o) => a.map((a) => {
2482
- let s = i(t, o), c = () => zr(e, t, a, o, s, r);
2495
+ let s = i(t, o), c = () => Br(e, t, a, o, s, r);
2483
2496
  return {
2484
2497
  key: a.id,
2485
2498
  label: r(a.label, a.id),
2486
2499
  commandId: a.commandId,
2487
- icon: Vr(a.icon),
2500
+ icon: Hr(a.icon),
2488
2501
  onClick: () => n.executeRowAction ? n.executeRowAction({
2489
2502
  record: t,
2490
2503
  action: a,
@@ -2494,42 +2507,42 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2494
2507
  }) : c()
2495
2508
  };
2496
2509
  });
2497
- }, Kr = (e, t, n = {}) => {
2510
+ }, qr = (e, t, n = {}) => {
2498
2511
  let r = [], i = n.resolveLabel ?? ((e, t) => W(e, t)), a = (t, r) => {
2499
2512
  let i = r.display?.kind === "badge-list" ? {
2500
2513
  ...r,
2501
2514
  render: (n, i) => fe(r, n, i, void 0, (n) => {
2502
2515
  if (r.display?.kind !== "badge-list") return;
2503
- let a = br(i, r.display.itemsAttributeId, n, t.extensionId, e.projectId);
2516
+ let a = xr(i, r.display.itemsAttributeId, n, t.extensionId, e.projectId);
2504
2517
  return a ? () => {
2505
2518
  e.workbench.navigation.openTarget(a);
2506
2519
  } : void 0;
2507
2520
  })
2508
2521
  } : r;
2509
2522
  return n.decorateAttribute?.(t, i) ?? i;
2510
- }, o = n.resolveRowResource ?? Dr, s = n.resolveRowActionResource ?? Or, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => Y(e, t, n, r).then((e) => (c(t), e));
2523
+ }, o = n.resolveRowResource ?? Or, s = n.resolveRowActionResource ?? kr, c = n.onAfterMutation ?? (() => {}), l = (t, n, r) => Y(e, t, n, r).then((e) => (c(t), e));
2511
2524
  for (let c of t) {
2512
- let t = Tr(c, c.attributes, i, a, (t, n) => e.workbench.notifications.show({
2525
+ let t = Er(c, c.attributes, i, a, (t, n) => e.workbench.notifications.show({
2513
2526
  id: `workbench.extension.${c.extensionId}.kanban.${c.id}.display.${t}`,
2514
2527
  level: "error",
2515
2528
  title: "Extension display is not available",
2516
2529
  message: `Attribute "${t}" in renderer "${c.id}" uses unknown display kind "${n}".`
2517
- })), u = c.attributes, d = at(c), f, p = Br({
2530
+ })), u = c.attributes, d = at(c), f, p = Vr({
2518
2531
  context: e,
2519
2532
  record: c,
2520
2533
  rowResource: (e) => o(c, e),
2521
2534
  onMetadata: (e) => {
2522
2535
  u = e.attributes ?? u, t.set(u), f = e.boardColumnConfigs;
2523
2536
  }
2524
- }), m = p.original, g = Ur(e, c, n, o, m);
2525
- r.push(...Rr(e, c, i)), r.push(e.workbench.views.registerView({
2537
+ }), m = p.original, g = Wr(e, c, n, o, m);
2538
+ r.push(...zr(e, c, i)), r.push(e.workbench.views.registerView({
2526
2539
  id: c.id,
2527
2540
  title: i(c.title, c.id),
2528
2541
  icon: c.icon,
2529
2542
  body: {
2530
2543
  kind: "kanban",
2531
2544
  resourceKind: c.resourceKind,
2532
- toolbarActions: Qn(c),
2545
+ toolbarActions: $n(c),
2533
2546
  listRowActions: () => (c.rowActions ?? []).map((e) => ({
2534
2547
  commandId: e.commandId,
2535
2548
  label: i(e.label, e.id)
@@ -2549,8 +2562,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2549
2562
  emptyDescription: i(c.emptyDescription, ""),
2550
2563
  hideToolbar: c.hideToolbar,
2551
2564
  createCommandId: c.createRow?.commandId,
2552
- createRow: Hr(c, i),
2553
- getBoardColumnConfig: (e) => Sr(f?.[e], i),
2565
+ createRow: Ur(c, i),
2566
+ getBoardColumnConfig: (e) => Cr(f?.[e], i),
2554
2567
  onRowActivate: g,
2555
2568
  executeQuery: async (e, t) => (await p.read(e, t)).rows,
2556
2569
  executePage: c.queryMode === "paged" ? async (e, t) => h(await p.read(e, t), e.page) : void 0,
@@ -2560,21 +2573,21 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2560
2573
  value: n
2561
2574
  }).then(() => void 0) : void 0,
2562
2575
  onMove: c.moveHandlerId ? (e) => l(c, c.moveHandlerId, { ...e }).then(() => void 0) : void 0,
2563
- onCreateRow: Wr(c, n, l, c.rowActivationHandlerId ? g : void 0),
2576
+ onCreateRow: Gr(c, n, l, c.rowActivationHandlerId ? g : void 0),
2564
2577
  onColumnAction: c.columnActionHandlerId ? async (e, t) => {
2565
2578
  await l(c, c.columnActionHandlerId, {
2566
2579
  columnId: e,
2567
2580
  actionId: t
2568
2581
  });
2569
2582
  } : void 0,
2570
- getRowContextMenuActions: Gr(e, c, n, i, s)
2583
+ getRowContextMenuActions: Kr(e, c, n, i, s)
2571
2584
  }
2572
2585
  }));
2573
2586
  }
2574
2587
  return { dispose() {
2575
2588
  for (let e = r.length - 1; e >= 0; --e) r[e]?.dispose();
2576
2589
  } };
2577
- }, qr = (e) => ({
2590
+ }, Jr = (e) => ({
2578
2591
  id: e.treeId,
2579
2592
  kind: "renderer",
2580
2593
  context: {
@@ -2607,14 +2620,14 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2607
2620
  params: r,
2608
2621
  signal: i,
2609
2622
  resource: o,
2610
- slot: qr({
2623
+ slot: Jr({
2611
2624
  modeId: a?.modeId,
2612
2625
  projectId: e.projectId,
2613
2626
  resource: o,
2614
2627
  treeId: t.id
2615
2628
  })
2616
2629
  });
2617
- }, Jr = async (e, t, n, r, i) => {
2630
+ }, Yr = async (e, t, n, r, i) => {
2618
2631
  let a = e.workbench.modes.getActiveModeId();
2619
2632
  return K(e, n, {
2620
2633
  params: {
@@ -2628,7 +2641,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2628
2641
  }
2629
2642
  },
2630
2643
  resource: i,
2631
- slot: qr({
2644
+ slot: Jr({
2632
2645
  modeId: a,
2633
2646
  projectId: e.projectId,
2634
2647
  resource: i,
@@ -2636,21 +2649,21 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2636
2649
  }),
2637
2650
  metadata: { treeId: t.id }
2638
2651
  });
2639
- }, Yr = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Xr = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Zr = async (e) => {
2640
- let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Xr(i, t);
2652
+ }, Xr = (e, t) => e.panels.flatMap((e) => [e, ...e.panelMenus ?? []]).filter((e) => e.renderer?.kind === "tree" && e.renderer.id === t.id), Zr = (e, t) => t.viewId ? e.find((e) => e.id === t.viewId) : e.length === 1 ? e[0] : void 0, Qr = async (e) => {
2653
+ let { ctx: t, getHostTreeHeaderNodes: n, record: r, treeViews: i } = e, a = Zr(i, t);
2641
2654
  return !a || !("hostTreeHeader" in a) || a.hostTreeHeader !== "default" ? [] : await n?.({
2642
2655
  ctx: t,
2643
2656
  record: r,
2644
2657
  panel: a
2645
2658
  }) ?? [];
2646
- }, Qr = async (e) => {
2647
- let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Xr(i, t);
2659
+ }, $r = async (e) => {
2660
+ let { ctx: t, getHostTreeFooterNodes: n, record: r, treeViews: i } = e, a = Zr(i, t);
2648
2661
  return !a || !("hostTreeFooter" in a) || a.hostTreeFooter !== "default" ? [] : await n?.({
2649
2662
  ctx: t,
2650
2663
  record: r,
2651
2664
  panel: a
2652
2665
  }) ?? [];
2653
- }, $r = (e, t) => (e.structure ?? []).map((e) => ({
2666
+ }, ei = (e, t) => (e.structure ?? []).map((e) => ({
2654
2667
  id: e.id,
2655
2668
  label: W(e.label),
2656
2669
  collapsible: e.collapsible,
@@ -2664,7 +2677,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2664
2677
  resource: t,
2665
2678
  selected: !0
2666
2679
  }] : []
2667
- })), ei = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, ti = (e) => e && !Array.isArray(e) ? e : void 0, ni = (e, t) => {
2680
+ })), ti = (e, t) => e && typeof e == "object" && !Array.isArray(e) ? e : t, ni = (e) => e && !Array.isArray(e) ? e : void 0, ri = (e, t) => {
2668
2681
  let n = /* @__PURE__ */ new WeakMap(), r = `workbench.extensionTreeRenderer.${t.id}.command`, i = (t) => e.resolveNodeResource?.(t) ?? t, a = (e) => {
2669
2682
  if (e.emptyState) return {
2670
2683
  title: W(e.emptyState.title),
@@ -2686,7 +2699,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2686
2699
  extensionId: t.extensionId,
2687
2700
  projectId: e.projectId
2688
2701
  }) : void 0, s = (n, r, i) => {
2689
- let a = n.command ? C({
2702
+ let a = n.command ? x({
2690
2703
  ...n.command,
2691
2704
  extensionId: n.command.extensionId ?? t.extensionId
2692
2705
  }) : void 0;
@@ -2695,14 +2708,14 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2695
2708
  resourceMutation: e.metadata.commands.find((e) => e.id === a)?.resourceMutation,
2696
2709
  label: W(n.label),
2697
2710
  icon: n.icon,
2698
- args: ti(n.params),
2711
+ args: ni(n.params),
2699
2712
  params: q(n.input, W, t.extensionId),
2700
2713
  submitLabel: n.submitLabel,
2701
2714
  when: n.when,
2702
2715
  disabled: n.disabled,
2703
2716
  run: a ? async (o) => {
2704
- let s = ei(o, ti(n.params));
2705
- n.command?.extensionId === "pstdio" ? await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource }) : (await Jr(e, t, a, s, r?.resource ?? i.resource), i.refresh());
2717
+ let s = ti(o, ni(n.params));
2718
+ n.command?.extensionId === "pstdio" ? await e.workbench.commands.executeCommand(a, s, { resource: r?.resource ?? i.resource }) : (await Yr(e, t, a, s, r?.resource ?? i.resource), i.refresh());
2706
2719
  } : void 0
2707
2720
  };
2708
2721
  }, c = (e, t) => {
@@ -2747,16 +2760,16 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2747
2760
  originalNodes: n,
2748
2761
  runnerCommandId: r
2749
2762
  };
2750
- }, ri = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), ii = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), ai = (e, t) => t.length > 0 ? [{
2763
+ }, ii = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "nodes" in e), ai = (e) => Array.isArray(e) && e.every((e) => e && typeof e == "object" && "id" in e), oi = (e, t) => t.length > 0 ? [{
2751
2764
  id: e,
2752
2765
  nodes: t,
2753
2766
  canReorder: !1
2754
- }] : [], oi = (e, t) => {
2755
- let n = ni(e, t), r = Yr(e.metadata, t), i = e.workbench.commands.registerCommand({
2767
+ }] : [], si = (e, t) => {
2768
+ let n = ri(e, t), r = Xr(e.metadata, t), i = e.workbench.commands.registerCommand({
2756
2769
  id: n.runnerCommandId,
2757
2770
  label: `${W(t.title, t.id)} tree command`
2758
2771
  }, { execute: async (n) => {
2759
- let r = n, i = await Jr(e, t, r.commandId, r.params, r.resource);
2772
+ let r = n, i = await Yr(e, t, r.commandId, r.params, r.resource);
2760
2773
  for (let t of e.workbench.views.listViews()) t.body.kind === "file" && e.workbench.views.refreshView(t.id);
2761
2774
  return i;
2762
2775
  } }), a = e.workbench.views.registerView({
@@ -2765,36 +2778,36 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2765
2778
  icon: t.icon,
2766
2779
  body: {
2767
2780
  kind: "tree",
2768
- getStructure: t.structure ? (e) => $r(t, e.resource) : void 0,
2781
+ getStructure: t.structure ? (e) => ei(t, e.resource) : void 0,
2769
2782
  searchable: t.searchable,
2770
2783
  searchPlaceholder: W(t.searchPlaceholder, "Search files"),
2771
2784
  defaultExpandedNodeIds: t.defaultExpandedNodeIds,
2772
2785
  defaultExpandedSectionIds: t.defaultExpandedSectionIds,
2773
2786
  getHeader: async (i) => {
2774
- let a = await Zr({
2787
+ let a = await Qr({
2775
2788
  ctx: i,
2776
2789
  getHostTreeHeaderNodes: e.getHostTreeHeaderNodes,
2777
2790
  record: t,
2778
2791
  treeViews: r
2779
2792
  });
2780
- if (!t.headerHandlerId) return ai(`${t.id}:host-header`, a);
2781
- let o = await Z(e, t, t.headerHandlerId, X(e, t, i), i.signal), s = ri(o) ? n.mapSections(o, i) : [];
2782
- return [...ai(`${t.id}:host-header`, a), ...s];
2793
+ if (!t.headerHandlerId) return oi(`${t.id}:host-header`, a);
2794
+ let o = await Z(e, t, t.headerHandlerId, X(e, t, i), i.signal), s = ii(o) ? n.mapSections(o, i) : [];
2795
+ return [...oi(`${t.id}:host-header`, a), ...s];
2783
2796
  },
2784
2797
  getBody: async (r) => {
2785
2798
  let i = await Z(e, t, t.bodyHandlerId, X(e, t, r), r.signal);
2786
- return ri(i) ? n.mapSections(i, r) : [];
2799
+ return ii(i) ? n.mapSections(i, r) : [];
2787
2800
  },
2788
2801
  getFooter: async (i) => {
2789
- let a = await Qr({
2802
+ let a = await $r({
2790
2803
  ctx: i,
2791
2804
  getHostTreeFooterNodes: e.getHostTreeFooterNodes,
2792
2805
  record: t,
2793
2806
  treeViews: r
2794
2807
  });
2795
- if (!t.footerHandlerId) return ai(`${t.id}:host-footer`, a);
2808
+ if (!t.footerHandlerId) return oi(`${t.id}:host-footer`, a);
2796
2809
  let o = await Z(e, t, t.footerHandlerId, X(e, t, i), i.signal);
2797
- return [...ri(o) ? n.mapSections(o, i) : [], ...ai(`${t.id}:host-footer`, a)];
2810
+ return [...ii(o) ? n.mapSections(o, i) : [], ...oi(`${t.id}:host-footer`, a)];
2798
2811
  },
2799
2812
  moveNode: t.moveHandlerId ? async (r, i, a) => {
2800
2813
  let o = n.originalNodes.get(r), s = i ? n.originalNodes.get(i) : void 0;
@@ -2810,37 +2823,37 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2810
2823
  let a = n.originalNodes.get(r);
2811
2824
  if (!a) return r.children ?? [];
2812
2825
  let o = await Z(e, t, t.childrenHandlerId, X(e, t, i, a), i.signal);
2813
- return ii(o) ? n.mapNodes(o, i) : [];
2826
+ return ai(o) ? n.mapNodes(o, i) : [];
2814
2827
  }
2815
2828
  }
2816
2829
  });
2817
2830
  return { dispose() {
2818
2831
  a.dispose(), i.dispose();
2819
2832
  } };
2820
- }, si = (e) => {
2833
+ }, ci = (e) => {
2821
2834
  let t = [];
2822
- for (let n of e.metadata.treeRenderers ?? []) t.push(oi(e, n));
2835
+ for (let n of e.metadata.treeRenderers ?? []) t.push(si(e, n));
2823
2836
  return { dispose() {
2824
2837
  for (let e = t.length - 1; e >= 0; --e) t[e]?.dispose();
2825
2838
  } };
2826
- }, ci = (e) => ({
2839
+ }, li = (e) => ({
2827
2840
  kind: e.kind,
2828
- id: w(e),
2841
+ id: S(e),
2829
2842
  extensionId: e.extensionId
2830
- }), li = (e, t, n) => {
2843
+ }), ui = (e, t, n) => {
2831
2844
  let r = n?.(t.when);
2832
2845
  return !r || e.context.matches(r);
2833
- }, ui = (e) => ({
2846
+ }, di = (e) => ({
2834
2847
  id: e.id,
2835
2848
  label: W(e.label, e.id),
2836
2849
  icon: e.icon,
2837
2850
  canHide: !0,
2838
2851
  canReorder: !0,
2839
2852
  target: H(e.action, { extensionId: e.extensionId })
2840
- }), di = (e, t, n) => {
2853
+ }), fi = (e, t, n) => {
2841
2854
  let r = /* @__PURE__ */ new Map();
2842
2855
  for (let i of t) {
2843
- if (!li(e, i, n)) continue;
2856
+ if (!ui(e, i, n)) continue;
2844
2857
  let t = i.group || void 0, a = t ? `${i.extensionId}:${t}` : g(i.slot), o = r.get(a) ?? {
2845
2858
  id: a,
2846
2859
  label: t,
@@ -2849,46 +2862,46 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2849
2862
  canReorder: !0,
2850
2863
  nodes: []
2851
2864
  };
2852
- o.nodes.push(ui(i)), r.set(a, o);
2865
+ o.nodes.push(di(i)), r.set(a, o);
2853
2866
  }
2854
2867
  return [...r.values()];
2855
- }, fi = (e) => {
2868
+ }, pi = (e) => {
2856
2869
  let t = /* @__PURE__ */ new Map();
2857
2870
  for (let n of e) {
2858
- let e = ci(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
2871
+ let e = li(n.owner), r = `${n.extensionId}:${e.kind}:${e.id}:${n.slot}`;
2859
2872
  t.set(r, [...t.get(r) ?? [], n]);
2860
2873
  }
2861
2874
  return [...t.values()];
2862
- }, pi = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], mi = (e) => fi(e.metadata.navigationItems).map((t) => {
2875
+ }, mi = (e) => [...new Set(e.flatMap((e) => e.group ? [`${e.extensionId}:${e.group}`] : []))], hi = (e) => pi(e.metadata.navigationItems).map((t) => {
2863
2876
  let n = t[0], r = t.some((e) => e.when?.resourceType?.length || e.when?.metadata);
2864
2877
  return e.workbench.navigationTrees.registerContribution({
2865
- id: `${n.extensionId}.navigation-items.${n.owner.kind}.${w(n.owner)}.${n.slot}`,
2866
- owner: ci(n.owner),
2878
+ id: `${n.extensionId}.navigation-items.${n.owner.kind}.${S(n.owner)}.${n.slot}`,
2879
+ owner: li(n.owner),
2867
2880
  sourceExtensionId: n.extensionId,
2868
2881
  declarationIndex: e.metadata.navigationItems.indexOf(n),
2869
2882
  slot: n.slot,
2870
- defaultExpandedSectionIds: pi(t),
2883
+ defaultExpandedSectionIds: mi(t),
2871
2884
  ...r ? {} : { resolveResource: () => void 0 },
2872
- getSections: () => di(e.workbench, t, e.createWhenExpression),
2885
+ getSections: () => fi(e.workbench, t, e.createWhenExpression),
2873
2886
  listActions: () => t.map((e) => ({
2874
2887
  label: W(e.label, e.id),
2875
2888
  category: e.group || void 0,
2876
2889
  action: H(e.action, { extensionId: e.extensionId })
2877
2890
  }))
2878
2891
  });
2879
- }), hi = (e) => e.metadata.navigationTrees.map((t, n) => {
2880
- let r = w(t.view);
2892
+ }), gi = (e) => e.metadata.navigationTrees.map((t, n) => {
2893
+ let r = S(t.view);
2881
2894
  return e.workbench.navigationTrees.registerContribution({
2882
2895
  id: t.id,
2883
2896
  idScope: t.id,
2884
- owner: ci(t.owner),
2897
+ owner: li(t.owner),
2885
2898
  sourceExtensionId: t.extensionId,
2886
2899
  declarationIndex: e.metadata.navigationItems.length + n,
2887
2900
  slot: t.slot,
2888
2901
  viewId: r,
2889
2902
  ...t.resourceScope === "project" ? { resolveResource: () => void 0 } : {}
2890
2903
  });
2891
- }), gi = (e) => [...mi(e), ...hi(e)], _i = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2904
+ }), _i = (e) => [...hi(e), ...gi(e)], vi = (e) => e.metadata.resourceKinds.map((t) => e.workbench.resources.registerKind({
2892
2905
  kind: t.id,
2893
2906
  extensionId: t.extensionId,
2894
2907
  label: W(t.label, t.id),
@@ -2899,7 +2912,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2899
2912
  resource: n,
2900
2913
  source: "dashboard"
2901
2914
  }, r);
2902
- return r.throwIfAborted(), st.array().parse(zn(i)).map((n) => ({
2915
+ return r.throwIfAborted(), st.array().parse(Bn(i)).map((n) => ({
2903
2916
  ...n,
2904
2917
  resource: {
2905
2918
  ...n.resource,
@@ -2908,13 +2921,13 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2908
2921
  }
2909
2922
  }));
2910
2923
  } : void 0
2911
- })), vi = () => {
2924
+ })), yi = () => {
2912
2925
  if (typeof navigator > "u") return;
2913
2926
  let e = `${navigator.platform} ${navigator.userAgent}`.toLowerCase();
2914
2927
  if (e.includes("mac")) return "mac";
2915
2928
  if (e.includes("win")) return "win";
2916
2929
  if (e.includes("linux")) return "linux";
2917
- }, yi = (e, t = vi()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, bi = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
2930
+ }, bi = (e, t = yi()) => (t ? e.platformOverrides?.[t] : void 0) ?? e.key, xi = (e) => e.bindings.map((t) => e.workbench.keybindings.registerKeybinding({
2918
2931
  id: t.id,
2919
2932
  layer: t.layer,
2920
2933
  targetScope: t.targetScope,
@@ -2922,16 +2935,16 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2922
2935
  sourceExtensionId: t.extensionId,
2923
2936
  sourceExtensionLabel: e.extensions?.find((e) => e.id === t.extensionId)?.displayName || e.extensions?.find((e) => e.id === t.extensionId)?.name,
2924
2937
  allowInInputs: t.allowInInputs,
2925
- action: H(t.action, { commandIdOf: (e) => e.extensionId ? C({
2938
+ action: H(t.action, { commandIdOf: (e) => e.extensionId ? x({
2926
2939
  extensionId: e.extensionId,
2927
2940
  id: e.id
2928
2941
  }) : void 0 }),
2929
- keybinding: yi(t),
2942
+ keybinding: bi(t),
2930
2943
  when: e.createWhenExpression?.(t.when)
2931
- })), xi = (e) => {
2944
+ })), Si = (e) => {
2932
2945
  if (!e) return;
2933
2946
  let t = (e) => {
2934
- if (e) return Array.isArray(e) ? e.map((e) => w(e)) : w(e);
2947
+ if (e) return Array.isArray(e) ? e.map((e) => S(e)) : S(e);
2935
2948
  };
2936
2949
  return {
2937
2950
  mode: t(e.mode),
@@ -2940,12 +2953,12 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2940
2953
  resourceType: e.resourceType?.map((e) => e.extensionId === "pstdio" ? e.id : `${e.extensionId}.${e.id}`),
2941
2954
  metadata: e.metadata
2942
2955
  };
2943
- }, Si = (e) => !(!e || typeof e != "object" || Array.isArray(e)), Ci = (e, t, n) => D(e) ? H(e, {
2956
+ }, Ci = (e) => !(!e || typeof e != "object" || Array.isArray(e)), wi = (e, t, n) => T(e) ? H(e, {
2944
2957
  extensionId: t,
2945
2958
  projectId: n
2946
- }) : void 0, wi = (e, t, n) => Array.isArray(e) ? e.flatMap((e) => {
2947
- if (!Si(e) || typeof e.id != "string") return [];
2948
- let r = Ci(e.action, t, n);
2959
+ }) : void 0, Ti = (e, t, n) => Array.isArray(e) ? e.flatMap((e) => {
2960
+ if (!Ci(e) || typeof e.id != "string") return [];
2961
+ let r = wi(e.action, t, n);
2949
2962
  return [{
2950
2963
  id: e.id,
2951
2964
  label: W(e.label, e.id),
@@ -2958,16 +2971,16 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2958
2971
  target: r
2959
2972
  } : void 0
2960
2973
  }];
2961
- }) : [], Ti = (e, t, n) => {
2962
- if (!Si(e)) return {};
2963
- let r = Si(e.indicator) ? {
2974
+ }) : [], Ei = (e, t, n) => {
2975
+ if (!Ci(e)) return {};
2976
+ let r = Ci(e.indicator) ? {
2964
2977
  icon: String(e.indicator.icon ?? ""),
2965
2978
  color: typeof e.indicator.color == "string" ? e.indicator.color : void 0,
2966
2979
  label: W(e.indicator.label)
2967
- } : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !Si(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
2980
+ } : void 0, i = Array.isArray(e.menu) ? e.menu.flatMap((e) => !Ci(e) || typeof e.id != "string" || !Array.isArray(e.rows) ? [] : [{
2968
2981
  id: e.id,
2969
2982
  label: W(e.label),
2970
- rows: wi(e.rows, t, n)
2983
+ rows: Ti(e.rows, t, n)
2971
2984
  }]) : void 0;
2972
2985
  return {
2973
2986
  label: W(e.label),
@@ -2975,7 +2988,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2975
2988
  indicator: r?.icon ? r : void 0,
2976
2989
  menu: i
2977
2990
  };
2978
- }, Ei = (e, t) => {
2991
+ }, Di = (e, t) => {
2979
2992
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = new Set(t.refreshEventIds ?? []), s = 0, c = (e) => JSON.stringify([e.instanceId, e.resource]), l = (o) => {
2980
2993
  r.set(o.instanceId, o);
2981
2994
  let u = c(o), d = i.get(u);
@@ -2993,7 +3006,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
2993
3006
  if (f && c(f) === u) {
2994
3007
  if (p !== s) i.delete(u), await l(f);
2995
3008
  else {
2996
- n.set(u, Ti(d, t.extensionId, e.projectId));
3009
+ n.set(u, Ei(d, t.extensionId, e.projectId));
2997
3010
  for (let e of a) e();
2998
3011
  }
2999
3012
  }
@@ -3011,7 +3024,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3011
3024
  subscribe(t) {
3012
3025
  a.add(t);
3013
3026
  let n = e.workbench.resources.preview.subscribeRefresh(async (e) => {
3014
- let t = [...r.values()].filter((t) => t.resource && ne(t.resource) === ne(e));
3027
+ let t = [...r.values()].filter((t) => t.resource && D(t.resource) === D(e));
3015
3028
  t.length && (s++, await Promise.all(t.map(l)));
3016
3029
  }), i = e.subscribeRefreshEvents?.((e) => {
3017
3030
  if (o.has(e.id)) {
@@ -3024,18 +3037,18 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3024
3037
  } };
3025
3038
  }
3026
3039
  };
3027
- }, Di = (e, t) => ({
3040
+ }, Oi = (e, t) => ({
3028
3041
  ...e,
3029
3042
  tab: e.tab && t.createTab ? t.createTab({
3030
3043
  ...e.tab,
3031
3044
  extensionId: t.extensionId,
3032
3045
  placementId: t.placementId
3033
3046
  }) : void 0
3034
- }), Oi = (e, t) => {
3047
+ }), ki = (e, t) => {
3035
3048
  if (e.kind === "group") return e;
3036
3049
  let n = e.empty && "view" in e.empty ? {
3037
3050
  view: e.empty.view,
3038
- breadcrumb: e.empty.breadcrumb ? Ti(e.empty.breadcrumb, t.extensionId, t.projectId) : void 0
3051
+ breadcrumb: e.empty.breadcrumb ? Ei(e.empty.breadcrumb, t.extensionId, t.projectId) : void 0
3039
3052
  } : e.empty;
3040
3053
  return e.kind === "panels" ? {
3041
3054
  ...e,
@@ -3049,7 +3062,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3049
3062
  placementId: t.placementId
3050
3063
  }) : void 0
3051
3064
  };
3052
- }, ki = (e, t = {}) => e.pages.map((e) => ({
3065
+ }, Ai = (e, t = {}) => e.pages.map((e) => ({
3053
3066
  id: e.id,
3054
3067
  ref: {
3055
3068
  extensionId: e.extensionId,
@@ -3061,33 +3074,33 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3061
3074
  document: e.document,
3062
3075
  params: e.params,
3063
3076
  regionSettings: e.regionSettings,
3064
- modeId: w(e.mode),
3077
+ modeId: S(e.mode),
3065
3078
  resource: e.resource,
3066
- main: Oi(e.main, {
3079
+ main: ki(e.main, {
3067
3080
  extensionId: e.extensionId,
3068
3081
  placementId: `${e.id}.$main`,
3069
3082
  ...t
3070
3083
  }),
3071
3084
  panelView: e.panelView,
3072
- slots: e.slots.map((n) => Di(n, {
3085
+ slots: e.slots.map((n) => Oi(n, {
3073
3086
  extensionId: e.extensionId,
3074
3087
  placementId: `${e.id}.${n.id}`,
3075
3088
  ...t
3076
3089
  })),
3077
3090
  ...e.icon ? { icon: e.icon } : {},
3078
- ...e.parent ? { parentId: w(e.parent) } : {}
3091
+ ...e.parent ? { parentId: S(e.parent) } : {}
3079
3092
  })), Q = (e, t) => {
3080
3093
  let n = e.pages.flatMap((e) => [...e.main.kind === "view" && e.resource ? [{
3081
3094
  ...e.resource,
3082
3095
  view: e.main.view
3083
3096
  }] : [], ...e.slots.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])]);
3084
- return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => w(e.view) === t)?.kinds[0]?.id;
3085
- }, Ai = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
3097
+ return n.push(...e.placements.flatMap((e) => e.item.kind === "binding" ? [e.item.binding] : [])), n.find((e) => S(e.view) === t)?.kinds[0]?.id;
3098
+ }, ji = (e) => e.body.kind === "webview" ? { webview: e.body.webview } : { renderer: {
3086
3099
  kind: e.body.kind,
3087
3100
  id: e.id
3088
- } }, ji = (e, t) => e.viewMenus.flatMap((n) => {
3089
- if (w(n.owner) !== t.id) return [];
3090
- let r = e.views.find((e) => e.id === w(n.view));
3101
+ } }, Mi = (e, t) => e.viewMenus.flatMap((n) => {
3102
+ if (S(n.owner) !== t.id) return [];
3103
+ let r = e.views.find((e) => e.id === S(n.view));
3091
3104
  return r ? [{
3092
3105
  id: n.id,
3093
3106
  extensionId: n.extensionId,
@@ -3099,22 +3112,22 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3099
3112
  placement: n.placement,
3100
3113
  hostTreeHeader: n.hostTreeHeader,
3101
3114
  hostTreeFooter: n.hostTreeFooter,
3102
- ...Ai(r)
3115
+ ...ji(r)
3103
3116
  }] : [];
3104
- }), Mi = (e) => e.views.map((t) => {
3105
- let n = ji(e, t);
3117
+ }), Ni = (e) => e.views.map((t) => {
3118
+ let n = Mi(e, t);
3106
3119
  return {
3107
3120
  id: t.id,
3108
3121
  extensionId: t.extensionId,
3109
3122
  title: t.title,
3110
3123
  icon: t.icon,
3111
3124
  panelMenus: n.length > 0 ? n : void 0,
3112
- ...Ai(t)
3125
+ ...ji(t)
3113
3126
  };
3114
3127
  }), $ = (e) => e?.map(({ command: e, ...t }) => ({
3115
3128
  ...t,
3116
- commandId: C(e)
3117
- })), Ni = (e) => e.views.flatMap((t) => {
3129
+ commandId: x(e)
3130
+ })), Pi = (e) => e.views.flatMap((t) => {
3118
3131
  let n = t.body;
3119
3132
  return n.kind === "kanban" ? [{
3120
3133
  ...n,
@@ -3130,17 +3143,17 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3130
3143
  params: n.createRow.params,
3131
3144
  attributesParam: n.createRow.attributesParam,
3132
3145
  labels: n.createRow.labels,
3133
- commandId: C(n.createRow.command),
3146
+ commandId: x(n.createRow.command),
3134
3147
  attachments: n.createRow.attachments ? {
3135
3148
  resourceParam: n.createRow.attachments.resourceParam,
3136
3149
  fileParam: n.createRow.attachments.fileParam,
3137
- commandId: C(n.createRow.attachments.command)
3150
+ commandId: x(n.createRow.attachments.command)
3138
3151
  } : void 0
3139
3152
  } : void 0,
3140
3153
  rowActions: $(n.rowActions),
3141
3154
  toolbarActions: $(n.toolbarActions)
3142
3155
  }] : [];
3143
- }), Pi = (e) => e.views.flatMap((t) => {
3156
+ }), Fi = (e) => e.views.flatMap((t) => {
3144
3157
  let n = t.body;
3145
3158
  return n.kind === "dataTable" ? [{
3146
3159
  ...n,
@@ -3153,28 +3166,28 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3153
3166
  rowActions: $(n.rowActions),
3154
3167
  toolbarActions: $(n.toolbarActions)
3155
3168
  }] : [];
3156
- }), Fi = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
3169
+ }), Ii = (e) => e.views.flatMap((t) => t.body.kind === "tree" ? [{
3157
3170
  ...t.body,
3158
3171
  id: t.id,
3159
3172
  extensionId: t.extensionId,
3160
3173
  title: t.title,
3161
3174
  icon: t.icon,
3162
3175
  resourceKind: t.body.resourceKind ?? Q(e, t.id)
3163
- }] : []), Ii = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
3176
+ }] : []), Li = (e) => e.views.flatMap((t) => t.body.kind === "file" ? [{
3164
3177
  ...t.body,
3165
3178
  id: t.id,
3166
3179
  extensionId: t.extensionId,
3167
3180
  title: t.title,
3168
3181
  icon: t.icon,
3169
3182
  resourceKind: t.body.resourceKind ?? Q(e, t.id)
3170
- }] : []), Li = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
3183
+ }] : []), Ri = (e) => e.views.flatMap((t) => t.body.kind === "controls" ? [{
3171
3184
  ...t.body,
3172
3185
  id: t.id,
3173
3186
  extensionId: t.extensionId,
3174
3187
  title: t.title,
3175
3188
  icon: t.icon,
3176
3189
  resourceKind: t.body.resourceKind ?? Q(e, t.id)
3177
- }] : []), Ri = (e) => e.modes.map((e) => ({
3190
+ }] : []), zi = (e) => e.modes.map((e) => ({
3178
3191
  id: e.id,
3179
3192
  extensionId: e.extensionId,
3180
3193
  modeId: e.id,
@@ -3184,17 +3197,17 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3184
3197
  regionSettings: e.regionSettings,
3185
3198
  floatingPanels: e.floatingPanels,
3186
3199
  canFullscreen: e.canFullscreen,
3187
- ...e.defaultTheme ? { defaultTheme: w(e.defaultTheme) } : {},
3188
- ...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && w(t)])) } : {}
3189
- })), zi = (e, t = {}) => {
3190
- let n = Mi(e);
3200
+ ...e.defaultTheme ? { defaultTheme: S(e.defaultTheme) } : {},
3201
+ ...e.chrome ? { chrome: Object.fromEntries(Object.entries(e.chrome).map(([e, t]) => [e, t !== !1 && S(t)])) } : {}
3202
+ })), Bi = (e, t = {}) => {
3203
+ let n = Ni(e);
3191
3204
  return {
3192
3205
  extensions: e.extensions,
3193
3206
  commands: e.commands,
3194
3207
  menuContributions: e.menuContributions,
3195
3208
  commandPaletteContributions: e.commandPaletteContributions,
3196
- modes: Ri(e),
3197
- pages: ki(e, t),
3209
+ modes: zi(e),
3210
+ pages: Ai(e, t),
3198
3211
  placements: e.placements.map((e) => ({
3199
3212
  id: e.id,
3200
3213
  ref: {
@@ -3202,7 +3215,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3202
3215
  kind: "placement",
3203
3216
  id: e.localId
3204
3217
  },
3205
- modeId: w(e.mode),
3218
+ modeId: S(e.mode),
3206
3219
  replaces: e.replaces,
3207
3220
  item: e.item,
3208
3221
  region: e.region,
@@ -3239,7 +3252,7 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3239
3252
  })),
3240
3253
  settingsSections: e.settingsSections ?? [],
3241
3254
  settingsPanels: e.settingsPanels.flatMap((t) => {
3242
- let n = e.views.find((e) => e.id === w(t.view));
3255
+ let n = e.views.find((e) => e.id === S(t.view));
3243
3256
  return n ? [{
3244
3257
  id: t.id,
3245
3258
  viewId: n.id,
@@ -3253,31 +3266,31 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3253
3266
  parentPanelId: t.slot.id === "developer.settings" ? "developer-tools" : void 0,
3254
3267
  title: n.title,
3255
3268
  icon: n.icon,
3256
- section: t.section ? w(t.section) : void 0
3269
+ section: t.section ? S(t.section) : void 0
3257
3270
  }] : [];
3258
3271
  }),
3259
- kanbanRenderers: Ni(e),
3260
- dataTableRenderers: Pi(e),
3272
+ kanbanRenderers: Pi(e),
3273
+ dataTableRenderers: Fi(e),
3261
3274
  commandPaletteResources: e.commandPaletteResources ?? [],
3262
- treeRenderers: Fi(e),
3263
- fileRenderers: Ii(e),
3264
- controlsRenderers: Li(e),
3275
+ treeRenderers: Ii(e),
3276
+ fileRenderers: Li(e),
3277
+ controlsRenderers: Ri(e),
3265
3278
  keybindings: e.keybindings ?? [],
3266
3279
  settingsDefinitions: e.settingsDefinitions ?? [],
3267
3280
  statusBarItems: e.statusBarItems.map((e) => ({
3268
3281
  id: e.id,
3269
3282
  extensionId: e.extensionId,
3270
- viewId: w(e.view),
3271
- popoverViewId: e.popover ? w(e.popover) : void 0,
3283
+ viewId: S(e.view),
3284
+ popoverViewId: e.popover ? S(e.popover) : void 0,
3272
3285
  slot: e.slot.id.endsWith("leading") ? "leading" : "trailing",
3273
3286
  order: e.order,
3274
- when: xi(e.when)
3287
+ when: Si(e.when)
3275
3288
  })),
3276
3289
  diagnostics: e.diagnostics
3277
3290
  };
3278
- }, Bi = (e, t, n = {}) => {
3291
+ }, Vi = (e, t, n = {}) => {
3279
3292
  e.views.refreshView(t.id, t.kind === "file" ? n : void 0);
3280
- }, Vi = (e) => {
3293
+ }, Hi = (e) => {
3281
3294
  let t = /* @__PURE__ */ new Map(), n = (e, n) => {
3282
3295
  for (let r of new Set(n.refreshEventIds ?? [])) {
3283
3296
  let i = t.get(r) ?? [];
@@ -3292,25 +3305,25 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3292
3305
  refreshEventIds: t.body.refreshEventIds
3293
3306
  });
3294
3307
  return t;
3295
- }, Hi = (e) => {
3296
- let t = Vi(e.metadata);
3308
+ }, Ui = (e) => {
3309
+ let t = Hi(e.metadata);
3297
3310
  return e.subscribe((n) => {
3298
3311
  let { id: r, ...i } = n;
3299
- for (let n of t.get(r) ?? []) Bi(e.workbench, n, i);
3312
+ for (let n of t.get(r) ?? []) Vi(e.workbench, n, i);
3300
3313
  });
3301
- }, Ui = (e, t) => {
3314
+ }, Wi = (e, t) => {
3302
3315
  for (let n of t.views) n.body.kind === "webview" && e.views.getView(n.id) && e.views.refreshView(n.id);
3303
- }, Wi = (e) => (t) => {
3316
+ }, Gi = (e) => (t) => {
3304
3317
  let n = t.extensionId ?? e.extensionIdForWebview(t.webviewId);
3305
3318
  return {
3306
- ...kn({
3319
+ ...An({
3307
3320
  ...t,
3308
3321
  extensionId: n,
3309
3322
  projectId: e.projectId
3310
3323
  }),
3311
3324
  executeCommand: (n, r) => {
3312
3325
  let i = n.resource ?? t.placement.resource;
3313
- return Vn({
3326
+ return Hn({
3314
3327
  ...e,
3315
3328
  workbench: t.workbench
3316
3329
  }, n.commandId, {
@@ -3330,14 +3343,14 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3330
3343
  files: e.files,
3331
3344
  artifacts: e.artifacts ? { read: (n) => e.artifacts.read(n, { webviewId: t.webviewId }) } : void 0
3332
3345
  };
3333
- }, Gi = (e) => ({
3346
+ }, Ki = (e) => ({
3334
3347
  title: W(e.title) || void 0,
3335
3348
  runtimeUrl: e.runtimeUrl,
3336
3349
  moduleUrl: e.moduleUrl,
3337
3350
  styles: e.styles,
3338
3351
  capabilities: e.capabilities
3339
- }), Ki = "extensions", qi = 1e3, Ji = (e) => e === void 0 ? void 0 : e, Yi = (e) => e === "project" ? "project" : "user", Xi = (e, t) => {
3340
- let n = Wi({
3352
+ }), qi = "extensions", Ji = 1e3, Yi = (e) => e === void 0 ? void 0 : e, Xi = (e) => e === "project" ? "project" : "user", Zi = (e, t) => {
3353
+ let n = Gi({
3341
3354
  artifacts: e.webviewArtifacts,
3342
3355
  executeCommand: e.executeCommand,
3343
3356
  extensionIdForWebview: (t) => e.metadata.panels.find((e) => e.id === t)?.extensionId,
@@ -3349,9 +3362,9 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3349
3362
  ...n(t),
3350
3363
  ...e.createWebviewHostAdapters?.(t)
3351
3364
  });
3352
- }, Zi = (e) => e.metadata.panels.flatMap((t) => {
3365
+ }, Qi = (e) => e.metadata.panels.flatMap((t) => {
3353
3366
  if (!t.webview) return [];
3354
- let n = Gi(t.webview);
3367
+ let n = Ki(t.webview);
3355
3368
  return [e.workbench.views.registerView({
3356
3369
  id: t.id,
3357
3370
  title: W(t.title, t.id),
@@ -3362,15 +3375,15 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3362
3375
  let i = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.parentPanelId), a = r.sizing;
3363
3376
  r.panel.region === "status" && (a = "content-width"), i && (a = "content-height");
3364
3377
  let o = e.metadata.settingsPanels.some((e) => e.id === r.instance.panelId && e.viewId === t.id) ? "settings" : "panel";
3365
- return e.renderWebview?.(r) ?? Pn({
3378
+ return e.renderWebview?.(r) ?? Fn({
3366
3379
  sizing: a,
3367
3380
  context: {
3368
3381
  workbench: r.workbench,
3369
3382
  webviewId: t.id,
3370
3383
  placement: r.instance,
3371
- hostEvents: Nn(r.workbench, r.instance)
3384
+ hostEvents: Pn(r.workbench, r.instance)
3372
3385
  },
3373
- createHostAdapters: Xi(e, o),
3386
+ createHostAdapters: Zi(e, o),
3374
3387
  createProps: e.createWebviewProps ?? (({ placement: e }) => ({
3375
3388
  placement: e,
3376
3389
  resource: e.resource
@@ -3383,18 +3396,18 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3383
3396
  }
3384
3397
  }
3385
3398
  })];
3386
- }), Qi = {
3399
+ }), $i = {
3387
3400
  first: 1e6,
3388
3401
  default: 0,
3389
3402
  last: -1e6
3390
- }, $i = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
3403
+ }, ea = (e) => e.metadata.panels.flatMap((e) => e.panelMenus ?? []).map((t, n) => e.workbench.viewMenus.registerViewMenu({
3391
3404
  id: t.id,
3392
3405
  ownerViewId: t.ownerPanelId,
3393
3406
  viewId: t.viewId,
3394
3407
  side: t.side,
3395
- priority: Qi[t.placement ?? "default"] - n
3396
- })), ea = (e) => {
3397
- let t = [], n = e.settingsSectionId ?? Ki;
3408
+ priority: $i[t.placement ?? "default"] - n
3409
+ })), ta = (e) => {
3410
+ let t = [], n = e.settingsSectionId ?? qi;
3398
3411
  e.workbench.settings.getSection(n) || t.push(e.workbench.settings.registerSection({
3399
3412
  id: n,
3400
3413
  title: e.settingsSectionTitle ?? "Extensions"
@@ -3411,8 +3424,8 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3411
3424
  let t = a.get(e.extensionId) ?? Object.create(null);
3412
3425
  t[e.key] = {
3413
3426
  type: e.type,
3414
- scope: Yi(e.scope),
3415
- default: Ji(e.default),
3427
+ scope: Xi(e.scope),
3428
+ default: Yi(e.default),
3416
3429
  enum: e.enum,
3417
3430
  description: W(e.description)
3418
3431
  }, a.set(e.extensionId, t);
@@ -3424,26 +3437,26 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3424
3437
  title: W(i.title, i.id),
3425
3438
  icon: i.icon,
3426
3439
  kind: "view",
3427
- order: qi + r,
3440
+ order: Ji + r,
3428
3441
  section: i.section ?? n,
3429
3442
  scope: i.scope,
3430
3443
  parentPanelId: i.parentPanelId,
3431
3444
  viewId: i.viewId
3432
3445
  }));
3433
3446
  return t;
3434
- }, ta = (e) => {
3447
+ }, na = (e) => {
3435
3448
  for (let t = e.length - 1; t >= 0; --t) e[t]?.dispose();
3436
- }, na = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, ra = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, ia = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
3449
+ }, ra = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, ia = (e, t, n, r, i) => e.prepareCommandArgs?.(t, n, r, i) ?? n, aa = (e, t) => t.commands.map((t) => e.workbench.commands.registerCommand({
3437
3450
  id: t.id,
3438
3451
  label: W(t.title, t.id),
3439
3452
  description: W(t.description),
3440
3453
  params: q(t.params, W, t.extensionId),
3441
3454
  resourceMutation: t.resourceMutation
3442
3455
  }, {
3443
- prepareArgs: (n, r, i) => ra(e, t.id, n, r, i),
3456
+ prepareArgs: (n, r, i) => ia(e, t.id, n, r, i),
3444
3457
  execute: (n, r) => K(e, t.id, {
3445
3458
  ...r,
3446
- params: na(n),
3459
+ params: ra(n),
3447
3460
  resource: r?.resource,
3448
3461
  signal: r?.signal,
3449
3462
  region: r?.region,
@@ -3452,9 +3465,9 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3452
3465
  }, {
3453
3466
  ownerId: t.extensionId,
3454
3467
  source: "extension"
3455
- })), aa = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), oa = (e, t) => {
3468
+ })), oa = (e, t) => t?.resource ?? e.workbench.getPrimaryResource(), sa = (e, t) => {
3456
3469
  if (!e.menuSlotsById) return [];
3457
- let { registrations: n } = fr({
3470
+ let { registrations: n } = pr({
3458
3471
  metadata: e.metadata,
3459
3472
  menuSlotsById: e.menuSlotsById,
3460
3473
  menuTargetsById: e.menuTargetsById,
@@ -3467,14 +3480,14 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3467
3480
  }]
3468
3481
  }));
3469
3482
  return (e.menuRegistrations ?? r).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
3470
- prepareArgs: (e, r, i) => ra(t, n.targetCommandId, e, r, i),
3483
+ prepareArgs: (e, r, i) => ia(t, n.targetCommandId, e, r, i),
3471
3484
  execute: (r, i) => K(t, n.targetCommandId, {
3472
3485
  ...i,
3473
3486
  params: {
3474
3487
  ...n.contribution.params ?? {},
3475
- ...na(r) ?? {}
3488
+ ...ra(r) ?? {}
3476
3489
  },
3477
- resource: aa(e, i),
3490
+ resource: oa(e, i),
3478
3491
  slot: G({
3479
3492
  id: n.contribution.slotId,
3480
3493
  kind: "menu",
@@ -3483,15 +3496,15 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3483
3496
  })
3484
3497
  })
3485
3498
  }), ...n.menuItems.map(({ menuPath: t, menuItem: n }) => e.workbench.layout.registerMenuItem(t, n))]);
3486
- }, sa = (e, t) => pr({ metadata: e.metadata }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
3487
- prepareArgs: (e, r, i) => ra(t, n.targetCommandId, e, r, i),
3499
+ }, ca = (e, t) => mr({ metadata: e.metadata }).flatMap((n) => [e.workbench.commands.registerCommand(n.command, {
3500
+ prepareArgs: (e, r, i) => ia(t, n.targetCommandId, e, r, i),
3488
3501
  execute: (r, i) => K(t, n.targetCommandId, {
3489
3502
  ...i,
3490
3503
  params: {
3491
3504
  ...n.contribution.params ?? {},
3492
- ...na(r) ?? {}
3505
+ ...ra(r) ?? {}
3493
3506
  },
3494
- resource: aa(e, i),
3507
+ resource: oa(e, i),
3495
3508
  slot: G({
3496
3509
  id: "workbench.commandPalette",
3497
3510
  kind: "menu",
@@ -3499,20 +3512,20 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3499
3512
  context: { panelId: n.contribution.id }
3500
3513
  })
3501
3514
  }),
3502
- isVisible: () => te(n.contribution.when, e.workbench.getPrimaryResource()?.type)
3503
- }), e.workbench.layout.registerMenuItem(y, n.menuItem)]), ca = (e, t) => {
3515
+ isVisible: () => E(n.contribution.when, e.workbench.getPrimaryResource()?.type)
3516
+ }), e.workbench.layout.registerMenuItem(v, n.menuItem)]), la = (e, t) => {
3504
3517
  let n = t?.mode;
3505
3518
  if (!n) return !0;
3506
3519
  let r = e.workbench.modes.getActiveModeId() ?? "";
3507
3520
  return Array.isArray(n) ? n.includes(r) : n === r;
3508
- }, la = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
3521
+ }, ua = (e) => (e.metadata.statusBarItems ?? []).map((t) => e.workbench.statusBar.registerItem({
3509
3522
  id: t.id,
3510
3523
  viewId: t.viewId,
3511
3524
  popoverViewId: t.popoverViewId,
3512
3525
  slot: t.slot,
3513
3526
  order: t.order,
3514
- isVisible: () => ca(e, t.when)
3515
- })), ua = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), da = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
3527
+ isVisible: () => la(e, t.when)
3528
+ })), da = (e) => e.metadata.pages.map((t) => e.workbench.pages.registerPage(t)), fa = (e) => e.metadata.modes.map((t) => e.workbench.modes.registerMode({
3516
3529
  id: t.modeId,
3517
3530
  label: W(t.label, t.modeId),
3518
3531
  panels: t.panelRegions,
@@ -3522,38 +3535,38 @@ var W = (e, t = "") => e === void 0 ? t : ut(e) ? e.default ?? e.$l10n : e, zn =
3522
3535
  defaultTheme: t.defaultTheme,
3523
3536
  chrome: t.chrome,
3524
3537
  activate: () => void 0
3525
- })), fa = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), pa = (e) => {
3538
+ })), pa = (e) => e.metadata.placements.map((t) => e.workbench.modePlacements.registerPlacement(t)), ma = (e) => {
3526
3539
  let t = {
3527
3540
  ...e,
3528
- metadata: zi(e.metadata, {
3541
+ metadata: Bi(e.metadata, {
3529
3542
  projectId: e.projectId,
3530
- createTab: (t) => Ei(e, t)
3543
+ createTab: (t) => Di(e, t)
3531
3544
  })
3532
3545
  }, n = [], r = t;
3533
3546
  try {
3534
- return n.push(...ia(r, t.metadata)), n.push(...bi({
3547
+ return n.push(...aa(r, t.metadata)), n.push(...xi({
3535
3548
  bindings: t.metadata.keybindings,
3536
3549
  extensions: t.metadata.extensions,
3537
3550
  createWhenExpression: t.createKeybindingWhenExpression,
3538
3551
  workbench: t.workbench
3539
- })), n.push(...oa(t, r)), n.push(...sa(t, r)), n.push(si({
3552
+ })), n.push(...sa(t, r)), n.push(...ca(t, r)), n.push(ci({
3540
3553
  ...t,
3541
3554
  resolveNodeResource: t.resolveTreeNodeResource
3542
- })), n.push(yr(t)), n.push(Xn(r, t.metadata.controlsRenderers ?? [])), n.push(...Zi(t)), n.push(...ea(t)), n.push(Kr(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(rr(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...$i(t)), n.push(qn(r, t.metadata.commandPaletteResources ?? [])), n.push(...gi({
3555
+ })), n.push(br(t)), n.push(Zn(r, t.metadata.controlsRenderers ?? [])), n.push(...Qi(t)), n.push(...ta(t)), n.push(qr(r, t.metadata.kanbanRenderers ?? [], t.kanbanAdapter)), n.push(ir(r, t.metadata.dataTableRenderers ?? [], t.dataTableAdapter)), n.push(...ea(t)), n.push(Jn(r, t.metadata.commandPaletteResources ?? [])), n.push(..._i({
3543
3556
  createWhenExpression: e.createNavigationWhenExpression,
3544
3557
  metadata: e.metadata,
3545
3558
  workbench: e.workbench
3546
- })), e.subscribeRefreshEvents && n.push(Hi({
3559
+ })), e.subscribeRefreshEvents && n.push(Ui({
3547
3560
  metadata: e.metadata,
3548
3561
  subscribe: e.subscribeRefreshEvents,
3549
3562
  workbench: e.workbench
3550
- })), n.push(...la(t)), n.push(..._i(t)), n.push(...da(t)), n.push(...fa(t)), n.push(...ua(t)), { dispose() {
3551
- ta(n);
3563
+ })), n.push(...ua(t)), n.push(...vi(t)), n.push(...fa(t)), n.push(...pa(t)), n.push(...da(t)), { dispose() {
3564
+ na(n);
3552
3565
  } };
3553
3566
  } catch (e) {
3554
- throw ta(n), e;
3567
+ throw na(n), e;
3555
3568
  }
3556
3569
  };
3557
- export { R as WebviewHostCapabilityError, pr as buildWorkbenchExtensionCommandPaletteRegistrations, fr as buildWorkbenchExtensionMenuRegistrations, G as createExtensionSlot, pn as createExtensionWebviewHostCapabilities, Nt as createTerminalSessionCapability, kn as createWorkbenchWebviewHostAdapters, An as createWorkbenchWebviewHostCapabilities, ar as emptyWorkbenchExtensionMetadata, Vn as executeWorkbenchExtensionCommandResponse, _r as fileRendererRefreshEnvelopeFromCommand, Nn as getBridgeWebviewHostEventPublisher, Ui as refreshOpenWorkbenchExtensionWebviews, Bi as refreshWorkbenchExtensionRenderer, qn as registerWorkbenchExtensionCommandPaletteResources, pa as registerWorkbenchExtensionContributions, Xn as registerWorkbenchExtensionControlsRenderers, rr as registerWorkbenchExtensionDataTableRenderers, yr as registerWorkbenchExtensionFileRenderers, Kr as registerWorkbenchExtensionKanbanRenderers, Hi as registerWorkbenchExtensionRendererRefreshEvents, si as registerWorkbenchExtensionTreeRenderers, Pn as renderBridgeWebviewFrame, H as toWorkbenchNavigationTarget, xi as toWorkbenchWhenExpression, rn as withFrameSignal };
3570
+ export { z as WebviewHostCapabilityError, mr as buildWorkbenchExtensionCommandPaletteRegistrations, pr as buildWorkbenchExtensionMenuRegistrations, G as createExtensionSlot, mn as createExtensionWebviewHostCapabilities, Nt as createTerminalSessionCapability, An as createWorkbenchWebviewHostAdapters, jn as createWorkbenchWebviewHostCapabilities, or as emptyWorkbenchExtensionMetadata, Hn as executeWorkbenchExtensionCommandResponse, vr as fileRendererRefreshEnvelopeFromCommand, Pn as getBridgeWebviewHostEventPublisher, Wi as refreshOpenWorkbenchExtensionWebviews, Vi as refreshWorkbenchExtensionRenderer, Jn as registerWorkbenchExtensionCommandPaletteResources, ma as registerWorkbenchExtensionContributions, Zn as registerWorkbenchExtensionControlsRenderers, ir as registerWorkbenchExtensionDataTableRenderers, br as registerWorkbenchExtensionFileRenderers, qr as registerWorkbenchExtensionKanbanRenderers, Ui as registerWorkbenchExtensionRendererRefreshEvents, ci as registerWorkbenchExtensionTreeRenderers, Fn as renderBridgeWebviewFrame, H as toWorkbenchNavigationTarget, Si as toWorkbenchWhenExpression, an as withFrameSignal };
3558
3571
 
3559
3572
  //# sourceMappingURL=extensions.js.map