reactive-vscode 1.0.0-beta.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,902 +1,793 @@
1
- import { shallowRef as r, effectScope as Q, computed as d, toValue as v, getCurrentScope as z, isRef as C, watchEffect as w, unref as M, watch as D, onScopeDispose as L, shallowReactive as G, readonly as J, toRaw as X, ref as F } from "@reactive-vscode/reactivity";
1
+ import { computed as e, effectScope as t, getCurrentScope as n, isRef as r, onScopeDispose as i, readonly as a, ref as o, shallowReactive as s, shallowRef as c, toRaw as l, toValue as u, unref as d, watch as f, watchEffect as p } from "@reactive-vscode/reactivity";
2
+ import { ColorThemeKind as m, EventEmitter as ee, Uri as te, chat as ne, commands as h, debug as g, env as _, extensions as v, l10n as y, lm as b, tasks as x, window as S, workspace as C } from "vscode";
2
3
  export * from "@reactive-vscode/reactivity";
3
- import { workspace as T, env as x, window as f, Uri as Y, debug as W, extensions as A, chat as Z, commands as S, EventEmitter as q, ColorThemeKind as O, l10n as N, lm as V, tasks as R } from "vscode";
4
- const B = [];
5
- function _(e) {
6
- E.value ? e(E.value) : B.push(e);
7
- }
8
- const $ = [];
9
- function ve(e) {
10
- $.push(e);
11
- }
12
- const E = r(null), k = Q();
13
- function de(e) {
14
- return {
15
- activate: (t) => (E.value = t, k.run(() => (B.forEach((n) => n(t)), e(t)))),
16
- deactivate: async () => {
17
- await Promise.allSettled($.map((t) => t())), k.stop();
18
- }
19
- };
20
- }
21
- function fe(e, t) {
22
- const n = !e, o = r(null);
23
- function s() {
24
- return o.value = T.getConfiguration(e ?? void 0, t);
25
- }
26
- function i() {
27
- if (!E.value)
28
- throw new Error("Cannot access config before extension is activated.");
29
- return o.value ? o.value : s();
30
- }
31
- function u(c) {
32
- return new Proxy({}, {
33
- get(p, l) {
34
- const g = i();
35
- if (typeof l != "string")
36
- throw new TypeError("Symbol keys are not supported in defineConfig proxy.");
37
- if (c === "" && ["get", "has", "inspect", "update"].includes(l))
38
- return Reflect.get(g, l).bind(g);
39
- const m = g.get(c + l);
40
- if (m === void 0)
41
- throw new Error(`Configuration key "${e ? `${e}.` : ""}${c + l}" is not defined.`);
42
- return typeof m != "object" || m === null || Array.isArray(m) ? m : u(`${c}${l}.`);
43
- },
44
- set(p, l, g) {
45
- const m = i();
46
- if (typeof l != "string")
47
- throw new TypeError("Symbol keys are not supported in defineConfig proxy.");
48
- return m.update(c + l, g), !0;
49
- },
50
- apply: P,
51
- construct: P,
52
- defineProperty(p, l, g) {
53
- const m = i();
54
- return Reflect.defineProperty(m, l, g);
55
- },
56
- deleteProperty(p, l) {
57
- const g = i();
58
- return Reflect.deleteProperty(g, l);
59
- },
60
- getOwnPropertyDescriptor(p, l) {
61
- const g = i();
62
- return Reflect.getOwnPropertyDescriptor(g, l);
63
- },
64
- getPrototypeOf(p) {
65
- const l = i();
66
- return Reflect.getPrototypeOf(l);
67
- },
68
- has(p, l) {
69
- const g = i();
70
- return Reflect.has(g, l);
71
- },
72
- isExtensible(p) {
73
- const l = i();
74
- return Reflect.isExtensible(l);
75
- },
76
- ownKeys(p) {
77
- const l = i();
78
- return Reflect.ownKeys(l);
79
- },
80
- preventExtensions: P,
81
- setPrototypeOf: P
82
- });
83
- }
84
- return _(() => {
85
- a(T.onDidChangeConfiguration((c) => {
86
- (n || c.affectsConfiguration(e, t ?? void 0)) && s();
87
- }));
88
- }), u("");
89
- }
90
- function P() {
91
- throw new Error("Not supported");
92
- }
93
- const ee = [
94
- "append",
95
- "appendLine",
96
- "replace",
97
- "clear",
98
- "show",
99
- "hide",
100
- "trace",
101
- "debug",
102
- "info",
103
- "warn",
104
- "error"
4
+ //#region src/utils/onActivate.ts
5
+ var w = [];
6
+ function T(e) {
7
+ D.value ? e(D.value) : w.push(e);
8
+ }
9
+ //#endregion
10
+ //#region src/utils/onDeactivate.ts
11
+ var E = [];
12
+ function re(e) {
13
+ E.push(e);
14
+ }
15
+ //#endregion
16
+ //#region src/utils/defineExtension.ts
17
+ var D = c(null), O = t();
18
+ function ie(e) {
19
+ return {
20
+ activate: (t) => (D.value = t, O.run(() => (w.forEach((e) => e(t)), e(t)))),
21
+ deactivate: async () => {
22
+ await Promise.allSettled(E.map((e) => e())), O.stop();
23
+ }
24
+ };
25
+ }
26
+ //#endregion
27
+ //#region src/utils/defineConfig.ts
28
+ function k(e, t) {
29
+ let n = !e, r = c(null);
30
+ function i() {
31
+ return r.value = C.getConfiguration(e ?? void 0, t);
32
+ }
33
+ function a() {
34
+ if (!D.value) throw Error("Cannot access config before extension is activated.");
35
+ return r.value ? r.value : i();
36
+ }
37
+ function o(t) {
38
+ let n = () => {
39
+ let e = a();
40
+ return t === "" ? e : e.get(t.slice(0, -1)) ?? {};
41
+ };
42
+ return new Proxy({}, {
43
+ get(n, r) {
44
+ let i = a();
45
+ if (typeof r != "string") throw TypeError("Symbol keys are not supported in defineConfig proxy.");
46
+ if (t === "" && [
47
+ "get",
48
+ "has",
49
+ "inspect",
50
+ "update"
51
+ ].includes(r)) return Reflect.get(i, r).bind(i);
52
+ let s = i.get(t + r);
53
+ if (s === void 0) throw Error(`Configuration key "${e ? `${e}.` : ""}${t + r}" is not defined.`);
54
+ return typeof s != "object" || !s || Array.isArray(s) ? s : o(`${t}${r}.`);
55
+ },
56
+ set(e, n, r) {
57
+ let i = a();
58
+ if (typeof n != "string") throw TypeError("Symbol keys are not supported in defineConfig proxy.");
59
+ return i.update(t + n, r), !0;
60
+ },
61
+ defineProperty(e, t, r) {
62
+ return Reflect.defineProperty(n(), t, r);
63
+ },
64
+ deleteProperty(e, t) {
65
+ return Reflect.deleteProperty(n(), t);
66
+ },
67
+ has(e, t) {
68
+ return Reflect.has(n(), t);
69
+ },
70
+ ownKeys(e) {
71
+ return Reflect.ownKeys(n());
72
+ },
73
+ getOwnPropertyDescriptor(e, t) {
74
+ let r = Reflect.getOwnPropertyDescriptor(n(), t);
75
+ return r && (r.configurable = !0), r;
76
+ }
77
+ });
78
+ }
79
+ return T(() => {
80
+ M(C.onDidChangeConfiguration((r) => {
81
+ (n || r.affectsConfiguration(e, t ?? void 0)) && i();
82
+ }));
83
+ }), o("");
84
+ }
85
+ //#endregion
86
+ //#region src/utils/defineLogger.ts
87
+ var A = [
88
+ "append",
89
+ "appendLine",
90
+ "replace",
91
+ "clear",
92
+ "show",
93
+ "hide",
94
+ "trace",
95
+ "debug",
96
+ "info",
97
+ "warn",
98
+ "error"
105
99
  ];
106
- function ge(e) {
107
- const t = r(null), n = r(x.logLevel), o = [];
108
- _(() => {
109
- const i = t.value = a(f.createOutputChannel(e, { log: !0 }));
110
- n.value = i.logLevel, a(i.onDidChangeLogLevel((u) => {
111
- n.value = u;
112
- })), o.forEach((u) => u());
113
- });
114
- const s = {};
115
- for (const i of ee)
116
- s[i] = (...u) => {
117
- t.value ? t.value[i](...u) : o.push(() => t.value[i](...u));
118
- };
119
- return {
120
- logger: d(() => t.value),
121
- ...s
122
- };
123
- }
124
- function h(e) {
125
- let t = !1, n = !1, o;
126
- return () => {
127
- if (!n) {
128
- if (t)
129
- throw new Error("Cannot call a singleton composable recursively.");
130
- try {
131
- t = !0, o = k.run(e);
132
- } finally {
133
- t = !1, n = !0;
134
- }
135
- }
136
- return o;
137
- };
138
- }
139
- function pe(e) {
140
- return d(() => Y.joinPath(E.value.extensionUri, v(e)));
141
- }
142
- function a(e) {
143
- return (z() ?? k).cleanups.push(e.dispose.bind(e)), e;
144
- }
145
- const te = h(() => {
146
- const e = r(f.activeColorTheme);
147
- return a(f.onDidChangeActiveColorTheme((t) => {
148
- e.value = t;
149
- })), e;
150
- }), he = h(() => {
151
- const e = r(W.activeDebugSession);
152
- return a(W.onDidChangeActiveDebugSession((t) => {
153
- e.value = t;
154
- })), d(() => e.value);
155
- }), me = h(() => {
156
- const e = r(f.activeNotebookEditor);
157
- return a(f.onDidChangeActiveNotebookEditor((t) => {
158
- e.value = t;
159
- })), e;
160
- }), Ce = h(() => {
161
- const e = r(f.activeTerminal);
162
- return a(f.onDidChangeActiveTerminal((t) => {
163
- e.value = t;
164
- })), e;
165
- }), we = h(() => {
166
- const e = r(f.activeTextEditor);
167
- return a(f.onDidChangeActiveTextEditor((t) => {
168
- e.value = t;
169
- })), d(() => e.value);
170
- }), De = h(() => {
171
- const e = r(A.all);
172
- return a(A.onDidChange(() => {
173
- e.value = A.all;
174
- })), d(() => e.value);
100
+ function ae(t) {
101
+ let n = c(null), r = c(_.logLevel), i = [];
102
+ T(() => {
103
+ let e = n.value = M(S.createOutputChannel(t, { log: !0 }));
104
+ r.value = e.logLevel, M(e.onDidChangeLogLevel((e) => {
105
+ r.value = e;
106
+ })), i.forEach((e) => e());
107
+ });
108
+ let a = {};
109
+ for (let e of A) a[e] = (...t) => {
110
+ n.value ? n.value[e](...t) : i.push(() => n.value[e](...t));
111
+ };
112
+ return {
113
+ logger: e(() => n.value),
114
+ logLevel: e(() => r.value),
115
+ ...a
116
+ };
117
+ }
118
+ //#endregion
119
+ //#region src/utils/defineService.ts
120
+ function j(e) {
121
+ let t = !1, n = !1, r;
122
+ return () => {
123
+ if (!n) {
124
+ if (t) throw Error("Cannot call a singleton composable recursively.");
125
+ try {
126
+ t = !0, r = O.run(e);
127
+ } finally {
128
+ t = !1, n = !0;
129
+ }
130
+ }
131
+ return r;
132
+ };
133
+ }
134
+ //#endregion
135
+ //#region src/composables/useAbsoluteUri.ts
136
+ function oe(t) {
137
+ return e(() => te.joinPath(D.value.extensionUri, u(t)));
138
+ }
139
+ //#endregion
140
+ //#region src/composables/useDisposable.ts
141
+ function M(e) {
142
+ return (n() ?? O).cleanups.push(e.dispose.bind(e)), e;
143
+ }
144
+ //#endregion
145
+ //#region src/composables/useActiveColorTheme.ts
146
+ var N = j(() => {
147
+ let e = c(S.activeColorTheme);
148
+ return M(S.onDidChangeActiveColorTheme((t) => {
149
+ e.value = t;
150
+ })), e;
151
+ }), se = j(() => {
152
+ let t = c(g.activeDebugSession);
153
+ return M(g.onDidChangeActiveDebugSession((e) => {
154
+ t.value = e;
155
+ })), e(() => t.value);
156
+ }), ce = j(() => {
157
+ let e = c(S.activeNotebookEditor);
158
+ return M(S.onDidChangeActiveNotebookEditor((t) => {
159
+ e.value = t;
160
+ })), e;
161
+ }), le = j(() => {
162
+ let e = c(S.activeTerminal);
163
+ return M(S.onDidChangeActiveTerminal((t) => {
164
+ e.value = t;
165
+ })), e;
166
+ }), ue = j(() => {
167
+ let t = c(S.activeTextEditor);
168
+ return M(S.onDidChangeActiveTextEditor((e) => {
169
+ t.value = e;
170
+ })), e(() => t.value);
171
+ }), de = j(() => {
172
+ let t = c(v.all);
173
+ return M(v.onDidChange(() => {
174
+ t.value = v.all;
175
+ })), e(() => t.value);
175
176
  });
176
- function b(e, t, n) {
177
- if (C(e) || typeof e == "function") {
178
- w(() => {
179
- const o = v(e);
180
- o != null && b(o, t, n);
181
- });
182
- return;
183
- }
184
- for (const o of n) {
185
- const s = t[o];
186
- s != null && e[o](s);
187
- }
188
- }
189
- function y(e, t, n) {
190
- for (const o of n) {
191
- const s = t[o];
192
- s !== void 0 && w(() => {
193
- const i = v(e);
194
- i != null && (i[o] = v(s));
195
- });
196
- }
197
- }
198
- function be(e, t, n = {}) {
199
- const o = a(Z.createChatParticipant(e, M(t)));
200
- return y(o, n, [
201
- "iconPath",
202
- "followupProvider"
203
- ]), b(o, n, [
204
- "onDidReceiveFeedback"
205
- ]), C(t) && D(t, (s) => {
206
- o.requestHandler = s;
207
- }), o;
208
- }
209
- function ne(e, t) {
210
- C(t) ? w((n) => {
211
- if (t.value) {
212
- const o = S.registerCommand(e, t.value);
213
- n(() => o.dispose());
214
- }
215
- }) : t && a(S.registerCommand(e, t));
216
- }
217
- function ye(e) {
218
- for (const [t, n] of Object.entries(e))
219
- ne(t, n);
220
- }
221
- function Te(e) {
222
- const t = r(v(e)?.getText());
223
- return (C(e) || typeof e == "function") && D(e, (n) => {
224
- t.value = n?.getText();
225
- }), a(T.onDidChangeTextDocument((n) => {
226
- n.document === v(e) && (t.value = n.document.getText());
227
- })), t;
228
- }
229
- function Ee(e, t, n, o = {}) {
230
- let s;
231
- const i = d(() => {
232
- s?.dispose(), s = void 0;
233
- const c = v(t);
234
- if ("key" in c)
235
- return c;
236
- const p = f.createTextEditorDecorationType(c);
237
- return s = p, p;
238
- });
239
- L(() => s?.dispose());
240
- const u = async () => {
241
- const c = v(e);
242
- c && c.setDecorations(
243
- i.value,
244
- typeof n == "function" ? await n(c) : M(n)
245
- );
246
- };
247
- return (o.watchDocumentChange ?? !0) && a(T.onDidChangeTextDocument(async (c) => {
248
- v(e)?.document === c.document && await u();
249
- })), (o.immediate ?? !0) && u(), {
250
- /**
251
- * Manually trigger the decoration update.
252
- */
253
- update: u
254
- };
255
- }
256
- const xe = h(() => {
257
- const e = r(x.shell);
258
- return a(x.onDidChangeShell((t) => {
259
- e.value = t;
260
- })), d(() => e.value);
177
+ //#endregion
178
+ //#region src/composables/useReactiveEvents.ts
179
+ function P(e, t, n) {
180
+ if (r(e) || typeof e == "function") {
181
+ p(() => {
182
+ let r = u(e);
183
+ r != null && P(r, t, n);
184
+ });
185
+ return;
186
+ }
187
+ for (let r of n) {
188
+ let n = t[r];
189
+ n != null && e[r](n);
190
+ }
191
+ }
192
+ //#endregion
193
+ //#region src/composables/useReactiveOptions.ts
194
+ function F(e, t, n) {
195
+ for (let r of n) {
196
+ let n = t[r];
197
+ n !== void 0 && p(() => {
198
+ let t = u(e);
199
+ t != null && (t[r] = u(n));
200
+ });
201
+ }
202
+ }
203
+ //#endregion
204
+ //#region src/composables/useChatParticipant.ts
205
+ function I(e, t, n = {}) {
206
+ let i = M(ne.createChatParticipant(e, d(t)));
207
+ return F(i, n, ["iconPath", "followupProvider"]), P(i, n, ["onDidReceiveFeedback"]), r(t) && f(t, (e) => {
208
+ i.requestHandler = e;
209
+ }), i;
210
+ }
211
+ //#endregion
212
+ //#region src/composables/useCommand.ts
213
+ function L(e, t) {
214
+ r(t) ? p((n) => {
215
+ if (t.value) {
216
+ let r = h.registerCommand(e, t.value);
217
+ n(() => r.dispose());
218
+ }
219
+ }) : t && M(h.registerCommand(e, t));
220
+ }
221
+ //#endregion
222
+ //#region src/composables/useCommands.ts
223
+ function R(e) {
224
+ for (let [t, n] of Object.entries(e)) L(t, n);
225
+ }
226
+ //#endregion
227
+ //#region src/composables/useDocumentText.ts
228
+ function z(e) {
229
+ let t = c(u(e)?.getText());
230
+ return (r(e) || typeof e == "function") && f(e, (e) => {
231
+ t.value = e?.getText();
232
+ }), M(C.onDidChangeTextDocument((n) => {
233
+ n.document === u(e) && (t.value = n.document.getText());
234
+ })), t;
235
+ }
236
+ //#endregion
237
+ //#region src/composables/useEditorDecorations.ts
238
+ function B(t, n, r, a = {}) {
239
+ let o, s = e(() => {
240
+ o?.dispose(), o = void 0;
241
+ let e = u(n);
242
+ if ("key" in e) return e;
243
+ let t = S.createTextEditorDecorationType(e);
244
+ return o = t, t;
245
+ });
246
+ i(() => o?.dispose());
247
+ let c = async () => {
248
+ let e = u(t);
249
+ e && e.setDecorations(s.value, typeof r == "function" ? await r(e) : d(r));
250
+ };
251
+ return (a.watchDocumentChange ?? !0) && M(C.onDidChangeTextDocument(async (e) => {
252
+ u(t)?.document === e.document && await c();
253
+ })), (a.immediate ?? !0) && c(), { update: c };
254
+ }
255
+ //#endregion
256
+ //#region src/composables/useEnvShell.ts
257
+ var V = j(() => {
258
+ let t = c(_.shell);
259
+ return M(_.onDidChangeShell((e) => {
260
+ t.value = e;
261
+ })), e(() => t.value);
261
262
  });
262
- function oe(e, t) {
263
- const n = (o, s, i) => a(e(o, s, i));
264
- return t?.forEach((o) => n(o)), n;
265
- }
266
- function I(e, t = []) {
267
- const n = Array.isArray(e) ? e : t ?? [], o = a(Array.isArray(e) || e == null ? new q() : e), s = oe(o.event, n);
268
- return {
269
- emitter: o,
270
- event: s,
271
- fire: o.fire.bind(o)
272
- };
273
- }
274
- function Se(e) {
275
- const t = E.value.secrets, n = r(null);
276
- t.get(e).then((u) => {
277
- n.value = u;
278
- }), a(t.onDidChange(async (u) => {
279
- u.key === e && (n.value = await t.get(e));
280
- }));
281
- const o = async (u) => {
282
- n.value = u, await t.store(e, u);
283
- }, s = async () => {
284
- n.value = void 0, await t.delete(e);
285
- }, i = d({
286
- get() {
287
- return n.value;
288
- },
289
- set(u) {
290
- u === void 0 ? s() : o(u);
291
- }
292
- });
293
- return i.set = o, i.remove = s, i;
294
- }
295
- function Re(e, t = {}) {
296
- const n = G(/* @__PURE__ */ new Map()), o = I(), s = I(), i = I(), u = d(() => {
297
- const l = v(e);
298
- return l instanceof Set ? l : new Set(
299
- Array.isArray(l) ? l : [l]
300
- );
301
- });
302
- function c() {
303
- const l = u.value;
304
- for (const [g, m] of n)
305
- l.has(g) || (m.dispose(), n.delete(g));
306
- for (const g of l)
307
- if (!n.has(g)) {
308
- const m = T.createFileSystemWatcher(
309
- g,
310
- t.onDidCreate === !1,
311
- t.onDidChange === !1,
312
- t.onDidDelete === !1
313
- );
314
- m.onDidCreate(o.fire), m.onDidChange(s.fire), m.onDidDelete(i.fire), n.set(g, m);
315
- }
316
- }
317
- function p() {
318
- for (const l of n.values())
319
- l.dispose();
320
- n.clear();
321
- }
322
- return c(), D(u, c), L(p), typeof t.onDidCreate == "function" && o.event(t.onDidCreate), typeof t.onDidChange == "function" && s.event(t.onDidChange), typeof t.onDidDelete == "function" && i.event(t.onDidDelete), {
323
- watchers: J(n),
324
- /**
325
- * @see {@link FileSystemWatcher.onDidCreate}
326
- */
327
- onDidCreate: o.event,
328
- /**
329
- * @see {@link FileSystemWatcher.onDidChange}
330
- */
331
- onDidChange: s.event,
332
- /**
333
- * @see {@link FileSystemWatcher.onDidDelete}
334
- */
335
- onDidDelete: i.event
336
- };
337
- }
338
- function U(e, t, n) {
339
- const o = r(e.get(t, n)), s = d({
340
- get() {
341
- return o.value;
342
- },
343
- set(i) {
344
- s.update(i);
345
- }
346
- });
347
- return s.update = async (i) => {
348
- o.value = i === void 0 ? n : i, await e.update(t, i);
349
- }, s;
350
- }
351
- function Pe(e, t) {
352
- return U(E.value.globalState, e, t);
353
- }
354
- function j(e, t) {
355
- y(e, t, [
356
- "title",
357
- "step",
358
- "totalSteps",
359
- "enabled",
360
- "busy",
361
- "ignoreFocusOut"
362
- ]), b(e, t, [
363
- "onDidHide"
364
- ]), t.visible != null && w(() => {
365
- v(t.visible) ? e.show() : e.hide();
366
- });
367
- }
368
- function Ie(e = {}) {
369
- const t = a(f.createInputBox());
370
- j(t, e), y(t, e, [
371
- "valueSelection",
372
- "placeholder",
373
- "password",
374
- "buttons",
375
- "prompt",
376
- "validationMessage"
377
- ]), b(t, e, [
378
- "onDidChangeValue",
379
- "onDidAccept",
380
- "onDidTriggerButton"
381
- ]);
382
- const n = r(e.value ?? t.value);
383
- return t.onDidChangeValue((o) => n.value = o), w(() => t.value = n.value), {
384
- ...t,
385
- /**
386
- * @see {@linkcode InputBox.value}
387
- */
388
- value: n
389
- };
390
- }
391
- const ke = h(() => {
392
- const e = te();
393
- return d(() => e.value.kind === O.Dark || e.value.kind === O.HighContrast);
394
- }), Ae = h(() => {
395
- const e = r(x.isTelemetryEnabled);
396
- return a(x.onDidChangeTelemetryEnabled((t) => {
397
- e.value = t;
398
- })), d(() => e.value);
263
+ //#endregion
264
+ //#region src/composables/useEvent.ts
265
+ function H(e, t) {
266
+ let n = (t, n, r) => M(e(t, n, r));
267
+ return t?.forEach((e) => n(e)), n;
268
+ }
269
+ //#endregion
270
+ //#region src/composables/useEventEmitter.ts
271
+ function U(e, t = []) {
272
+ let n = Array.isArray(e) ? e : t ?? [], r = M(Array.isArray(e) || e == null ? new ee() : e);
273
+ return {
274
+ emitter: r,
275
+ event: H(r.event, n),
276
+ fire: r.fire.bind(r)
277
+ };
278
+ }
279
+ //#endregion
280
+ //#region src/composables/useExtensionSecret.ts
281
+ function fe(t) {
282
+ let n = D.value.secrets, r = c(null);
283
+ n.get(t).then((e) => {
284
+ r.value = e;
285
+ }), M(n.onDidChange(async (e) => {
286
+ e.key === t && (r.value = await n.get(t));
287
+ }));
288
+ let i = async (e) => {
289
+ r.value = e, await n.store(t, e);
290
+ }, a = async () => {
291
+ r.value = void 0, await n.delete(t);
292
+ }, o = e({
293
+ get() {
294
+ return r.value;
295
+ },
296
+ set(e) {
297
+ e === void 0 ? a() : i(e);
298
+ }
299
+ });
300
+ return o.set = i, o.remove = a, o;
301
+ }
302
+ //#endregion
303
+ //#region src/composables/useFileSystemWatcher.ts
304
+ function pe(t, n = {}) {
305
+ let r = s(/* @__PURE__ */ new Map()), o = U(), c = U(), l = U(), d = e(() => {
306
+ let e = u(t);
307
+ return e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]);
308
+ });
309
+ function p() {
310
+ let e = d.value;
311
+ for (let [t, n] of r) e.has(t) || (n.dispose(), r.delete(t));
312
+ for (let t of e) if (!r.has(t)) {
313
+ let e = C.createFileSystemWatcher(t, n.onDidCreate === !1, n.onDidChange === !1, n.onDidDelete === !1);
314
+ e.onDidCreate(o.fire), e.onDidChange(c.fire), e.onDidDelete(l.fire), r.set(t, e);
315
+ }
316
+ }
317
+ function m() {
318
+ for (let e of r.values()) e.dispose();
319
+ r.clear();
320
+ }
321
+ return p(), f(d, p), i(m), typeof n.onDidCreate == "function" && o.event(n.onDidCreate), typeof n.onDidChange == "function" && c.event(n.onDidChange), typeof n.onDidDelete == "function" && l.event(n.onDidDelete), {
322
+ watchers: a(r),
323
+ onDidCreate: o.event,
324
+ onDidChange: c.event,
325
+ onDidDelete: l.event
326
+ };
327
+ }
328
+ //#endregion
329
+ //#region src/composables/useMementoItem.ts
330
+ function W(t, n, r) {
331
+ let i = c(t.get(n, r)), a = e({
332
+ get() {
333
+ return i.value;
334
+ },
335
+ set(e) {
336
+ a.update(e);
337
+ }
338
+ });
339
+ return a.update = async (e) => {
340
+ i.value = e === void 0 ? r : e, await t.update(n, e);
341
+ }, a;
342
+ }
343
+ //#endregion
344
+ //#region src/composables/useGlobalState.ts
345
+ function me(e, t) {
346
+ return W(D.value.globalState, e, t);
347
+ }
348
+ //#endregion
349
+ //#region src/composables/useQuickInputOptions.ts
350
+ function G(e, t) {
351
+ F(e, t, [
352
+ "title",
353
+ "step",
354
+ "totalSteps",
355
+ "enabled",
356
+ "busy",
357
+ "ignoreFocusOut"
358
+ ]), P(e, t, ["onDidHide"]), t.visible != null && p(() => {
359
+ u(t.visible) ? e.show() : e.hide();
360
+ });
361
+ }
362
+ //#endregion
363
+ //#region src/composables/useInputBox.ts
364
+ function he(e = {}) {
365
+ let t = M(S.createInputBox());
366
+ G(t, e), F(t, e, [
367
+ "valueSelection",
368
+ "placeholder",
369
+ "password",
370
+ "buttons",
371
+ "prompt",
372
+ "validationMessage"
373
+ ]), P(t, e, [
374
+ "onDidChangeValue",
375
+ "onDidAccept",
376
+ "onDidTriggerButton"
377
+ ]);
378
+ let n = c(e.value ?? t.value);
379
+ return t.onDidChangeValue((e) => n.value = e), p(() => t.value = n.value), {
380
+ inputBox: t,
381
+ value: n
382
+ };
383
+ }
384
+ //#endregion
385
+ //#region src/composables/useIsDarkTheme.ts
386
+ var ge = j(() => {
387
+ let t = N();
388
+ return e(() => t.value.kind === m.Dark || t.value.kind === m.HighContrast);
389
+ }), _e = j(() => {
390
+ let t = c(_.isTelemetryEnabled);
391
+ return M(_.onDidChangeTelemetryEnabled((e) => {
392
+ t.value = e;
393
+ })), e(() => t.value);
399
394
  });
400
- function Ve(e, ...t) {
401
- return d(() => {
402
- const n = v(t[0]);
403
- return typeof n == "object" ? N.t(v(e), X(n)) : N.t(v(e), ...t.map(v));
404
- });
405
- }
406
- const We = h(() => {
407
- const e = r(V.tools);
408
- return a(V.onDidChangeChatModels(() => {
409
- e.value = V.tools;
410
- })), d(() => e.value);
411
- }), Oe = h(() => {
412
- const e = r(x.logLevel);
413
- return a(x.onDidChangeLogLevel((t) => {
414
- e.value = t;
415
- })), d(() => e.value);
395
+ //#endregion
396
+ //#region src/composables/useL10nText.ts
397
+ function ve(t, ...n) {
398
+ return e(() => {
399
+ let e = u(n[0]);
400
+ return typeof e == "object" ? y.t(u(t), l(e)) : y.t(u(t), ...n.map(u));
401
+ });
402
+ }
403
+ //#endregion
404
+ //#region src/composables/useLmTools.ts
405
+ var ye = j(() => {
406
+ let t = c(b.tools);
407
+ return M(b.onDidChangeChatModels(() => {
408
+ t.value = b.tools;
409
+ })), e(() => t.value);
410
+ }), be = j(() => {
411
+ let t = c(_.logLevel);
412
+ return M(_.onDidChangeLogLevel((e) => {
413
+ t.value = e;
414
+ })), e(() => t.value);
416
415
  });
417
- function ie(e) {
418
- const t = r(v(e)?.selections ?? []);
419
- return (C(e) || typeof e == "function") && D(e, (n) => {
420
- t.value = n?.selections ?? [];
421
- }), a(f.onDidChangeNotebookEditorSelection((n) => {
422
- n.notebookEditor === v(e) && (t.value = n.selections);
423
- })), d({
424
- get() {
425
- return t.value;
426
- },
427
- set(n) {
428
- t.value = n;
429
- const o = v(e);
430
- o && (o.selections = n);
431
- }
432
- });
433
- }
434
- function Ne(e) {
435
- const t = ie(e);
436
- return d({
437
- get() {
438
- return t.value[0];
439
- },
440
- set(n) {
441
- t.value = n ? [n] : [];
442
- }
443
- });
444
- }
445
- function Me(e) {
446
- const t = r(v(e)?.visibleRanges ?? []);
447
- return (C(e) || typeof e == "function") && D(e, (n) => {
448
- t.value = n?.visibleRanges ?? [];
449
- }), a(f.onDidChangeNotebookEditorVisibleRanges((n) => {
450
- n.notebookEditor === v(e) && (t.value = n.visibleRanges);
451
- })), d(() => t.value);
452
- }
453
- const Le = h(() => {
454
- const e = r(f.terminals);
455
- function t() {
456
- e.value = f.terminals;
457
- }
458
- return a(f.onDidOpenTerminal(t)), a(f.onDidCloseTerminal(t)), e;
416
+ //#endregion
417
+ //#region src/composables/useNotebookEditorSelections.ts
418
+ function K(t) {
419
+ let n = c(u(t)?.selections ?? []);
420
+ return (r(t) || typeof t == "function") && f(t, (e) => {
421
+ n.value = e?.selections ?? [];
422
+ }), M(S.onDidChangeNotebookEditorSelection((e) => {
423
+ e.notebookEditor === u(t) && (n.value = e.selections);
424
+ })), e({
425
+ get() {
426
+ return n.value;
427
+ },
428
+ set(e) {
429
+ n.value = e;
430
+ let r = u(t);
431
+ r && (r.selections = e);
432
+ }
433
+ });
434
+ }
435
+ //#endregion
436
+ //#region src/composables/useNotebookEditorSelection.ts
437
+ function xe(t) {
438
+ let n = K(t);
439
+ return e({
440
+ get() {
441
+ return n.value[0];
442
+ },
443
+ set(e) {
444
+ n.value = e ? [e] : [];
445
+ }
446
+ });
447
+ }
448
+ //#endregion
449
+ //#region src/composables/useNotebookEditorVisibleRanges.ts
450
+ function Se(t) {
451
+ let n = c(u(t)?.visibleRanges ?? []);
452
+ return (r(t) || typeof t == "function") && f(t, (e) => {
453
+ n.value = e?.visibleRanges ?? [];
454
+ }), M(S.onDidChangeNotebookEditorVisibleRanges((e) => {
455
+ e.notebookEditor === u(t) && (n.value = e.visibleRanges);
456
+ })), e(() => n.value);
457
+ }
458
+ //#endregion
459
+ //#region src/composables/useOpenedTerminals.ts
460
+ var Ce = j(() => {
461
+ let e = c(S.terminals);
462
+ function t() {
463
+ e.value = S.terminals;
464
+ }
465
+ return M(S.onDidOpenTerminal(t)), M(S.onDidCloseTerminal(t)), e;
459
466
  });
460
- function Fe(e = {}) {
461
- const t = a(f.createQuickPick());
462
- j(t, e), y(t, e, [
463
- "items",
464
- "buttons",
465
- "title",
466
- "step",
467
- "totalSteps",
468
- "enabled",
469
- "busy",
470
- "ignoreFocusOut",
471
- "placeholder",
472
- "canSelectMany",
473
- "matchOnDescription",
474
- "matchOnDetail",
475
- "keepScrollPosition"
476
- ]), b(t, e, [
477
- "onDidChangeValue",
478
- "onDidAccept",
479
- "onDidTriggerButton",
480
- "onDidTriggerItemButton",
481
- "onDidChangeActive",
482
- "onDidChangeSelection"
483
- ]);
484
- const n = r(e.value ?? t.value);
485
- t.onDidChangeValue((i) => n.value = i), w(() => t.value = n.value);
486
- const o = r(e.activeItems ?? t.activeItems);
487
- t.onDidChangeActive((i) => o.value = i), w(() => t.activeItems = o.value);
488
- const s = r(e.selectedItems ?? t.selectedItems);
489
- return t.onDidChangeSelection((i) => s.value = i), w(() => t.selectedItems = s.value), {
490
- ...t,
491
- /**
492
- * @see {@linkcode QuickPick.value}
493
- */
494
- value: n,
495
- /**
496
- * @see {@linkcode QuickPick.activeItems}
497
- */
498
- activeItems: o,
499
- /**
500
- * @see {@linkcode QuickPick.selectedItems}
501
- */
502
- selectedItems: s
503
- };
504
- }
505
- function Be(e) {
506
- const t = a(e.id ? f.createStatusBarItem(e.id, e.alignment, e.priority) : f.createStatusBarItem(e.alignment, e.priority));
507
- return y(t, e, [
508
- "name",
509
- "text",
510
- "tooltip",
511
- "color",
512
- "backgroundColor",
513
- "command",
514
- "accessibilityInformation"
515
- ]), e.visible != null && w(() => {
516
- v(e.visible) ? t.show() : t.hide();
517
- }), t;
518
- }
519
- const _e = h(() => {
520
- const e = r(R.taskExecutions);
521
- function t() {
522
- e.value = R.taskExecutions;
523
- }
524
- return a(R.onDidStartTask(t)), a(R.onDidEndTask(t)), d(() => e.value);
467
+ //#endregion
468
+ //#region src/composables/useQuickPick.ts
469
+ function we(e = {}) {
470
+ let t = M(S.createQuickPick());
471
+ G(t, e), F(t, e, [
472
+ "items",
473
+ "buttons",
474
+ "title",
475
+ "step",
476
+ "totalSteps",
477
+ "enabled",
478
+ "busy",
479
+ "ignoreFocusOut",
480
+ "placeholder",
481
+ "canSelectMany",
482
+ "matchOnDescription",
483
+ "matchOnDetail",
484
+ "keepScrollPosition"
485
+ ]), P(t, e, [
486
+ "onDidChangeValue",
487
+ "onDidAccept",
488
+ "onDidTriggerButton",
489
+ "onDidTriggerItemButton",
490
+ "onDidChangeActive",
491
+ "onDidChangeSelection"
492
+ ]);
493
+ let n = c(e.value ?? t.value);
494
+ t.onDidChangeValue((e) => n.value = e), p(() => t.value = n.value);
495
+ let r = c(e.activeItems ?? t.activeItems);
496
+ t.onDidChangeActive((e) => r.value = e), p(() => t.activeItems = r.value);
497
+ let i = c(e.selectedItems ?? t.selectedItems);
498
+ return t.onDidChangeSelection((e) => i.value = e), p(() => t.selectedItems = i.value), {
499
+ quickPick: t,
500
+ value: n,
501
+ activeItems: r,
502
+ selectedItems: i
503
+ };
504
+ }
505
+ //#endregion
506
+ //#region src/composables/useStatusBarItem.ts
507
+ function Te(e) {
508
+ let t = M(e.id ? S.createStatusBarItem(e.id, e.alignment, e.priority) : S.createStatusBarItem(e.alignment, e.priority));
509
+ return F(t, e, [
510
+ "name",
511
+ "text",
512
+ "tooltip",
513
+ "color",
514
+ "backgroundColor",
515
+ "command",
516
+ "accessibilityInformation"
517
+ ]), e.visible != null && p(() => {
518
+ u(e.visible) ? t.show() : t.hide();
519
+ }), t;
520
+ }
521
+ //#endregion
522
+ //#region src/composables/useTaskExecutions.ts
523
+ var Ee = j(() => {
524
+ let t = c(x.taskExecutions);
525
+ function n() {
526
+ t.value = x.taskExecutions;
527
+ }
528
+ return M(x.onDidStartTask(n)), M(x.onDidEndTask(n)), e(() => t.value);
525
529
  });
526
- function se(e) {
527
- const t = r(v(e)?.shellIntegration);
528
- return (C(e) || typeof e == "function") && D(e, (n) => {
529
- t.value = n?.shellIntegration;
530
- }), a(f.onDidChangeTerminalShellIntegration((n) => {
531
- n.terminal === v(e) && (t.value = n.shellIntegration);
532
- })), d(() => t.value);
533
- }
534
- function ae(e) {
535
- const t = r(v(e)?.state);
536
- return (C(e) || typeof e == "function") && D(e, (n) => {
537
- t.value = n?.state;
538
- }), a(f.onDidChangeTerminalState((n) => {
539
- n === v(e) && (t.value = n.state);
540
- })), d(() => t.value);
541
- }
542
- function $e(...e) {
543
- const t = a(f.createTerminal(...e));
544
- return {
545
- terminal: t,
546
- state: ae(t),
547
- shellIntegration: se(t),
548
- sendText: t.sendText.bind(t),
549
- show: t.show.bind(t),
550
- hide: t.hide.bind(t),
551
- dispose: t.dispose.bind(t)
552
- };
553
- }
554
- function re(e, t) {
555
- C(t) ? w((n) => {
556
- if (t.value) {
557
- const o = S.registerTextEditorCommand(e, t.value);
558
- n(() => o.dispose());
559
- }
560
- }) : t && a(S.registerTextEditorCommand(e, t));
561
- }
562
- function Ue(e) {
563
- for (const [t, n] of Object.entries(e))
564
- re(t, n);
565
- }
566
- function ue(e, t) {
567
- const n = r(v(e)?.selections ?? []);
568
- return (C(e) || typeof e == "function") && D(e, (o) => {
569
- n.value = o?.selections ?? [];
570
- }), a(f.onDidChangeTextEditorSelection((o) => {
571
- if (o.textEditor === v(e)) {
572
- const s = v(t);
573
- (!s || s.includes(o.kind)) && (n.value = o.selections);
574
- }
575
- })), d({
576
- get() {
577
- return n.value;
578
- },
579
- set(o) {
580
- n.value = o;
581
- const s = v(e);
582
- s && (s.selections = o);
583
- }
584
- });
585
- }
586
- function je(e, t) {
587
- const n = ue(e, t);
588
- return d({
589
- get() {
590
- return n.value[0];
591
- },
592
- set(o) {
593
- n.value = o ? [o] : [];
594
- }
595
- });
596
- }
597
- function He(e) {
598
- const t = r(v(e)?.viewColumn);
599
- return (C(e) || typeof e == "function") && D(e, (n) => {
600
- t.value = n?.viewColumn;
601
- }), a(f.onDidChangeTextEditorViewColumn((n) => {
602
- n.textEditor === v(e) && (t.value = n.viewColumn);
603
- })), d(() => t.value);
604
- }
605
- function Ke(e) {
606
- const t = r(v(e)?.visibleRanges ?? []);
607
- return (C(e) || typeof e == "function") && D(e, (n) => {
608
- t.value = n?.visibleRanges ?? [];
609
- }), a(f.onDidChangeTextEditorVisibleRanges((n) => {
610
- n.textEditor === v(e) && (t.value = n.visibleRanges);
611
- })), d(() => t.value);
612
- }
613
- function H(e) {
614
- const t = F(v(e)?.visible);
615
- return (C(e) || typeof e == "function") && D(e, (n) => {
616
- t.value = n?.visible;
617
- }), w((n) => {
618
- const o = v(e);
619
- if (o) {
620
- const s = o.onDidChangeVisibility(() => {
621
- t.value = o.visible;
622
- });
623
- n(() => s.dispose());
624
- }
625
- }), d(() => !!t.value);
626
- }
627
- function Qe(e, t, n = {}) {
628
- const o = I(), s = /* @__PURE__ */ new WeakMap(), i = a(f.createTreeView(e, {
629
- ...n,
630
- treeDataProvider: {
631
- onDidChangeTreeData: o.event,
632
- getTreeItem(c) {
633
- return c.treeItem;
634
- },
635
- async getChildren(c) {
636
- if (c) {
637
- const p = await c.children;
638
- return p?.forEach((l) => s.set(l, c)), p;
639
- }
640
- return v(t);
641
- },
642
- getParent(c) {
643
- return s.get(c);
644
- },
645
- resolveTreeItem: n.resolveTreeItem
646
- }
647
- }));
648
- D(t, () => o.fire()), y(i, n, [
649
- "message",
650
- "title",
651
- "description",
652
- "badge"
653
- ]), b(i, n, [
654
- "onDidExpandElement",
655
- "onDidCollapseElement",
656
- "onDidChangeSelection",
657
- "onDidChangeVisibility",
658
- "onDidChangeCheckboxState"
659
- ]);
660
- const u = r(i.selection);
661
- return a(i.onDidChangeSelection((c) => {
662
- u.value = c.selection;
663
- })), {
664
- view: i,
665
- /**
666
- * @see {@linkcode TreeView.selection}
667
- */
668
- selection: u,
669
- /**
670
- * @see {@linkcode TreeView.visible}
671
- */
672
- visible: H(i),
673
- /**
674
- * @see {@linkcode TreeView.reveal}
675
- */
676
- reveal: i.reveal.bind(i)
677
- };
678
- }
679
- const ze = h(() => {
680
- const e = r(f.visibleNotebookEditors);
681
- return a(f.onDidChangeVisibleNotebookEditors((t) => {
682
- e.value = t;
683
- })), d(() => e.value);
684
- }), Ge = h(() => {
685
- const e = r(f.visibleTextEditors);
686
- return a(f.onDidChangeVisibleTextEditors((t) => {
687
- e.value = t;
688
- })), d(() => e.value);
530
+ //#endregion
531
+ //#region src/composables/useTerminalShellIntegration.ts
532
+ function q(t) {
533
+ let n = c(u(t)?.shellIntegration);
534
+ return (r(t) || typeof t == "function") && f(t, (e) => {
535
+ n.value = e?.shellIntegration;
536
+ }), M(S.onDidChangeTerminalShellIntegration((e) => {
537
+ e.terminal === u(t) && (n.value = e.shellIntegration);
538
+ })), e(() => n.value);
539
+ }
540
+ //#endregion
541
+ //#region src/composables/useTerminalState.ts
542
+ function J(t) {
543
+ let n = c(u(t)?.state);
544
+ return (r(t) || typeof t == "function") && f(t, (e) => {
545
+ n.value = e?.state;
546
+ }), M(S.onDidChangeTerminalState((e) => {
547
+ e === u(t) && (n.value = e.state);
548
+ })), e(() => n.value);
549
+ }
550
+ //#endregion
551
+ //#region src/composables/useTerminal.ts
552
+ function De(...e) {
553
+ let t = M(S.createTerminal(...e));
554
+ return {
555
+ terminal: t,
556
+ state: J(t),
557
+ shellIntegration: q(t),
558
+ sendText: t.sendText.bind(t),
559
+ show: t.show.bind(t),
560
+ hide: t.hide.bind(t),
561
+ dispose: t.dispose.bind(t)
562
+ };
563
+ }
564
+ //#endregion
565
+ //#region src/composables/useTextEditorCommand.ts
566
+ function Y(e, t) {
567
+ r(t) ? p((n) => {
568
+ if (t.value) {
569
+ let r = h.registerTextEditorCommand(e, t.value);
570
+ n(() => r.dispose());
571
+ }
572
+ }) : t && M(h.registerTextEditorCommand(e, t));
573
+ }
574
+ //#endregion
575
+ //#region src/composables/useTextEditorCommands.ts
576
+ function Oe(e) {
577
+ for (let [t, n] of Object.entries(e)) Y(t, n);
578
+ }
579
+ //#endregion
580
+ //#region src/composables/useTextEditorSelections.ts
581
+ function X(t, n) {
582
+ let i = c(u(t)?.selections ?? []);
583
+ return (r(t) || typeof t == "function") && f(t, (e) => {
584
+ i.value = e?.selections ?? [];
585
+ }), M(S.onDidChangeTextEditorSelection((e) => {
586
+ if (e.textEditor === u(t)) {
587
+ let t = u(n);
588
+ (!t || t.includes(e.kind)) && (i.value = e.selections);
589
+ }
590
+ })), e({
591
+ get() {
592
+ return i.value;
593
+ },
594
+ set(e) {
595
+ i.value = e;
596
+ let n = u(t);
597
+ n && (n.selections = e);
598
+ }
599
+ });
600
+ }
601
+ //#endregion
602
+ //#region src/composables/useTextEditorSelection.ts
603
+ function ke(t, n) {
604
+ let r = X(t, n);
605
+ return e({
606
+ get() {
607
+ return r.value[0];
608
+ },
609
+ set(e) {
610
+ r.value = e ? [e] : [];
611
+ }
612
+ });
613
+ }
614
+ //#endregion
615
+ //#region src/composables/useTextEditorViewColumn.ts
616
+ function Ae(t) {
617
+ let n = c(u(t)?.viewColumn);
618
+ return (r(t) || typeof t == "function") && f(t, (e) => {
619
+ n.value = e?.viewColumn;
620
+ }), M(S.onDidChangeTextEditorViewColumn((e) => {
621
+ e.textEditor === u(t) && (n.value = e.viewColumn);
622
+ })), e(() => n.value);
623
+ }
624
+ //#endregion
625
+ //#region src/composables/useTextEditorVisibleRanges.ts
626
+ function je(t) {
627
+ let n = c(u(t)?.visibleRanges ?? []);
628
+ return (r(t) || typeof t == "function") && f(t, (e) => {
629
+ n.value = e?.visibleRanges ?? [];
630
+ }), M(S.onDidChangeTextEditorVisibleRanges((e) => {
631
+ e.textEditor === u(t) && (n.value = e.visibleRanges);
632
+ })), e(() => n.value);
633
+ }
634
+ //#endregion
635
+ //#region src/composables/useViewVisibility.ts
636
+ function Z(t) {
637
+ let n = o(u(t)?.visible);
638
+ return (r(t) || typeof t == "function") && f(t, (e) => {
639
+ n.value = e?.visible;
640
+ }), p((e) => {
641
+ let r = u(t);
642
+ if (r) {
643
+ let t = r.onDidChangeVisibility(() => {
644
+ n.value = r.visible;
645
+ });
646
+ e(() => t.dispose());
647
+ }
648
+ }), e(() => !!n.value);
649
+ }
650
+ //#endregion
651
+ //#region src/composables/useTreeView.ts
652
+ function Q(e, t, n = {}) {
653
+ let r = U(), i = /* @__PURE__ */ new WeakMap(), a = M(S.createTreeView(e, {
654
+ ...n,
655
+ treeDataProvider: {
656
+ onDidChangeTreeData: r.event,
657
+ getTreeItem(e) {
658
+ return e.treeItem;
659
+ },
660
+ async getChildren(e) {
661
+ if (e) {
662
+ let t = await e.children;
663
+ return t?.forEach((t) => i.set(t, e)), t;
664
+ }
665
+ return u(t);
666
+ },
667
+ getParent(e) {
668
+ return i.get(e);
669
+ },
670
+ resolveTreeItem: n.resolveTreeItem
671
+ }
672
+ }));
673
+ f(t, () => r.fire()), F(a, n, [
674
+ "message",
675
+ "title",
676
+ "description",
677
+ "badge"
678
+ ]), P(a, n, [
679
+ "onDidExpandElement",
680
+ "onDidCollapseElement",
681
+ "onDidChangeSelection",
682
+ "onDidChangeVisibility",
683
+ "onDidChangeCheckboxState"
684
+ ]);
685
+ let o = c(a.selection);
686
+ return M(a.onDidChangeSelection((e) => {
687
+ o.value = e.selection;
688
+ })), {
689
+ view: a,
690
+ selection: o,
691
+ visible: Z(a),
692
+ reveal: a.reveal.bind(a)
693
+ };
694
+ }
695
+ //#endregion
696
+ //#region src/composables/useVisibleNotebookEditors.ts
697
+ var Me = j(() => {
698
+ let t = c(S.visibleNotebookEditors);
699
+ return M(S.onDidChangeVisibleNotebookEditors((e) => {
700
+ t.value = e;
701
+ })), e(() => t.value);
702
+ }), Ne = j(() => {
703
+ let t = c(S.visibleTextEditors);
704
+ return M(S.onDidChangeVisibleTextEditors((e) => {
705
+ t.value = e;
706
+ })), e(() => t.value);
689
707
  });
690
- function Je(e, t) {
691
- const n = C(t) ? t : typeof t == "function" ? d(t) : F(t);
692
- return D(n, (o) => {
693
- S.executeCommand("setContext", e, o);
694
- }, { immediate: !0 }), n;
695
- }
696
- function Xe(e, t, n, o, s = {}) {
697
- const i = a(f.createWebviewPanel(
698
- e,
699
- v(t),
700
- o,
701
- s
702
- )), u = i.webview;
703
- y(i, s, [
704
- "title",
705
- "iconPath"
706
- ]), b(i, s, [
707
- "onDidChangeViewState",
708
- "onDidDispose"
709
- ]);
710
- const c = r(0);
711
- w(() => {
712
- u.html = `${v(n)}<!--${c.value}-->`;
713
- }), y(u, { options: s.webviewOptions }, [
714
- "options"
715
- ]), b(u, s, [
716
- "onDidReceiveMessage"
717
- ]);
718
- const p = r(i.viewColumn), l = r(i.active), g = r(i.visible);
719
- return a(i.onDidChangeViewState((m) => {
720
- i === m.webviewPanel && (p.value = i.viewColumn, l.value = i.active, g.value = i.visible);
721
- })), {
722
- panel: i,
723
- webview: u,
724
- /**
725
- * @see {@linkcode WebviewPanel.viewColumn}
726
- */
727
- viewColumn: d(() => p.value),
728
- /**
729
- * @see {@linkcode WebviewPanel.active}
730
- */
731
- active: d(() => l.value),
732
- /**
733
- * @see {@linkcode WebviewPanel.visible}
734
- */
735
- visible: d(() => g.value),
736
- /**
737
- * @see {@linkcode WebviewPanel.reveal}
738
- */
739
- reveal: i.reveal.bind(i),
740
- /**
741
- * @see {@linkcode Webview.postMessage}
742
- */
743
- postMessage: u.postMessage.bind(u),
744
- /**
745
- * @see {@linkcode Webview.asWebviewUri}
746
- */
747
- asWebviewUri: u.asWebviewUri.bind(u),
748
- /**
749
- * Force reload the webview content.
750
- */
751
- forceReload: () => {
752
- c.value++;
753
- }
754
- };
755
- }
756
- function Ye(e, t, n = {}) {
757
- const o = r(), s = d(() => o.value?.webview), i = r();
758
- a(f.registerWebviewViewProvider(
759
- e,
760
- {
761
- resolveWebviewView(c, p) {
762
- o.value = c, i.value = p;
763
- }
764
- },
765
- {
766
- webviewOptions: {
767
- retainContextWhenHidden: n.retainContextWhenHidden
768
- }
769
- }
770
- ));
771
- const u = r(0);
772
- return w(() => {
773
- o.value && (o.value.webview.html = `${v(t)}<!--${u.value}-->`);
774
- }), y(o, n, [
775
- "title",
776
- "description",
777
- "badge"
778
- ]), b(o, n, [
779
- "onDidDispose"
780
- ]), y(s, { options: n.webviewOptions }, [
781
- "options"
782
- ]), b(s, n, [
783
- "onDidReceiveMessage"
784
- ]), {
785
- view: d(() => o.value),
786
- /**
787
- * @see {@linkcode WebviewView.webview}
788
- */
789
- webview: s,
790
- /**
791
- * Additional metadata about the view being resolved.
792
- */
793
- context: d(() => i.value),
794
- /**
795
- * @see {@linkcode WebviewView.visible}
796
- */
797
- visible: H(o),
798
- /**
799
- * @see {@linkcode WebviewView.show}
800
- */
801
- show: (c) => o.value?.show(c),
802
- /**
803
- * @see {@linkcode Webview.postMessage}
804
- */
805
- postMessage: (c) => o.value?.webview.postMessage(c),
806
- /**
807
- * @see {@linkcode Webview.asWebviewUri}
808
- */
809
- asWebviewUri: (c) => s.value?.asWebviewUri(c),
810
- /**
811
- * Force reload the webview content.
812
- */
813
- forceReload: () => {
814
- u.value++;
815
- }
816
- };
817
- }
818
- const K = h(() => {
819
- const e = r(f.state);
820
- return a(f.onDidChangeWindowState((t) => {
821
- e.value = t;
822
- })), {
823
- focused: d(() => e.value.focused),
824
- active: d(() => e.value.active)
825
- };
826
- }), Ze = h(() => K().active), qe = h(() => K().focused), et = h(() => {
827
- const e = r(T.workspaceFolders);
828
- return a(T.onDidChangeWorkspaceFolders(() => {
829
- e.value = T.workspaceFolders;
830
- })), d(() => e.value);
708
+ //#endregion
709
+ //#region src/composables/useVscodeContext.ts
710
+ function Pe(t, n) {
711
+ let i = r(n) ? n : typeof n == "function" ? e(n) : o(n);
712
+ return f(i, (e) => {
713
+ h.executeCommand("setContext", t, e);
714
+ }, { immediate: !0 }), i;
715
+ }
716
+ //#endregion
717
+ //#region src/composables/useWebviewPanel.ts
718
+ function Fe(t, n, r, i, a = {}) {
719
+ let o = M(S.createWebviewPanel(t, u(n), i, a)), s = o.webview;
720
+ F(o, a, ["title", "iconPath"]), P(o, a, ["onDidChangeViewState", "onDidDispose"]);
721
+ let l = c(0);
722
+ p(() => {
723
+ s.html = `${u(r)}<!--${l.value}-->`;
724
+ }), F(s, { options: a.webviewOptions }, ["options"]), P(s, a, ["onDidReceiveMessage"]);
725
+ let d = c(o.viewColumn), f = c(o.active), m = c(o.visible);
726
+ return M(o.onDidChangeViewState((e) => {
727
+ o === e.webviewPanel && (d.value = o.viewColumn, f.value = o.active, m.value = o.visible);
728
+ })), {
729
+ panel: o,
730
+ webview: s,
731
+ viewColumn: e(() => d.value),
732
+ active: e(() => f.value),
733
+ visible: e(() => m.value),
734
+ reveal: o.reveal.bind(o),
735
+ postMessage: s.postMessage.bind(s),
736
+ asWebviewUri: s.asWebviewUri.bind(s),
737
+ forceReload: () => {
738
+ l.value++;
739
+ }
740
+ };
741
+ }
742
+ //#endregion
743
+ //#region src/composables/useWebviewView.ts
744
+ function Ie(t, n, r = {}) {
745
+ let i = c(), a = e(() => i.value?.webview), o = c();
746
+ M(S.registerWebviewViewProvider(t, { resolveWebviewView(e, t) {
747
+ i.value = e, o.value = t;
748
+ } }, { webviewOptions: { retainContextWhenHidden: r.retainContextWhenHidden } }));
749
+ let s = c(0);
750
+ return p(() => {
751
+ i.value && (i.value.webview.html = `${u(n)}<!--${s.value}-->`);
752
+ }), F(i, r, [
753
+ "title",
754
+ "description",
755
+ "badge"
756
+ ]), P(i, r, ["onDidDispose"]), F(a, { options: r.webviewOptions }, ["options"]), P(a, r, ["onDidReceiveMessage"]), {
757
+ view: e(() => i.value),
758
+ webview: a,
759
+ context: e(() => o.value),
760
+ visible: Z(i),
761
+ show: (e) => i.value?.show(e),
762
+ postMessage: (e) => i.value?.webview.postMessage(e),
763
+ asWebviewUri: (e) => a.value?.asWebviewUri(e),
764
+ forceReload: () => {
765
+ s.value++;
766
+ }
767
+ };
768
+ }
769
+ //#endregion
770
+ //#region src/composables/useWindowState.ts
771
+ var $ = j(() => {
772
+ let t = c(S.state);
773
+ return M(S.onDidChangeWindowState((e) => {
774
+ t.value = e;
775
+ })), {
776
+ focused: e(() => t.value.focused),
777
+ active: e(() => t.value.active)
778
+ };
779
+ }), Le = j(() => $().active), Re = j(() => $().focused), ze = j(() => {
780
+ let t = c(C.workspaceFolders);
781
+ return M(C.onDidChangeWorkspaceFolders(() => {
782
+ t.value = C.workspaceFolders;
783
+ })), e(() => t.value);
831
784
  });
832
- function tt(e, t) {
833
- return U(E.value.workspaceState, e, t);
834
- }
835
- export {
836
- B as activateCbs,
837
- $ as deactivateCbs,
838
- fe as defineConfig,
839
- de as defineExtension,
840
- ge as defineLogger,
841
- h as defineService,
842
- E as extensionContext,
843
- k as extensionScope,
844
- _ as onActivate,
845
- ve as onDeactivate,
846
- pe as useAbsoluteUri,
847
- te as useActiveColorTheme,
848
- he as useActiveDebugSession,
849
- me as useActiveNotebookEditor,
850
- Ce as useActiveTerminal,
851
- we as useActiveTextEditor,
852
- De as useAllExtensions,
853
- be as useChatParticipant,
854
- ne as useCommand,
855
- ye as useCommands,
856
- a as useDisposable,
857
- Te as useDocumentText,
858
- Ee as useEditorDecorations,
859
- xe as useEnvShell,
860
- oe as useEvent,
861
- I as useEventEmitter,
862
- Se as useExtensionSecret,
863
- Re as useFileSystemWatcher,
864
- Pe as useGlobalState,
865
- Ie as useInputBox,
866
- ke as useIsDarkTheme,
867
- Ae as useIsTelemetryEnabled,
868
- Ve as useL10nText,
869
- We as useLmTools,
870
- Oe as useLogLevel,
871
- U as useMementoItem,
872
- Ne as useNotebookEditorSelection,
873
- ie as useNotebookEditorSelections,
874
- Me as useNotebookEditorVisibleRanges,
875
- Le as useOpenedTerminals,
876
- Fe as useQuickPick,
877
- y as useReactiveOptions,
878
- Be as useStatusBarItem,
879
- _e as useTaskExecutions,
880
- $e as useTerminal,
881
- se as useTerminalShellIntegration,
882
- ae as useTerminalState,
883
- re as useTextEditorCommand,
884
- Ue as useTextEditorCommands,
885
- je as useTextEditorSelection,
886
- ue as useTextEditorSelections,
887
- He as useTextEditorViewColumn,
888
- Ke as useTextEditorVisibleRanges,
889
- Qe as useTreeView,
890
- H as useViewVisibility,
891
- ze as useVisibleNotebookEditors,
892
- Ge as useVisibleTextEditors,
893
- Je as useVscodeContext,
894
- Xe as useWebviewPanel,
895
- Ye as useWebviewView,
896
- Ze as useWindowActive,
897
- qe as useWindowFocused,
898
- K as useWindowState,
899
- et as useWorkspaceFolders,
900
- tt as useWorkspaceState
901
- };
902
- //# sourceMappingURL=index.js.map
785
+ //#endregion
786
+ //#region src/composables/useWorkspaceState.ts
787
+ function Be(e, t) {
788
+ return W(D.value.workspaceState, e, t);
789
+ }
790
+ //#endregion
791
+ export { w as activateCbs, E as deactivateCbs, k as defineConfig, ie as defineExtension, ae as defineLogger, j as defineService, D as extensionContext, O as extensionScope, T as onActivate, re as onDeactivate, oe as useAbsoluteUri, N as useActiveColorTheme, se as useActiveDebugSession, ce as useActiveNotebookEditor, le as useActiveTerminal, ue as useActiveTextEditor, de as useAllExtensions, I as useChatParticipant, L as useCommand, R as useCommands, M as useDisposable, z as useDocumentText, B as useEditorDecorations, V as useEnvShell, H as useEvent, U as useEventEmitter, fe as useExtensionSecret, pe as useFileSystemWatcher, me as useGlobalState, he as useInputBox, ge as useIsDarkTheme, _e as useIsTelemetryEnabled, ve as useL10nText, ye as useLmTools, be as useLogLevel, W as useMementoItem, xe as useNotebookEditorSelection, K as useNotebookEditorSelections, Se as useNotebookEditorVisibleRanges, Ce as useOpenedTerminals, we as useQuickPick, F as useReactiveOptions, Te as useStatusBarItem, Ee as useTaskExecutions, De as useTerminal, q as useTerminalShellIntegration, J as useTerminalState, Y as useTextEditorCommand, Oe as useTextEditorCommands, ke as useTextEditorSelection, X as useTextEditorSelections, Ae as useTextEditorViewColumn, je as useTextEditorVisibleRanges, Q as useTreeView, Z as useViewVisibility, Me as useVisibleNotebookEditors, Ne as useVisibleTextEditors, Pe as useVscodeContext, Fe as useWebviewPanel, Ie as useWebviewView, Le as useWindowActive, Re as useWindowFocused, $ as useWindowState, ze as useWorkspaceFolders, Be as useWorkspaceState };
792
+
793
+ //# sourceMappingURL=index.js.map