@antcde/vue-utils 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1362 @@
1
+ import { useColorMode as _t, objectPick as It, objectOmit as nt, useMagicKeys as Et, whenever as Ot, useAsyncState as At, watchDebounced as Pt } from "@vueuse/core";
2
+ import { computed as S, ref as g, watch as z, onBeforeUnmount as ot, inject as jt, unref as Tt, watchEffect as Ct } from "vue";
3
+ import { useI18n as H } from "vue-i18n";
4
+ import { newCommsClient as kt, newCommsHost as Lt } from "@antcde/connect-ts";
5
+ function Ue(e, r) {
6
+ const t = _t(r), n = S(() => e.context.value.darkMode), o = S(() => {
7
+ switch (n.value) {
8
+ case null:
9
+ return "auto";
10
+ case !0:
11
+ return "dark";
12
+ case !1:
13
+ return "light";
14
+ default:
15
+ return t.value;
16
+ }
17
+ }), i = S(() => {
18
+ switch (o.value) {
19
+ case "light":
20
+ case "auto":
21
+ return !1;
22
+ case "dark":
23
+ return !0;
24
+ }
25
+ });
26
+ return Object.assign(
27
+ o,
28
+ { host: n, isDark: i },
29
+ It(t, ["state", "system", "store"])
30
+ );
31
+ }
32
+ function Re(e, r) {
33
+ const t = g(H(r));
34
+ return z(
35
+ e.locales.value,
36
+ ({ locale: n }) => t.value = H({ ...r, locale: n })
37
+ ), Object.keys(t.value).reduce(
38
+ (n, o) => Object.defineProperty(n, o, {
39
+ get: () => t.value[o],
40
+ enumerable: !0
41
+ }),
42
+ {}
43
+ );
44
+ }
45
+ var G = function(e, r) {
46
+ return G = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
47
+ t.__proto__ = n;
48
+ } || function(t, n) {
49
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
50
+ }, G(e, r);
51
+ };
52
+ function x(e, r) {
53
+ if (typeof r != "function" && r !== null)
54
+ throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
55
+ G(e, r);
56
+ function t() {
57
+ this.constructor = e;
58
+ }
59
+ e.prototype = r === null ? Object.create(r) : (t.prototype = r.prototype, new t());
60
+ }
61
+ function Ut(e, r, t, n) {
62
+ function o(i) {
63
+ return i instanceof t ? i : new t(function(u) {
64
+ u(i);
65
+ });
66
+ }
67
+ return new (t || (t = Promise))(function(i, u) {
68
+ function c(l) {
69
+ try {
70
+ s(n.next(l));
71
+ } catch (p) {
72
+ u(p);
73
+ }
74
+ }
75
+ function a(l) {
76
+ try {
77
+ s(n.throw(l));
78
+ } catch (p) {
79
+ u(p);
80
+ }
81
+ }
82
+ function s(l) {
83
+ l.done ? i(l.value) : o(l.value).then(c, a);
84
+ }
85
+ s((n = n.apply(e, r || [])).next());
86
+ });
87
+ }
88
+ function it(e, r) {
89
+ var t = { label: 0, sent: function() {
90
+ if (i[0] & 1) throw i[1];
91
+ return i[1];
92
+ }, trys: [], ops: [] }, n, o, i, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
93
+ return u.next = c(0), u.throw = c(1), u.return = c(2), typeof Symbol == "function" && (u[Symbol.iterator] = function() {
94
+ return this;
95
+ }), u;
96
+ function c(s) {
97
+ return function(l) {
98
+ return a([s, l]);
99
+ };
100
+ }
101
+ function a(s) {
102
+ if (n) throw new TypeError("Generator is already executing.");
103
+ for (; u && (u = 0, s[0] && (t = 0)), t; ) try {
104
+ if (n = 1, o && (i = s[0] & 2 ? o.return : s[0] ? o.throw || ((i = o.return) && i.call(o), 0) : o.next) && !(i = i.call(o, s[1])).done) return i;
105
+ switch (o = 0, i && (s = [s[0] & 2, i.value]), s[0]) {
106
+ case 0:
107
+ case 1:
108
+ i = s;
109
+ break;
110
+ case 4:
111
+ return t.label++, { value: s[1], done: !1 };
112
+ case 5:
113
+ t.label++, o = s[1], s = [0];
114
+ continue;
115
+ case 7:
116
+ s = t.ops.pop(), t.trys.pop();
117
+ continue;
118
+ default:
119
+ if (i = t.trys, !(i = i.length > 0 && i[i.length - 1]) && (s[0] === 6 || s[0] === 2)) {
120
+ t = 0;
121
+ continue;
122
+ }
123
+ if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
124
+ t.label = s[1];
125
+ break;
126
+ }
127
+ if (s[0] === 6 && t.label < i[1]) {
128
+ t.label = i[1], i = s;
129
+ break;
130
+ }
131
+ if (i && t.label < i[2]) {
132
+ t.label = i[2], t.ops.push(s);
133
+ break;
134
+ }
135
+ i[2] && t.ops.pop(), t.trys.pop();
136
+ continue;
137
+ }
138
+ s = r.call(e, t);
139
+ } catch (l) {
140
+ s = [6, l], o = 0;
141
+ } finally {
142
+ n = i = 0;
143
+ }
144
+ if (s[0] & 5) throw s[1];
145
+ return { value: s[0] ? s[1] : void 0, done: !0 };
146
+ }
147
+ }
148
+ function P(e) {
149
+ var r = typeof Symbol == "function" && Symbol.iterator, t = r && e[r], n = 0;
150
+ if (t) return t.call(e);
151
+ if (e && typeof e.length == "number") return {
152
+ next: function() {
153
+ return e && n >= e.length && (e = void 0), { value: e && e[n++], done: !e };
154
+ }
155
+ };
156
+ throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
157
+ }
158
+ function R(e, r) {
159
+ var t = typeof Symbol == "function" && e[Symbol.iterator];
160
+ if (!t) return e;
161
+ var n = t.call(e), o, i = [], u;
162
+ try {
163
+ for (; (r === void 0 || r-- > 0) && !(o = n.next()).done; ) i.push(o.value);
164
+ } catch (c) {
165
+ u = { error: c };
166
+ } finally {
167
+ try {
168
+ o && !o.done && (t = n.return) && t.call(n);
169
+ } finally {
170
+ if (u) throw u.error;
171
+ }
172
+ }
173
+ return i;
174
+ }
175
+ function F(e, r, t) {
176
+ if (t || arguments.length === 2) for (var n = 0, o = r.length, i; n < o; n++)
177
+ (i || !(n in r)) && (i || (i = Array.prototype.slice.call(r, 0, n)), i[n] = r[n]);
178
+ return e.concat(i || Array.prototype.slice.call(r));
179
+ }
180
+ function A(e) {
181
+ return this instanceof A ? (this.v = e, this) : new A(e);
182
+ }
183
+ function Rt(e, r, t) {
184
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
185
+ var n = t.apply(e, r || []), o, i = [];
186
+ return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), c("next"), c("throw"), c("return", u), o[Symbol.asyncIterator] = function() {
187
+ return this;
188
+ }, o;
189
+ function u(h) {
190
+ return function(b) {
191
+ return Promise.resolve(b).then(h, p);
192
+ };
193
+ }
194
+ function c(h, b) {
195
+ n[h] && (o[h] = function(v) {
196
+ return new Promise(function(O, f) {
197
+ i.push([h, v, O, f]) > 1 || a(h, v);
198
+ });
199
+ }, b && (o[h] = b(o[h])));
200
+ }
201
+ function a(h, b) {
202
+ try {
203
+ s(n[h](b));
204
+ } catch (v) {
205
+ y(i[0][3], v);
206
+ }
207
+ }
208
+ function s(h) {
209
+ h.value instanceof A ? Promise.resolve(h.value.v).then(l, p) : y(i[0][2], h);
210
+ }
211
+ function l(h) {
212
+ a("next", h);
213
+ }
214
+ function p(h) {
215
+ a("throw", h);
216
+ }
217
+ function y(h, b) {
218
+ h(b), i.shift(), i.length && a(i[0][0], i[0][1]);
219
+ }
220
+ }
221
+ function Ft(e) {
222
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
223
+ var r = e[Symbol.asyncIterator], t;
224
+ return r ? r.call(e) : (e = typeof P == "function" ? P(e) : e[Symbol.iterator](), t = {}, n("next"), n("throw"), n("return"), t[Symbol.asyncIterator] = function() {
225
+ return this;
226
+ }, t);
227
+ function n(i) {
228
+ t[i] = e[i] && function(u) {
229
+ return new Promise(function(c, a) {
230
+ u = e[i](u), o(c, a, u.done, u.value);
231
+ });
232
+ };
233
+ }
234
+ function o(i, u, c, a) {
235
+ Promise.resolve(a).then(function(s) {
236
+ i({ value: s, done: c });
237
+ }, u);
238
+ }
239
+ }
240
+ function d(e) {
241
+ return typeof e == "function";
242
+ }
243
+ function ut(e) {
244
+ var r = function(n) {
245
+ Error.call(n), n.stack = new Error().stack;
246
+ }, t = e(r);
247
+ return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
248
+ }
249
+ var D = ut(function(e) {
250
+ return function(t) {
251
+ e(this), this.message = t ? t.length + ` errors occurred during unsubscription:
252
+ ` + t.map(function(n, o) {
253
+ return o + 1 + ") " + n.toString();
254
+ }).join(`
255
+ `) : "", this.name = "UnsubscriptionError", this.errors = t;
256
+ };
257
+ });
258
+ function M(e, r) {
259
+ if (e) {
260
+ var t = e.indexOf(r);
261
+ 0 <= t && e.splice(t, 1);
262
+ }
263
+ }
264
+ var j = function() {
265
+ function e(r) {
266
+ this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
267
+ }
268
+ return e.prototype.unsubscribe = function() {
269
+ var r, t, n, o, i;
270
+ if (!this.closed) {
271
+ this.closed = !0;
272
+ var u = this._parentage;
273
+ if (u)
274
+ if (this._parentage = null, Array.isArray(u))
275
+ try {
276
+ for (var c = P(u), a = c.next(); !a.done; a = c.next()) {
277
+ var s = a.value;
278
+ s.remove(this);
279
+ }
280
+ } catch (v) {
281
+ r = { error: v };
282
+ } finally {
283
+ try {
284
+ a && !a.done && (t = c.return) && t.call(c);
285
+ } finally {
286
+ if (r) throw r.error;
287
+ }
288
+ }
289
+ else
290
+ u.remove(this);
291
+ var l = this.initialTeardown;
292
+ if (d(l))
293
+ try {
294
+ l();
295
+ } catch (v) {
296
+ i = v instanceof D ? v.errors : [v];
297
+ }
298
+ var p = this._finalizers;
299
+ if (p) {
300
+ this._finalizers = null;
301
+ try {
302
+ for (var y = P(p), h = y.next(); !h.done; h = y.next()) {
303
+ var b = h.value;
304
+ try {
305
+ Q(b);
306
+ } catch (v) {
307
+ i = i ?? [], v instanceof D ? i = F(F([], R(i)), R(v.errors)) : i.push(v);
308
+ }
309
+ }
310
+ } catch (v) {
311
+ n = { error: v };
312
+ } finally {
313
+ try {
314
+ h && !h.done && (o = y.return) && o.call(y);
315
+ } finally {
316
+ if (n) throw n.error;
317
+ }
318
+ }
319
+ }
320
+ if (i)
321
+ throw new D(i);
322
+ }
323
+ }, e.prototype.add = function(r) {
324
+ var t;
325
+ if (r && r !== this)
326
+ if (this.closed)
327
+ Q(r);
328
+ else {
329
+ if (r instanceof e) {
330
+ if (r.closed || r._hasParent(this))
331
+ return;
332
+ r._addParent(this);
333
+ }
334
+ (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(r);
335
+ }
336
+ }, e.prototype._hasParent = function(r) {
337
+ var t = this._parentage;
338
+ return t === r || Array.isArray(t) && t.includes(r);
339
+ }, e.prototype._addParent = function(r) {
340
+ var t = this._parentage;
341
+ this._parentage = Array.isArray(t) ? (t.push(r), t) : t ? [t, r] : r;
342
+ }, e.prototype._removeParent = function(r) {
343
+ var t = this._parentage;
344
+ t === r ? this._parentage = null : Array.isArray(t) && M(t, r);
345
+ }, e.prototype.remove = function(r) {
346
+ var t = this._finalizers;
347
+ t && M(t, r), r instanceof e && r._removeParent(this);
348
+ }, e.EMPTY = function() {
349
+ var r = new e();
350
+ return r.closed = !0, r;
351
+ }(), e;
352
+ }(), st = j.EMPTY;
353
+ function ct(e) {
354
+ return e instanceof j || e && "closed" in e && d(e.remove) && d(e.add) && d(e.unsubscribe);
355
+ }
356
+ function Q(e) {
357
+ d(e) ? e() : e.unsubscribe();
358
+ }
359
+ var Mt = {
360
+ Promise: void 0
361
+ }, Vt = {
362
+ setTimeout: function(e, r) {
363
+ for (var t = [], n = 2; n < arguments.length; n++)
364
+ t[n - 2] = arguments[n];
365
+ return setTimeout.apply(void 0, F([e, r], R(t)));
366
+ },
367
+ clearTimeout: function(e) {
368
+ return clearTimeout(e);
369
+ },
370
+ delegate: void 0
371
+ };
372
+ function at(e) {
373
+ Vt.setTimeout(function() {
374
+ throw e;
375
+ });
376
+ }
377
+ function X() {
378
+ }
379
+ function U(e) {
380
+ e();
381
+ }
382
+ var q = function(e) {
383
+ x(r, e);
384
+ function r(t) {
385
+ var n = e.call(this) || this;
386
+ return n.isStopped = !1, t ? (n.destination = t, ct(t) && t.add(n)) : n.destination = Yt, n;
387
+ }
388
+ return r.create = function(t, n, o) {
389
+ return new K(t, n, o);
390
+ }, r.prototype.next = function(t) {
391
+ this.isStopped || this._next(t);
392
+ }, r.prototype.error = function(t) {
393
+ this.isStopped || (this.isStopped = !0, this._error(t));
394
+ }, r.prototype.complete = function() {
395
+ this.isStopped || (this.isStopped = !0, this._complete());
396
+ }, r.prototype.unsubscribe = function() {
397
+ this.closed || (this.isStopped = !0, e.prototype.unsubscribe.call(this), this.destination = null);
398
+ }, r.prototype._next = function(t) {
399
+ this.destination.next(t);
400
+ }, r.prototype._error = function(t) {
401
+ try {
402
+ this.destination.error(t);
403
+ } finally {
404
+ this.unsubscribe();
405
+ }
406
+ }, r.prototype._complete = function() {
407
+ try {
408
+ this.destination.complete();
409
+ } finally {
410
+ this.unsubscribe();
411
+ }
412
+ }, r;
413
+ }(j), Bt = function() {
414
+ function e(r) {
415
+ this.partialObserver = r;
416
+ }
417
+ return e.prototype.next = function(r) {
418
+ var t = this.partialObserver;
419
+ if (t.next)
420
+ try {
421
+ t.next(r);
422
+ } catch (n) {
423
+ L(n);
424
+ }
425
+ }, e.prototype.error = function(r) {
426
+ var t = this.partialObserver;
427
+ if (t.error)
428
+ try {
429
+ t.error(r);
430
+ } catch (n) {
431
+ L(n);
432
+ }
433
+ else
434
+ L(r);
435
+ }, e.prototype.complete = function() {
436
+ var r = this.partialObserver;
437
+ if (r.complete)
438
+ try {
439
+ r.complete();
440
+ } catch (t) {
441
+ L(t);
442
+ }
443
+ }, e;
444
+ }(), K = function(e) {
445
+ x(r, e);
446
+ function r(t, n, o) {
447
+ var i = e.call(this) || this, u;
448
+ return d(t) || !t ? u = {
449
+ next: t ?? void 0,
450
+ error: n ?? void 0,
451
+ complete: o ?? void 0
452
+ } : u = t, i.destination = new Bt(u), i;
453
+ }
454
+ return r;
455
+ }(q);
456
+ function L(e) {
457
+ at(e);
458
+ }
459
+ function Dt(e) {
460
+ throw e;
461
+ }
462
+ var Yt = {
463
+ closed: !0,
464
+ next: X,
465
+ error: Dt,
466
+ complete: X
467
+ }, W = function() {
468
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
469
+ }();
470
+ function B(e) {
471
+ return e;
472
+ }
473
+ function zt(e) {
474
+ return e.length === 0 ? B : e.length === 1 ? e[0] : function(t) {
475
+ return e.reduce(function(n, o) {
476
+ return o(n);
477
+ }, t);
478
+ };
479
+ }
480
+ var w = function() {
481
+ function e(r) {
482
+ r && (this._subscribe = r);
483
+ }
484
+ return e.prototype.lift = function(r) {
485
+ var t = new e();
486
+ return t.source = this, t.operator = r, t;
487
+ }, e.prototype.subscribe = function(r, t, n) {
488
+ var o = this, i = Gt(r) ? r : new K(r, t, n);
489
+ return U(function() {
490
+ var u = o, c = u.operator, a = u.source;
491
+ i.add(c ? c.call(i, a) : a ? o._subscribe(i) : o._trySubscribe(i));
492
+ }), i;
493
+ }, e.prototype._trySubscribe = function(r) {
494
+ try {
495
+ return this._subscribe(r);
496
+ } catch (t) {
497
+ r.error(t);
498
+ }
499
+ }, e.prototype.forEach = function(r, t) {
500
+ var n = this;
501
+ return t = Z(t), new t(function(o, i) {
502
+ var u = new K({
503
+ next: function(c) {
504
+ try {
505
+ r(c);
506
+ } catch (a) {
507
+ i(a), u.unsubscribe();
508
+ }
509
+ },
510
+ error: i,
511
+ complete: o
512
+ });
513
+ n.subscribe(u);
514
+ });
515
+ }, e.prototype._subscribe = function(r) {
516
+ var t;
517
+ return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(r);
518
+ }, e.prototype[W] = function() {
519
+ return this;
520
+ }, e.prototype.pipe = function() {
521
+ for (var r = [], t = 0; t < arguments.length; t++)
522
+ r[t] = arguments[t];
523
+ return zt(r)(this);
524
+ }, e.prototype.toPromise = function(r) {
525
+ var t = this;
526
+ return r = Z(r), new r(function(n, o) {
527
+ var i;
528
+ t.subscribe(function(u) {
529
+ return i = u;
530
+ }, function(u) {
531
+ return o(u);
532
+ }, function() {
533
+ return n(i);
534
+ });
535
+ });
536
+ }, e.create = function(r) {
537
+ return new e(r);
538
+ }, e;
539
+ }();
540
+ function Z(e) {
541
+ var r;
542
+ return (r = e ?? Mt.Promise) !== null && r !== void 0 ? r : Promise;
543
+ }
544
+ function Ht(e) {
545
+ return e && d(e.next) && d(e.error) && d(e.complete);
546
+ }
547
+ function Gt(e) {
548
+ return e && e instanceof q || Ht(e) && ct(e);
549
+ }
550
+ function Kt(e) {
551
+ return d(e == null ? void 0 : e.lift);
552
+ }
553
+ function I(e) {
554
+ return function(r) {
555
+ if (Kt(r))
556
+ return r.lift(function(t) {
557
+ try {
558
+ return e(t, this);
559
+ } catch (n) {
560
+ this.error(n);
561
+ }
562
+ });
563
+ throw new TypeError("Unable to lift unknown Observable type");
564
+ };
565
+ }
566
+ function _(e, r, t, n, o) {
567
+ return new qt(e, r, t, n, o);
568
+ }
569
+ var qt = function(e) {
570
+ x(r, e);
571
+ function r(t, n, o, i, u, c) {
572
+ var a = e.call(this, t) || this;
573
+ return a.onFinalize = u, a.shouldUnsubscribe = c, a._next = n ? function(s) {
574
+ try {
575
+ n(s);
576
+ } catch (l) {
577
+ t.error(l);
578
+ }
579
+ } : e.prototype._next, a._error = i ? function(s) {
580
+ try {
581
+ i(s);
582
+ } catch (l) {
583
+ t.error(l);
584
+ } finally {
585
+ this.unsubscribe();
586
+ }
587
+ } : e.prototype._error, a._complete = o ? function() {
588
+ try {
589
+ o();
590
+ } catch (s) {
591
+ t.error(s);
592
+ } finally {
593
+ this.unsubscribe();
594
+ }
595
+ } : e.prototype._complete, a;
596
+ }
597
+ return r.prototype.unsubscribe = function() {
598
+ var t;
599
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
600
+ var n = this.closed;
601
+ e.prototype.unsubscribe.call(this), !n && ((t = this.onFinalize) === null || t === void 0 || t.call(this));
602
+ }
603
+ }, r;
604
+ }(q), Wt = ut(function(e) {
605
+ return function() {
606
+ e(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
607
+ };
608
+ }), $ = function(e) {
609
+ x(r, e);
610
+ function r() {
611
+ var t = e.call(this) || this;
612
+ return t.closed = !1, t.currentObservers = null, t.observers = [], t.isStopped = !1, t.hasError = !1, t.thrownError = null, t;
613
+ }
614
+ return r.prototype.lift = function(t) {
615
+ var n = new N(this, this);
616
+ return n.operator = t, n;
617
+ }, r.prototype._throwIfClosed = function() {
618
+ if (this.closed)
619
+ throw new Wt();
620
+ }, r.prototype.next = function(t) {
621
+ var n = this;
622
+ U(function() {
623
+ var o, i;
624
+ if (n._throwIfClosed(), !n.isStopped) {
625
+ n.currentObservers || (n.currentObservers = Array.from(n.observers));
626
+ try {
627
+ for (var u = P(n.currentObservers), c = u.next(); !c.done; c = u.next()) {
628
+ var a = c.value;
629
+ a.next(t);
630
+ }
631
+ } catch (s) {
632
+ o = { error: s };
633
+ } finally {
634
+ try {
635
+ c && !c.done && (i = u.return) && i.call(u);
636
+ } finally {
637
+ if (o) throw o.error;
638
+ }
639
+ }
640
+ }
641
+ });
642
+ }, r.prototype.error = function(t) {
643
+ var n = this;
644
+ U(function() {
645
+ if (n._throwIfClosed(), !n.isStopped) {
646
+ n.hasError = n.isStopped = !0, n.thrownError = t;
647
+ for (var o = n.observers; o.length; )
648
+ o.shift().error(t);
649
+ }
650
+ });
651
+ }, r.prototype.complete = function() {
652
+ var t = this;
653
+ U(function() {
654
+ if (t._throwIfClosed(), !t.isStopped) {
655
+ t.isStopped = !0;
656
+ for (var n = t.observers; n.length; )
657
+ n.shift().complete();
658
+ }
659
+ });
660
+ }, r.prototype.unsubscribe = function() {
661
+ this.isStopped = this.closed = !0, this.observers = this.currentObservers = null;
662
+ }, Object.defineProperty(r.prototype, "observed", {
663
+ get: function() {
664
+ var t;
665
+ return ((t = this.observers) === null || t === void 0 ? void 0 : t.length) > 0;
666
+ },
667
+ enumerable: !1,
668
+ configurable: !0
669
+ }), r.prototype._trySubscribe = function(t) {
670
+ return this._throwIfClosed(), e.prototype._trySubscribe.call(this, t);
671
+ }, r.prototype._subscribe = function(t) {
672
+ return this._throwIfClosed(), this._checkFinalizedStatuses(t), this._innerSubscribe(t);
673
+ }, r.prototype._innerSubscribe = function(t) {
674
+ var n = this, o = this, i = o.hasError, u = o.isStopped, c = o.observers;
675
+ return i || u ? st : (this.currentObservers = null, c.push(t), new j(function() {
676
+ n.currentObservers = null, M(c, t);
677
+ }));
678
+ }, r.prototype._checkFinalizedStatuses = function(t) {
679
+ var n = this, o = n.hasError, i = n.thrownError, u = n.isStopped;
680
+ o ? t.error(i) : u && t.complete();
681
+ }, r.prototype.asObservable = function() {
682
+ var t = new w();
683
+ return t.source = this, t;
684
+ }, r.create = function(t, n) {
685
+ return new N(t, n);
686
+ }, r;
687
+ }(w), N = function(e) {
688
+ x(r, e);
689
+ function r(t, n) {
690
+ var o = e.call(this) || this;
691
+ return o.destination = t, o.source = n, o;
692
+ }
693
+ return r.prototype.next = function(t) {
694
+ var n, o;
695
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.next) === null || o === void 0 || o.call(n, t);
696
+ }, r.prototype.error = function(t) {
697
+ var n, o;
698
+ (o = (n = this.destination) === null || n === void 0 ? void 0 : n.error) === null || o === void 0 || o.call(n, t);
699
+ }, r.prototype.complete = function() {
700
+ var t, n;
701
+ (n = (t = this.destination) === null || t === void 0 ? void 0 : t.complete) === null || n === void 0 || n.call(t);
702
+ }, r.prototype._subscribe = function(t) {
703
+ var n, o;
704
+ return (o = (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(t)) !== null && o !== void 0 ? o : st;
705
+ }, r;
706
+ }($), Y = function(e) {
707
+ x(r, e);
708
+ function r(t) {
709
+ var n = e.call(this) || this;
710
+ return n._value = t, n;
711
+ }
712
+ return Object.defineProperty(r.prototype, "value", {
713
+ get: function() {
714
+ return this.getValue();
715
+ },
716
+ enumerable: !1,
717
+ configurable: !0
718
+ }), r.prototype._subscribe = function(t) {
719
+ var n = e.prototype._subscribe.call(this, t);
720
+ return !n.closed && t.next(this._value), n;
721
+ }, r.prototype.getValue = function() {
722
+ var t = this, n = t.hasError, o = t.thrownError, i = t._value;
723
+ if (n)
724
+ throw o;
725
+ return this._throwIfClosed(), i;
726
+ }, r.prototype.next = function(t) {
727
+ e.prototype.next.call(this, this._value = t);
728
+ }, r;
729
+ }($), $t = {
730
+ now: function() {
731
+ return Date.now();
732
+ }
733
+ }, Jt = function(e) {
734
+ x(r, e);
735
+ function r(t, n) {
736
+ return e.call(this) || this;
737
+ }
738
+ return r.prototype.schedule = function(t, n) {
739
+ return this;
740
+ }, r;
741
+ }(j), tt = {
742
+ setInterval: function(e, r) {
743
+ for (var t = [], n = 2; n < arguments.length; n++)
744
+ t[n - 2] = arguments[n];
745
+ return setInterval.apply(void 0, F([e, r], R(t)));
746
+ },
747
+ clearInterval: function(e) {
748
+ return clearInterval(e);
749
+ },
750
+ delegate: void 0
751
+ }, Qt = function(e) {
752
+ x(r, e);
753
+ function r(t, n) {
754
+ var o = e.call(this, t, n) || this;
755
+ return o.scheduler = t, o.work = n, o.pending = !1, o;
756
+ }
757
+ return r.prototype.schedule = function(t, n) {
758
+ var o;
759
+ if (n === void 0 && (n = 0), this.closed)
760
+ return this;
761
+ this.state = t;
762
+ var i = this.id, u = this.scheduler;
763
+ return i != null && (this.id = this.recycleAsyncId(u, i, n)), this.pending = !0, this.delay = n, this.id = (o = this.id) !== null && o !== void 0 ? o : this.requestAsyncId(u, this.id, n), this;
764
+ }, r.prototype.requestAsyncId = function(t, n, o) {
765
+ return o === void 0 && (o = 0), tt.setInterval(t.flush.bind(t, this), o);
766
+ }, r.prototype.recycleAsyncId = function(t, n, o) {
767
+ if (o === void 0 && (o = 0), o != null && this.delay === o && this.pending === !1)
768
+ return n;
769
+ n != null && tt.clearInterval(n);
770
+ }, r.prototype.execute = function(t, n) {
771
+ if (this.closed)
772
+ return new Error("executing a cancelled action");
773
+ this.pending = !1;
774
+ var o = this._execute(t, n);
775
+ if (o)
776
+ return o;
777
+ this.pending === !1 && this.id != null && (this.id = this.recycleAsyncId(this.scheduler, this.id, null));
778
+ }, r.prototype._execute = function(t, n) {
779
+ var o = !1, i;
780
+ try {
781
+ this.work(t);
782
+ } catch (u) {
783
+ o = !0, i = u || new Error("Scheduled action threw falsy error");
784
+ }
785
+ if (o)
786
+ return this.unsubscribe(), i;
787
+ }, r.prototype.unsubscribe = function() {
788
+ if (!this.closed) {
789
+ var t = this, n = t.id, o = t.scheduler, i = o.actions;
790
+ this.work = this.state = this.scheduler = null, this.pending = !1, M(i, this), n != null && (this.id = this.recycleAsyncId(o, n, null)), this.delay = null, e.prototype.unsubscribe.call(this);
791
+ }
792
+ }, r;
793
+ }(Jt), et = function() {
794
+ function e(r, t) {
795
+ t === void 0 && (t = e.now), this.schedulerActionCtor = r, this.now = t;
796
+ }
797
+ return e.prototype.schedule = function(r, t, n) {
798
+ return t === void 0 && (t = 0), new this.schedulerActionCtor(this, r).schedule(n, t);
799
+ }, e.now = $t.now, e;
800
+ }(), Xt = function(e) {
801
+ x(r, e);
802
+ function r(t, n) {
803
+ n === void 0 && (n = et.now);
804
+ var o = e.call(this, t, n) || this;
805
+ return o.actions = [], o._active = !1, o;
806
+ }
807
+ return r.prototype.flush = function(t) {
808
+ var n = this.actions;
809
+ if (this._active) {
810
+ n.push(t);
811
+ return;
812
+ }
813
+ var o;
814
+ this._active = !0;
815
+ do
816
+ if (o = t.execute(t.state, t.delay))
817
+ break;
818
+ while (t = n.shift());
819
+ if (this._active = !1, o) {
820
+ for (; t = n.shift(); )
821
+ t.unsubscribe();
822
+ throw o;
823
+ }
824
+ }, r;
825
+ }(et), Zt = new Xt(Qt);
826
+ function Nt(e) {
827
+ return e && d(e.schedule);
828
+ }
829
+ function te(e) {
830
+ return e[e.length - 1];
831
+ }
832
+ function ee(e) {
833
+ return Nt(te(e)) ? e.pop() : void 0;
834
+ }
835
+ var lt = function(e) {
836
+ return e && typeof e.length == "number" && typeof e != "function";
837
+ };
838
+ function ft(e) {
839
+ return d(e == null ? void 0 : e.then);
840
+ }
841
+ function ht(e) {
842
+ return d(e[W]);
843
+ }
844
+ function vt(e) {
845
+ return Symbol.asyncIterator && d(e == null ? void 0 : e[Symbol.asyncIterator]);
846
+ }
847
+ function dt(e) {
848
+ return new TypeError("You provided " + (e !== null && typeof e == "object" ? "an invalid object" : "'" + e + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
849
+ }
850
+ function re() {
851
+ return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
852
+ }
853
+ var pt = re();
854
+ function bt(e) {
855
+ return d(e == null ? void 0 : e[pt]);
856
+ }
857
+ function yt(e) {
858
+ return Rt(this, arguments, function() {
859
+ var t, n, o, i;
860
+ return it(this, function(u) {
861
+ switch (u.label) {
862
+ case 0:
863
+ t = e.getReader(), u.label = 1;
864
+ case 1:
865
+ u.trys.push([1, , 9, 10]), u.label = 2;
866
+ case 2:
867
+ return [4, A(t.read())];
868
+ case 3:
869
+ return n = u.sent(), o = n.value, i = n.done, i ? [4, A(void 0)] : [3, 5];
870
+ case 4:
871
+ return [2, u.sent()];
872
+ case 5:
873
+ return [4, A(o)];
874
+ case 6:
875
+ return [4, u.sent()];
876
+ case 7:
877
+ return u.sent(), [3, 2];
878
+ case 8:
879
+ return [3, 10];
880
+ case 9:
881
+ return t.releaseLock(), [7];
882
+ case 10:
883
+ return [2];
884
+ }
885
+ });
886
+ });
887
+ }
888
+ function mt(e) {
889
+ return d(e == null ? void 0 : e.getReader);
890
+ }
891
+ function T(e) {
892
+ if (e instanceof w)
893
+ return e;
894
+ if (e != null) {
895
+ if (ht(e))
896
+ return ne(e);
897
+ if (lt(e))
898
+ return oe(e);
899
+ if (ft(e))
900
+ return ie(e);
901
+ if (vt(e))
902
+ return wt(e);
903
+ if (bt(e))
904
+ return ue(e);
905
+ if (mt(e))
906
+ return se(e);
907
+ }
908
+ throw dt(e);
909
+ }
910
+ function ne(e) {
911
+ return new w(function(r) {
912
+ var t = e[W]();
913
+ if (d(t.subscribe))
914
+ return t.subscribe(r);
915
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
916
+ });
917
+ }
918
+ function oe(e) {
919
+ return new w(function(r) {
920
+ for (var t = 0; t < e.length && !r.closed; t++)
921
+ r.next(e[t]);
922
+ r.complete();
923
+ });
924
+ }
925
+ function ie(e) {
926
+ return new w(function(r) {
927
+ e.then(function(t) {
928
+ r.closed || (r.next(t), r.complete());
929
+ }, function(t) {
930
+ return r.error(t);
931
+ }).then(null, at);
932
+ });
933
+ }
934
+ function ue(e) {
935
+ return new w(function(r) {
936
+ var t, n;
937
+ try {
938
+ for (var o = P(e), i = o.next(); !i.done; i = o.next()) {
939
+ var u = i.value;
940
+ if (r.next(u), r.closed)
941
+ return;
942
+ }
943
+ } catch (c) {
944
+ t = { error: c };
945
+ } finally {
946
+ try {
947
+ i && !i.done && (n = o.return) && n.call(o);
948
+ } finally {
949
+ if (t) throw t.error;
950
+ }
951
+ }
952
+ r.complete();
953
+ });
954
+ }
955
+ function wt(e) {
956
+ return new w(function(r) {
957
+ ce(e, r).catch(function(t) {
958
+ return r.error(t);
959
+ });
960
+ });
961
+ }
962
+ function se(e) {
963
+ return wt(yt(e));
964
+ }
965
+ function ce(e, r) {
966
+ var t, n, o, i;
967
+ return Ut(this, void 0, void 0, function() {
968
+ var u, c;
969
+ return it(this, function(a) {
970
+ switch (a.label) {
971
+ case 0:
972
+ a.trys.push([0, 5, 6, 11]), t = Ft(e), a.label = 1;
973
+ case 1:
974
+ return [4, t.next()];
975
+ case 2:
976
+ if (n = a.sent(), !!n.done) return [3, 4];
977
+ if (u = n.value, r.next(u), r.closed)
978
+ return [2];
979
+ a.label = 3;
980
+ case 3:
981
+ return [3, 1];
982
+ case 4:
983
+ return [3, 11];
984
+ case 5:
985
+ return c = a.sent(), o = { error: c }, [3, 11];
986
+ case 6:
987
+ return a.trys.push([6, , 9, 10]), n && !n.done && (i = t.return) ? [4, i.call(t)] : [3, 8];
988
+ case 7:
989
+ a.sent(), a.label = 8;
990
+ case 8:
991
+ return [3, 10];
992
+ case 9:
993
+ if (o) throw o.error;
994
+ return [7];
995
+ case 10:
996
+ return [7];
997
+ case 11:
998
+ return r.complete(), [2];
999
+ }
1000
+ });
1001
+ });
1002
+ }
1003
+ function E(e, r, t, n, o) {
1004
+ n === void 0 && (n = 0), o === void 0 && (o = !1);
1005
+ var i = r.schedule(function() {
1006
+ t(), o ? e.add(this.schedule(null, n)) : this.unsubscribe();
1007
+ }, n);
1008
+ if (e.add(i), !o)
1009
+ return i;
1010
+ }
1011
+ function St(e, r) {
1012
+ return r === void 0 && (r = 0), I(function(t, n) {
1013
+ t.subscribe(_(n, function(o) {
1014
+ return E(n, e, function() {
1015
+ return n.next(o);
1016
+ }, r);
1017
+ }, function() {
1018
+ return E(n, e, function() {
1019
+ return n.complete();
1020
+ }, r);
1021
+ }, function(o) {
1022
+ return E(n, e, function() {
1023
+ return n.error(o);
1024
+ }, r);
1025
+ }));
1026
+ });
1027
+ }
1028
+ function gt(e, r) {
1029
+ return r === void 0 && (r = 0), I(function(t, n) {
1030
+ n.add(e.schedule(function() {
1031
+ return t.subscribe(n);
1032
+ }, r));
1033
+ });
1034
+ }
1035
+ function ae(e, r) {
1036
+ return T(e).pipe(gt(r), St(r));
1037
+ }
1038
+ function le(e, r) {
1039
+ return T(e).pipe(gt(r), St(r));
1040
+ }
1041
+ function fe(e, r) {
1042
+ return new w(function(t) {
1043
+ var n = 0;
1044
+ return r.schedule(function() {
1045
+ n === e.length ? t.complete() : (t.next(e[n++]), t.closed || this.schedule());
1046
+ });
1047
+ });
1048
+ }
1049
+ function he(e, r) {
1050
+ return new w(function(t) {
1051
+ var n;
1052
+ return E(t, r, function() {
1053
+ n = e[pt](), E(t, r, function() {
1054
+ var o, i, u;
1055
+ try {
1056
+ o = n.next(), i = o.value, u = o.done;
1057
+ } catch (c) {
1058
+ t.error(c);
1059
+ return;
1060
+ }
1061
+ u ? t.complete() : t.next(i);
1062
+ }, 0, !0);
1063
+ }), function() {
1064
+ return d(n == null ? void 0 : n.return) && n.return();
1065
+ };
1066
+ });
1067
+ }
1068
+ function xt(e, r) {
1069
+ if (!e)
1070
+ throw new Error("Iterable cannot be null");
1071
+ return new w(function(t) {
1072
+ E(t, r, function() {
1073
+ var n = e[Symbol.asyncIterator]();
1074
+ E(t, r, function() {
1075
+ n.next().then(function(o) {
1076
+ o.done ? t.complete() : t.next(o.value);
1077
+ });
1078
+ }, 0, !0);
1079
+ });
1080
+ });
1081
+ }
1082
+ function ve(e, r) {
1083
+ return xt(yt(e), r);
1084
+ }
1085
+ function de(e, r) {
1086
+ if (e != null) {
1087
+ if (ht(e))
1088
+ return ae(e, r);
1089
+ if (lt(e))
1090
+ return fe(e, r);
1091
+ if (ft(e))
1092
+ return le(e, r);
1093
+ if (vt(e))
1094
+ return xt(e, r);
1095
+ if (bt(e))
1096
+ return he(e, r);
1097
+ if (mt(e))
1098
+ return ve(e, r);
1099
+ }
1100
+ throw dt(e);
1101
+ }
1102
+ function pe(e, r) {
1103
+ return r ? de(e, r) : T(e);
1104
+ }
1105
+ function J(e, r) {
1106
+ return I(function(t, n) {
1107
+ var o = 0;
1108
+ t.subscribe(_(n, function(i) {
1109
+ n.next(e.call(r, i, o++));
1110
+ }));
1111
+ });
1112
+ }
1113
+ function be(e, r, t, n, o, i, u, c) {
1114
+ var a = [], s = 0, l = 0, p = !1, y = function() {
1115
+ p && !a.length && !s && r.complete();
1116
+ }, h = function(v) {
1117
+ return s < n ? b(v) : a.push(v);
1118
+ }, b = function(v) {
1119
+ s++;
1120
+ var O = !1;
1121
+ T(t(v, l++)).subscribe(_(r, function(f) {
1122
+ r.next(f);
1123
+ }, function() {
1124
+ O = !0;
1125
+ }, void 0, function() {
1126
+ if (O)
1127
+ try {
1128
+ s--;
1129
+ for (var f = function() {
1130
+ var m = a.shift();
1131
+ u || b(m);
1132
+ }; a.length && s < n; )
1133
+ f();
1134
+ y();
1135
+ } catch (m) {
1136
+ r.error(m);
1137
+ }
1138
+ }));
1139
+ };
1140
+ return e.subscribe(_(r, h, function() {
1141
+ p = !0, y();
1142
+ })), function() {
1143
+ };
1144
+ }
1145
+ function V(e, r, t) {
1146
+ return t === void 0 && (t = 1 / 0), d(r) ? V(function(n, o) {
1147
+ return J(function(i, u) {
1148
+ return r(n, i, o, u);
1149
+ })(T(e(n, o)));
1150
+ }, t) : (typeof r == "number" && (t = r), I(function(n, o) {
1151
+ return be(n, o, e, t);
1152
+ }));
1153
+ }
1154
+ function ye(e) {
1155
+ return V(B, e);
1156
+ }
1157
+ function me() {
1158
+ return ye(1);
1159
+ }
1160
+ function we() {
1161
+ for (var e = [], r = 0; r < arguments.length; r++)
1162
+ e[r] = arguments[r];
1163
+ return me()(pe(e, ee(e)));
1164
+ }
1165
+ function Se(e, r) {
1166
+ return I(function(t, n) {
1167
+ var o = 0;
1168
+ t.subscribe(_(n, function(i) {
1169
+ return e.call(r, i, o++) && n.next(i);
1170
+ }));
1171
+ });
1172
+ }
1173
+ function rt(e, r) {
1174
+ return d(r) ? V(e, r, 1) : V(e, 1);
1175
+ }
1176
+ function ge(e, r) {
1177
+ return r === void 0 && (r = Zt), I(function(t, n) {
1178
+ var o = null, i = null, u = null, c = function() {
1179
+ if (o) {
1180
+ o.unsubscribe(), o = null;
1181
+ var s = i;
1182
+ i = null, n.next(s);
1183
+ }
1184
+ };
1185
+ function a() {
1186
+ var s = u + e, l = r.now();
1187
+ if (l < s) {
1188
+ o = this.schedule(void 0, s - l), n.add(o);
1189
+ return;
1190
+ }
1191
+ c();
1192
+ }
1193
+ t.subscribe(_(n, function(s) {
1194
+ i = s, u = r.now(), o || (o = r.schedule(a, e), n.add(o));
1195
+ }, function() {
1196
+ c(), n.complete();
1197
+ }, void 0, function() {
1198
+ i = o = null;
1199
+ }));
1200
+ });
1201
+ }
1202
+ function xe(e, r) {
1203
+ return r === void 0 && (r = B), e = e ?? _e, I(function(t, n) {
1204
+ var o, i = !0;
1205
+ t.subscribe(_(n, function(u) {
1206
+ var c = r(u);
1207
+ (i || !e(o, c)) && (i = !1, o = c, n.next(u));
1208
+ }));
1209
+ });
1210
+ }
1211
+ function _e(e, r) {
1212
+ return e === r;
1213
+ }
1214
+ function Ie(e, r, t) {
1215
+ var n = d(e) || r || t ? { next: e, error: r, complete: t } : e;
1216
+ return n ? I(function(o, i) {
1217
+ var u;
1218
+ (u = n.subscribe) === null || u === void 0 || u.call(n);
1219
+ var c = !0;
1220
+ o.subscribe(_(i, function(a) {
1221
+ var s;
1222
+ (s = n.next) === null || s === void 0 || s.call(n, a), i.next(a);
1223
+ }, function() {
1224
+ var a;
1225
+ c = !1, (a = n.complete) === null || a === void 0 || a.call(n), i.complete();
1226
+ }, function(a) {
1227
+ var s;
1228
+ c = !1, (s = n.error) === null || s === void 0 || s.call(n, a), i.error(a);
1229
+ }, function() {
1230
+ var a, s;
1231
+ c && ((a = n.unsubscribe) === null || a === void 0 || a.call(n)), (s = n.finalize) === null || s === void 0 || s.call(n);
1232
+ }));
1233
+ }) : B;
1234
+ }
1235
+ function Ee(e, r) {
1236
+ const t = g({}), n = kt({ parent: window.parent, connect: e }), o = g(""), i = S({
1237
+ get: () => o.value,
1238
+ set: (c) => n.appState.set(c)
1239
+ }), u = g({ availableLocales: [] });
1240
+ return n.context.subscribe((c) => t.value = c), we(n.appState.get(), n.appState).subscribe((c) => o.value = c), n.locales.subscribe((c) => u.value = c), Ae(n.signal, n, r), ot(() => n.unsubscribe()), Object.assign(
1241
+ nt(n, ["context", "toolbar", "appState", "locales"]),
1242
+ {
1243
+ context: t,
1244
+ toolbar: Oe(n),
1245
+ appState: i,
1246
+ locales: u
1247
+ }
1248
+ );
1249
+ }
1250
+ function Oe(e) {
1251
+ const r = {
1252
+ start: S({
1253
+ get: () => e.toolbar.get().start,
1254
+ set: (t) => e.toolbar.set((n) => ({ ...n, start: t }))
1255
+ }),
1256
+ title: S({
1257
+ get: () => e.toolbar.get().title,
1258
+ set: (t) => e.toolbar.set((n) => ({ ...n, title: t }))
1259
+ }),
1260
+ searchEnabled: S({
1261
+ get: () => e.toolbar.get().search.enabled,
1262
+ set: (t) => e.toolbar.set((n) => ({ ...n, search: { ...n.search, enabled: t } }))
1263
+ }),
1264
+ search: g(""),
1265
+ menu: S({
1266
+ get: () => e.toolbar.get().menu ?? [],
1267
+ set: (t) => e.toolbar.set((n) => ({ ...n, menu: t }))
1268
+ }),
1269
+ isLoading: S({
1270
+ get: () => e.toolbar.get().isLoading,
1271
+ set: (t) => e.toolbar.set((n) => ({ ...n, isLoading: t }))
1272
+ })
1273
+ };
1274
+ return e.toolbar.pipe(J((t) => t.search.input ?? ""), xe(), ge(300), Ie(console.log)).forEach((t) => r.search.value = t), r;
1275
+ }
1276
+ function Ae(e, r, t) {
1277
+ const { shift: n } = Et(), o = g(null), i = new $(), u = i.pipe(
1278
+ rt(t ?? ((c) => Promise.resolve(c))),
1279
+ rt((c) => e(c))
1280
+ ).subscribe();
1281
+ return r.add(u), Ot(n, () => {
1282
+ const c = Date.now();
1283
+ o.value && c - o.value < 300 ? (o.value = null, console.log("lastShiftPress"), i.next({ overlay: { action: "show" } })) : o.value = c;
1284
+ }), u;
1285
+ }
1286
+ function Pe(e) {
1287
+ return Object.fromEntries(
1288
+ Object.entries(e).map(([r, t]) => [r, Tt(t)])
1289
+ );
1290
+ }
1291
+ function Fe(e = "comms") {
1292
+ const [r, t] = je(
1293
+ e,
1294
+ () => Ee(),
1295
+ (n) => n.unsubscribe()
1296
+ );
1297
+ return { provideComms: r, injectComms: t };
1298
+ }
1299
+ function je(e, r, t) {
1300
+ let n;
1301
+ const o = () => (!n && (n = r()), n);
1302
+ return [
1303
+ (i) => (i.onUnmount(() => t && n && t(n)), i.provide(e, o)),
1304
+ () => jt(e)()
1305
+ ];
1306
+ }
1307
+ function Me(e, r, t) {
1308
+ const o = At(e, r, { immediate: !1, ...t });
1309
+ return Object.assign(nt(o, ["execute"]), {
1310
+ execute: (...i) => o.execute(void 0, ...i),
1311
+ executeDelayed: o.execute
1312
+ });
1313
+ }
1314
+ function Ve(e) {
1315
+ const { context: r } = e, t = new Y({}), n = (f) => t.next(f(t.value)), o = g(), i = new Y(void 0);
1316
+ Object.entries(r).forEach(([f, m]) => z(
1317
+ m,
1318
+ (C) => n((k) => ({ ...k, [f]: C })),
1319
+ { immediate: !0 }
1320
+ )), z(o, (f) => i.next(f), { immediate: !0 });
1321
+ const u = i.asObservable().pipe(
1322
+ J((f) => f == null ? void 0 : f.contentWindow),
1323
+ Se((f) => !!f)
1324
+ ), c = new Y({ availableLocales: [] }), { locale: a, availableLocales: s } = H();
1325
+ Ct(() => c.next(Pe({ locale: a, availableLocales: s })));
1326
+ const l = Lt({ ...e, contextChanges: t, windowChanges: u, locales: c });
1327
+ l.toolbar.subscribe((f) => {
1328
+ var C, k;
1329
+ const m = e.toolbar;
1330
+ m.start.value = f.start, m.title.value = f.title, m.searchEnabled.value = ((C = f.search) == null ? void 0 : C.enabled) ?? !1, m.search.value = (k = f.search) == null ? void 0 : k.input, m.menu.value = f.menu, m.isLoading.value = (f == null ? void 0 : f.isLoading) ?? !1;
1331
+ }), Pt(
1332
+ e.toolbar.search,
1333
+ (f) => l.toolbar.set.search(f),
1334
+ { immediate: !0, debounce: 100 }
1335
+ );
1336
+ const p = g(l.appState.get()), y = S({
1337
+ get: () => p.value,
1338
+ set: (f) => l.appState.set(f)
1339
+ });
1340
+ l.appState.changes.subscribe((f) => p.value = f);
1341
+ const h = g(!1);
1342
+ l.isConnectionInitialized.subscribe((f) => h.value = f), ot(() => l.unsubscribe());
1343
+ const { unsubscribe: b, signal: v, closed: O } = l;
1344
+ return {
1345
+ ...e,
1346
+ client: o,
1347
+ appState: y,
1348
+ isConnectionInitialized: h,
1349
+ unsubscribe: b,
1350
+ signal: v,
1351
+ closed: O
1352
+ };
1353
+ }
1354
+ export {
1355
+ Ue as useAntColorMode,
1356
+ Re as useAntI18n,
1357
+ Me as useApi,
1358
+ Ee as useCommsClient,
1359
+ Ve as useCommsHost,
1360
+ Fe as useCommsInjection,
1361
+ je as useSingleton
1362
+ };