mp-front-cli 1.0.0 → 2.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,811 @@
1
+ var J = Object.defineProperty;
2
+ var N = (e, t, r) => t in e ? J(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var m = (e, t, r) => N(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { switchMap as H, of as B, catchError as V } from "rxjs";
5
+ import { CustomLogger as q } from "./mp-front-cli-logger.es.js";
6
+ var T = function(e, t) {
7
+ return T = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
8
+ r.__proto__ = n;
9
+ } || function(r, n) {
10
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
11
+ }, T(e, t);
12
+ };
13
+ function I(e, t) {
14
+ if (typeof t != "function" && t !== null)
15
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
16
+ T(e, t);
17
+ function r() {
18
+ this.constructor = e;
19
+ }
20
+ e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
21
+ }
22
+ var w = function() {
23
+ return w = Object.assign || function(t) {
24
+ for (var r, n = 1, i = arguments.length; n < i; n++) {
25
+ r = arguments[n];
26
+ for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (t[o] = r[o]);
27
+ }
28
+ return t;
29
+ }, w.apply(this, arguments);
30
+ };
31
+ function W(e, t) {
32
+ var r = {};
33
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
34
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
35
+ for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
36
+ t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
37
+ return r;
38
+ }
39
+ function Q(e, t, r, n) {
40
+ function i(o) {
41
+ return o instanceof r ? o : new r(function(u) {
42
+ u(o);
43
+ });
44
+ }
45
+ return new (r || (r = Promise))(function(o, u) {
46
+ function s(l) {
47
+ try {
48
+ c(n.next(l));
49
+ } catch (d) {
50
+ u(d);
51
+ }
52
+ }
53
+ function a(l) {
54
+ try {
55
+ c(n.throw(l));
56
+ } catch (d) {
57
+ u(d);
58
+ }
59
+ }
60
+ function c(l) {
61
+ l.done ? o(l.value) : i(l.value).then(s, a);
62
+ }
63
+ c((n = n.apply(e, t || [])).next());
64
+ });
65
+ }
66
+ function D(e, t) {
67
+ var r = { label: 0, sent: function() {
68
+ if (o[0] & 1) throw o[1];
69
+ return o[1];
70
+ }, trys: [], ops: [] }, n, i, o, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
71
+ return u.next = s(0), u.throw = s(1), u.return = s(2), typeof Symbol == "function" && (u[Symbol.iterator] = function() {
72
+ return this;
73
+ }), u;
74
+ function s(c) {
75
+ return function(l) {
76
+ return a([c, l]);
77
+ };
78
+ }
79
+ function a(c) {
80
+ if (n) throw new TypeError("Generator is already executing.");
81
+ for (; u && (u = 0, c[0] && (r = 0)), r; ) try {
82
+ if (n = 1, i && (o = c[0] & 2 ? i.return : c[0] ? i.throw || ((o = i.return) && o.call(i), 0) : i.next) && !(o = o.call(i, c[1])).done) return o;
83
+ switch (i = 0, o && (c = [c[0] & 2, o.value]), c[0]) {
84
+ case 0:
85
+ case 1:
86
+ o = c;
87
+ break;
88
+ case 4:
89
+ return r.label++, { value: c[1], done: !1 };
90
+ case 5:
91
+ r.label++, i = c[1], c = [0];
92
+ continue;
93
+ case 7:
94
+ c = r.ops.pop(), r.trys.pop();
95
+ continue;
96
+ default:
97
+ if (o = r.trys, !(o = o.length > 0 && o[o.length - 1]) && (c[0] === 6 || c[0] === 2)) {
98
+ r = 0;
99
+ continue;
100
+ }
101
+ if (c[0] === 3 && (!o || c[1] > o[0] && c[1] < o[3])) {
102
+ r.label = c[1];
103
+ break;
104
+ }
105
+ if (c[0] === 6 && r.label < o[1]) {
106
+ r.label = o[1], o = c;
107
+ break;
108
+ }
109
+ if (o && r.label < o[2]) {
110
+ r.label = o[2], r.ops.push(c);
111
+ break;
112
+ }
113
+ o[2] && r.ops.pop(), r.trys.pop();
114
+ continue;
115
+ }
116
+ c = t.call(e, r);
117
+ } catch (l) {
118
+ c = [6, l], i = 0;
119
+ } finally {
120
+ n = o = 0;
121
+ }
122
+ if (c[0] & 5) throw c[1];
123
+ return { value: c[0] ? c[1] : void 0, done: !0 };
124
+ }
125
+ }
126
+ function S(e) {
127
+ var t = typeof Symbol == "function" && Symbol.iterator, r = t && e[t], n = 0;
128
+ if (r) return r.call(e);
129
+ if (e && typeof e.length == "number") return {
130
+ next: function() {
131
+ return e && n >= e.length && (e = void 0), { value: e && e[n++], done: !e };
132
+ }
133
+ };
134
+ throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
135
+ }
136
+ function O(e, t) {
137
+ var r = typeof Symbol == "function" && e[Symbol.iterator];
138
+ if (!r) return e;
139
+ var n = r.call(e), i, o = [], u;
140
+ try {
141
+ for (; (t === void 0 || t-- > 0) && !(i = n.next()).done; ) o.push(i.value);
142
+ } catch (s) {
143
+ u = { error: s };
144
+ } finally {
145
+ try {
146
+ i && !i.done && (r = n.return) && r.call(n);
147
+ } finally {
148
+ if (u) throw u.error;
149
+ }
150
+ }
151
+ return o;
152
+ }
153
+ function E(e, t, r) {
154
+ if (r || arguments.length === 2) for (var n = 0, i = t.length, o; n < i; n++)
155
+ (o || !(n in t)) && (o || (o = Array.prototype.slice.call(t, 0, n)), o[n] = t[n]);
156
+ return e.concat(o || Array.prototype.slice.call(t));
157
+ }
158
+ function A(e) {
159
+ return this instanceof A ? (this.v = e, this) : new A(e);
160
+ }
161
+ function X(e, t, r) {
162
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
163
+ var n = r.apply(e, t || []), i, o = [];
164
+ return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), s("next"), s("throw"), s("return", u), i[Symbol.asyncIterator] = function() {
165
+ return this;
166
+ }, i;
167
+ function u(f) {
168
+ return function(b) {
169
+ return Promise.resolve(b).then(f, d);
170
+ };
171
+ }
172
+ function s(f, b) {
173
+ n[f] && (i[f] = function(h) {
174
+ return new Promise(function($, G) {
175
+ o.push([f, h, $, G]) > 1 || a(f, h);
176
+ });
177
+ }, b && (i[f] = b(i[f])));
178
+ }
179
+ function a(f, b) {
180
+ try {
181
+ c(n[f](b));
182
+ } catch (h) {
183
+ p(o[0][3], h);
184
+ }
185
+ }
186
+ function c(f) {
187
+ f.value instanceof A ? Promise.resolve(f.value.v).then(l, d) : p(o[0][2], f);
188
+ }
189
+ function l(f) {
190
+ a("next", f);
191
+ }
192
+ function d(f) {
193
+ a("throw", f);
194
+ }
195
+ function p(f, b) {
196
+ f(b), o.shift(), o.length && a(o[0][0], o[0][1]);
197
+ }
198
+ }
199
+ function Z(e) {
200
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
201
+ var t = e[Symbol.asyncIterator], r;
202
+ return t ? t.call(e) : (e = typeof S == "function" ? S(e) : e[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function() {
203
+ return this;
204
+ }, r);
205
+ function n(o) {
206
+ r[o] = e[o] && function(u) {
207
+ return new Promise(function(s, a) {
208
+ u = e[o](u), i(s, a, u.done, u.value);
209
+ });
210
+ };
211
+ }
212
+ function i(o, u, s, a) {
213
+ Promise.resolve(a).then(function(c) {
214
+ o({ value: c, done: s });
215
+ }, u);
216
+ }
217
+ }
218
+ function y(e) {
219
+ return typeof e == "function";
220
+ }
221
+ function z(e) {
222
+ var t = function(n) {
223
+ Error.call(n), n.stack = new Error().stack;
224
+ }, r = e(t);
225
+ return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
226
+ }
227
+ var g = z(function(e) {
228
+ return function(r) {
229
+ e(this), this.message = r ? r.length + ` errors occurred during unsubscription:
230
+ ` + r.map(function(n, i) {
231
+ return i + 1 + ") " + n.toString();
232
+ }).join(`
233
+ `) : "", this.name = "UnsubscriptionError", this.errors = r;
234
+ };
235
+ });
236
+ function j(e, t) {
237
+ if (e) {
238
+ var r = e.indexOf(t);
239
+ 0 <= r && e.splice(r, 1);
240
+ }
241
+ }
242
+ var x = function() {
243
+ function e(t) {
244
+ this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
245
+ }
246
+ return e.prototype.unsubscribe = function() {
247
+ var t, r, n, i, o;
248
+ if (!this.closed) {
249
+ this.closed = !0;
250
+ var u = this._parentage;
251
+ if (u)
252
+ if (this._parentage = null, Array.isArray(u))
253
+ try {
254
+ for (var s = S(u), a = s.next(); !a.done; a = s.next()) {
255
+ var c = a.value;
256
+ c.remove(this);
257
+ }
258
+ } catch (h) {
259
+ t = { error: h };
260
+ } finally {
261
+ try {
262
+ a && !a.done && (r = s.return) && r.call(s);
263
+ } finally {
264
+ if (t) throw t.error;
265
+ }
266
+ }
267
+ else
268
+ u.remove(this);
269
+ var l = this.initialTeardown;
270
+ if (y(l))
271
+ try {
272
+ l();
273
+ } catch (h) {
274
+ o = h instanceof g ? h.errors : [h];
275
+ }
276
+ var d = this._finalizers;
277
+ if (d) {
278
+ this._finalizers = null;
279
+ try {
280
+ for (var p = S(d), f = p.next(); !f.done; f = p.next()) {
281
+ var b = f.value;
282
+ try {
283
+ L(b);
284
+ } catch (h) {
285
+ o = o ?? [], h instanceof g ? o = E(E([], O(o)), O(h.errors)) : o.push(h);
286
+ }
287
+ }
288
+ } catch (h) {
289
+ n = { error: h };
290
+ } finally {
291
+ try {
292
+ f && !f.done && (i = p.return) && i.call(p);
293
+ } finally {
294
+ if (n) throw n.error;
295
+ }
296
+ }
297
+ }
298
+ if (o)
299
+ throw new g(o);
300
+ }
301
+ }, e.prototype.add = function(t) {
302
+ var r;
303
+ if (t && t !== this)
304
+ if (this.closed)
305
+ L(t);
306
+ else {
307
+ if (t instanceof e) {
308
+ if (t.closed || t._hasParent(this))
309
+ return;
310
+ t._addParent(this);
311
+ }
312
+ (this._finalizers = (r = this._finalizers) !== null && r !== void 0 ? r : []).push(t);
313
+ }
314
+ }, e.prototype._hasParent = function(t) {
315
+ var r = this._parentage;
316
+ return r === t || Array.isArray(r) && r.includes(t);
317
+ }, e.prototype._addParent = function(t) {
318
+ var r = this._parentage;
319
+ this._parentage = Array.isArray(r) ? (r.push(t), r) : r ? [r, t] : t;
320
+ }, e.prototype._removeParent = function(t) {
321
+ var r = this._parentage;
322
+ r === t ? this._parentage = null : Array.isArray(r) && j(r, t);
323
+ }, e.prototype.remove = function(t) {
324
+ var r = this._finalizers;
325
+ r && j(r, t), t instanceof e && t._removeParent(this);
326
+ }, e.EMPTY = function() {
327
+ var t = new e();
328
+ return t.closed = !0, t;
329
+ }(), e;
330
+ }();
331
+ x.EMPTY;
332
+ function K(e) {
333
+ return e instanceof x || e && "closed" in e && y(e.remove) && y(e.add) && y(e.unsubscribe);
334
+ }
335
+ function L(e) {
336
+ y(e) ? e() : e.unsubscribe();
337
+ }
338
+ var ee = {
339
+ onUnhandledError: null,
340
+ onStoppedNotification: null,
341
+ Promise: void 0,
342
+ useDeprecatedSynchronousErrorHandling: !1,
343
+ useDeprecatedNextContext: !1
344
+ }, F = {
345
+ setTimeout: function(e, t) {
346
+ for (var r = [], n = 2; n < arguments.length; n++)
347
+ r[n - 2] = arguments[n];
348
+ return setTimeout.apply(void 0, E([e, t], O(r)));
349
+ },
350
+ clearTimeout: function(e) {
351
+ var t = F.delegate;
352
+ return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(e);
353
+ },
354
+ delegate: void 0
355
+ };
356
+ function M(e) {
357
+ F.setTimeout(function() {
358
+ throw e;
359
+ });
360
+ }
361
+ function k() {
362
+ }
363
+ function re(e) {
364
+ e();
365
+ }
366
+ var U = function(e) {
367
+ I(t, e);
368
+ function t(r) {
369
+ var n = e.call(this) || this;
370
+ return n.isStopped = !1, r ? (n.destination = r, K(r) && r.add(n)) : n.destination = oe, n;
371
+ }
372
+ return t.create = function(r, n, i) {
373
+ return new P(r, n, i);
374
+ }, t.prototype.next = function(r) {
375
+ this.isStopped || this._next(r);
376
+ }, t.prototype.error = function(r) {
377
+ this.isStopped || (this.isStopped = !0, this._error(r));
378
+ }, t.prototype.complete = function() {
379
+ this.isStopped || (this.isStopped = !0, this._complete());
380
+ }, t.prototype.unsubscribe = function() {
381
+ this.closed || (this.isStopped = !0, e.prototype.unsubscribe.call(this), this.destination = null);
382
+ }, t.prototype._next = function(r) {
383
+ this.destination.next(r);
384
+ }, t.prototype._error = function(r) {
385
+ try {
386
+ this.destination.error(r);
387
+ } finally {
388
+ this.unsubscribe();
389
+ }
390
+ }, t.prototype._complete = function() {
391
+ try {
392
+ this.destination.complete();
393
+ } finally {
394
+ this.unsubscribe();
395
+ }
396
+ }, t;
397
+ }(x), te = function() {
398
+ function e(t) {
399
+ this.partialObserver = t;
400
+ }
401
+ return e.prototype.next = function(t) {
402
+ var r = this.partialObserver;
403
+ if (r.next)
404
+ try {
405
+ r.next(t);
406
+ } catch (n) {
407
+ _(n);
408
+ }
409
+ }, e.prototype.error = function(t) {
410
+ var r = this.partialObserver;
411
+ if (r.error)
412
+ try {
413
+ r.error(t);
414
+ } catch (n) {
415
+ _(n);
416
+ }
417
+ else
418
+ _(t);
419
+ }, e.prototype.complete = function() {
420
+ var t = this.partialObserver;
421
+ if (t.complete)
422
+ try {
423
+ t.complete();
424
+ } catch (r) {
425
+ _(r);
426
+ }
427
+ }, e;
428
+ }(), P = function(e) {
429
+ I(t, e);
430
+ function t(r, n, i) {
431
+ var o = e.call(this) || this, u;
432
+ return y(r) || !r ? u = {
433
+ next: r ?? void 0,
434
+ error: n ?? void 0,
435
+ complete: i ?? void 0
436
+ } : u = r, o.destination = new te(u), o;
437
+ }
438
+ return t;
439
+ }(U);
440
+ function _(e) {
441
+ M(e);
442
+ }
443
+ function ne(e) {
444
+ throw e;
445
+ }
446
+ var oe = {
447
+ closed: !0,
448
+ next: k,
449
+ error: ne,
450
+ complete: k
451
+ };
452
+ function ie(e, t, r, n, i) {
453
+ return new ue(e, t, r, n, i);
454
+ }
455
+ var ue = function(e) {
456
+ I(t, e);
457
+ function t(r, n, i, o, u, s) {
458
+ var a = e.call(this, r) || this;
459
+ return a.onFinalize = u, a.shouldUnsubscribe = s, a._next = n ? function(c) {
460
+ try {
461
+ n(c);
462
+ } catch (l) {
463
+ r.error(l);
464
+ }
465
+ } : e.prototype._next, a._error = o ? function(c) {
466
+ try {
467
+ o(c);
468
+ } catch (l) {
469
+ r.error(l);
470
+ } finally {
471
+ this.unsubscribe();
472
+ }
473
+ } : e.prototype._error, a._complete = i ? function() {
474
+ try {
475
+ i();
476
+ } catch (c) {
477
+ r.error(c);
478
+ } finally {
479
+ this.unsubscribe();
480
+ }
481
+ } : e.prototype._complete, a;
482
+ }
483
+ return t.prototype.unsubscribe = function() {
484
+ var r;
485
+ if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
486
+ var n = this.closed;
487
+ e.prototype.unsubscribe.call(this), !n && ((r = this.onFinalize) === null || r === void 0 || r.call(this));
488
+ }
489
+ }, t;
490
+ }(U), R = function() {
491
+ return typeof Symbol == "function" && Symbol.observable || "@@observable";
492
+ }();
493
+ function ce(e) {
494
+ return e;
495
+ }
496
+ function ae(e) {
497
+ return e.length === 0 ? ce : e.length === 1 ? e[0] : function(r) {
498
+ return e.reduce(function(n, i) {
499
+ return i(n);
500
+ }, r);
501
+ };
502
+ }
503
+ var v = function() {
504
+ function e(t) {
505
+ t && (this._subscribe = t);
506
+ }
507
+ return e.prototype.lift = function(t) {
508
+ var r = new e();
509
+ return r.source = this, r.operator = t, r;
510
+ }, e.prototype.subscribe = function(t, r, n) {
511
+ var i = this, o = fe(t) ? t : new P(t, r, n);
512
+ return re(function() {
513
+ var u = i, s = u.operator, a = u.source;
514
+ o.add(s ? s.call(o, a) : a ? i._subscribe(o) : i._trySubscribe(o));
515
+ }), o;
516
+ }, e.prototype._trySubscribe = function(t) {
517
+ try {
518
+ return this._subscribe(t);
519
+ } catch (r) {
520
+ t.error(r);
521
+ }
522
+ }, e.prototype.forEach = function(t, r) {
523
+ var n = this;
524
+ return r = C(r), new r(function(i, o) {
525
+ var u = new P({
526
+ next: function(s) {
527
+ try {
528
+ t(s);
529
+ } catch (a) {
530
+ o(a), u.unsubscribe();
531
+ }
532
+ },
533
+ error: o,
534
+ complete: i
535
+ });
536
+ n.subscribe(u);
537
+ });
538
+ }, e.prototype._subscribe = function(t) {
539
+ var r;
540
+ return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t);
541
+ }, e.prototype[R] = function() {
542
+ return this;
543
+ }, e.prototype.pipe = function() {
544
+ for (var t = [], r = 0; r < arguments.length; r++)
545
+ t[r] = arguments[r];
546
+ return ae(t)(this);
547
+ }, e.prototype.toPromise = function(t) {
548
+ var r = this;
549
+ return t = C(t), new t(function(n, i) {
550
+ var o;
551
+ r.subscribe(function(u) {
552
+ return o = u;
553
+ }, function(u) {
554
+ return i(u);
555
+ }, function() {
556
+ return n(o);
557
+ });
558
+ });
559
+ }, e.create = function(t) {
560
+ return new e(t);
561
+ }, e;
562
+ }();
563
+ function C(e) {
564
+ var t;
565
+ return (t = e ?? ee.Promise) !== null && t !== void 0 ? t : Promise;
566
+ }
567
+ function se(e) {
568
+ return e && y(e.next) && y(e.error) && y(e.complete);
569
+ }
570
+ function fe(e) {
571
+ return e && e instanceof U || se(e) && K(e);
572
+ }
573
+ var le = function(e) {
574
+ return e && typeof e.length == "number" && typeof e != "function";
575
+ };
576
+ function he(e) {
577
+ return y(e == null ? void 0 : e.then);
578
+ }
579
+ function ye(e) {
580
+ return y(e[R]);
581
+ }
582
+ function de(e) {
583
+ return Symbol.asyncIterator && y(e == null ? void 0 : e[Symbol.asyncIterator]);
584
+ }
585
+ function pe(e) {
586
+ 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.");
587
+ }
588
+ function be() {
589
+ return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
590
+ }
591
+ var ve = be();
592
+ function me(e) {
593
+ return y(e == null ? void 0 : e[ve]);
594
+ }
595
+ function Ae(e) {
596
+ return X(this, arguments, function() {
597
+ var r, n, i, o;
598
+ return D(this, function(u) {
599
+ switch (u.label) {
600
+ case 0:
601
+ r = e.getReader(), u.label = 1;
602
+ case 1:
603
+ u.trys.push([1, , 9, 10]), u.label = 2;
604
+ case 2:
605
+ return [4, A(r.read())];
606
+ case 3:
607
+ return n = u.sent(), i = n.value, o = n.done, o ? [4, A(void 0)] : [3, 5];
608
+ case 4:
609
+ return [2, u.sent()];
610
+ case 5:
611
+ return [4, A(i)];
612
+ case 6:
613
+ return [4, u.sent()];
614
+ case 7:
615
+ return u.sent(), [3, 2];
616
+ case 8:
617
+ return [3, 10];
618
+ case 9:
619
+ return r.releaseLock(), [7];
620
+ case 10:
621
+ return [2];
622
+ }
623
+ });
624
+ });
625
+ }
626
+ function Se(e) {
627
+ return y(e == null ? void 0 : e.getReader);
628
+ }
629
+ function _e(e) {
630
+ if (e instanceof v)
631
+ return e;
632
+ if (e != null) {
633
+ if (ye(e))
634
+ return we(e);
635
+ if (le(e))
636
+ return ge(e);
637
+ if (he(e))
638
+ return Te(e);
639
+ if (de(e))
640
+ return Y(e);
641
+ if (me(e))
642
+ return Oe(e);
643
+ if (Se(e))
644
+ return Ee(e);
645
+ }
646
+ throw pe(e);
647
+ }
648
+ function we(e) {
649
+ return new v(function(t) {
650
+ var r = e[R]();
651
+ if (y(r.subscribe))
652
+ return r.subscribe(t);
653
+ throw new TypeError("Provided object does not correctly implement Symbol.observable");
654
+ });
655
+ }
656
+ function ge(e) {
657
+ return new v(function(t) {
658
+ for (var r = 0; r < e.length && !t.closed; r++)
659
+ t.next(e[r]);
660
+ t.complete();
661
+ });
662
+ }
663
+ function Te(e) {
664
+ return new v(function(t) {
665
+ e.then(function(r) {
666
+ t.closed || (t.next(r), t.complete());
667
+ }, function(r) {
668
+ return t.error(r);
669
+ }).then(null, M);
670
+ });
671
+ }
672
+ function Oe(e) {
673
+ return new v(function(t) {
674
+ var r, n;
675
+ try {
676
+ for (var i = S(e), o = i.next(); !o.done; o = i.next()) {
677
+ var u = o.value;
678
+ if (t.next(u), t.closed)
679
+ return;
680
+ }
681
+ } catch (s) {
682
+ r = { error: s };
683
+ } finally {
684
+ try {
685
+ o && !o.done && (n = i.return) && n.call(i);
686
+ } finally {
687
+ if (r) throw r.error;
688
+ }
689
+ }
690
+ t.complete();
691
+ });
692
+ }
693
+ function Y(e) {
694
+ return new v(function(t) {
695
+ Pe(e, t).catch(function(r) {
696
+ return t.error(r);
697
+ });
698
+ });
699
+ }
700
+ function Ee(e) {
701
+ return Y(Ae(e));
702
+ }
703
+ function Pe(e, t) {
704
+ var r, n, i, o;
705
+ return Q(this, void 0, void 0, function() {
706
+ var u, s;
707
+ return D(this, function(a) {
708
+ switch (a.label) {
709
+ case 0:
710
+ a.trys.push([0, 5, 6, 11]), r = Z(e), a.label = 1;
711
+ case 1:
712
+ return [4, r.next()];
713
+ case 2:
714
+ if (n = a.sent(), !!n.done) return [3, 4];
715
+ if (u = n.value, t.next(u), t.closed)
716
+ return [2];
717
+ a.label = 3;
718
+ case 3:
719
+ return [3, 1];
720
+ case 4:
721
+ return [3, 11];
722
+ case 5:
723
+ return s = a.sent(), i = { error: s }, [3, 11];
724
+ case 6:
725
+ return a.trys.push([6, , 9, 10]), n && !n.done && (o = r.return) ? [4, o.call(r)] : [3, 8];
726
+ case 7:
727
+ a.sent(), a.label = 8;
728
+ case 8:
729
+ return [3, 10];
730
+ case 9:
731
+ if (i) throw i.error;
732
+ return [7];
733
+ case 10:
734
+ return [7];
735
+ case 11:
736
+ return t.complete(), [2];
737
+ }
738
+ });
739
+ });
740
+ }
741
+ function Ie(e, t) {
742
+ t === void 0 && (t = {});
743
+ var r = t.selector, n = W(t, ["selector"]);
744
+ return new v(function(i) {
745
+ var o = new AbortController(), u = o.signal, s = !0, a = n.signal;
746
+ if (a)
747
+ if (a.aborted)
748
+ o.abort();
749
+ else {
750
+ var c = function() {
751
+ u.aborted || o.abort();
752
+ };
753
+ a.addEventListener("abort", c), i.add(function() {
754
+ return a.removeEventListener("abort", c);
755
+ });
756
+ }
757
+ var l = w(w({}, n), { signal: u }), d = function(p) {
758
+ s = !1, i.error(p);
759
+ };
760
+ return fetch(e, l).then(function(p) {
761
+ r ? _e(r(p)).subscribe(ie(i, void 0, function() {
762
+ s = !1, i.complete();
763
+ }, d)) : (s = !1, i.next(p), i.complete());
764
+ }).catch(d), function() {
765
+ s && o.abort();
766
+ };
767
+ });
768
+ }
769
+ class He extends q {
770
+ constructor() {
771
+ super();
772
+ m(this, "API_AUTH_BACK_URL");
773
+ m(this, "API_AUTH_BACK_USERNAME_AUTH");
774
+ m(this, "API_AUTH_BACK_PASSWORD_AUTH");
775
+ m(this, "headers");
776
+ m(this, "ID", process.env.ID_FRONT ?? "NOT_AVAILABLE");
777
+ this.API_AUTH_BACK_URL = process.env.API_AUTH_BACK_URL, this.API_AUTH_BACK_USERNAME_AUTH = process.env.API_AUTH_BACK_USERNAME_AUTH, this.API_AUTH_BACK_PASSWORD_AUTH = process.env.API_AUTH_BACK_PASSWORD_AUTH, this.headers = {
778
+ Accept: "application/json",
779
+ "Content-Type": "application/vnd.api+json"
780
+ };
781
+ }
782
+ get() {
783
+ return this.logDebug("get ServiceToken"), Ie(this.API_AUTH_BACK_URL, {
784
+ method: "POST",
785
+ headers: this.headers,
786
+ body: JSON.stringify({
787
+ data: {
788
+ id: this.ID,
789
+ type: "AuthUser",
790
+ attributes: {
791
+ username: this.API_AUTH_BACK_USERNAME_AUTH,
792
+ password: this.API_AUTH_BACK_PASSWORD_AUTH
793
+ }
794
+ }
795
+ })
796
+ }).pipe(
797
+ H((r) => r.json()),
798
+ H((r) => {
799
+ var n;
800
+ return this.logDebug(
801
+ `ServiceToken <URL>: \x1B[33m ${this.API_AUTH_BACK_URL} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(this.headers)} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(r)} \x1B[37m`
802
+ ), B(((n = r == null ? void 0 : r.data.attributes) == null ? void 0 : n.token) || "");
803
+ }),
804
+ V((r) => (this.logError(`ServiceToken ${r}`), B("")))
805
+ );
806
+ }
807
+ }
808
+ export {
809
+ He as S,
810
+ Ie as f
811
+ };