citadel_cli 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,689 +1,14 @@
1
- var Xn = Object.defineProperty;
2
- var Qn = (o, n, t) => n in o ? Xn(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
3
- var A = (o, n, t) => Qn(o, typeof n != "symbol" ? n + "" : n, t);
4
- import Q, { useEffect as z, useMemo as be, createContext as Zn, useContext as ve, useState as Y, useCallback as R, useReducer as et, useRef as X } from "react";
5
- import nt from "react-dom";
6
- var Te = { exports: {} }, ae = {};
7
- /**
8
- * @license React
9
- * react-jsx-runtime.production.min.js
10
- *
11
- * Copyright (c) Facebook, Inc. and its affiliates.
12
- *
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */
16
- var on;
17
- function tt() {
18
- if (on) return ae;
19
- on = 1;
20
- var o = Q, n = Symbol.for("react.element"), t = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, a = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
21
- function u(f, c, m) {
22
- var h, b = {}, _ = null, S = null;
23
- m !== void 0 && (_ = "" + m), c.key !== void 0 && (_ = "" + c.key), c.ref !== void 0 && (S = c.ref);
24
- for (h in c) r.call(c, h) && !i.hasOwnProperty(h) && (b[h] = c[h]);
25
- if (f && f.defaultProps) for (h in c = f.defaultProps, c) b[h] === void 0 && (b[h] = c[h]);
26
- return { $$typeof: n, type: f, key: _, ref: S, props: b, _owner: a.current };
27
- }
28
- return ae.Fragment = t, ae.jsx = u, ae.jsxs = u, ae;
29
- }
30
- var se = {};
31
- /**
32
- * @license React
33
- * react-jsx-runtime.development.js
34
- *
35
- * Copyright (c) Facebook, Inc. and its affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- */
40
- var an;
41
- function rt() {
42
- return an || (an = 1, process.env.NODE_ENV !== "production" && function() {
43
- var o = Q, n = Symbol.for("react.element"), t = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), f = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), U = Symbol.iterator, I = "@@iterator";
44
- function d(e) {
45
- if (e === null || typeof e != "object")
46
- return null;
47
- var s = U && e[U] || e[I];
48
- return typeof s == "function" ? s : null;
49
- }
50
- var y = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function w(e) {
52
- {
53
- for (var s = arguments.length, l = new Array(s > 1 ? s - 1 : 0), g = 1; g < s; g++)
54
- l[g - 1] = arguments[g];
55
- N("error", e, l);
56
- }
57
- }
58
- function N(e, s, l) {
59
- {
60
- var g = y.ReactDebugCurrentFrame, C = g.getStackAddendum();
61
- C !== "" && (s += "%s", l = l.concat([C]));
62
- var E = l.map(function(x) {
63
- return String(x);
64
- });
65
- E.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, E);
66
- }
67
- }
68
- var k = !1, j = !1, P = !1, $ = !1, L = !1, ee;
69
- ee = Symbol.for("react.module.reference");
70
- function de(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === r || e === i || L || e === a || e === m || e === h || $ || e === S || k || j || P || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === b || e.$$typeof === u || e.$$typeof === f || e.$$typeof === c || // This needs to include all possible module reference object
72
- // types supported by any Flight configuration anywhere since
73
- // we don't know which Flight build this will end up being used
74
- // with.
75
- e.$$typeof === ee || e.getModuleId !== void 0));
76
- }
77
- function ne(e, s, l) {
78
- var g = e.displayName;
79
- if (g)
80
- return g;
81
- var C = s.displayName || s.name || "";
82
- return C !== "" ? l + "(" + C + ")" : l;
83
- }
84
- function De(e) {
85
- return e.displayName || "Context";
86
- }
87
- function V(e) {
88
- if (e == null)
89
- return null;
90
- if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
- return e.displayName || e.name || null;
92
- if (typeof e == "string")
93
- return e;
94
- switch (e) {
95
- case r:
96
- return "Fragment";
97
- case t:
98
- return "Portal";
99
- case i:
100
- return "Profiler";
101
- case a:
102
- return "StrictMode";
103
- case m:
104
- return "Suspense";
105
- case h:
106
- return "SuspenseList";
107
- }
108
- if (typeof e == "object")
109
- switch (e.$$typeof) {
110
- case f:
111
- var s = e;
112
- return De(s) + ".Consumer";
113
- case u:
114
- var l = e;
115
- return De(l._context) + ".Provider";
116
- case c:
117
- return ne(e, e.render, "ForwardRef");
118
- case b:
119
- var g = e.displayName || null;
120
- return g !== null ? g : V(e.type) || "Memo";
121
- case _: {
122
- var C = e, E = C._payload, x = C._init;
123
- try {
124
- return V(x(E));
125
- } catch {
126
- return null;
127
- }
128
- }
129
- }
130
- return null;
131
- }
132
- var K = Object.assign, te = 0, ze, Fe, Ue, He, Me, $e, We;
133
- function Le() {
134
- }
135
- Le.__reactDisabledLog = !0;
136
- function En() {
137
- {
138
- if (te === 0) {
139
- ze = console.log, Fe = console.info, Ue = console.warn, He = console.error, Me = console.group, $e = console.groupCollapsed, We = console.groupEnd;
140
- var e = {
141
- configurable: !0,
142
- enumerable: !0,
143
- value: Le,
144
- writable: !0
145
- };
146
- Object.defineProperties(console, {
147
- info: e,
148
- log: e,
149
- warn: e,
150
- error: e,
151
- group: e,
152
- groupCollapsed: e,
153
- groupEnd: e
154
- });
155
- }
156
- te++;
157
- }
158
- }
159
- function kn() {
160
- {
161
- if (te--, te === 0) {
162
- var e = {
163
- configurable: !0,
164
- enumerable: !0,
165
- writable: !0
166
- };
167
- Object.defineProperties(console, {
168
- log: K({}, e, {
169
- value: ze
170
- }),
171
- info: K({}, e, {
172
- value: Fe
173
- }),
174
- warn: K({}, e, {
175
- value: Ue
176
- }),
177
- error: K({}, e, {
178
- value: He
179
- }),
180
- group: K({}, e, {
181
- value: Me
182
- }),
183
- groupCollapsed: K({}, e, {
184
- value: $e
185
- }),
186
- groupEnd: K({}, e, {
187
- value: We
188
- })
189
- });
190
- }
191
- te < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
- }
193
- }
194
- var Ce = y.ReactCurrentDispatcher, Se;
195
- function me(e, s, l) {
196
- {
197
- if (Se === void 0)
198
- try {
199
- throw Error();
200
- } catch (C) {
201
- var g = C.stack.trim().match(/\n( *(at )?)/);
202
- Se = g && g[1] || "";
203
- }
204
- return `
205
- ` + Se + e;
206
- }
207
- }
208
- var Ee = !1, pe;
209
- {
210
- var _n = typeof WeakMap == "function" ? WeakMap : Map;
211
- pe = new _n();
212
- }
213
- function Ye(e, s) {
214
- if (!e || Ee)
215
- return "";
216
- {
217
- var l = pe.get(e);
218
- if (l !== void 0)
219
- return l;
220
- }
221
- var g;
222
- Ee = !0;
223
- var C = Error.prepareStackTrace;
224
- Error.prepareStackTrace = void 0;
225
- var E;
226
- E = Ce.current, Ce.current = null, En();
227
- try {
228
- if (s) {
229
- var x = function() {
230
- throw Error();
231
- };
232
- if (Object.defineProperty(x.prototype, "props", {
233
- set: function() {
234
- throw Error();
235
- }
236
- }), typeof Reflect == "object" && Reflect.construct) {
237
- try {
238
- Reflect.construct(x, []);
239
- } catch (H) {
240
- g = H;
241
- }
242
- Reflect.construct(e, [], x);
243
- } else {
244
- try {
245
- x.call();
246
- } catch (H) {
247
- g = H;
248
- }
249
- e.call(x.prototype);
250
- }
251
- } else {
252
- try {
253
- throw Error();
254
- } catch (H) {
255
- g = H;
256
- }
257
- e();
258
- }
259
- } catch (H) {
260
- if (H && g && typeof H.stack == "string") {
261
- for (var v = H.stack.split(`
262
- `), F = g.stack.split(`
263
- `), T = v.length - 1, O = F.length - 1; T >= 1 && O >= 0 && v[T] !== F[O]; )
264
- O--;
265
- for (; T >= 1 && O >= 0; T--, O--)
266
- if (v[T] !== F[O]) {
267
- if (T !== 1 || O !== 1)
268
- do
269
- if (T--, O--, O < 0 || v[T] !== F[O]) {
270
- var W = `
271
- ` + v[T].replace(" at new ", " at ");
272
- return e.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", e.displayName)), typeof e == "function" && pe.set(e, W), W;
273
- }
274
- while (T >= 1 && O >= 0);
275
- break;
276
- }
277
- }
278
- } finally {
279
- Ee = !1, Ce.current = E, kn(), Error.prepareStackTrace = C;
280
- }
281
- var G = e ? e.displayName || e.name : "", B = G ? me(G) : "";
282
- return typeof e == "function" && pe.set(e, B), B;
283
- }
284
- function Rn(e, s, l) {
285
- return Ye(e, !1);
286
- }
287
- function jn(e) {
288
- var s = e.prototype;
289
- return !!(s && s.isReactComponent);
290
- }
291
- function fe(e, s, l) {
292
- if (e == null)
293
- return "";
294
- if (typeof e == "function")
295
- return Ye(e, jn(e));
296
- if (typeof e == "string")
297
- return me(e);
298
- switch (e) {
299
- case m:
300
- return me("Suspense");
301
- case h:
302
- return me("SuspenseList");
303
- }
304
- if (typeof e == "object")
305
- switch (e.$$typeof) {
306
- case c:
307
- return Rn(e.render);
308
- case b:
309
- return fe(e.type, s, l);
310
- case _: {
311
- var g = e, C = g._payload, E = g._init;
312
- try {
313
- return fe(E(C), s, l);
314
- } catch {
315
- }
316
- }
317
- }
318
- return "";
319
- }
320
- var re = Object.prototype.hasOwnProperty, Ve = {}, Ke = y.ReactDebugCurrentFrame;
321
- function he(e) {
322
- if (e) {
323
- var s = e._owner, l = fe(e.type, e._source, s ? s.type : null);
324
- Ke.setExtraStackFrame(l);
325
- } else
326
- Ke.setExtraStackFrame(null);
327
- }
328
- function An(e, s, l, g, C) {
329
- {
330
- var E = Function.call.bind(re);
331
- for (var x in e)
332
- if (E(e, x)) {
333
- var v = void 0;
334
- try {
335
- if (typeof e[x] != "function") {
336
- var F = Error((g || "React class") + ": " + l + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw F.name = "Invariant Violation", F;
338
- }
339
- v = e[x](s, x, g, l, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (T) {
341
- v = T;
342
- }
343
- v && !(v instanceof Error) && (he(C), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", l, x, typeof v), he(null)), v instanceof Error && !(v.message in Ve) && (Ve[v.message] = !0, he(C), w("Failed %s type: %s", l, v.message), he(null));
344
- }
345
- }
346
- }
347
- var Pn = Array.isArray;
348
- function ke(e) {
349
- return Pn(e);
350
- }
351
- function Tn(e) {
352
- {
353
- var s = typeof Symbol == "function" && Symbol.toStringTag, l = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
- return l;
355
- }
356
- }
357
- function On(e) {
358
- try {
359
- return Be(e), !1;
360
- } catch {
361
- return !0;
362
- }
363
- }
364
- function Be(e) {
365
- return "" + e;
366
- }
367
- function qe(e) {
368
- if (On(e))
369
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Tn(e)), Be(e);
370
- }
371
- var oe = y.ReactCurrentOwner, Nn = {
372
- key: !0,
373
- ref: !0,
374
- __self: !0,
375
- __source: !0
376
- }, Je, Ge, _e;
377
- _e = {};
378
- function In(e) {
379
- if (re.call(e, "ref")) {
380
- var s = Object.getOwnPropertyDescriptor(e, "ref").get;
381
- if (s && s.isReactWarning)
382
- return !1;
383
- }
384
- return e.ref !== void 0;
385
- }
386
- function Dn(e) {
387
- if (re.call(e, "key")) {
388
- var s = Object.getOwnPropertyDescriptor(e, "key").get;
389
- if (s && s.isReactWarning)
390
- return !1;
391
- }
392
- return e.key !== void 0;
393
- }
394
- function zn(e, s) {
395
- if (typeof e.ref == "string" && oe.current && s && oe.current.stateNode !== s) {
396
- var l = V(oe.current.type);
397
- _e[l] || (w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', V(oe.current.type), e.ref), _e[l] = !0);
398
- }
399
- }
400
- function Fn(e, s) {
401
- {
402
- var l = function() {
403
- Je || (Je = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
404
- };
405
- l.isReactWarning = !0, Object.defineProperty(e, "key", {
406
- get: l,
407
- configurable: !0
408
- });
409
- }
410
- }
411
- function Un(e, s) {
412
- {
413
- var l = function() {
414
- Ge || (Ge = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
415
- };
416
- l.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
- get: l,
418
- configurable: !0
419
- });
420
- }
421
- }
422
- var Hn = function(e, s, l, g, C, E, x) {
423
- var v = {
424
- // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: n,
426
- // Built-in properties that belong on the element
427
- type: e,
428
- key: s,
429
- ref: l,
430
- props: x,
431
- // Record the component responsible for creating this element.
432
- _owner: E
433
- };
434
- return v._store = {}, Object.defineProperty(v._store, "validated", {
435
- configurable: !1,
436
- enumerable: !1,
437
- writable: !0,
438
- value: !1
439
- }), Object.defineProperty(v, "_self", {
440
- configurable: !1,
441
- enumerable: !1,
442
- writable: !1,
443
- value: g
444
- }), Object.defineProperty(v, "_source", {
445
- configurable: !1,
446
- enumerable: !1,
447
- writable: !1,
448
- value: C
449
- }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
450
- };
451
- function Mn(e, s, l, g, C) {
452
- {
453
- var E, x = {}, v = null, F = null;
454
- l !== void 0 && (qe(l), v = "" + l), Dn(s) && (qe(s.key), v = "" + s.key), In(s) && (F = s.ref, zn(s, C));
455
- for (E in s)
456
- re.call(s, E) && !Nn.hasOwnProperty(E) && (x[E] = s[E]);
457
- if (e && e.defaultProps) {
458
- var T = e.defaultProps;
459
- for (E in T)
460
- x[E] === void 0 && (x[E] = T[E]);
461
- }
462
- if (v || F) {
463
- var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- v && Fn(x, O), F && Un(x, O);
465
- }
466
- return Hn(e, v, F, C, g, oe.current, x);
467
- }
468
- }
469
- var Re = y.ReactCurrentOwner, Xe = y.ReactDebugCurrentFrame;
470
- function J(e) {
471
- if (e) {
472
- var s = e._owner, l = fe(e.type, e._source, s ? s.type : null);
473
- Xe.setExtraStackFrame(l);
474
- } else
475
- Xe.setExtraStackFrame(null);
476
- }
477
- var je;
478
- je = !1;
479
- function Ae(e) {
480
- return typeof e == "object" && e !== null && e.$$typeof === n;
481
- }
482
- function Qe() {
483
- {
484
- if (Re.current) {
485
- var e = V(Re.current.type);
486
- if (e)
487
- return `
488
-
489
- Check the render method of \`` + e + "`.";
490
- }
491
- return "";
492
- }
493
- }
494
- function $n(e) {
495
- return "";
496
- }
497
- var Ze = {};
498
- function Wn(e) {
499
- {
500
- var s = Qe();
501
- if (!s) {
502
- var l = typeof e == "string" ? e : e.displayName || e.name;
503
- l && (s = `
504
-
505
- Check the top-level render call using <` + l + ">.");
506
- }
507
- return s;
508
- }
509
- }
510
- function en(e, s) {
511
- {
512
- if (!e._store || e._store.validated || e.key != null)
513
- return;
514
- e._store.validated = !0;
515
- var l = Wn(s);
516
- if (Ze[l])
517
- return;
518
- Ze[l] = !0;
519
- var g = "";
520
- e && e._owner && e._owner !== Re.current && (g = " It was passed a child from " + V(e._owner.type) + "."), J(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', l, g), J(null);
521
- }
522
- }
523
- function nn(e, s) {
524
- {
525
- if (typeof e != "object")
526
- return;
527
- if (ke(e))
528
- for (var l = 0; l < e.length; l++) {
529
- var g = e[l];
530
- Ae(g) && en(g, s);
531
- }
532
- else if (Ae(e))
533
- e._store && (e._store.validated = !0);
534
- else if (e) {
535
- var C = d(e);
536
- if (typeof C == "function" && C !== e.entries)
537
- for (var E = C.call(e), x; !(x = E.next()).done; )
538
- Ae(x.value) && en(x.value, s);
539
- }
540
- }
541
- }
542
- function Ln(e) {
543
- {
544
- var s = e.type;
545
- if (s == null || typeof s == "string")
546
- return;
547
- var l;
548
- if (typeof s == "function")
549
- l = s.propTypes;
550
- else if (typeof s == "object" && (s.$$typeof === c || // Note: Memo only checks outer props here.
551
- // Inner props are checked in the reconciler.
552
- s.$$typeof === b))
553
- l = s.propTypes;
554
- else
555
- return;
556
- if (l) {
557
- var g = V(s);
558
- An(l, e.props, "prop", g, e);
559
- } else if (s.PropTypes !== void 0 && !je) {
560
- je = !0;
561
- var C = V(s);
562
- w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
563
- }
564
- typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
- }
566
- }
567
- function Yn(e) {
568
- {
569
- for (var s = Object.keys(e.props), l = 0; l < s.length; l++) {
570
- var g = s[l];
571
- if (g !== "children" && g !== "key") {
572
- J(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), J(null);
573
- break;
574
- }
575
- }
576
- e.ref !== null && (J(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), J(null));
577
- }
578
- }
579
- var tn = {};
580
- function rn(e, s, l, g, C, E) {
581
- {
582
- var x = de(e);
583
- if (!x) {
584
- var v = "";
585
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var F = $n();
587
- F ? v += F : v += Qe();
588
- var T;
589
- e === null ? T = "null" : ke(e) ? T = "array" : e !== void 0 && e.$$typeof === n ? (T = "<" + (V(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, v);
590
- }
591
- var O = Mn(e, s, l, C, E);
592
- if (O == null)
593
- return O;
594
- if (x) {
595
- var W = s.children;
596
- if (W !== void 0)
597
- if (g)
598
- if (ke(W)) {
599
- for (var G = 0; G < W.length; G++)
600
- nn(W[G], e);
601
- Object.freeze && Object.freeze(W);
602
- } else
603
- w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
- else
605
- nn(W, e);
606
- }
607
- if (re.call(s, "key")) {
608
- var B = V(e), H = Object.keys(s).filter(function(Gn) {
609
- return Gn !== "key";
610
- }), Pe = H.length > 0 ? "{key: someKey, " + H.join(": ..., ") + ": ...}" : "{key: someKey}";
611
- if (!tn[B + Pe]) {
612
- var Jn = H.length > 0 ? "{" + H.join(": ..., ") + ": ...}" : "{}";
613
- w(`A props object containing a "key" prop is being spread into JSX:
614
- let props = %s;
615
- <%s {...props} />
616
- React keys must be passed directly to JSX without using spread:
617
- let props = %s;
618
- <%s key={someKey} {...props} />`, Pe, B, Jn, B), tn[B + Pe] = !0;
619
- }
620
- }
621
- return e === r ? Yn(O) : Ln(O), O;
622
- }
623
- }
624
- function Vn(e, s, l) {
625
- return rn(e, s, l, !0);
626
- }
627
- function Kn(e, s, l) {
628
- return rn(e, s, l, !1);
629
- }
630
- var Bn = Kn, qn = Vn;
631
- se.Fragment = r, se.jsx = Bn, se.jsxs = qn;
632
- }()), se;
633
- }
634
- process.env.NODE_ENV === "production" ? Te.exports = tt() : Te.exports = rt();
635
- var p = Te.exports, Oe, ge = nt;
636
- if (process.env.NODE_ENV === "production")
637
- Oe = ge.createRoot, ge.hydrateRoot;
638
- else {
639
- var sn = ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
640
- Oe = function(o, n) {
641
- sn.usingClientEntryPoint = !0;
642
- try {
643
- return ge.createRoot(o, n);
644
- } finally {
645
- sn.usingClientEntryPoint = !1;
646
- }
647
- };
648
- }
649
- const ot = ({ onOpen: o, onClose: n, isVisible: t, showCitadelKey: r }) => {
650
- z(() => {
651
- const a = (i) => {
652
- var u, f;
653
- !t && i.key === r && !["input", "textarea"].includes(((f = (u = i.target) == null ? void 0 : u.tagName) == null ? void 0 : f.toLowerCase()) || "") && (i.preventDefault(), o()), t && i.key === "Escape" && (i.preventDefault(), n());
654
- };
655
- return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
656
- }, [o, n, t, r]);
657
- }, at = "_container_141sr_3", st = "_innerContainer_141sr_19", it = "_inputSection_141sr_28", lt = "_resizeHandle_141sr_35", ct = "_citadel_slideUp_141sr_64", ut = "_citadel_slideDown_141sr_68", ln = {
658
- container: at,
659
- innerContainer: st,
660
- inputSection: it,
661
- resizeHandle: lt,
662
- citadel_slideUp: ct,
663
- citadel_slideDown: ut
664
- }, dt = (o) => {
665
- const { isVisible: n, isClosing: t, onAnimationComplete: r } = o, a = be(() => n ? t ? ln.slideDown : ln.slideUp : "", [n, t]);
666
- return z(() => {
667
- if (r) {
668
- const u = setTimeout(() => {
669
- r();
670
- }, 200);
671
- return () => clearTimeout(u);
672
- }
673
- }, [t, r]), {
674
- style: be(() => ({
675
- opacity: n ? 1 : 0,
676
- transform: n ? "translateY(0)" : t ? "translateY(100%)" : "translateY(-100%)",
677
- transition: "opacity 200ms ease-in-out, transform 200ms ease-in-out"
678
- }), [n, t]),
679
- animationClass: a
680
- };
681
- };
682
- var ie = /* @__PURE__ */ ((o) => (o.Pending = "pending", o.Success = "success", o.Failure = "failure", o.Timeout = "timeout", o))(ie || {});
683
- class Z {
684
- constructor(n = Date.now()) {
685
- A(this, "_status", "pending");
686
- this.timestamp = n;
1
+ var ge = Object.defineProperty;
2
+ var fe = (r, e, n) => e in r ? ge(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
3
+ var b = (r, e, n) => fe(r, typeof e != "symbol" ? e + "" : e, n);
4
+ import { jsx as m, jsxs as _, Fragment as we } from "react/jsx-runtime";
5
+ import L, { createContext as be, useEffect as A, useContext as Y, useState as R, useCallback as w, useMemo as V, useReducer as ye, useRef as H } from "react";
6
+ import { createRoot as xe } from "react-dom/client";
7
+ var T = /* @__PURE__ */ ((r) => (r.Pending = "pending", r.Success = "success", r.Failure = "failure", r.Timeout = "timeout", r))(T || {});
8
+ class U {
9
+ constructor(e = Date.now()) {
10
+ b(this, "_status", "pending");
11
+ this.timestamp = e;
687
12
  }
688
13
  get status() {
689
14
  return this._status;
@@ -698,41 +23,41 @@ class Z {
698
23
  this._status = "timeout";
699
24
  }
700
25
  }
701
- class Ht extends Z {
702
- constructor(n, t) {
703
- super(t), this.data = n;
26
+ class an extends U {
27
+ constructor(e, n) {
28
+ super(n), this.data = e;
704
29
  }
705
30
  render() {
706
- return /* @__PURE__ */ p.jsx("pre", { className: "text-gray-200", children: JSON.stringify(this.data, null, 2) });
31
+ return /* @__PURE__ */ m("pre", { className: "text-gray-200", children: JSON.stringify(this.data, null, 2) });
707
32
  }
708
33
  }
709
- class hn extends Z {
710
- constructor(n, t) {
711
- super(t), this.text = n;
34
+ class ae extends U {
35
+ constructor(e, n) {
36
+ super(n), this.text = e;
712
37
  }
713
38
  render() {
714
- return /* @__PURE__ */ p.jsx("div", { className: "text-gray-200 whitespace-pre font-mono", children: this.text });
39
+ return /* @__PURE__ */ m("div", { className: "text-gray-200 whitespace-pre font-mono", children: this.text });
715
40
  }
716
41
  }
717
- class mt extends Z {
718
- constructor(n, t) {
719
- super(t), this.error = n, this.markFailure();
42
+ class ve extends U {
43
+ constructor(e, n) {
44
+ super(n), this.error = e, this.markFailure();
720
45
  }
721
46
  render() {
722
- return /* @__PURE__ */ p.jsx("div", { className: "mt-1 text-red-400", children: this.error });
47
+ return /* @__PURE__ */ m("div", { className: "mt-1 text-red-400", children: this.error });
723
48
  }
724
49
  }
725
- class pt extends Z {
50
+ class Ce extends U {
726
51
  render() {
727
- return /* @__PURE__ */ p.jsx("div", { className: "text-gray-400", children: "..." });
52
+ return /* @__PURE__ */ m("div", { className: "text-gray-400", children: "..." });
728
53
  }
729
54
  }
730
- class Mt extends Z {
731
- constructor(n, t = "", r) {
732
- super(r), this.imageUrl = n, this.altText = t;
55
+ class ln extends U {
56
+ constructor(e, n = "", t) {
57
+ super(t), this.imageUrl = e, this.altText = n;
733
58
  }
734
59
  render() {
735
- return /* @__PURE__ */ p.jsx("div", { className: "my-2", children: /* @__PURE__ */ p.jsx(
60
+ return /* @__PURE__ */ m("div", { className: "my-2", children: /* @__PURE__ */ m(
736
61
  "img",
737
62
  {
738
63
  src: this.imageUrl,
@@ -742,142 +67,143 @@ class Mt extends Z {
742
67
  ) });
743
68
  }
744
69
  }
745
- const ft = (o) => async function() {
746
- const n = o.commands.filter((t) => t.fullPath[0] !== "help").map((t) => `${t.segments.map((a) => a.type === "argument" ? `<${a.name}>` : a.name).join(" ")} - ${t.description}`).sort();
747
- return n.push("help - Show available commands"), new hn(
748
- n.length > 0 ? `Available Commands:
749
- ` + n.join(`
70
+ const Se = (r) => async function() {
71
+ const e = r.commands.filter((n) => n.fullPath[0] !== "help").map((n) => `${n.segments.map((o) => o.type === "argument" ? `<${o.name}>` : o.name).join(" ")} - ${n.description}`).sort();
72
+ return e.push("help - Show available commands"), new ae(
73
+ e.length > 0 ? `Available Commands:
74
+ ` + e.join(`
750
75
  `) : "No commands available yet. Add some commands to get started!"
751
76
  );
752
77
  };
753
- var we = /* @__PURE__ */ ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o[o.TRACE = 5] = "TRACE", o))(we || {});
754
- class D {
755
- static configure(n) {
756
- this.level = n.level, this.prefix = n.prefix || "[Citadel]";
78
+ var W = /* @__PURE__ */ ((r) => (r[r.NONE = 0] = "NONE", r[r.ERROR = 1] = "ERROR", r[r.WARN = 2] = "WARN", r[r.INFO = 3] = "INFO", r[r.DEBUG = 4] = "DEBUG", r[r.TRACE = 5] = "TRACE", r))(W || {});
79
+ class C {
80
+ static configure(e) {
81
+ this.level = e.level, this.prefix = e.prefix || "[Citadel]";
757
82
  }
758
- static trace(...n) {
759
- this.level >= 5 && process.env.NODE_ENV !== "production" && console.trace(this.prefix, ...n);
83
+ static trace(...e) {
84
+ this.level >= 5 && process.env.NODE_ENV !== "production" && console.trace(this.prefix, ...e);
760
85
  }
761
- static debug(...n) {
762
- this.level >= 4 && process.env.NODE_ENV !== "production" && console.debug(this.prefix, ...n);
86
+ static debug(...e) {
87
+ this.level >= 4 && process.env.NODE_ENV !== "production" && console.debug(this.prefix, ...e);
763
88
  }
764
- static info(...n) {
765
- this.level >= 3 && console.info(this.prefix, ...n);
89
+ static info(...e) {
90
+ this.level >= 3 && console.info(this.prefix, ...e);
766
91
  }
767
- static warn(...n) {
768
- this.level >= 2 && console.warn(this.prefix, ...n);
92
+ static warn(...e) {
93
+ this.level >= 2 && console.warn(this.prefix, ...e);
769
94
  }
770
- static error(...n) {
771
- this.level >= 1 && console.error(this.prefix, ...n);
95
+ static error(...e) {
96
+ this.level >= 1 && console.error(this.prefix, ...e);
772
97
  }
773
98
  }
774
- A(D, "level", 0), A(D, "prefix", "");
775
- const M = {
99
+ b(C, "level", 0), b(C, "prefix", "");
100
+ const z = {
776
101
  commandTimeoutMs: 1e4,
777
102
  cursorColor: "var(--cursor-color, #fff)",
778
103
  cursorSpeed: 530,
779
104
  cursorType: "blink",
780
105
  includeHelpCommand: !0,
781
106
  initialHeight: "40vh",
782
- logLevel: process.env.NODE_ENV === "production" ? we.ERROR : we.DEBUG,
107
+ logLevel: process.env.NODE_ENV === "production" ? W.ERROR : W.DEBUG,
783
108
  maxHeight: "80vh",
784
109
  minHeight: "200",
785
110
  outputFontSize: "0.875rem",
786
111
  resetStateOnHide: !1,
787
112
  showCitadelKey: ".",
113
+ displayMode: "panel",
788
114
  storage: {
789
115
  type: "localStorage",
790
116
  maxCommands: 100
791
117
  }
792
118
  };
793
- class gn {
794
- constructor(n) {
795
- A(this, "config");
119
+ class ie {
120
+ constructor(e) {
121
+ b(this, "config");
796
122
  this.config = {
797
123
  type: "localStorage",
798
124
  maxCommands: 100,
799
- ...n
125
+ ...e
800
126
  };
801
127
  }
802
128
  /**
803
129
  * Add a command to history, enforcing storage limits
804
130
  */
805
- async addStoredCommand(n) {
806
- const t = await this.getStoredCommands();
807
- for (t.push(n); t.length > this.config.maxCommands; )
808
- t.shift();
809
- await this.saveCommands(t);
131
+ async addStoredCommand(e) {
132
+ const n = await this.getStoredCommands();
133
+ for (n.push(e); n.length > this.config.maxCommands; )
134
+ n.shift();
135
+ await this.saveCommands(n);
810
136
  }
811
137
  }
812
- class ht extends gn {
813
- constructor(t) {
814
- super(t);
815
- A(this, "storageKey", "citadel_command_history");
138
+ class ke extends ie {
139
+ constructor(n) {
140
+ super(n);
141
+ b(this, "storageKey", "citadel_command_history");
816
142
  }
817
143
  async getStoredCommands() {
818
144
  try {
819
- const t = window.localStorage.getItem(this.storageKey);
820
- return t ? JSON.parse(t).map((a) => ({
821
- commandSegments: a.commandSegments || [],
822
- timestamp: a.timestamp
145
+ const n = window.localStorage.getItem(this.storageKey);
146
+ return n ? JSON.parse(n).map((o) => ({
147
+ commandSegments: o.commandSegments || [],
148
+ timestamp: o.timestamp
823
149
  })) : [];
824
- } catch (t) {
825
- return console.warn("Failed to load commands from localStorage:", t), [];
150
+ } catch (n) {
151
+ return console.warn("Failed to load commands from localStorage:", n), [];
826
152
  }
827
153
  }
828
154
  async clear() {
829
155
  try {
830
156
  window.localStorage.removeItem(this.storageKey);
831
- } catch (t) {
832
- console.warn("Failed to clear localStorage:", t);
157
+ } catch (n) {
158
+ console.warn("Failed to clear localStorage:", n);
833
159
  }
834
160
  }
835
- async saveCommands(t) {
161
+ async saveCommands(n) {
836
162
  try {
837
- const r = t.map((a) => ({
838
- commandSegments: Array.isArray(a.commandSegments) ? [...a.commandSegments] : [],
839
- timestamp: a.timestamp
163
+ const t = n.map((o) => ({
164
+ commandSegments: Array.isArray(o.commandSegments) ? [...o.commandSegments] : [],
165
+ timestamp: o.timestamp
840
166
  }));
841
- window.localStorage.setItem(this.storageKey, JSON.stringify(r));
842
- } catch (r) {
843
- throw console.warn("Failed to save commands to localStorage:", r), r;
167
+ window.localStorage.setItem(this.storageKey, JSON.stringify(t));
168
+ } catch (t) {
169
+ throw console.warn("Failed to save commands to localStorage:", t), t;
844
170
  }
845
171
  }
846
172
  }
847
- class gt extends gn {
848
- constructor(t) {
849
- super(t);
850
- A(this, "storedCommands", []);
173
+ class Ee extends ie {
174
+ constructor(n) {
175
+ super(n);
176
+ b(this, "storedCommands", []);
851
177
  }
852
178
  async getStoredCommands() {
853
- return this.storedCommands.map((t) => ({
854
- commandSegments: Array.isArray(t.commandSegments) ? [...t.commandSegments] : [],
855
- timestamp: t.timestamp
179
+ return this.storedCommands.map((n) => ({
180
+ commandSegments: Array.isArray(n.commandSegments) ? [...n.commandSegments] : [],
181
+ timestamp: n.timestamp
856
182
  }));
857
183
  }
858
184
  async clear() {
859
185
  this.storedCommands = [];
860
186
  }
861
- async saveCommands(t) {
862
- this.storedCommands = t.map((r) => ({
863
- commandSegments: Array.isArray(r.commandSegments) ? [...r.commandSegments] : [],
864
- timestamp: r.timestamp
187
+ async saveCommands(n) {
188
+ this.storedCommands = n.map((t) => ({
189
+ commandSegments: Array.isArray(t.commandSegments) ? [...t.commandSegments] : [],
190
+ timestamp: t.timestamp
865
191
  }));
866
192
  }
867
193
  }
868
- const q = class q {
194
+ const D = class D {
869
195
  constructor() {
870
- A(this, "currentStorage");
196
+ b(this, "currentStorage");
871
197
  }
872
198
  static getInstance() {
873
- return q.instance || (q.instance = new q()), q.instance;
199
+ return D.instance || (D.instance = new D()), D.instance;
874
200
  }
875
- initializeStorage(n) {
201
+ initializeStorage(e) {
876
202
  if (!this.currentStorage)
877
203
  try {
878
- this.currentStorage = new ht(n);
879
- } catch (t) {
880
- console.warn("Failed to create storage, falling back to memory storage:", t), this.currentStorage = new gt(n);
204
+ this.currentStorage = new ke(e);
205
+ } catch (n) {
206
+ console.warn("Failed to create storage, falling back to memory storage:", n), this.currentStorage = new Ee(e);
881
207
  }
882
208
  }
883
209
  getStorage() {
@@ -886,39 +212,39 @@ const q = class q {
886
212
  return this.currentStorage;
887
213
  }
888
214
  };
889
- A(q, "instance");
890
- let ye = q;
891
- const bn = async () => new hn("");
892
- class Ne {
893
- constructor(n, t, r) {
894
- this.type = n, this.name = t, this.description = r;
215
+ b(D, "instance");
216
+ let q = D;
217
+ const le = async () => new ae("");
218
+ class J {
219
+ constructor(e, n, t) {
220
+ this.type = e, this.name = n, this.description = t;
895
221
  }
896
222
  toString() {
897
223
  return this.name;
898
224
  }
899
225
  }
900
- class wn extends Ne {
226
+ class ce extends J {
901
227
  constructor() {
902
228
  super("null", ">null<", "Empty segment");
903
229
  }
904
230
  }
905
- class bt extends Ne {
906
- constructor(n, t) {
907
- super("word", n, t);
231
+ class Ne extends J {
232
+ constructor(e, n) {
233
+ super("word", e, n);
908
234
  }
909
235
  }
910
- class wt extends Ne {
911
- constructor(n, t, r, a) {
912
- super("argument", n, t), this.value = r, this.valid = a;
236
+ class _e extends J {
237
+ constructor(e, n, t, o) {
238
+ super("argument", e, n), this.value = t, this.valid = o;
913
239
  }
914
240
  }
915
- class yt {
916
- constructor(n, t, r = bn) {
917
- A(this, "_segments");
918
- A(this, "_description");
241
+ class Ae {
242
+ constructor(e, n, t = le) {
243
+ b(this, "_segments");
244
+ b(this, "_description");
919
245
  // Used by `Help` command, etc.
920
- A(this, "_handler");
921
- this._segments = n, this._description = t, this._handler = r;
246
+ b(this, "_handler");
247
+ this._segments = e, this._description = n, this._handler = t;
922
248
  }
923
249
  get segments() {
924
250
  return this._segments;
@@ -930,46 +256,50 @@ class yt {
930
256
  return this._handler;
931
257
  }
932
258
  get hasArguments() {
933
- return this.segments.some((n) => n.type === "argument");
259
+ return this.segments.some((e) => e.type === "argument");
934
260
  }
935
261
  get fullPath() {
936
- return this.segments.map((n) => n.name);
262
+ return this.segments.map((e) => e.name);
937
263
  }
938
264
  get fullPath_s() {
939
265
  return this.fullPath.join(" ");
940
266
  }
941
- equals(n) {
942
- return this.fullPath.join(" ") === n.fullPath.join(" ");
267
+ equals(e) {
268
+ return this.fullPath.join(" ") === e.fullPath.join(" ");
943
269
  }
944
270
  }
945
- class Ie {
271
+ class Q {
946
272
  constructor() {
947
- A(this, "_commands", []);
273
+ b(this, "_commands", []);
948
274
  }
949
275
  get commands() {
950
276
  return this._commands;
951
277
  }
952
278
  /**
953
- * Registers a new command
954
- *
955
- * @param newCommandNode The new command to add
956
- * @throws {Error} If attempting to add a duplicate leaf command or a subcommand to a leaf
957
- *
279
+ * Registers a new command composed of ordered segments.
280
+ *
281
+ * Each segment describes either a literal word or an argument placeholder. The resulting
282
+ * path must be unique across the registry once argument placeholders are normalized.
283
+ *
284
+ * @param segments Ordered command path definition.
285
+ * @param description Human-readable summary surfaced by help and search results.
286
+ * @param handler Async handler executed when the command is submitted; defaults to `NoopHandler`.
287
+ * @throws {Error} If the segment list is empty or the path collides with an existing command.
958
288
  */
959
- addCommand(n, t, r = bn) {
960
- if (n === void 0 || n.length === 0)
289
+ addCommand(e, n, t = le) {
290
+ if (e === void 0 || e.length === 0)
961
291
  throw new Error("Command path cannot be empty");
962
- const a = new yt(n, t, r), i = this._commands.find((u) => {
963
- const f = u.segments.map(
964
- (m) => m.type === "argument" ? "*" : m.name
965
- ).join(" "), c = n.map(
966
- (m) => m.type === "argument" ? "*" : m.name
292
+ const o = new Ae(e, n, t), s = this._commands.find((a) => {
293
+ const l = a.segments.map(
294
+ (c) => c.type === "argument" ? "*" : c.name
295
+ ).join(" "), d = e.map(
296
+ (c) => c.type === "argument" ? "*" : c.name
967
297
  ).join(" ");
968
- return f === c;
298
+ return l === d;
969
299
  });
970
- if (i)
971
- throw new Error(`Duplicate commands: '${i.fullPath_s}' and '${a.fullPath_s}'`);
972
- this._commands.push(a);
300
+ if (s)
301
+ throw new Error(`Duplicate commands: '${s.fullPath_s}' and '${o.fullPath_s}'`);
302
+ this._commands.push(o);
973
303
  }
974
304
  /**
975
305
  * Retrieves a command from the registry for the given path.
@@ -977,24 +307,27 @@ class Ie {
977
307
  * @param path The path of the command.
978
308
  * @returns The command node or undefined if not found.
979
309
  */
980
- getCommand(n) {
981
- return this._commands.find((t) => {
982
- const r = t.fullPath.join(" "), a = n.join(" ");
983
- return r === a;
310
+ getCommand(e) {
311
+ return this._commands.find((n) => {
312
+ const t = n.fullPath.join(" "), o = e.join(" ");
313
+ if (t === o)
314
+ return !0;
315
+ const a = n.segments.filter((l) => l.type === "word").map((l) => l.name);
316
+ return a.length === e.length && a.join(" ") === o;
984
317
  });
985
318
  }
986
- commandExistsForPath(n) {
987
- const t = this._commands.map(
988
- (a) => a.segments.map(
989
- (i) => i.type === "argument" ? "*" : i.name
319
+ commandExistsForPath(e) {
320
+ const n = this._commands.map(
321
+ (o) => o.segments.map(
322
+ (s) => s.type === "argument" ? "*" : s.name
990
323
  ).join(" ")
991
- ), r = n.map((a, i) => this._commands.some(
992
- (f) => {
993
- var c;
994
- return ((c = f.segments[i]) == null ? void 0 : c.type) === "argument";
324
+ ), t = e.map((o, s) => this._commands.some(
325
+ (l) => {
326
+ var d;
327
+ return ((d = l.segments[s]) == null ? void 0 : d.type) === "argument";
995
328
  }
996
- ) ? "*" : a).join(" ");
997
- return t.includes(r);
329
+ ) ? "*" : o).join(" ");
330
+ return n.includes(t);
998
331
  }
999
332
  /**
1000
333
  * Gets possible matches for a given path.
@@ -1003,8 +336,8 @@ class Ie {
1003
336
  * @returns An array of completion strings.
1004
337
  */
1005
338
  // used by AvailableCommands
1006
- getCompletions_s(n) {
1007
- return this.getCompletions(n).map((t) => t.name);
339
+ getCompletions_s(e) {
340
+ return this.getCompletions(e).map((n) => n.name);
1008
341
  }
1009
342
  /**
1010
343
  * Gets an array of segments reachable from a given path
@@ -1012,51 +345,51 @@ class Ie {
1012
345
  * @param path The path to get completions for.
1013
346
  * @returns An array of completion strings.
1014
347
  */
1015
- getCompletions(n) {
1016
- if (D.debug("[getCompletions] path: ", n), !n.length) {
1017
- const i = this._commands.map((c) => c.segments[0]), u = (c, m) => c.type === m.type && c.name === m.name;
1018
- return i.filter(
1019
- (c, m, h) => m === h.findIndex((b) => u(b, c))
348
+ getCompletions(e) {
349
+ if (C.debug("[getCompletions] path: ", e), !e.length) {
350
+ const s = this._commands.map((d) => d.segments[0]), a = (d, c) => d.type === c.type && d.name === c.name;
351
+ return s.filter(
352
+ (d, c, u) => c === u.findIndex((p) => a(p, d))
1020
353
  );
1021
354
  }
1022
- const t = n.length;
1023
- return this._commands.filter((i) => {
1024
- const u = i.segments;
1025
- if (u.length <= t - 1)
355
+ const n = e.length;
356
+ return this._commands.filter((s) => {
357
+ const a = s.segments;
358
+ if (a.length <= n - 1)
1026
359
  return !1;
1027
- for (let f = 0; f < t; f++) {
1028
- const c = n[f], m = u[f];
1029
- if (!(c === "*" && m.type === "argument") && c !== m.name)
360
+ for (let l = 0; l < n; l++) {
361
+ const d = e[l], c = a[l];
362
+ if (!(d === "*" && c.type === "argument") && d !== c.name)
1030
363
  return !1;
1031
364
  }
1032
365
  return !0;
1033
- }).filter((i) => i.segments.length > t).map((i) => {
1034
- const u = i.segments[t], f = u.type === "argument" ? wt : bt;
1035
- return new f(u.name, u.description);
366
+ }).filter((s) => s.segments.length > n).map((s) => {
367
+ const a = s.segments[n], l = a.type === "argument" ? _e : Ne;
368
+ return new l(a.name, a.description);
1036
369
  }).filter(
1037
- (i, u, f) => u === f.findIndex(
1038
- (c) => c.type === i.type && c.name === i.name
370
+ (s, a, l) => a === l.findIndex(
371
+ (d) => d.type === s.type && d.name === s.name
1039
372
  )
1040
373
  );
1041
374
  }
1042
- hasNextSegment(n) {
1043
- return this.getCompletions(n).length > 0;
375
+ hasNextSegment(e) {
376
+ return this.getCompletions(e).length > 0;
1044
377
  }
1045
378
  }
1046
- class yn {
379
+ class de {
1047
380
  constructor() {
1048
- A(this, "segments", []);
1049
- A(this, "nullSegment", new wn());
1050
- A(this, "observers", []);
381
+ b(this, "segments", []);
382
+ b(this, "nullSegment", new ce());
383
+ b(this, "observers", []);
1051
384
  }
1052
- subscribe(n) {
1053
- this.observers.push(n);
385
+ subscribe(e) {
386
+ this.observers.push(e);
1054
387
  }
1055
- unsubscribe(n) {
1056
- this.observers = this.observers.filter((t) => t !== n);
388
+ unsubscribe(e) {
389
+ this.observers = this.observers.filter((n) => n !== e);
1057
390
  }
1058
391
  notifyObservers() {
1059
- this.observers.forEach((n) => n.update());
392
+ this.observers.forEach((e) => e.update());
1060
393
  }
1061
394
  /**
1062
395
  * Clears all segments from the stack
@@ -1067,22 +400,22 @@ class yn {
1067
400
  /**
1068
401
  * Pushes a new segment onto the stack
1069
402
  */
1070
- push(n) {
1071
- this.segments.push(n), this.notifyObservers();
403
+ push(e) {
404
+ this.segments.push(e), this.notifyObservers();
1072
405
  }
1073
406
  /**
1074
407
  * Pushes an array of segments onto the stack
1075
408
  */
1076
- pushAll(n) {
1077
- n.forEach((t) => this.push(t));
409
+ pushAll(e) {
410
+ e.forEach((n) => this.push(n));
1078
411
  }
1079
412
  /**
1080
413
  * Removes and returns the top segment from the stack
1081
414
  * Returns NullSegment if stack is empty
1082
415
  */
1083
416
  pop() {
1084
- const n = this.segments.pop() || this.nullSegment;
1085
- return this.notifyObservers(), n;
417
+ const e = this.segments.pop() || this.nullSegment;
418
+ return this.notifyObservers(), e;
1086
419
  }
1087
420
  /**
1088
421
  * Returns the top segment without removing it
@@ -1107,21 +440,21 @@ class yn {
1107
440
  * Returns true if any segment in the stack is an argument
1108
441
  */
1109
442
  get hasArguments() {
1110
- return this.segments.some((n) => n.type === "argument");
443
+ return this.segments.some((e) => e.type === "argument");
1111
444
  }
1112
445
  /**
1113
446
  * Returns all argument segments in the stack
1114
447
  */
1115
448
  get arguments() {
1116
449
  return this.segments.filter(
1117
- (n) => n.type === "argument"
450
+ (e) => e.type === "argument"
1118
451
  );
1119
452
  }
1120
453
  /**
1121
454
  * Returns the command path as an array of segment names
1122
455
  */
1123
456
  path() {
1124
- return this.segments.map((n) => n.name);
457
+ return this.segments.map((e) => e.name);
1125
458
  }
1126
459
  /**
1127
460
  * Returns a copy of the internal segments array
@@ -1130,240 +463,352 @@ class yn {
1130
463
  return [...this.segments];
1131
464
  }
1132
465
  }
1133
- const vt = {
1134
- config: M,
1135
- commands: new Ie(),
1136
- segmentStack: new yn()
1137
- }, le = Zn(vt), xt = ({ config: o = M, commandRegistry: n, children: t }) => {
1138
- const [r, a] = Q.useState(), i = {
1139
- ...M,
1140
- ...o,
466
+ const ze = {
467
+ config: z,
468
+ commands: new Q(),
469
+ segmentStack: new de()
470
+ }, j = be(ze), Ie = ({ config: r = z, commandRegistry: e, children: n }) => {
471
+ const [t, o] = L.useState(), s = {
472
+ ...z,
473
+ ...r,
1141
474
  // Ensure nested objects are properly merged
1142
475
  storage: {
1143
- ...M.storage,
1144
- ...o.storage
476
+ ...z.storage,
477
+ ...r.storage
1145
478
  },
1146
479
  // Ensure explicit values from config take precedence
1147
- cursorType: o.cursorType ?? M.cursorType,
1148
- cursorColor: o.cursorColor ?? M.cursorColor,
1149
- cursorSpeed: o.cursorSpeed ?? M.cursorSpeed,
1150
- showCitadelKey: o.showCitadelKey || "."
480
+ cursorType: r.cursorType ?? z.cursorType,
481
+ cursorColor: r.cursorColor ?? z.cursorColor,
482
+ cursorSpeed: r.cursorSpeed ?? z.cursorSpeed,
483
+ showCitadelKey: r.showCitadelKey || "."
1151
484
  };
1152
- z(() => {
1153
- ye.getInstance().initializeStorage(
1154
- i.storage ?? M.storage
1155
- ), a(ye.getInstance().getStorage());
1156
- }, []), z(() => {
1157
- if (n && i.includeHelpCommand && !n.commandExistsForPath(["help"])) {
1158
- const f = ft(n);
1159
- n.addCommand(
485
+ A(() => {
486
+ q.getInstance().initializeStorage(
487
+ s.storage ?? z.storage
488
+ ), o(q.getInstance().getStorage());
489
+ }, []), A(() => {
490
+ if (e && s.includeHelpCommand && !e.commandExistsForPath(["help"])) {
491
+ const l = Se(e);
492
+ e.addCommand(
1160
493
  [{ type: "word", name: "help" }],
1161
494
  "Show available commands",
1162
- f
495
+ l
1163
496
  );
1164
497
  }
1165
- }, [n, i.includeHelpCommand]);
1166
- const u = {
1167
- config: i,
1168
- commands: n || new Ie(),
1169
- storage: r,
1170
- segmentStack: new yn()
498
+ }, [e, s.includeHelpCommand]);
499
+ const a = {
500
+ config: s,
501
+ commands: e || new Q(),
502
+ storage: t,
503
+ segmentStack: new de()
1171
504
  };
1172
- return /* @__PURE__ */ p.jsx(le.Provider, { value: u, children: t });
1173
- }, ce = () => {
1174
- const o = ve(le);
1175
- if (o === void 0)
505
+ return /* @__PURE__ */ m(j.Provider, { value: a, children: n });
506
+ }, F = () => {
507
+ const r = Y(j);
508
+ if (r === void 0)
1176
509
  throw new Error("useCitadelConfig must be used within a CitadelConfigProvider");
1177
- return o.config;
1178
- }, xe = () => {
1179
- const o = ve(le);
1180
- if (o === void 0)
510
+ return r.config;
511
+ }, B = () => {
512
+ const r = Y(j);
513
+ if (r === void 0)
1181
514
  throw new Error("useCitadelCommands must be used within a CitadelConfigProvider");
1182
- return o.commands;
1183
- }, vn = () => {
1184
- const o = ve(le);
1185
- if (o === void 0)
515
+ return r.commands;
516
+ }, me = () => {
517
+ const r = Y(j);
518
+ if (r === void 0)
1186
519
  throw new Error("useCitadelStorage must be used within a CitadelConfigProvider");
1187
- return o.storage;
1188
- }, ue = () => {
1189
- const o = ve(le);
1190
- if (o === void 0)
520
+ return r.storage;
521
+ }, O = () => {
522
+ const r = Y(j);
523
+ if (r === void 0)
1191
524
  throw new Error("useSegmentStack must be used within a CitadelConfigProvider");
1192
- return o.segmentStack;
525
+ return r.segmentStack;
1193
526
  };
1194
- class Ct {
1195
- constructor(n, t) {
1196
- A(this, "timestamp");
1197
- A(this, "command");
1198
- A(this, "result");
1199
- this.command = n.toArray().map((r) => r.type === "argument" ? r.value || "" : r.name), this.timestamp = Date.now(), this.result = t ?? new pt();
527
+ class Re {
528
+ constructor(e, n) {
529
+ b(this, "timestamp");
530
+ b(this, "command");
531
+ b(this, "result");
532
+ this.command = e.toArray().map((t) => t.type === "argument" ? t.value || "" : t.name), this.timestamp = Date.now(), this.result = n ?? new Ce();
1200
533
  }
1201
534
  }
1202
- function St(o) {
535
+ function Pe(r) {
1203
536
  return {
1204
- commandSegments: o,
537
+ commandSegments: r,
1205
538
  timestamp: Date.now()
1206
539
  };
1207
540
  }
1208
- function xn() {
1209
- const o = vn(), [n, t] = Y({
541
+ function ue() {
542
+ const r = me(), [e, n] = R({
1210
543
  storedCommands: [],
1211
544
  position: null
1212
- }), r = R(async (f) => {
1213
- if (o)
545
+ }), t = w(async (l) => {
546
+ if (r)
1214
547
  try {
1215
- const c = St(f);
1216
- await o.addStoredCommand(c), t((m) => ({
1217
- ...m,
1218
- storedCommands: [...m.storedCommands, c],
548
+ const d = Pe(l);
549
+ await r.addStoredCommand(d), n((c) => ({
550
+ ...c,
551
+ storedCommands: [...c.storedCommands, d],
1219
552
  position: null
1220
553
  }));
1221
- } catch (c) {
1222
- console.warn("Failed to save command to history:", c);
554
+ } catch (d) {
555
+ console.warn("Failed to save command to history:", d);
1223
556
  }
1224
- }, [o]), a = R(async () => o ? await o.getStoredCommands() : [], [o]);
1225
- z(() => {
1226
- if (!o) return;
557
+ }, [r]), o = w(async () => r ? await r.getStoredCommands() : [], [r]);
558
+ A(() => {
559
+ if (!r) return;
1227
560
  (async () => {
1228
561
  try {
1229
- const c = await o.getStoredCommands();
1230
- return t((m) => ({
1231
- ...m,
1232
- storedCommands: c
1233
- })), c;
1234
- } catch (c) {
1235
- console.warn("Failed to load command history:", c);
562
+ const d = await r.getStoredCommands();
563
+ return n((c) => ({
564
+ ...c,
565
+ storedCommands: d
566
+ })), d;
567
+ } catch (d) {
568
+ console.warn("Failed to load command history:", d);
1236
569
  }
1237
570
  })();
1238
- }, [o]);
1239
- const i = R(async (f) => {
1240
- if ((await a()).length === 0)
571
+ }, [r]);
572
+ const s = w(async (l) => {
573
+ if ((await o()).length === 0)
1241
574
  return { segments: null, position: null };
1242
- let m = null;
1243
- return f === "up" ? n.position === null ? m = n.storedCommands.length - 1 : n.position > 0 ? m = n.position - 1 : m = 0 : n.position === null || n.position >= n.storedCommands.length - 1 ? m = null : m = n.position + 1, t((b) => ({
1244
- ...b,
1245
- position: m
1246
- })), m === null ? {
575
+ let c = null;
576
+ return l === "up" ? e.position === null ? c = e.storedCommands.length - 1 : e.position > 0 ? c = e.position - 1 : c = 0 : e.position === null || e.position >= e.storedCommands.length - 1 ? c = null : c = e.position + 1, n((p) => ({
577
+ ...p,
578
+ position: c
579
+ })), c === null ? {
1247
580
  segments: [],
1248
581
  position: null
1249
582
  } : {
1250
- segments: m !== null ? n.storedCommands[m].commandSegments : null,
1251
- position: m
583
+ segments: c !== null ? e.storedCommands[c].commandSegments : null,
584
+ position: c
1252
585
  };
1253
- }, [n, a]), u = R(async () => {
586
+ }, [e, o]), a = w(async () => {
1254
587
  try {
1255
- if (!o) return;
1256
- await o.clear(), t({
588
+ if (!r) return;
589
+ await r.clear(), n({
1257
590
  storedCommands: [],
1258
591
  position: null
1259
592
  });
1260
- } catch (f) {
1261
- console.warn("Failed to clear command history:", f);
593
+ } catch (l) {
594
+ console.warn("Failed to clear command history:", l);
1262
595
  }
1263
- }, [o]);
596
+ }, [r]);
1264
597
  return {
1265
- history: n,
1266
- addStoredCommand: r,
1267
- getStoredCommands: a,
1268
- navigateHistory: i,
1269
- clear: u
598
+ history: e,
599
+ addStoredCommand: t,
600
+ getStoredCommands: o,
601
+ navigateHistory: s,
602
+ clear: a
1270
603
  };
1271
604
  }
1272
- const Cn = () => {
1273
- const o = ce(), n = xe(), t = xn(), r = ue(), a = vn(), [i, u] = Y({
605
+ const X = () => {
606
+ const r = F(), e = B(), n = ue(), t = O(), o = me(), [s, a] = R({
1274
607
  currentInput: "",
1275
608
  isEnteringArg: !1,
1276
609
  output: [],
1277
610
  history: {
1278
611
  commands: [],
1279
612
  position: null,
1280
- storage: a
613
+ storage: o
1281
614
  }
1282
615
  });
1283
- z(() => {
1284
- }, [a]), z(() => {
1285
- u((h) => ({
1286
- ...h,
616
+ A(() => {
617
+ }, [o]), A(() => {
618
+ a((u) => ({
619
+ ...u,
1287
620
  history: {
1288
- commands: t.history.storedCommands,
1289
- position: t.history.position,
1290
- storage: a
621
+ commands: n.history.storedCommands,
622
+ position: n.history.position,
623
+ storage: o
1291
624
  }
1292
625
  }));
1293
- }, [t.history, a]);
1294
- const f = {
1295
- setCurrentInput: R((h) => {
1296
- D.debug("[CitadelActions] setCurrentInput: ", h), u((b) => ({ ...b, currentInput: h }));
626
+ }, [n.history, o]);
627
+ const l = {
628
+ setCurrentInput: w((u) => {
629
+ C.debug("[CitadelActions] setCurrentInput: ", u), a((p) => ({ ...p, currentInput: u }));
1297
630
  }, []),
1298
- setIsEnteringArg: R((h) => {
1299
- D.debug("[CitadelActions] setIsEnteringArg: ", h), u((b) => ({ ...b, isEnteringArg: h }));
631
+ setIsEnteringArg: w((u) => {
632
+ C.debug("[CitadelActions] setIsEnteringArg: ", u), a((p) => ({ ...p, isEnteringArg: u }));
1300
633
  }, []),
1301
- addOutput: R((h) => {
1302
- D.debug("[CitadelActions]addOutput: ", h), u((b) => ({
1303
- ...b,
1304
- output: [...b.output, h]
634
+ addOutput: w((u) => {
635
+ C.debug("[CitadelActions]addOutput: ", u), a((p) => ({
636
+ ...p,
637
+ output: [...p.output, u]
1305
638
  }));
1306
639
  }, []),
1307
- executeCommand: R(async () => {
1308
- const h = r.path(), b = n.getCommand(h);
1309
- if (!b) {
1310
- console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ", h);
640
+ executeCommand: w(async () => {
641
+ const u = t.path(), p = e.getCommand(u);
642
+ if (!p) {
643
+ console.error("[CitadelActions][executeCommand] Cannot execute command because no command was found for the given path: ", u);
1311
644
  return;
1312
645
  }
1313
- const _ = new Ct(r);
1314
- u((S) => ({
1315
- ...S,
1316
- output: [...S.output, _]
646
+ const k = new Re(t);
647
+ a((y) => ({
648
+ ...y,
649
+ output: [...y.output, k]
1317
650
  }));
1318
651
  try {
1319
- const S = new Promise((d, y) => {
652
+ const y = new Promise((i, h) => {
1320
653
  setTimeout(() => {
1321
- y(new Error("Request timed out"));
1322
- }, o.commandTimeoutMs);
1323
- }), U = r.arguments.map((d) => d.value || ""), I = await Promise.race([
1324
- b.handler(U),
1325
- S
654
+ h(new Error("Request timed out"));
655
+ }, r.commandTimeoutMs);
656
+ }), E = t.arguments.map((i) => i.value || ""), N = await Promise.race([
657
+ p.handler(E),
658
+ y
1326
659
  ]);
1327
- if (!(I instanceof Z))
660
+ if (!(N instanceof U))
1328
661
  throw new Error(
1329
- `The ${h.join(".")} command returned an invalid result type. Commands must return an instance of a CommandResult.
662
+ `The ${u.join(".")} command returned an invalid result type. Commands must return an instance of a CommandResult.
1330
663
  For example:
1331
664
  return new JsonCommandResult({ text: "Hello World" });
1332
- Check the definition of the ${h.join(".")} command and update the return type for its handler.`
665
+ Check the definition of the ${u.join(".")} command and update the return type for its handler.`
1333
666
  );
1334
- I.markSuccess(), u((d) => ({
1335
- ...d,
1336
- output: d.output.map(
1337
- (y) => y.timestamp === _.timestamp ? { ...y, result: I } : y
667
+ N.markSuccess(), a((i) => ({
668
+ ...i,
669
+ output: i.output.map(
670
+ (h) => h.timestamp === k.timestamp ? { ...h, result: N } : h
1338
671
  )
1339
672
  }));
1340
- } catch (S) {
1341
- const U = new mt(
1342
- S instanceof Error ? S.message : "Unknown error"
673
+ } catch (y) {
674
+ const E = new ve(
675
+ y instanceof Error ? y.message : "Unknown error"
1343
676
  );
1344
- U.markFailure(), u((I) => ({
1345
- ...I,
1346
- output: I.output.map(
1347
- (d) => d.timestamp === _.timestamp ? { ...d, result: U } : d
677
+ E.markFailure(), a((N) => ({
678
+ ...N,
679
+ output: N.output.map(
680
+ (i) => i.timestamp === k.timestamp ? { ...i, result: E } : i
1348
681
  )
1349
682
  }));
1350
683
  }
1351
- }, [n, o.commandTimeoutMs, r]),
1352
- clearHistory: R(async () => {
684
+ }, [e, r.commandTimeoutMs, t]),
685
+ clearHistory: w(async () => {
1353
686
  try {
1354
- await t.clear();
1355
- } catch (h) {
1356
- console.warn("Failed to clear history:", h);
687
+ await n.clear();
688
+ } catch (u) {
689
+ console.warn("Failed to clear history:", u);
1357
690
  }
1358
- }, [t])
1359
- }, c = R(() => n.getCompletions_s(r.path()), [r, n]), m = R(() => n.getCompletions(r.path()), [r, n]);
691
+ }, [n])
692
+ }, d = w(() => e.getCompletions_s(t.path()), [t, e]), c = w(() => e.getCompletions(t.path()), [t, e]);
1360
693
  return {
1361
- state: i,
1362
- actions: f,
1363
- getAvailableCommands_s: c,
1364
- getAvailableCommandSegments: m
694
+ state: s,
695
+ actions: l,
696
+ getAvailableCommands_s: d,
697
+ getAvailableCommandSegments: c
698
+ };
699
+ }, He = ({ onOpen: r, onClose: e, isVisible: n, showCitadelKey: t }) => {
700
+ A(() => {
701
+ const o = (s) => {
702
+ var a, l;
703
+ !n && s.key === t && !["input", "textarea"].includes(((l = (a = s.target) == null ? void 0 : a.tagName) == null ? void 0 : l.toLowerCase()) || "") && (s.preventDefault(), r()), n && s.key === "Escape" && (s.preventDefault(), e());
704
+ };
705
+ return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
706
+ }, [r, e, n, t]);
707
+ }, De = "_panelContainer_1pav9_3", Me = "_innerContainer_1pav9_19", Ue = "_inputSection_1pav9_29", Fe = "_resizeHandle_1pav9_36", Te = "_citadel_slideUp_1pav9_65", je = "_citadel_slideDown_1pav9_69", Oe = "_inlineContainer_1pav9_73", Z = {
708
+ panelContainer: De,
709
+ innerContainer: Me,
710
+ inputSection: Ue,
711
+ resizeHandle: Fe,
712
+ citadel_slideUp: Te,
713
+ citadel_slideDown: je,
714
+ inlineContainer: Oe
715
+ }, $e = (r) => {
716
+ const { isVisible: e, isClosing: n, onAnimationComplete: t } = r, o = V(() => e ? n ? Z.slideDown : Z.slideUp : "", [e, n]);
717
+ return A(() => {
718
+ if (t) {
719
+ const a = setTimeout(() => {
720
+ t();
721
+ }, 200);
722
+ return () => clearTimeout(a);
723
+ }
724
+ }, [n, t]), {
725
+ style: V(() => ({
726
+ opacity: e ? 1 : 0,
727
+ transform: e ? "translateY(0)" : n ? "translateY(100%)" : "translateY(-100%)",
728
+ transition: "opacity 200ms ease-in-out, transform 200ms ease-in-out"
729
+ }), [e, n]),
730
+ animationClass: o
1365
731
  };
1366
- }, Et = {
732
+ }, Ke = () => /* @__PURE__ */ m(
733
+ "div",
734
+ {
735
+ "data-testid": "spinner",
736
+ className: "animate-spin rounded-full h-4 w-4 border-2 border-gray-300 border-t-gray-600"
737
+ }
738
+ ), Le = ({
739
+ command: r,
740
+ timestamp: e,
741
+ status: n
742
+ }) => /* @__PURE__ */ _("div", { className: "flex items-center gap-2 font-mono text-sm", children: [
743
+ /* @__PURE__ */ _("span", { className: "text-gray-200", children: [
744
+ "> ",
745
+ r.split(" ").map((t, o) => {
746
+ const s = t.startsWith("<") && t.endsWith(">");
747
+ return /* @__PURE__ */ _(
748
+ "span",
749
+ {
750
+ className: s ? "text-green-400" : "text-gray-200",
751
+ children: [
752
+ o > 0 ? " " : "",
753
+ t
754
+ ]
755
+ },
756
+ o
757
+ );
758
+ })
759
+ ] }),
760
+ /* @__PURE__ */ m("span", { className: "text-gray-400", children: "·" }),
761
+ /* @__PURE__ */ m("span", { className: "text-gray-500", children: e }),
762
+ n === T.Pending && /* @__PURE__ */ m(Ke, {}),
763
+ n === T.Success && /* @__PURE__ */ m(
764
+ "div",
765
+ {
766
+ "data-testid": "success-indicator",
767
+ className: "w-4 h-4 rounded-full bg-green-500"
768
+ }
769
+ ),
770
+ (n === T.Timeout || n === T.Failure) && /* @__PURE__ */ m(
771
+ "div",
772
+ {
773
+ "data-testid": "success-indicator",
774
+ className: "w-4 h-4 rounded-full bg-red-500"
775
+ }
776
+ )
777
+ ] }), Ve = ({ output: r, outputRef: e }) => {
778
+ const n = F(), t = w(() => {
779
+ if (e.current) {
780
+ const o = e.current;
781
+ requestAnimationFrame(() => {
782
+ o.scrollTop = o.scrollHeight;
783
+ });
784
+ }
785
+ }, [e]);
786
+ return A(() => {
787
+ if (t(), e.current) {
788
+ const o = e.current.getElementsByTagName("img"), s = o[o.length - 1];
789
+ if (s && !s.complete)
790
+ return s.addEventListener("load", t), () => s.removeEventListener("load", t);
791
+ }
792
+ }, [r, t, e]), /* @__PURE__ */ m(
793
+ "div",
794
+ {
795
+ ref: e,
796
+ className: "h-full overflow-y-auto border border-gray-700 rounded-lg p-3 text-left",
797
+ "data-testid": "citadel-command-output",
798
+ children: r.map((o, s) => /* @__PURE__ */ _("div", { className: "mb-4 last:mb-0", children: [
799
+ /* @__PURE__ */ m(
800
+ Le,
801
+ {
802
+ command: o.command.join(" "),
803
+ timestamp: new Date(o.timestamp).toLocaleTimeString(),
804
+ status: o.result.status
805
+ }
806
+ ),
807
+ /* @__PURE__ */ m("pre", { className: `text-gray-200 whitespace-pre font-mono ${n.outputFontSize}`, children: o.result.render() })
808
+ ] }, s))
809
+ }
810
+ );
811
+ }, We = {
1367
812
  blink: {
1368
813
  character: "▋",
1369
814
  speed: 530,
@@ -1384,301 +829,299 @@ Check the definition of the ${h.join(".")} command and update the return type fo
1384
829
  speed: 120,
1385
830
  color: "#fff"
1386
831
  }
1387
- }, cn = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], un = ["|", "/", "-", "\\"], kt = ({
1388
- style: o = { type: "blink" },
1389
- isValid: n = !0,
1390
- errorMessage: t
832
+ }, ee = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], ne = ["|", "/", "-", "\\"], qe = ({
833
+ style: r = { type: "blink" },
834
+ isValid: e = !0,
835
+ errorMessage: n
1391
836
  }) => {
1392
- const r = be(() => ({
1393
- ...Et[o.type],
1394
- ...o
1395
- }), [o]), [a, i] = Y(!0), [u, f] = Y(0);
1396
- z(() => {
1397
- if (r.speed === 0) return;
1398
- const h = setInterval(() => {
1399
- r.type === "blink" ? i((b) => !b) : ["spin", "bbs"].includes(r.type) && f((b) => (b + 1) % (r.type === "bbs" ? un.length : cn.length));
1400
- }, r.speed);
1401
- return () => clearInterval(h);
1402
- }, [r.type, r.speed]);
1403
- const c = be(() => ({
1404
- color: n ? r.color : "#ff4444",
837
+ const t = V(() => ({
838
+ ...We[r.type],
839
+ ...r
840
+ }), [r]), [o, s] = R(!0), [a, l] = R(0);
841
+ A(() => {
842
+ if (t.speed === 0) return;
843
+ const u = setInterval(() => {
844
+ t.type === "blink" ? s((p) => !p) : ["spin", "bbs"].includes(t.type) && l((p) => (p + 1) % (t.type === "bbs" ? ne.length : ee.length));
845
+ }, t.speed);
846
+ return () => clearInterval(u);
847
+ }, [t.type, t.speed]);
848
+ const d = V(() => ({
849
+ color: e ? t.color : "#ff4444",
1405
850
  transition: "color 0.15s ease-in-out"
1406
- }), [n, r.color]), m = () => !n && t ? "✗" : ["spin", "bbs"].includes(r.type) ? (r.type === "bbs" ? un : cn)[u] : r.type === "solid" || a ? r.character : " ";
1407
- return /* @__PURE__ */ p.jsx("div", { className: "relative inline-block", children: /* @__PURE__ */ p.jsx(
851
+ }), [e, t.color]);
852
+ return /* @__PURE__ */ m("div", { className: "relative inline-block", children: /* @__PURE__ */ m(
1408
853
  "span",
1409
854
  {
1410
- className: `command-cursor ${n ? "" : "animate-shake"}`,
1411
- style: c,
1412
- title: t,
1413
- children: m()
855
+ className: `command-cursor ${e ? "" : "animate-shake"}`,
856
+ style: d,
857
+ title: n,
858
+ children: !e && n ? "✗" : ["spin", "bbs"].includes(t.type) ? (t.type === "bbs" ? ne : ee)[a] : t.type === "solid" || o ? t.character : " "
1414
859
  }
1415
860
  ) });
1416
861
  };
1417
- function _t(o, n) {
1418
- switch (n.type) {
862
+ function Ye(r, e) {
863
+ switch (e.type) {
1419
864
  case "set":
1420
- return D.debug(`[inputStateReducer] InputState changing from ${o} to ${n.state}`), n.state;
865
+ return C.debug(`[inputStateReducer] InputState changing from ${r} to ${e.state}`), e.state;
1421
866
  default:
1422
- return o;
1423
- }
1424
- }
1425
- const Rt = () => {
1426
- const { state: o } = Cn(), n = xe(), t = xn(), r = ue(), [a, i] = et(_t, "idle"), u = (d) => {
1427
- i({ type: "set", state: d });
1428
- }, f = R(() => {
1429
- const y = n.getCompletions(r.path())[0] || r.nullSegment;
1430
- return D.debug("[getNextExpectedSegment] ", y), y;
1431
- }, [n, r]), c = R(() => n.getCompletions_s(r.path()).map((y) => n.getCommand([...r.path(), y])).filter((y) => y !== void 0), [n, r]), m = R((d, y) => {
1432
- if (!d) return y;
1433
- const w = y.reduce((k, j) => {
1434
- const P = f();
1435
- return (P == null ? void 0 : P.type) === "word" && k.set(P.name, j), k;
867
+ return r;
868
+ }
869
+ }
870
+ const Be = () => {
871
+ const { state: r } = X(), e = B(), n = ue(), t = O(), [o, s] = ye(Ye, "idle"), a = (i) => {
872
+ s({ type: "set", state: i });
873
+ }, l = w(() => {
874
+ const h = e.getCompletions(t.path())[0] || t.nullSegment;
875
+ return C.debug("[getNextExpectedSegment] ", h), h;
876
+ }, [e, t]), d = w(() => e.getCompletions_s(t.path()).map((h) => e.getCommand([...t.path(), h])).filter((h) => h !== void 0), [e, t]), c = w((i, h) => {
877
+ if (!i) return h;
878
+ const g = h.reduce((f, x) => {
879
+ const v = l();
880
+ return (v == null ? void 0 : v.type) === "word" && f.set(v.name, x), f;
1436
881
  }, /* @__PURE__ */ new Map());
1437
- return Array.from(w.values()).filter(() => {
1438
- const k = f();
1439
- return k.type !== "word" ? !1 : k.name.toLowerCase().startsWith(d.toLowerCase());
882
+ return Array.from(g.values()).filter(() => {
883
+ const f = l();
884
+ return f.type !== "word" ? !1 : f.name.toLowerCase().startsWith(i.toLowerCase());
1440
885
  });
1441
- }, [f]), h = R((d) => {
1442
- const w = n.getCompletions(r.path()).filter((N) => N.type === "word").filter(
1443
- (N) => N.name.toLowerCase().startsWith(d.toLowerCase())
886
+ }, [l]), u = w((i) => {
887
+ const g = e.getCompletions(t.path()).filter((S) => S.type === "word").filter(
888
+ (S) => S.name.toLowerCase().startsWith(i.toLowerCase())
1444
889
  );
1445
- return w.length === 1 ? w[0] : r.nullSegment;
1446
- }, [n, r]), b = R((d) => {
1447
- const y = r.path(), w = n.getCompletions(y);
1448
- return w.length === 0 && d ? !1 : w.some((k) => k.type === "argument") ? !0 : w.some(
1449
- (k) => k.type === "word" && k.name.toLowerCase().startsWith(d.toLowerCase())
890
+ return g.length === 1 ? g[0] : t.nullSegment;
891
+ }, [e, t]), p = w((i) => {
892
+ const h = t.path(), g = e.getCompletions(h);
893
+ return g.length === 0 && i ? !1 : g.some((f) => f.type === "argument") ? !0 : g.some(
894
+ (f) => f.type === "word" && f.name.toLowerCase().startsWith(i.toLowerCase())
1450
895
  );
1451
- }, [n, r]), _ = R((d) => {
1452
- D.debug("[tryAutoComplete] input: ", d);
1453
- const y = h(d);
1454
- return !y || y.name === d ? new wn() : (D.debug("[tryAutoComplete] result: ", y), y);
1455
- }, [h]), S = R((d, y) => {
1456
- if (o.history.position === null) {
1457
- if (y.setCurrentInput(d), D.debug("[useCommandParser][handleInputChange] newValue: ", d), a === "entering_argument") {
1458
- const w = dn(d);
1459
- if (w.isQuoted)
1460
- if (w.isComplete) {
1461
- const N = f();
1462
- if (N.type === "argument") {
1463
- const k = N;
1464
- k.value = d.trim() || "", D.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", k), r.push(k), y.setCurrentInput(""), u("idle");
896
+ }, [e, t]), k = w((i) => {
897
+ C.debug("[tryAutoComplete] input: ", i);
898
+ const h = u(i);
899
+ return !h || h.name === i ? new ce() : (C.debug("[tryAutoComplete] result: ", h), h);
900
+ }, [u]), y = w((i, h) => {
901
+ if (r.history.position === null) {
902
+ if (h.setCurrentInput(i), C.debug("[useCommandParser][handleInputChange] newValue: ", i), o === "entering_argument") {
903
+ const g = te(i);
904
+ if (g.isQuoted)
905
+ if (g.isComplete) {
906
+ const S = l();
907
+ if (S.type === "argument") {
908
+ const f = S;
909
+ f.value = i.trim() || "", C.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", f), t.push(f), h.setCurrentInput(""), a("idle");
1465
910
  return;
1466
911
  }
1467
912
  } else
1468
913
  return;
1469
- else if (w.isComplete) {
1470
- const N = f();
1471
- N.value = d.trim() || "", D.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", N), r.push(N), y.setCurrentInput(""), u("idle");
914
+ else if (g.isComplete) {
915
+ const S = l();
916
+ S.value = i.trim() || "", C.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", S), t.push(S), h.setCurrentInput(""), a("idle");
1472
917
  return;
1473
918
  } else
1474
919
  return;
1475
920
  }
1476
- if (a == "entering_command") {
1477
- const w = _(d);
1478
- if (w.type === "word") {
1479
- D.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", w), r.push(w), y.setCurrentInput(""), u("idle");
921
+ if (o == "entering_command") {
922
+ const g = k(i);
923
+ if (g.type === "word") {
924
+ C.debug("[useCommandParser][handleInputChange][entering_command] pushing: ", g), t.push(g), h.setCurrentInput(""), a("idle");
1480
925
  return;
1481
926
  }
1482
927
  }
1483
928
  }
1484
- }, [_, o, f, a, r]), U = R((d) => {
1485
- d.setCurrentInput(""), d.setIsEnteringArg(!1), r.clear(), u("idle");
1486
- }, [r]), I = R((d, y, w) => {
1487
- if (!(d.key === "Backspace" || d.key === "Enter" || d.key === "ArrowUp" || d.key === "ArrowDown" || d.key === "ArrowLeft" || d.key === "ArrowRight" || d.key === "Escape" || d.key === "Delete" || d.key === "Home" || d.key === "End" || d.key.length === 1))
929
+ }, [k, r, l, o, t]), E = w((i) => {
930
+ i.setCurrentInput(""), i.setIsEnteringArg(!1), t.clear(), a("idle");
931
+ }, [t]), N = w((i, h, g) => {
932
+ if (!(i.key === "Backspace" || i.key === "Enter" || i.key === "ArrowUp" || i.key === "ArrowDown" || i.key === "ArrowLeft" || i.key === "ArrowRight" || i.key === "Escape" || i.key === "Delete" || i.key === "Home" || i.key === "End" || i.key.length === 1))
1488
933
  return !0;
1489
- const { currentInput: k, isEnteringArg: j } = y, P = dn(k);
1490
- switch (d.key) {
934
+ const { currentInput: f, isEnteringArg: x } = h, v = te(f);
935
+ switch (i.key) {
1491
936
  case "Backspace":
1492
- return k === "" && (d.preventDefault(), r.size() > 0 && r.pop(), u("idle")), !0;
937
+ return f === "" && (i.preventDefault(), t.size() > 0 && t.pop(), a("idle")), !0;
1493
938
  case "Enter": {
1494
- if (d.preventDefault(), P.isQuoted && !P.isComplete)
939
+ if (i.preventDefault(), v.isQuoted && !v.isComplete)
1495
940
  return !0;
1496
- if (a === "entering_argument") {
1497
- const L = f();
1498
- L.value = k, D.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", L), r.push(L);
941
+ if (o === "entering_argument" || x && f.trim()) {
942
+ const G = l();
943
+ G.value = f, C.debug("[handleKeyDown][Enter]['entering_argument'] pushing: ", G), t.push(G);
1499
944
  }
1500
- return D.debug("[handleKeyDown][Enter] calling actions.executeCommand. segmentStack: ", r), w.executeCommand(), t.addStoredCommand(r.toArray()), U(w), !0;
945
+ const I = t.path(), P = e.getCommand(I);
946
+ if (!P)
947
+ return !1;
948
+ const $ = P.segments.filter((M) => M.type === "argument"), K = t.arguments;
949
+ return $.length > K.length ? !1 : (C.debug("[handleKeyDown][Enter] calling actions.executeCommand. segmentStack: ", t), g.executeCommand(), n.addStoredCommand(t.toArray()), E(g), !0);
1501
950
  }
1502
951
  case "ArrowUp":
1503
- return d.preventDefault(), (async () => {
1504
- const $ = await t.navigateHistory("up", r.toArray());
1505
- return $.segments && (r.clear(), r.pushAll($.segments), w.setCurrentInput("")), !0;
952
+ return i.preventDefault(), (async () => {
953
+ const I = await n.navigateHistory("up", t.toArray());
954
+ return I.segments && (t.clear(), t.pushAll(I.segments), g.setCurrentInput("")), !0;
1506
955
  })();
1507
956
  case "ArrowDown":
1508
- return d.preventDefault(), (async () => {
1509
- const $ = await t.navigateHistory("down", r.toArray());
1510
- return $.segments && (r.clear(), r.pushAll($.segments), w.setCurrentInput("")), !0;
957
+ return i.preventDefault(), (async () => {
958
+ const I = await n.navigateHistory("down", t.toArray());
959
+ return I.segments && (t.clear(), t.pushAll(I.segments), g.setCurrentInput("")), !0;
1511
960
  })();
1512
961
  default: {
1513
- if (!j && d.key.length === 1) {
1514
- const $ = k + d.key;
1515
- if (!b($))
1516
- return d.preventDefault(), !1;
962
+ if (!x && i.key.length === 1) {
963
+ const I = f + i.key;
964
+ if (!p(I))
965
+ return i.preventDefault(), !1;
1517
966
  }
1518
967
  return !0;
1519
968
  }
1520
969
  }
1521
970
  }, [
1522
- a,
1523
- b,
1524
- f,
1525
- t,
1526
- U,
1527
- r
971
+ o,
972
+ p,
973
+ l,
974
+ n,
975
+ E,
976
+ e,
977
+ t
1528
978
  ]);
1529
979
  return {
1530
- handleInputChange: S,
1531
- handleKeyDown: I,
1532
- inputState: a,
1533
- setInputStateWithLogging: u,
980
+ handleInputChange: y,
981
+ handleKeyDown: N,
982
+ inputState: o,
983
+ setInputStateWithLogging: a,
1534
984
  // Expose internal functions for testing
1535
- findMatchingCommands: m,
1536
- getAutocompleteSuggestion: h,
1537
- getAvailableNodes: c,
1538
- getNextExpectedSegment: f,
1539
- isValidCommandInput: b
985
+ findMatchingCommands: c,
986
+ getAutocompleteSuggestion: u,
987
+ getAvailableNodes: d,
988
+ getNextExpectedSegment: l,
989
+ isValidCommandInput: p
1540
990
  };
1541
991
  };
1542
- function dn(o) {
1543
- const n = [];
1544
- let t = "", r = !1, a;
1545
- for (let i = 0; i < o.length; i++) {
1546
- const u = o[i];
1547
- (u === '"' || u === "'") && (!r || u === a) ? r ? (n.push(t), t = "", r = !1, a = void 0) : (t && (n.push(t), t = ""), r = !0, a = u) : !r && u === " " ? t && (n.push(t), t = "") : t += u;
992
+ function te(r) {
993
+ const e = [];
994
+ let n = "", t = !1, o;
995
+ for (let s = 0; s < r.length; s++) {
996
+ const a = r[s];
997
+ (a === '"' || a === "'") && (!t || a === o) ? t ? (e.push(n), n = "", t = !1, o = void 0) : (n && (e.push(n), n = ""), t = !0, o = a) : !t && a === " " ? n && (e.push(n), n = "") : n += a;
1548
998
  }
1549
999
  return {
1550
- words: n,
1551
- currentWord: t,
1552
- isQuoted: r,
1553
- quoteChar: a,
1554
- isComplete: !r && !t
1000
+ words: e,
1001
+ currentWord: n,
1002
+ isQuoted: t,
1003
+ quoteChar: o,
1004
+ isComplete: !t && !n
1555
1005
  };
1556
1006
  }
1557
- const jt = () => {
1558
- const o = ue(), [n, t] = Y(0);
1559
- return z(() => {
1560
- const r = {
1007
+ const Ge = () => {
1008
+ const r = O(), [e, n] = R(0);
1009
+ return A(() => {
1010
+ const t = {
1561
1011
  update: () => {
1562
- t((a) => a + 1);
1012
+ n((o) => o + 1);
1563
1013
  }
1564
1014
  };
1565
- return o.subscribe(r), () => {
1566
- o.unsubscribe(r);
1015
+ return r.subscribe(t), () => {
1016
+ r.unsubscribe(t);
1567
1017
  };
1568
- }, [o]), n;
1569
- }, At = ({
1570
- state: o,
1571
- actions: n
1018
+ }, [r]), e;
1019
+ }, Je = ({
1020
+ state: r,
1021
+ actions: e
1572
1022
  }) => {
1573
- const t = X(null), r = xe(), a = ue(), {
1574
- handleKeyDown: i,
1575
- handleInputChange: u,
1576
- inputState: f,
1577
- setInputStateWithLogging: c,
1578
- getNextExpectedSegment: m
1579
- } = Rt(), [h, b] = Y(!1), _ = ce(), S = jt(), U = async (j) => {
1580
- const P = i(j, o, n);
1581
- await Promise.resolve(P) === !1 && (b(!0), setTimeout(() => b(!1), 500));
1582
- }, I = (j) => {
1583
- u(j.target.value, n);
1584
- }, d = (j) => {
1585
- j.preventDefault();
1586
- const P = j.clipboardData.getData("text");
1587
- u(P, n);
1023
+ const n = H(null), t = B(), o = O(), {
1024
+ handleKeyDown: s,
1025
+ handleInputChange: a,
1026
+ inputState: l,
1027
+ setInputStateWithLogging: d,
1028
+ getNextExpectedSegment: c
1029
+ } = Be(), [u, p] = R(!1), k = F(), y = Ge(), E = async (x) => {
1030
+ const v = s(x, r, e);
1031
+ await Promise.resolve(v) === !1 && (p(!0), setTimeout(() => p(!1), 500));
1032
+ }, N = (x) => {
1033
+ a(x.target.value, e);
1034
+ }, i = (x) => {
1035
+ x.preventDefault();
1036
+ const v = x.clipboardData.getData("text");
1037
+ a(v, e);
1588
1038
  };
1589
- z(() => {
1590
- t.current && t.current.focus(), f !== "entering_command" && c("entering_command");
1591
- }, [f, c]), z(() => {
1592
- if (f !== "idle") return;
1593
- const j = m();
1594
- let P = "idle";
1595
- switch (j.type) {
1039
+ A(() => {
1040
+ n.current && n.current.focus(), l !== "entering_command" && d("entering_command");
1041
+ }, [l, d]), A(() => {
1042
+ if (l !== "idle") return;
1043
+ const x = c();
1044
+ let v = "idle";
1045
+ switch (x.type) {
1596
1046
  case "word":
1597
- P = "entering_command", n.setIsEnteringArg(!1);
1047
+ v = "entering_command", e.setIsEnteringArg(!1);
1598
1048
  break;
1599
1049
  case "argument":
1600
- P = "entering_argument", n.setIsEnteringArg(!0);
1050
+ v = "entering_argument", e.setIsEnteringArg(!0);
1601
1051
  break;
1602
1052
  }
1603
- c(P);
1604
- }, [S, f, m, c, n]);
1605
- const [y, w] = Y([]);
1606
- z(() => {
1607
- const j = [], P = a.toArray().map((L, ee) => {
1608
- j.push(L.name);
1609
- const de = r.hasNextSegment(j);
1610
- if (L.type === "argument") {
1611
- const ne = L;
1612
- return /* @__PURE__ */ p.jsxs(Q.Fragment, { children: [
1613
- /* @__PURE__ */ p.jsx("span", { className: "text-gray-200 whitespace-pre", children: ne.value }),
1614
- ee < a.size() && de && /* @__PURE__ */ p.jsx("span", { className: "text-gray-200 whitespace-pre", children: " " })
1615
- ] }, "arg-" + ne.name + ne.value);
1053
+ d(v);
1054
+ }, [y, l, c, d, e]);
1055
+ const [h, g] = R([]);
1056
+ A(() => {
1057
+ const x = [], v = o.toArray().map((P, $) => {
1058
+ x.push(P.name);
1059
+ const K = t.hasNextSegment(x);
1060
+ if (P.type === "argument") {
1061
+ const M = P;
1062
+ return /* @__PURE__ */ _(L.Fragment, { children: [
1063
+ /* @__PURE__ */ m("span", { className: "text-gray-200 whitespace-pre", children: M.value }),
1064
+ $ < o.size() && K && /* @__PURE__ */ m("span", { className: "text-gray-200 whitespace-pre", children: " " })
1065
+ ] }, "arg-" + M.name + M.value);
1616
1066
  }
1617
- return /* @__PURE__ */ p.jsxs(Q.Fragment, { children: [
1618
- /* @__PURE__ */ p.jsx("span", { className: "text-blue-400 whitespace-pre", children: L.name }),
1619
- ee < a.size() && de && /* @__PURE__ */ p.jsx("span", { className: "text-blue-400 whitespace-pre", children: " " })
1620
- ] }, "word-" + L.name);
1067
+ return /* @__PURE__ */ _(L.Fragment, { children: [
1068
+ /* @__PURE__ */ m("span", { className: "text-blue-400 whitespace-pre", children: P.name }),
1069
+ $ < o.size() && K && /* @__PURE__ */ m("span", { className: "text-blue-400 whitespace-pre", children: " " })
1070
+ ] }, "word-" + P.name);
1621
1071
  });
1622
- w([/* @__PURE__ */ p.jsx("div", { className: "flex items-center gap-1", "data-testid": "user-input-area", children: P }, "{segmentStackVersion}")]);
1623
- }, [S, r, a]);
1624
- const [N, k] = Y("");
1625
- return z(() => {
1626
- const j = m();
1627
- j.type === "argument" ? k(j.name) : k("");
1628
- }, [S, m]), /* @__PURE__ */ p.jsxs("div", { className: "flex flex-col w-full bg-gray-900 rounded-lg p-4", children: [
1629
- /* @__PURE__ */ p.jsx("style", { children: `
1630
- @keyframes shake {
1631
- 0%, 100% { transform: translateX(0); }
1632
- 25% { transform: translateX(-4px); }
1633
- 75% { transform: translateX(4px); }
1634
- }
1635
- @keyframes flashBorder {
1636
- 0%, 100% { border-color: transparent; }
1637
- 50% { border-color: rgb(239, 68, 68); }
1072
+ g([/* @__PURE__ */ m("div", { className: "flex items-center gap-1", "data-testid": "user-input-area", children: v }, "{segmentStackVersion}")]);
1073
+ }, [y, t, o]);
1074
+ const [S, f] = R("");
1075
+ return A(() => {
1076
+ const x = c();
1077
+ x.type === "argument" ? f(x.name) : f("");
1078
+ }, [y, c]), /* @__PURE__ */ _("div", { className: "flex flex-col w-full bg-gray-900 rounded-lg p-4", children: [
1079
+ /* @__PURE__ */ m("style", { children: `
1080
+ @keyframes subtleGlow {
1081
+ 0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
1082
+ 50% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
1638
1083
  }
1639
1084
  .invalid-input-animation {
1640
- animation: shake 0.2s ease-in-out, flashBorder 0.3s ease-in-out;
1641
- border-width: 1px;
1642
- border-style: solid;
1085
+ animation: subtleGlow 0.4s ease-in-out;
1643
1086
  }
1644
1087
  ` }),
1645
- /* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-2", children: [
1646
- /* @__PURE__ */ p.jsx("div", { className: "text-gray-400 font-mono", children: ">" }),
1647
- /* @__PURE__ */ p.jsxs("div", { className: "flex-1 font-mono flex items-center", children: [
1648
- y,
1649
- /* @__PURE__ */ p.jsxs("div", { className: "relative flex-1", children: [
1650
- /* @__PURE__ */ p.jsx(
1088
+ /* @__PURE__ */ _("div", { className: "flex items-center gap-2", children: [
1089
+ /* @__PURE__ */ m("div", { className: "text-gray-400 font-mono", children: ">" }),
1090
+ /* @__PURE__ */ _("div", { className: "flex-1 font-mono flex items-center", children: [
1091
+ h,
1092
+ /* @__PURE__ */ _("div", { className: "relative flex-1", children: [
1093
+ /* @__PURE__ */ m(
1651
1094
  "input",
1652
1095
  {
1653
- ref: t,
1096
+ ref: n,
1654
1097
  type: "text",
1655
1098
  role: "textbox",
1656
- value: o.currentInput,
1657
- onChange: I,
1658
- onKeyDown: U,
1659
- onPaste: d,
1099
+ value: r.currentInput,
1100
+ onChange: N,
1101
+ onKeyDown: E,
1102
+ onPaste: i,
1660
1103
  "data-testid": "citadel-command-input",
1661
- className: `w-full bg-transparent outline-none text-gray-200 caret-transparent ${h ? "invalid-input-animation" : ""}`,
1104
+ className: `w-full bg-transparent outline-none text-gray-200 caret-transparent ${u ? "invalid-input-animation" : ""}`,
1662
1105
  spellCheck: !1,
1663
1106
  autoComplete: "off",
1664
- placeholder: N
1107
+ placeholder: S
1665
1108
  }
1666
1109
  ),
1667
- /* @__PURE__ */ p.jsx(
1110
+ /* @__PURE__ */ m(
1668
1111
  "div",
1669
1112
  {
1670
1113
  className: "absolute top-0 pointer-events-none",
1671
1114
  style: {
1672
- left: `${o.currentInput.length}ch`,
1115
+ left: `${r.currentInput.length}ch`,
1673
1116
  transition: "left 0.05s ease-out"
1674
1117
  },
1675
- children: /* @__PURE__ */ p.jsx(
1676
- kt,
1118
+ children: /* @__PURE__ */ m(
1119
+ qe,
1677
1120
  {
1678
1121
  style: {
1679
- type: _.cursorType ?? M.cursorType,
1680
- color: _.cursorColor || M.cursorColor,
1681
- speed: _.cursorSpeed || M.cursorSpeed
1122
+ type: k.cursorType ?? z.cursorType,
1123
+ color: k.cursorColor || z.cursorColor,
1124
+ speed: k.cursorSpeed || z.cursorSpeed
1682
1125
  }
1683
1126
  }
1684
1127
  )
@@ -1688,121 +1131,123 @@ const jt = () => {
1688
1131
  ] })
1689
1132
  ] })
1690
1133
  ] });
1691
- }, Pt = () => /* @__PURE__ */ p.jsx(
1692
- "div",
1693
- {
1694
- "data-testid": "spinner",
1695
- className: "animate-spin rounded-full h-4 w-4 border-2 border-gray-300 border-t-gray-600"
1696
- }
1697
- ), Tt = ({
1698
- command: o,
1699
- timestamp: n,
1700
- status: t
1701
- }) => /* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-2 font-mono text-sm", children: [
1702
- /* @__PURE__ */ p.jsxs("span", { className: "text-gray-200", children: [
1703
- "> ",
1704
- o.split(" ").map((r, a) => {
1705
- const i = r.startsWith("<") && r.endsWith(">");
1706
- return /* @__PURE__ */ p.jsxs(
1707
- "span",
1708
- {
1709
- className: i ? "text-green-400" : "text-gray-200",
1710
- children: [
1711
- a > 0 ? " " : "",
1712
- r
1713
- ]
1714
- },
1715
- a
1716
- );
1717
- })
1718
- ] }),
1719
- /* @__PURE__ */ p.jsx("span", { className: "text-gray-400", children: "·" }),
1720
- /* @__PURE__ */ p.jsx("span", { className: "text-gray-500", children: n }),
1721
- t === ie.Pending && /* @__PURE__ */ p.jsx(Pt, {}),
1722
- t === ie.Success && /* @__PURE__ */ p.jsx(
1723
- "div",
1724
- {
1725
- "data-testid": "success-indicator",
1726
- className: "w-4 h-4 rounded-full bg-green-500"
1727
- }
1728
- ),
1729
- (t === ie.Timeout || t === ie.Failure) && /* @__PURE__ */ p.jsx(
1730
- "div",
1731
- {
1732
- "data-testid": "success-indicator",
1733
- className: "w-4 h-4 rounded-full bg-red-500"
1734
- }
1735
- )
1736
- ] }), Ot = ({ output: o, outputRef: n }) => {
1737
- const t = ce(), r = R(() => {
1738
- if (n.current) {
1739
- const a = n.current;
1740
- requestAnimationFrame(() => {
1741
- a.scrollTop = a.scrollHeight;
1742
- });
1743
- }
1744
- }, [n]);
1745
- return z(() => {
1746
- if (r(), n.current) {
1747
- const a = n.current.getElementsByTagName("img"), i = a[a.length - 1];
1748
- if (i && !i.complete)
1749
- return i.addEventListener("load", r), () => i.removeEventListener("load", r);
1750
- }
1751
- }, [o, r, n]), /* @__PURE__ */ p.jsx(
1752
- "div",
1753
- {
1754
- ref: n,
1755
- className: "h-full overflow-y-auto border border-gray-700 rounded-lg p-3 text-left",
1756
- children: o.map((a, i) => /* @__PURE__ */ p.jsxs("div", { className: "mb-4 last:mb-0", children: [
1757
- /* @__PURE__ */ p.jsx(
1758
- Tt,
1759
- {
1760
- command: a.command.join(" "),
1761
- timestamp: new Date(a.timestamp).toLocaleTimeString(),
1762
- status: a.result.status
1763
- }
1764
- ),
1765
- /* @__PURE__ */ p.jsx("pre", { className: `text-gray-200 whitespace-pre font-mono ${t.outputFontSize}`, children: a.result.render() })
1766
- ] }, i))
1767
- }
1768
- );
1769
- }, Nt = () => {
1770
- const o = xe(), n = ce(), t = ue(), r = "h-12 mt-2 border-t border-gray-700 px-4", a = "text-gray-300 pt-2", i = o.getCompletions(t.path());
1771
- D.debug("[AvailableCommands] nextCommandSegments: ", i);
1772
- const u = Q.useMemo(() => {
1773
- if (n.includeHelpCommand) {
1774
- const m = i.filter((b) => b.name !== "help"), h = i.find((b) => b.name === "help");
1775
- return [...m, ...h ? [h] : []];
1134
+ }, Qe = () => {
1135
+ const r = B(), e = F(), n = O(), t = "h-12 mt-2 border-t border-gray-700 px-4", o = "text-gray-300 pt-2", s = r.getCompletions(n.path());
1136
+ C.debug("[AvailableCommands] nextCommandSegments: ", s);
1137
+ const a = L.useMemo(() => {
1138
+ if (e.includeHelpCommand) {
1139
+ const c = s.filter((p) => p.name !== "help"), u = s.find((p) => p.name === "help");
1140
+ return [...c, ...u ? [u] : []];
1776
1141
  }
1777
- return i;
1778
- }, [i, n.includeHelpCommand]), f = i.some((m) => m.type === "argument"), c = i[0];
1779
- return /* @__PURE__ */ p.jsx("div", { className: r, "data-testid": "available-commands", children: /* @__PURE__ */ p.jsx("div", { className: a, children: f ? i.length > 0 ? /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
1780
- /* @__PURE__ */ p.jsx("span", { className: "text-blue-400", children: c.name }),
1781
- c.description && /* @__PURE__ */ p.jsxs("span", { className: "text-gray-400 ml-2", children: [
1142
+ return s;
1143
+ }, [s, e.includeHelpCommand]), l = s.some((c) => c.type === "argument"), d = s[0];
1144
+ return /* @__PURE__ */ m("div", { className: t, "data-testid": "available-commands", children: /* @__PURE__ */ m("div", { className: o, children: l ? s.length > 0 ? /* @__PURE__ */ _(we, { children: [
1145
+ /* @__PURE__ */ m("span", { className: "text-blue-400", children: d.name }),
1146
+ d.description && /* @__PURE__ */ _("span", { className: "text-gray-400 ml-2", children: [
1782
1147
  "- ",
1783
- c.description
1148
+ d.description
1784
1149
  ] })
1785
- ] }) : null : /* @__PURE__ */ p.jsx("div", { className: "flex flex-wrap gap-2", children: u == null ? void 0 : u.map((m) => {
1786
- const h = u == null ? void 0 : u.reduce((b, _) => {
1787
- if (_ === m) return b;
1788
- let S = 0;
1789
- for (; S < m.name.length && S < _.name.length && m.name[S].toLowerCase() === _.name[S].toLowerCase(); )
1790
- S++;
1791
- return Math.max(b, S + 1);
1150
+ ] }) : null : /* @__PURE__ */ m("div", { className: "flex flex-wrap gap-2", children: a == null ? void 0 : a.map((c) => {
1151
+ const u = a == null ? void 0 : a.reduce((p, k) => {
1152
+ if (k === c) return p;
1153
+ let y = 0;
1154
+ for (; y < c.name.length && y < k.name.length && c.name[y].toLowerCase() === k.name[y].toLowerCase(); )
1155
+ y++;
1156
+ return Math.max(p, y + 1);
1792
1157
  }, 1);
1793
- return /* @__PURE__ */ p.jsx(
1158
+ return /* @__PURE__ */ m(
1794
1159
  "div",
1795
1160
  {
1796
1161
  className: "px-2 py-1 rounded bg-gray-800 mr-2 last:mr-0",
1797
- children: /* @__PURE__ */ p.jsxs("span", { className: "font-mono text-white", children: [
1798
- /* @__PURE__ */ p.jsx("strong", { className: "underline", children: m.name.slice(0, h) }),
1799
- m.name.slice(h)
1162
+ children: /* @__PURE__ */ _("span", { className: "font-mono text-white", children: [
1163
+ /* @__PURE__ */ m("strong", { className: "underline", children: c.name.slice(0, u) }),
1164
+ c.name.slice(u)
1800
1165
  ] })
1801
1166
  },
1802
- m.name
1167
+ c.name
1803
1168
  );
1804
1169
  }) }) }) });
1805
- }, mn = `:host {
1170
+ }, pe = ({
1171
+ state: r,
1172
+ actions: e,
1173
+ outputRef: n
1174
+ }) => /* @__PURE__ */ _("div", { className: "innerContainer", children: [
1175
+ /* @__PURE__ */ m("div", { className: "flex-1 min-h-0 pt-3 px-4", children: /* @__PURE__ */ m(Ve, { output: r.output, outputRef: n }) }),
1176
+ /* @__PURE__ */ _("div", { children: [
1177
+ /* @__PURE__ */ m(Je, { state: r, actions: e }),
1178
+ /* @__PURE__ */ m(Qe, {})
1179
+ ] })
1180
+ ] }), Xe = () => {
1181
+ const [r, e] = R(!1), [n, t] = R(!1), o = F(), [s, a] = R(() => o.initialHeight || null), l = H(null), d = H(null), c = H(!1), u = H(0), p = H(0), { state: k, actions: y } = X();
1182
+ He({
1183
+ onOpen: () => e(!0),
1184
+ onClose: () => t(!0),
1185
+ isVisible: r,
1186
+ showCitadelKey: o.showCitadelKey || "."
1187
+ });
1188
+ const E = w((g) => {
1189
+ var v;
1190
+ if (!c.current) return;
1191
+ const S = g.clientY - u.current, f = (v = o.maxHeight) != null && v.endsWith("vh") ? window.innerHeight * parseInt(o.maxHeight, 10) / 100 : parseInt(o.maxHeight || "80vh", 10), x = Math.min(
1192
+ Math.max(p.current - S, parseInt(o.minHeight || "200", 10)),
1193
+ f
1194
+ );
1195
+ d.current && (d.current.style.height = `${x}px`, d.current.style.bottom = "0", a(`${x}px`));
1196
+ }, [o.maxHeight, o.minHeight]), N = w(() => {
1197
+ c.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", N);
1198
+ }, [E]), i = w((g) => {
1199
+ d.current && (c.current = !0, u.current = g.clientY, p.current = d.current.offsetHeight, document.documentElement.style.userSelect = "none", document.documentElement.style.webkitUserSelect = "none", document.documentElement.style.mozUserSelect = "none", document.documentElement.style.msUserSelect = "none", document.addEventListener("mousemove", E), document.addEventListener("mouseup", N));
1200
+ }, [E, N]);
1201
+ A(() => () => {
1202
+ document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", N);
1203
+ }, [E, N]);
1204
+ const h = w(() => {
1205
+ n && (e(!1), t(!1));
1206
+ }, [n]);
1207
+ return $e({
1208
+ isVisible: r,
1209
+ isClosing: n,
1210
+ onAnimationComplete: h
1211
+ }), r ? /* @__PURE__ */ _(
1212
+ "div",
1213
+ {
1214
+ ref: d,
1215
+ className: `panelContainer ${r ? "citadel_slideUp" : ""} ${n ? "citadel_slideDown" : ""}`,
1216
+ style: {
1217
+ ...s ? { height: s } : void 0,
1218
+ maxHeight: o.maxHeight
1219
+ },
1220
+ children: [
1221
+ /* @__PURE__ */ m("div", { className: "resizeHandle", onMouseDown: i }),
1222
+ /* @__PURE__ */ m(
1223
+ pe,
1224
+ {
1225
+ state: k,
1226
+ actions: y,
1227
+ outputRef: l
1228
+ }
1229
+ )
1230
+ ]
1231
+ }
1232
+ ) : null;
1233
+ }, Ze = () => {
1234
+ const { state: r, actions: e } = X(), n = H(null);
1235
+ return /* @__PURE__ */ m(
1236
+ "div",
1237
+ {
1238
+ className: "inlineContainer",
1239
+ "data-testid": "citadel-inline-container",
1240
+ children: /* @__PURE__ */ m(
1241
+ pe,
1242
+ {
1243
+ state: r,
1244
+ actions: e,
1245
+ outputRef: n
1246
+ }
1247
+ )
1248
+ }
1249
+ );
1250
+ }, re = `:host {
1806
1251
  --citadel-bg: rgb(17, 24, 39);
1807
1252
  --citadel-text: rgba(255, 255, 255, 0.87);
1808
1253
  --citadel-border: rgb(55, 65, 81);
@@ -1813,22 +1258,38 @@ const jt = () => {
1813
1258
  --citadel-default-height: 35vh;
1814
1259
  --citadel-error: rgb(239, 68, 68);
1815
1260
 
1816
- height: var(--citadel-default-height);
1817
- max-height: var(--citadel-max-height);
1818
- min-height: var(--citadel-min-height);
1819
- width: 100%;
1261
+ display: block;
1262
+ pointer-events: auto;
1263
+ font-synthesis: none;
1264
+ text-rendering: optimizeLegibility;
1265
+ -webkit-font-smoothing: antialiased;
1266
+ -moz-osx-font-smoothing: grayscale;
1267
+ }
1820
1268
 
1269
+ :host([data-display-mode="panel"]) {
1821
1270
  position: fixed;
1822
1271
  bottom: 0;
1823
1272
  left: 0;
1824
1273
  right: 0;
1274
+ width: 100%;
1275
+ height: var(--citadel-default-height);
1276
+ max-height: var(--citadel-max-height);
1277
+ min-height: var(--citadel-min-height);
1278
+ z-index: 2147483647; /* Maximum z-index value */
1825
1279
  overflow: hidden;
1280
+ }
1826
1281
 
1827
- pointer-events: auto;
1828
- font-synthesis: none;
1829
- text-rendering: optimizeLegibility;
1830
- -webkit-font-smoothing: antialiased;
1831
- -moz-osx-font-smoothing: grayscale;
1282
+ :host([data-display-mode="inline"]) {
1283
+ position: relative;
1284
+ bottom: auto;
1285
+ left: auto;
1286
+ right: auto;
1287
+ z-index: auto;
1288
+ width: 100%;
1289
+ height: 100%;
1290
+ max-height: none;
1291
+ min-height: 0;
1292
+ overflow: hidden;
1832
1293
  }
1833
1294
 
1834
1295
  button {
@@ -1890,10 +1351,9 @@ a:hover {
1890
1351
  .text-left {
1891
1352
  text-align: left;
1892
1353
  }
1354
+ `, oe = `/* Keep only component-specific styles here */
1893
1355
 
1894
- `, pn = `/* Keep only component-specific styles here */
1895
-
1896
- .container {
1356
+ .panelContainer {
1897
1357
  position: fixed;
1898
1358
  height: var(--citadel-default-height);
1899
1359
  min-height: var(--citadel-min-height);
@@ -1911,6 +1371,7 @@ a:hover {
1911
1371
 
1912
1372
  .innerContainer {
1913
1373
  height: 100%;
1374
+ flex: 1;
1914
1375
  width: 100%;
1915
1376
  display: flex;
1916
1377
  flex-direction: column;
@@ -1961,10 +1422,21 @@ a:hover {
1961
1422
  .citadel_slideDown {
1962
1423
  animation: citadel_slideDown 0.2s ease-out forwards;
1963
1424
  }
1964
- `, fn = `@tailwind base;
1425
+
1426
+ .inlineContainer {
1427
+ position: relative;
1428
+ width: 100%;
1429
+ height: 100%;
1430
+ display: flex;
1431
+ flex-direction: column;
1432
+ background-color: var(--citadel-bg);
1433
+ overflow: hidden;
1434
+ box-sizing: border-box;
1435
+ }
1436
+ `, se = `@tailwind base;
1965
1437
  @tailwind components;
1966
1438
  @tailwind utilities;
1967
- `, It = `*, ::before, ::after {
1439
+ `, en = `*, ::before, ::after {
1968
1440
  --tw-border-spacing-x: 0;
1969
1441
  --tw-border-spacing-y: 0;
1970
1442
  --tw-translate-x: 0;
@@ -2781,112 +2253,75 @@ video {
2781
2253
  .last\\:mr-0:last-child {
2782
2254
  margin-right: 0px;
2783
2255
  }
2784
- `, $t = ({
2785
- config: o = M,
2786
- commandRegistry: n = new Ie(),
2787
- containerId: t = null
2788
- }) => (z(() => {
2789
- D.configure({
2790
- level: o.logLevel || M.logLevel || we.ERROR,
2791
- prefix: "[Citadel]"
2792
- });
2793
- const r = new Sn(n, o), a = t ? document.getElementById(t) : document.body;
2794
- return a ? a.appendChild(r) : (console.warn(`Container with id "${t}" not found, falling back to body`), document.body.appendChild(r)), () => {
2795
- var i;
2796
- (i = r.parentElement) == null || i.removeChild(r);
2797
- };
2798
- }, [n, t, o]), null);
2799
- class Sn extends HTMLElement {
2800
- constructor(t, r) {
2256
+ `, cn = ({
2257
+ config: r = z,
2258
+ commandRegistry: e = new Q(),
2259
+ containerId: n = null
2260
+ }) => {
2261
+ const t = H(null), o = r.displayMode ?? z.displayMode ?? "panel";
2262
+ return A(() => {
2263
+ C.configure({
2264
+ level: r.logLevel || z.logLevel || W.ERROR,
2265
+ prefix: "[Citadel]"
2266
+ });
2267
+ const s = new he(e, r), a = o === "inline" && !n, l = a ? t.current : n ? document.getElementById(n) : document.body;
2268
+ if (l)
2269
+ l.appendChild(s);
2270
+ else {
2271
+ if (a) {
2272
+ console.warn("[Citadel] No host available for inline mode; skipping mount.");
2273
+ return;
2274
+ }
2275
+ console.warn(`Container with id "${n}" not found, falling back to body`), document.body.appendChild(s);
2276
+ }
2277
+ return () => {
2278
+ var d;
2279
+ (d = s.parentElement) == null || d.removeChild(s);
2280
+ };
2281
+ }, [e, n, r, o]), o === "inline" && !n ? /* @__PURE__ */ m("div", { ref: t, style: { width: "100%", height: "100%" } }) : null;
2282
+ };
2283
+ class he extends HTMLElement {
2284
+ constructor(n, t) {
2285
+ var s;
2801
2286
  super();
2802
- A(this, "shadow");
2803
- A(this, "root", null);
2804
- A(this, "commandRegistry");
2805
- A(this, "config");
2806
- this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry = t, this.config = r;
2287
+ b(this, "shadow");
2288
+ b(this, "root", null);
2289
+ b(this, "commandRegistry");
2290
+ b(this, "config");
2291
+ this.shadow = this.attachShadow({ mode: "open" }), this.commandRegistry = n, this.config = t;
2292
+ const o = ((s = this.config) == null ? void 0 : s.displayMode) ?? "panel";
2293
+ this.setAttribute("data-display-mode", o);
2807
2294
  }
2808
2295
  connectedCallback() {
2809
2296
  try {
2810
- const r = [mn, pn, fn, It].map((a) => {
2811
- const i = new CSSStyleSheet();
2812
- return i.replaceSync(a), i;
2297
+ const t = [re, oe, se, en].map((o) => {
2298
+ const s = new CSSStyleSheet();
2299
+ return s.replaceSync(o), s;
2813
2300
  });
2814
- this.shadow.adoptedStyleSheets = [...r];
2301
+ this.shadow.adoptedStyleSheets = [...t];
2815
2302
  } catch {
2816
- const r = [mn, pn, fn].join(`
2817
- `), a = document.createElement("style");
2818
- a.textContent = r, this.shadow.appendChild(a);
2303
+ const t = [re, oe, se].join(`
2304
+ `), o = document.createElement("style");
2305
+ o.textContent = t, this.shadow.appendChild(o);
2819
2306
  }
2820
- const t = document.createElement("div");
2821
- t.id = "citadel-root", this.shadow.appendChild(t), this.root = Oe(t), this.root.render(
2822
- /* @__PURE__ */ p.jsx(xt, { config: this.config || M, commandRegistry: this.commandRegistry, children: /* @__PURE__ */ p.jsx(Dt, {}) })
2307
+ const n = document.createElement("div");
2308
+ n.id = "citadel-root", n.style.width = "100%", n.style.height = "100%", this.shadow.appendChild(n), this.root = xe(n), this.root.render(
2309
+ /* @__PURE__ */ m(Ie, { config: this.config || z, commandRegistry: this.commandRegistry, children: /* @__PURE__ */ m(nn, {}) })
2823
2310
  );
2824
2311
  }
2825
2312
  }
2826
- customElements.define("citadel-element", Sn);
2827
- const Dt = () => {
2828
- const [o, n] = Y(!1), [t, r] = Y(!1), a = ce(), [i, u] = Y(() => a.initialHeight || null), f = X(null), c = X(null), m = X(!1), h = X(0), b = X(0), { state: _, actions: S } = Cn();
2829
- ot({
2830
- onOpen: () => n(!0),
2831
- onClose: () => r(!0),
2832
- isVisible: o,
2833
- showCitadelKey: a.showCitadelKey || "."
2834
- });
2835
- const U = R((w) => {
2836
- c.current && (m.current = !0, h.current = w.clientY, b.current = c.current.offsetHeight, document.documentElement.style.userSelect = "none", document.documentElement.style.webkitUserSelect = "none", document.documentElement.style.mozUserSelect = "none", document.documentElement.style.msUserSelect = "none", document.addEventListener("mousemove", I), document.addEventListener("mouseup", d));
2837
- }, []), I = R((w) => {
2838
- var P;
2839
- if (!m.current) return;
2840
- const N = w.clientY - h.current, k = (P = a.maxHeight) != null && P.endsWith("vh") ? window.innerHeight * parseInt(a.maxHeight, 10) / 100 : parseInt(a.maxHeight || "80vh", 10), j = Math.min(
2841
- Math.max(b.current - N, parseInt(a.minHeight || "200", 10)),
2842
- k
2843
- );
2844
- c.current && (c.current.style.height = `${j}px`, c.current.style.bottom = "0", u(`${j}px`));
2845
- }, [a.maxHeight, a.minHeight]), d = R(() => {
2846
- m.current = !1, document.documentElement.style.userSelect = "", document.documentElement.style.webkitUserSelect = "", document.documentElement.style.mozUserSelect = "", document.documentElement.style.msUserSelect = "", document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", d);
2847
- }, [I]);
2848
- z(() => () => {
2849
- document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", d);
2850
- }, [I, d]);
2851
- const y = R(() => {
2852
- t && (n(!1), r(!1));
2853
- }, [t]);
2854
- return dt({
2855
- isVisible: o,
2856
- isClosing: t,
2857
- onAnimationComplete: y
2858
- }), o ? /* @__PURE__ */ p.jsxs(
2859
- "div",
2860
- {
2861
- ref: c,
2862
- className: `container ${o ? "citadel_slideUp" : ""} ${t ? "citadel_slideDown" : ""}`,
2863
- style: {
2864
- ...i ? { height: i } : void 0,
2865
- maxHeight: a.maxHeight
2866
- },
2867
- children: [
2868
- /* @__PURE__ */ p.jsx("div", { className: "resizeHandle", onMouseDown: U }),
2869
- /* @__PURE__ */ p.jsxs("div", { className: "innerContainer", children: [
2870
- /* @__PURE__ */ p.jsx("div", { className: "flex-1 min-h-0 pt-3 px-4", children: /* @__PURE__ */ p.jsx(Ot, { output: _.output, outputRef: f }) }),
2871
- /* @__PURE__ */ p.jsxs("div", { children: [
2872
- /* @__PURE__ */ p.jsx(At, { state: _, actions: S }),
2873
- /* @__PURE__ */ p.jsx(Nt, {})
2874
- ] })
2875
- ] })
2876
- ]
2877
- }
2878
- ) : null;
2879
- };
2313
+ customElements.define("citadel-element", he);
2314
+ const nn = () => (F().displayMode ?? "panel") === "inline" ? /* @__PURE__ */ m(Ze, {}) : /* @__PURE__ */ m(Xe, {});
2880
2315
  export {
2881
- $t as Citadel,
2882
- Ie as CommandRegistry,
2883
- Z as CommandResult,
2884
- ie as CommandStatus,
2885
- Et as DEFAULT_CURSOR_CONFIGS,
2886
- mt as ErrorCommandResult,
2887
- Mt as ImageCommandResult,
2888
- Ht as JsonCommandResult,
2889
- Ct as OutputItem,
2890
- pt as PendingCommandResult,
2891
- hn as TextCommandResult
2316
+ cn as Citadel,
2317
+ Q as CommandRegistry,
2318
+ U as CommandResult,
2319
+ T as CommandStatus,
2320
+ We as DEFAULT_CURSOR_CONFIGS,
2321
+ ve as ErrorCommandResult,
2322
+ ln as ImageCommandResult,
2323
+ an as JsonCommandResult,
2324
+ Re as OutputItem,
2325
+ Ce as PendingCommandResult,
2326
+ ae as TextCommandResult
2892
2327
  };