mp-front-cli 0.0.37 → 0.0.38

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