@sambath999/localize-token 12.0.8 → 12.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1113 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('jwt-decode'), require('@angular/common/http')) :
3
+ typeof define === 'function' && define.amd ? define('@sambath999/localize-token', ['exports', '@angular/core', 'rxjs', 'jwt-decode', '@angular/common/http'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.sambath999 = global.sambath999 || {}, global.sambath999["localize-token"] = {}), global.ng.core, global.rxjs, global.jwt_decode, global.ng.common.http));
5
+ })(this, (function (exports, i0, rxjs, jwt_decode, http) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+ var jwt_decode__namespace = /*#__PURE__*/_interopNamespace(jwt_decode);
27
+
28
+ /******************************************************************************
29
+ Copyright (c) Microsoft Corporation.
30
+
31
+ Permission to use, copy, modify, and/or distribute this software for any
32
+ purpose with or without fee is hereby granted.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
35
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
37
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
38
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
+ PERFORMANCE OF THIS SOFTWARE.
41
+ ***************************************************************************** */
42
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
43
+ var extendStatics = function (d, b) {
44
+ extendStatics = Object.setPrototypeOf ||
45
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
46
+ function (d, b) { for (var p in b)
47
+ if (Object.prototype.hasOwnProperty.call(b, p))
48
+ d[p] = b[p]; };
49
+ return extendStatics(d, b);
50
+ };
51
+ function __extends(d, b) {
52
+ if (typeof b !== "function" && b !== null)
53
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
54
+ extendStatics(d, b);
55
+ function __() { this.constructor = d; }
56
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57
+ }
58
+ var __assign = function () {
59
+ __assign = Object.assign || function __assign(t) {
60
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
61
+ s = arguments[i];
62
+ for (var p in s)
63
+ if (Object.prototype.hasOwnProperty.call(s, p))
64
+ t[p] = s[p];
65
+ }
66
+ return t;
67
+ };
68
+ return __assign.apply(this, arguments);
69
+ };
70
+ function __rest(s, e) {
71
+ var t = {};
72
+ for (var p in s)
73
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
74
+ t[p] = s[p];
75
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
76
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
77
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
78
+ t[p[i]] = s[p[i]];
79
+ }
80
+ return t;
81
+ }
82
+ function __decorate(decorators, target, key, desc) {
83
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
84
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
85
+ r = Reflect.decorate(decorators, target, key, desc);
86
+ else
87
+ for (var i = decorators.length - 1; i >= 0; i--)
88
+ if (d = decorators[i])
89
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
90
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
91
+ }
92
+ function __param(paramIndex, decorator) {
93
+ return function (target, key) { decorator(target, key, paramIndex); };
94
+ }
95
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
96
+ function accept(f) { if (f !== void 0 && typeof f !== "function")
97
+ throw new TypeError("Function expected"); return f; }
98
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
99
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
100
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
101
+ var _, done = false;
102
+ for (var i = decorators.length - 1; i >= 0; i--) {
103
+ var context = {};
104
+ for (var p in contextIn)
105
+ context[p] = p === "access" ? {} : contextIn[p];
106
+ for (var p in contextIn.access)
107
+ context.access[p] = contextIn.access[p];
108
+ context.addInitializer = function (f) { if (done)
109
+ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
110
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
111
+ if (kind === "accessor") {
112
+ if (result === void 0)
113
+ continue;
114
+ if (result === null || typeof result !== "object")
115
+ throw new TypeError("Object expected");
116
+ if (_ = accept(result.get))
117
+ descriptor.get = _;
118
+ if (_ = accept(result.set))
119
+ descriptor.set = _;
120
+ if (_ = accept(result.init))
121
+ initializers.unshift(_);
122
+ }
123
+ else if (_ = accept(result)) {
124
+ if (kind === "field")
125
+ initializers.unshift(_);
126
+ else
127
+ descriptor[key] = _;
128
+ }
129
+ }
130
+ if (target)
131
+ Object.defineProperty(target, contextIn.name, descriptor);
132
+ done = true;
133
+ }
134
+ ;
135
+ function __runInitializers(thisArg, initializers, value) {
136
+ var useValue = arguments.length > 2;
137
+ for (var i = 0; i < initializers.length; i++) {
138
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
139
+ }
140
+ return useValue ? value : void 0;
141
+ }
142
+ ;
143
+ function __propKey(x) {
144
+ return typeof x === "symbol" ? x : "".concat(x);
145
+ }
146
+ ;
147
+ function __setFunctionName(f, name, prefix) {
148
+ if (typeof name === "symbol")
149
+ name = name.description ? "[".concat(name.description, "]") : "";
150
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
151
+ }
152
+ ;
153
+ function __metadata(metadataKey, metadataValue) {
154
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
155
+ return Reflect.metadata(metadataKey, metadataValue);
156
+ }
157
+ function __awaiter(thisArg, _arguments, P, generator) {
158
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
159
+ return new (P || (P = Promise))(function (resolve, reject) {
160
+ function fulfilled(value) { try {
161
+ step(generator.next(value));
162
+ }
163
+ catch (e) {
164
+ reject(e);
165
+ } }
166
+ function rejected(value) { try {
167
+ step(generator["throw"](value));
168
+ }
169
+ catch (e) {
170
+ reject(e);
171
+ } }
172
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
173
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
174
+ });
175
+ }
176
+ function __generator(thisArg, body) {
177
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
178
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
179
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
180
+ function verb(n) { return function (v) { return step([n, v]); }; }
181
+ function step(op) {
182
+ if (f)
183
+ throw new TypeError("Generator is already executing.");
184
+ while (g && (g = 0, op[0] && (_ = 0)), _)
185
+ try {
186
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
187
+ return t;
188
+ if (y = 0, t)
189
+ op = [op[0] & 2, t.value];
190
+ switch (op[0]) {
191
+ case 0:
192
+ case 1:
193
+ t = op;
194
+ break;
195
+ case 4:
196
+ _.label++;
197
+ return { value: op[1], done: false };
198
+ case 5:
199
+ _.label++;
200
+ y = op[1];
201
+ op = [0];
202
+ continue;
203
+ case 7:
204
+ op = _.ops.pop();
205
+ _.trys.pop();
206
+ continue;
207
+ default:
208
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
209
+ _ = 0;
210
+ continue;
211
+ }
212
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
213
+ _.label = op[1];
214
+ break;
215
+ }
216
+ if (op[0] === 6 && _.label < t[1]) {
217
+ _.label = t[1];
218
+ t = op;
219
+ break;
220
+ }
221
+ if (t && _.label < t[2]) {
222
+ _.label = t[2];
223
+ _.ops.push(op);
224
+ break;
225
+ }
226
+ if (t[2])
227
+ _.ops.pop();
228
+ _.trys.pop();
229
+ continue;
230
+ }
231
+ op = body.call(thisArg, _);
232
+ }
233
+ catch (e) {
234
+ op = [6, e];
235
+ y = 0;
236
+ }
237
+ finally {
238
+ f = t = 0;
239
+ }
240
+ if (op[0] & 5)
241
+ throw op[1];
242
+ return { value: op[0] ? op[1] : void 0, done: true };
243
+ }
244
+ }
245
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
246
+ if (k2 === undefined)
247
+ k2 = k;
248
+ var desc = Object.getOwnPropertyDescriptor(m, k);
249
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
250
+ desc = { enumerable: true, get: function () { return m[k]; } };
251
+ }
252
+ Object.defineProperty(o, k2, desc);
253
+ }) : (function (o, m, k, k2) {
254
+ if (k2 === undefined)
255
+ k2 = k;
256
+ o[k2] = m[k];
257
+ });
258
+ function __exportStar(m, o) {
259
+ for (var p in m)
260
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
261
+ __createBinding(o, m, p);
262
+ }
263
+ function __values(o) {
264
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
265
+ if (m)
266
+ return m.call(o);
267
+ if (o && typeof o.length === "number")
268
+ return {
269
+ next: function () {
270
+ if (o && i >= o.length)
271
+ o = void 0;
272
+ return { value: o && o[i++], done: !o };
273
+ }
274
+ };
275
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
276
+ }
277
+ function __read(o, n) {
278
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
279
+ if (!m)
280
+ return o;
281
+ var i = m.call(o), r, ar = [], e;
282
+ try {
283
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
284
+ ar.push(r.value);
285
+ }
286
+ catch (error) {
287
+ e = { error: error };
288
+ }
289
+ finally {
290
+ try {
291
+ if (r && !r.done && (m = i["return"]))
292
+ m.call(i);
293
+ }
294
+ finally {
295
+ if (e)
296
+ throw e.error;
297
+ }
298
+ }
299
+ return ar;
300
+ }
301
+ /** @deprecated */
302
+ function __spread() {
303
+ for (var ar = [], i = 0; i < arguments.length; i++)
304
+ ar = ar.concat(__read(arguments[i]));
305
+ return ar;
306
+ }
307
+ /** @deprecated */
308
+ function __spreadArrays() {
309
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
310
+ s += arguments[i].length;
311
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
312
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
313
+ r[k] = a[j];
314
+ return r;
315
+ }
316
+ function __spreadArray(to, from, pack) {
317
+ if (pack || arguments.length === 2)
318
+ for (var i = 0, l = from.length, ar; i < l; i++) {
319
+ if (ar || !(i in from)) {
320
+ if (!ar)
321
+ ar = Array.prototype.slice.call(from, 0, i);
322
+ ar[i] = from[i];
323
+ }
324
+ }
325
+ return to.concat(ar || Array.prototype.slice.call(from));
326
+ }
327
+ function __await(v) {
328
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
329
+ }
330
+ function __asyncGenerator(thisArg, _arguments, generator) {
331
+ if (!Symbol.asyncIterator)
332
+ throw new TypeError("Symbol.asyncIterator is not defined.");
333
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
334
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
335
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
336
+ function verb(n, f) { if (g[n]) {
337
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); };
338
+ if (f)
339
+ i[n] = f(i[n]);
340
+ } }
341
+ function resume(n, v) { try {
342
+ step(g[n](v));
343
+ }
344
+ catch (e) {
345
+ settle(q[0][3], e);
346
+ } }
347
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
348
+ function fulfill(value) { resume("next", value); }
349
+ function reject(value) { resume("throw", value); }
350
+ function settle(f, v) { if (f(v), q.shift(), q.length)
351
+ resume(q[0][0], q[0][1]); }
352
+ }
353
+ function __asyncDelegator(o) {
354
+ var i, p;
355
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
356
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
357
+ }
358
+ function __asyncValues(o) {
359
+ if (!Symbol.asyncIterator)
360
+ throw new TypeError("Symbol.asyncIterator is not defined.");
361
+ var m = o[Symbol.asyncIterator], i;
362
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
363
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
364
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
365
+ }
366
+ function __makeTemplateObject(cooked, raw) {
367
+ if (Object.defineProperty) {
368
+ Object.defineProperty(cooked, "raw", { value: raw });
369
+ }
370
+ else {
371
+ cooked.raw = raw;
372
+ }
373
+ return cooked;
374
+ }
375
+ ;
376
+ var __setModuleDefault = Object.create ? (function (o, v) {
377
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
378
+ }) : function (o, v) {
379
+ o["default"] = v;
380
+ };
381
+ var ownKeys = function (o) {
382
+ ownKeys = Object.getOwnPropertyNames || function (o) {
383
+ var ar = [];
384
+ for (var k in o)
385
+ if (Object.prototype.hasOwnProperty.call(o, k))
386
+ ar[ar.length] = k;
387
+ return ar;
388
+ };
389
+ return ownKeys(o);
390
+ };
391
+ function __importStar(mod) {
392
+ if (mod && mod.__esModule)
393
+ return mod;
394
+ var result = {};
395
+ if (mod != null)
396
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++)
397
+ if (k[i] !== "default")
398
+ __createBinding(result, mod, k[i]);
399
+ __setModuleDefault(result, mod);
400
+ return result;
401
+ }
402
+ function __importDefault(mod) {
403
+ return (mod && mod.__esModule) ? mod : { default: mod };
404
+ }
405
+ function __classPrivateFieldGet(receiver, state, kind, f) {
406
+ if (kind === "a" && !f)
407
+ throw new TypeError("Private accessor was defined without a getter");
408
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
409
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
410
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
411
+ }
412
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
413
+ if (kind === "m")
414
+ throw new TypeError("Private method is not writable");
415
+ if (kind === "a" && !f)
416
+ throw new TypeError("Private accessor was defined without a setter");
417
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
418
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
419
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
420
+ }
421
+ function __classPrivateFieldIn(state, receiver) {
422
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
423
+ throw new TypeError("Cannot use 'in' operator on non-object");
424
+ return typeof state === "function" ? receiver === state : state.has(receiver);
425
+ }
426
+ function __addDisposableResource(env, value, async) {
427
+ if (value !== null && value !== void 0) {
428
+ if (typeof value !== "object" && typeof value !== "function")
429
+ throw new TypeError("Object expected.");
430
+ var dispose, inner;
431
+ if (async) {
432
+ if (!Symbol.asyncDispose)
433
+ throw new TypeError("Symbol.asyncDispose is not defined.");
434
+ dispose = value[Symbol.asyncDispose];
435
+ }
436
+ if (dispose === void 0) {
437
+ if (!Symbol.dispose)
438
+ throw new TypeError("Symbol.dispose is not defined.");
439
+ dispose = value[Symbol.dispose];
440
+ if (async)
441
+ inner = dispose;
442
+ }
443
+ if (typeof dispose !== "function")
444
+ throw new TypeError("Object not disposable.");
445
+ if (inner)
446
+ dispose = function () { try {
447
+ inner.call(this);
448
+ }
449
+ catch (e) {
450
+ return Promise.reject(e);
451
+ } };
452
+ env.stack.push({ value: value, dispose: dispose, async: async });
453
+ }
454
+ else if (async) {
455
+ env.stack.push({ async: true });
456
+ }
457
+ return value;
458
+ }
459
+ var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
460
+ var e = new Error(message);
461
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
462
+ };
463
+ function __disposeResources(env) {
464
+ function fail(e) {
465
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
466
+ env.hasError = true;
467
+ }
468
+ var r, s = 0;
469
+ function next() {
470
+ while (r = env.stack.pop()) {
471
+ try {
472
+ if (!r.async && s === 1)
473
+ return s = 0, env.stack.push(r), Promise.resolve().then(next);
474
+ if (r.dispose) {
475
+ var result = r.dispose.call(r.value);
476
+ if (r.async)
477
+ return s |= 2, Promise.resolve(result).then(next, function (e) { fail(e); return next(); });
478
+ }
479
+ else
480
+ s |= 1;
481
+ }
482
+ catch (e) {
483
+ fail(e);
484
+ }
485
+ }
486
+ if (s === 1)
487
+ return env.hasError ? Promise.reject(env.error) : Promise.resolve();
488
+ if (env.hasError)
489
+ throw env.error;
490
+ }
491
+ return next();
492
+ }
493
+ function __rewriteRelativeImportExtension(path, preserveJsx) {
494
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
495
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
496
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
497
+ });
498
+ }
499
+ return path;
500
+ }
501
+ var tslib_es6 = {
502
+ __extends: __extends,
503
+ __assign: __assign,
504
+ __rest: __rest,
505
+ __decorate: __decorate,
506
+ __param: __param,
507
+ __esDecorate: __esDecorate,
508
+ __runInitializers: __runInitializers,
509
+ __propKey: __propKey,
510
+ __setFunctionName: __setFunctionName,
511
+ __metadata: __metadata,
512
+ __awaiter: __awaiter,
513
+ __generator: __generator,
514
+ __createBinding: __createBinding,
515
+ __exportStar: __exportStar,
516
+ __values: __values,
517
+ __read: __read,
518
+ __spread: __spread,
519
+ __spreadArrays: __spreadArrays,
520
+ __spreadArray: __spreadArray,
521
+ __await: __await,
522
+ __asyncGenerator: __asyncGenerator,
523
+ __asyncDelegator: __asyncDelegator,
524
+ __asyncValues: __asyncValues,
525
+ __makeTemplateObject: __makeTemplateObject,
526
+ __importStar: __importStar,
527
+ __importDefault: __importDefault,
528
+ __classPrivateFieldGet: __classPrivateFieldGet,
529
+ __classPrivateFieldSet: __classPrivateFieldSet,
530
+ __classPrivateFieldIn: __classPrivateFieldIn,
531
+ __addDisposableResource: __addDisposableResource,
532
+ __disposeResources: __disposeResources,
533
+ __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
534
+ };
535
+
536
+ /**
537
+ * Assembly of @package ng2-cookies @see https://www.npmjs.com/package/ng2-cookies
538
+ *
539
+ * Reassembled by
540
+ * @author sambath999
541
+ * @date_29_09_2021
542
+ * Updated from raw parameters to
543
+ * @param {ICookieOptions} options and added another newer cookie flag
544
+ * @param {string} samesite
545
+ * @param {constant} SameSiteTypes, @param {string} strict "strict", @param {string} lax "lax", @param {string} none "none"
546
+ *
547
+ * @enum
548
+ */
549
+ var LocalizeTokenStorageHelper = /** @class */ (function () {
550
+ function LocalizeTokenStorageHelper() {
551
+ }
552
+ /**
553
+ * Checks the existence of a single cookie by it's name
554
+ *
555
+ * @param {string} name Identification of the cookie
556
+ * @returns existence of the cookie
557
+ */
558
+ LocalizeTokenStorageHelper.prototype.check = function (name) {
559
+ if (typeof document === "undefined")
560
+ return false;
561
+ name = encodeURIComponent(name);
562
+ var regexp = new RegExp('(?:^' + name + '|;\\s*' + name + ')=(.*?)(?:;|$)', 'g');
563
+ return regexp.test(document.cookie);
564
+ };
565
+ /**
566
+ * Retrieves a single cookie by it's name
567
+ *
568
+ * @param {string} name Identification of the Cookie
569
+ * @returns The Cookie's value
570
+ */
571
+ LocalizeTokenStorageHelper.prototype.get = function (name) {
572
+ if (!this.check(name))
573
+ return undefined;
574
+ name = encodeURIComponent(name);
575
+ var regexp = new RegExp('(?:^' + name + '|;\\s*' + name + ')=(.*?)(?:;|$)', 'g');
576
+ var result = regexp.exec(document.cookie);
577
+ return result ? decodeURIComponent(result[1]) : undefined;
578
+ };
579
+ /**
580
+ * Retrieves a a list of all cookie avaiable
581
+ *
582
+ * @returns Object with all Cookies
583
+ */
584
+ LocalizeTokenStorageHelper.prototype.getAll = function () {
585
+ var e_1, _a;
586
+ var cookies = {};
587
+ if (document.cookie) {
588
+ var split = document.cookie.split(';');
589
+ try {
590
+ for (var split_1 = __values(split), split_1_1 = split_1.next(); !split_1_1.done; split_1_1 = split_1.next()) {
591
+ var s = split_1_1.value;
592
+ var currCookie = s.split('=');
593
+ currCookie[0] = currCookie[0].trim();
594
+ cookies[decodeURIComponent(currCookie[0])] = decodeURIComponent(currCookie[1]);
595
+ }
596
+ }
597
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
598
+ finally {
599
+ try {
600
+ if (split_1_1 && !split_1_1.done && (_a = split_1.return)) _a.call(split_1);
601
+ }
602
+ finally { if (e_1) throw e_1.error; }
603
+ }
604
+ }
605
+ return cookies;
606
+ };
607
+ Object.defineProperty(LocalizeTokenStorageHelper.prototype, "defaultOptions", {
608
+ get: function () { return LocalizeToken.cookieOptions; },
609
+ enumerable: false,
610
+ configurable: true
611
+ });
612
+ LocalizeTokenStorageHelper.prototype.set = function (name, value, options) {
613
+ options !== null && options !== void 0 ? options : (options = this.defaultOptions);
614
+ var expires = options.expires, path = options.path, domain = options.domain, secure = options.secure, samesite = options.samesite;
615
+ var cookieStr = encodeURIComponent(name) + "=" + encodeURIComponent(value) + ";";
616
+ if (expires) {
617
+ var dtExpires = typeof expires === 'number' ? new Date(Date.now() + expires * 864e5) : expires;
618
+ cookieStr += "expires=" + dtExpires.toUTCString() + ";";
619
+ }
620
+ cookieStr += path ? "path=" + path + ";" : '';
621
+ cookieStr += domain ? "domain=" + domain + ";" : '';
622
+ cookieStr += secure ? 'secure;' : '';
623
+ cookieStr += samesite ? "samesite=" + samesite + ";" : '';
624
+ document.cookie = cookieStr;
625
+ };
626
+ /**
627
+ * Removes specified Cookie
628
+ *
629
+ * @param {string} name Cookie's identification
630
+ * @param {string} path Path relative to the domain where the cookie should be avaiable. Default /
631
+ * @param {string} domain Domain where the cookie should be avaiable. Default current domain
632
+ */
633
+ LocalizeTokenStorageHelper.prototype.delete = function (name, path, domain) {
634
+ if (path === void 0) { path = '/'; }
635
+ if (domain === void 0) { domain = window.location.hostname; }
636
+ this.set(name, '', { path: path, domain: domain, expires: -1 });
637
+ };
638
+ /**
639
+ * Delete all cookie avaiable
640
+ */
641
+ LocalizeTokenStorageHelper.prototype.deleteAll = function (path, domain) {
642
+ var e_2, _a;
643
+ var cookies = this.getAll();
644
+ try {
645
+ for (var _b = __values(Object.keys(cookies)), _c = _b.next(); !_c.done; _c = _b.next()) {
646
+ var cookieName = _c.value;
647
+ this.delete(cookieName, path, domain);
648
+ }
649
+ }
650
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
651
+ finally {
652
+ try {
653
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
654
+ }
655
+ finally { if (e_2) throw e_2.error; }
656
+ }
657
+ };
658
+ return LocalizeTokenStorageHelper;
659
+ }());
660
+ exports.ISameSiteType = void 0;
661
+ (function (ISameSiteType) {
662
+ ISameSiteType["strict"] = "strict";
663
+ ISameSiteType["lax"] = "lax";
664
+ ISameSiteType["none"] = "none";
665
+ })(exports.ISameSiteType || (exports.ISameSiteType = {}));
666
+
667
+ var LocalizeToken = /** @class */ (function () {
668
+ function LocalizeToken() {
669
+ }
670
+ return LocalizeToken;
671
+ }());
672
+ LocalizeToken.config = {
673
+ mainDomain: location.hostname,
674
+ authTokenName: 'auth-token',
675
+ tenantTokenName: 'tenant-token',
676
+ refreshTokenName: 'refresh-token',
677
+ needTenant: false,
678
+ isProduction: false,
679
+ };
680
+ LocalizeToken.cookieOptions = {
681
+ path: '/',
682
+ domain: LocalizeToken.config.mainDomain,
683
+ secure: true,
684
+ // samesite: SameSiteType.strict,
685
+ expires: 1
686
+ };
687
+ LocalizeToken.storage = new LocalizeTokenStorageHelper();
688
+ LocalizeToken.httpHeaders = {
689
+ AUTHORIZATION: 'Authorization',
690
+ X_TENANT: 'X-Tenant',
691
+ X_REFRESH_TOKEN: 'X-RefreshToken',
692
+ CONTENT_TYPE: 'Content-Type',
693
+ };
694
+ /**
695
+ * Waits for a specified amount of time.
696
+ * @param milliseconds - The milliseconds to wait.
697
+ * @param when - The condition to wait for. Default is true.
698
+ * @returns - Promise<void>
699
+ */
700
+ function waitFor(milliseconds, when) {
701
+ if (when === void 0) { when = true; }
702
+ return __awaiter(this, void 0, void 0, function () {
703
+ return __generator(this, function (_a) {
704
+ switch (_a.label) {
705
+ case 0:
706
+ if (!when)
707
+ return [2 /*return*/];
708
+ return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, milliseconds); })];
709
+ case 1:
710
+ _a.sent();
711
+ return [2 /*return*/];
712
+ }
713
+ });
714
+ });
715
+ }
716
+ /**
717
+ * Waits until the condition is met.
718
+ * @param when - The condition to wait for.
719
+ * @param intervalNumber - The interval number in milliseconds to check the condition. Default is 50.
720
+ */
721
+ function waitUntil(when, intervalNumber) {
722
+ if (intervalNumber === void 0) { intervalNumber = 50; }
723
+ return __awaiter(this, void 0, void 0, function () {
724
+ var _this = this;
725
+ return __generator(this, function (_a) {
726
+ switch (_a.label) {
727
+ case 0: return [4 /*yield*/, new Promise(function (resolve) {
728
+ var interval = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
729
+ var cond, result, _a;
730
+ return __generator(this, function (_b) {
731
+ switch (_b.label) {
732
+ case 0:
733
+ cond = when();
734
+ if (!(cond instanceof Promise)) return [3 /*break*/, 2];
735
+ return [4 /*yield*/, cond];
736
+ case 1:
737
+ _a = _b.sent();
738
+ return [3 /*break*/, 3];
739
+ case 2:
740
+ _a = cond;
741
+ _b.label = 3;
742
+ case 3:
743
+ result = _a;
744
+ if (result) {
745
+ clearInterval(interval);
746
+ resolve(true);
747
+ }
748
+ return [2 /*return*/];
749
+ }
750
+ });
751
+ }); }, intervalNumber);
752
+ })];
753
+ case 1:
754
+ _a.sent();
755
+ return [2 /*return*/];
756
+ }
757
+ });
758
+ });
759
+ }
760
+
761
+ var LocalizeTokenService = /** @class */ (function () {
762
+ function LocalizeTokenService() {
763
+ this.isRevokingTokenSubject = new rxjs.BehaviorSubject(false);
764
+ this.decodeToken = function (token) { return jwt_decode__namespace.jwtDecode(token); };
765
+ }
766
+ Object.defineProperty(LocalizeTokenService.prototype, "authToken", {
767
+ get: function () { return this.storageGet(); },
768
+ set: function (value) {
769
+ value
770
+ ? this.storageSet(value)
771
+ : LocalizeToken.storage.delete(LocalizeToken.config.authTokenName);
772
+ },
773
+ enumerable: false,
774
+ configurable: true
775
+ });
776
+ Object.defineProperty(LocalizeTokenService.prototype, "refreshToken", {
777
+ get: function () { return LocalizeToken.storage.get(LocalizeToken.config.refreshTokenName); },
778
+ enumerable: false,
779
+ configurable: true
780
+ });
781
+ Object.defineProperty(LocalizeTokenService.prototype, "accessToken", {
782
+ get: function () { var _a; return (_a = this.authToken) === null || _a === void 0 ? void 0 : _a.token; },
783
+ set: function (value) {
784
+ if (value) {
785
+ this.authToken = { token: value, revoke: false };
786
+ }
787
+ },
788
+ enumerable: false,
789
+ configurable: true
790
+ });
791
+ Object.defineProperty(LocalizeTokenService.prototype, "isRevokingToken", {
792
+ get: function () { return this.isRevokingTokenSubject.value; /* this.authToken?.revoke ?? false */ },
793
+ set: function (value) {
794
+ this.isRevokingTokenSubject.next(value);
795
+ if (this.authToken) {
796
+ this.authToken = Object.assign(Object.assign({}, this.authToken), { revoke: value });
797
+ }
798
+ },
799
+ enumerable: false,
800
+ configurable: true
801
+ });
802
+ Object.defineProperty(LocalizeTokenService.prototype, "tenantToken", {
803
+ get: function () { return LocalizeToken.storage.get(LocalizeToken.config.tenantTokenName); },
804
+ enumerable: false,
805
+ configurable: true
806
+ });
807
+ LocalizeTokenService.prototype.storageGet = function () {
808
+ try {
809
+ var encoded = LocalizeToken.storage.get(LocalizeToken.config.authTokenName);
810
+ var decoded = atob(encoded || '');
811
+ return JSON.parse(decoded);
812
+ }
813
+ catch (_a) {
814
+ return undefined;
815
+ }
816
+ };
817
+ LocalizeTokenService.prototype.storageSet = function (value) {
818
+ var base64 = btoa(JSON.stringify(value));
819
+ LocalizeToken.storage.set(LocalizeToken.config.authTokenName, base64);
820
+ };
821
+ LocalizeTokenService.prototype.tokensValid = function () {
822
+ var _a, _b;
823
+ return ((_a = this.refreshToken) === null || _a === void 0 ? void 0 : _a.length) && (!LocalizeToken.config.needTenant || ((_b = this.tenantToken) === null || _b === void 0 ? void 0 : _b.length));
824
+ };
825
+ Object.defineProperty(LocalizeTokenService.prototype, "decodeRefreshToken", {
826
+ get: function () {
827
+ var token = LocalizeToken.storage.get(LocalizeToken.config.refreshTokenName);
828
+ if (!token)
829
+ return null;
830
+ return this.decodeToken(token);
831
+ },
832
+ enumerable: false,
833
+ configurable: true
834
+ });
835
+ return LocalizeTokenService;
836
+ }());
837
+ LocalizeTokenService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalizeTokenService_Factory() { return new LocalizeTokenService(); }, token: LocalizeTokenService, providedIn: "root" });
838
+ LocalizeTokenService.decorators = [
839
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
840
+ ];
841
+ LocalizeTokenService.ctorParameters = function () { return []; };
842
+
843
+ /**
844
+ * Http method options
845
+ */
846
+ exports.EMethod = void 0;
847
+ (function (EMethod) {
848
+ EMethod[EMethod["POST"] = 1] = "POST";
849
+ EMethod[EMethod["GET"] = 2] = "GET";
850
+ EMethod[EMethod["PUT"] = 3] = "PUT";
851
+ EMethod[EMethod["DELETE"] = 4] = "DELETE";
852
+ EMethod[EMethod["PATCH"] = 5] = "PATCH";
853
+ })(exports.EMethod || (exports.EMethod = {}));
854
+ var LocalizeApiService = /** @class */ (function () {
855
+ function LocalizeApiService(localizeTokenService) {
856
+ var _this = this;
857
+ this.localizeTokenService = localizeTokenService;
858
+ this.isRequestingSubject = new rxjs.BehaviorSubject(false);
859
+ this.isResolvedStartupSubject = new rxjs.BehaviorSubject(false);
860
+ this.apiConfigs = {};
861
+ /**
862
+ * A higher-order function that returns a curried function for making API requests.
863
+ *
864
+ * @param baseUrl - The base URL of the API.
865
+ * @returns A curried function that can be used to make API requests.
866
+ */
867
+ this.func = function (baseUrl) { return function (path, method, value, isFormData, headers) {
868
+ if (method === void 0) { method = exports.EMethod.GET; }
869
+ if (value === void 0) { value = null; }
870
+ if (isFormData === void 0) { isFormData = false; }
871
+ return _this.base(baseUrl, path, method, value, isFormData, headers);
872
+ }; };
873
+ }
874
+ Object.defineProperty(LocalizeApiService.prototype, "isRequesting", {
875
+ get: function () { return this.isRequestingSubject.value; },
876
+ enumerable: false,
877
+ configurable: true
878
+ });
879
+ Object.defineProperty(LocalizeApiService.prototype, "isResolvedStartup", {
880
+ get: function () { return this.isResolvedStartupSubject.value; },
881
+ enumerable: false,
882
+ configurable: true
883
+ });
884
+ /**
885
+ * Initialize the API service.
886
+ * @param apiConfigs - The API configurations.
887
+ */
888
+ LocalizeApiService.prototype.init = function (apiConfigs, httpClient) {
889
+ this.httpClient = httpClient;
890
+ this.apiConfigs = apiConfigs;
891
+ };
892
+ LocalizeApiService.prototype.base = function (baseUrl, path, method, value, isFormData, headers) {
893
+ if (method === void 0) { method = exports.EMethod.GET; }
894
+ if (value === void 0) { value = null; }
895
+ if (isFormData === void 0) { isFormData = false; }
896
+ return __awaiter(this, void 0, void 0, function () {
897
+ var url, httpMethod, request, error_1;
898
+ var _this = this;
899
+ return __generator(this, function (_b) {
900
+ switch (_b.label) {
901
+ case 0: return [4 /*yield*/, this.ifPromise(this.apiConfigs.onPrepareRequest)];
902
+ case 1:
903
+ _b.sent();
904
+ url = "" + baseUrl.trim().replace(/\/?$/, '/') + path.trim().replace(/^\//, '');
905
+ httpMethod = exports.EMethod[method].toLowerCase();
906
+ request = function () { return { body: value, headers: _this.options(isFormData, headers) }; };
907
+ // Wait for previous request to complete
908
+ return [4 /*yield*/, this.toWaitForPreviousRequest()];
909
+ case 2:
910
+ // Wait for previous request to complete
911
+ _b.sent();
912
+ _b.label = 3;
913
+ case 3:
914
+ _b.trys.push([3, 5, , 7]);
915
+ return [4 /*yield*/, this.processRequest(httpMethod, url, request())];
916
+ case 4: return [2 /*return*/, _b.sent()];
917
+ case 5:
918
+ error_1 = _b.sent();
919
+ if (error_1.status !== 401) {
920
+ throw error_1;
921
+ }
922
+ return [4 /*yield*/, this.onUnauthorizedError(httpMethod, url, request)];
923
+ case 6: return [2 /*return*/, _b.sent()];
924
+ case 7: return [2 /*return*/];
925
+ }
926
+ });
927
+ });
928
+ };
929
+ LocalizeApiService.prototype.onUnauthorizedError = function (httpMethod, url, request) {
930
+ return __awaiter(this, void 0, void 0, function () {
931
+ return __generator(this, function (_b) {
932
+ switch (_b.label) {
933
+ case 0: return [4 /*yield*/, this.revokeToken()];
934
+ case 1:
935
+ _b.sent();
936
+ if (!!this.isResolvedStartup) return [3 /*break*/, 3];
937
+ return [4 /*yield*/, this.processRequest(httpMethod, url, request())];
938
+ case 2: return [2 /*return*/, _b.sent()];
939
+ case 3: return [2 /*return*/];
940
+ }
941
+ });
942
+ });
943
+ };
944
+ LocalizeApiService.prototype.toWaitForPreviousRequest = function () {
945
+ return __awaiter(this, void 0, void 0, function () {
946
+ var _this = this;
947
+ return __generator(this, function (_b) {
948
+ switch (_b.label) {
949
+ case 0:
950
+ if (!this.localizeTokenService.isRevokingToken) return [3 /*break*/, 2];
951
+ return [4 /*yield*/, waitUntil(function () { return !_this.localizeTokenService.isRevokingToken; })];
952
+ case 1:
953
+ _b.sent();
954
+ _b.label = 2;
955
+ case 2:
956
+ // to wait for each request in 50ms, even if the request is not completed
957
+ return [4 /*yield*/, waitFor(50, this.isRequesting)];
958
+ case 3:
959
+ // to wait for each request in 50ms, even if the request is not completed
960
+ _b.sent();
961
+ return [2 /*return*/];
962
+ }
963
+ });
964
+ });
965
+ };
966
+ LocalizeApiService.prototype.processRequest = function (method, url, options) {
967
+ return __awaiter(this, void 0, void 0, function () {
968
+ var result;
969
+ var _this = this;
970
+ return __generator(this, function (_b) {
971
+ switch (_b.label) {
972
+ case 0:
973
+ this.isRequestingSubject.next(true);
974
+ return [4 /*yield*/, new Promise(function (resolve, reject) { var _a; return (_a = _this.httpClient) === null || _a === void 0 ? void 0 : _a.request(method, url, options).subscribe({ next: resolve, error: reject }); })];
975
+ case 1:
976
+ result = _b.sent();
977
+ this.isRequestingSubject.next(false);
978
+ return [2 /*return*/, result];
979
+ }
980
+ });
981
+ });
982
+ };
983
+ LocalizeApiService.prototype.revokeToken = function (force) {
984
+ if (force === void 0) { force = false; }
985
+ return __awaiter(this, void 0, void 0, function () {
986
+ var reqUrl_1, reqHeaders_1, revokeToken;
987
+ var _this = this;
988
+ return __generator(this, function (_b) {
989
+ switch (_b.label) {
990
+ case 0:
991
+ if (!(this.localizeTokenService.isRevokingToken && !force)) return [3 /*break*/, 2];
992
+ return [4 /*yield*/, waitUntil(function () { return !_this.localizeTokenService.isRevokingToken; })];
993
+ case 1:
994
+ _b.sent();
995
+ return [2 /*return*/];
996
+ case 2:
997
+ _b.trys.push([2, , 10, 11]);
998
+ this.localizeTokenService.isRevokingToken = true;
999
+ reqUrl_1 = LocalizeToken.config.revokeTokenUrl;
1000
+ reqHeaders_1 = this.options().append(LocalizeToken.httpHeaders.X_REFRESH_TOKEN, "" + this.localizeTokenService.refreshToken);
1001
+ return [4 /*yield*/, new Promise(function (resolve, reject) { var _a; return (_a = _this.httpClient) === null || _a === void 0 ? void 0 : _a.get(reqUrl_1, { headers: reqHeaders_1 }).subscribe({ next: resolve, error: reject }); })];
1002
+ case 3:
1003
+ revokeToken = _b.sent();
1004
+ if (!(revokeToken === null || revokeToken === void 0 ? void 0 : revokeToken.status)) return [3 /*break*/, 4];
1005
+ this.localizeTokenService.accessToken = revokeToken.message;
1006
+ return [3 /*break*/, 9];
1007
+ case 4:
1008
+ if (!!this.localizeTokenService.refreshToken) return [3 /*break*/, 6];
1009
+ return [4 /*yield*/, this.ifPromise(this.apiConfigs.onAutoLogout)];
1010
+ case 5:
1011
+ _b.sent();
1012
+ return [3 /*break*/, 9];
1013
+ case 6:
1014
+ if (!this.apiConfigs.onRevokeUnauthorized) return [3 /*break*/, 9];
1015
+ return [4 /*yield*/, this.ifPromise(this.apiConfigs.onRevokeUnauthorized)];
1016
+ case 7:
1017
+ _b.sent();
1018
+ return [4 /*yield*/, this.revokeToken(true)];
1019
+ case 8:
1020
+ _b.sent();
1021
+ _b.label = 9;
1022
+ case 9: return [3 /*break*/, 11];
1023
+ case 10:
1024
+ this.localizeTokenService.isRevokingToken = false;
1025
+ return [7 /*endfinally*/];
1026
+ case 11: return [2 /*return*/];
1027
+ }
1028
+ });
1029
+ });
1030
+ };
1031
+ /** default http request options */
1032
+ LocalizeApiService.prototype.options = function (isFormData, headers) {
1033
+ var _b;
1034
+ if (isFormData === void 0) { isFormData = false; }
1035
+ if (headers === void 0) { headers = {}; }
1036
+ var defaultHeaders = (_b = {}, _b[LocalizeToken.httpHeaders.AUTHORIZATION] = "Bearer " + this.localizeTokenService.accessToken, _b);
1037
+ if (LocalizeToken.config.needTenant) {
1038
+ defaultHeaders[LocalizeToken.httpHeaders.X_TENANT] = "" + this.localizeTokenService.tenantToken;
1039
+ }
1040
+ if (!isFormData) {
1041
+ defaultHeaders[LocalizeToken.httpHeaders.CONTENT_TYPE] = 'application/json';
1042
+ }
1043
+ var filteredHeaders = Object.keys(defaultHeaders).filter(function (key) { return !Object.keys(headers).includes(key); })
1044
+ .reduce(function (acc, key) {
1045
+ var _b;
1046
+ return (Object.assign(Object.assign({}, acc), (_b = {}, _b[key] = defaultHeaders[key], _b)));
1047
+ }, {});
1048
+ var mergedHeaders = Object.assign(Object.assign({}, filteredHeaders), headers);
1049
+ return new http.HttpHeaders(mergedHeaders);
1050
+ };
1051
+ LocalizeApiService.prototype.ifPromise = function (fn) {
1052
+ return __awaiter(this, void 0, void 0, function () {
1053
+ var _b;
1054
+ return __generator(this, function (_c) {
1055
+ switch (_c.label) {
1056
+ case 0:
1057
+ if (!fn)
1058
+ return [2 /*return*/];
1059
+ if (!(fn instanceof Promise)) return [3 /*break*/, 2];
1060
+ return [4 /*yield*/, fn()];
1061
+ case 1:
1062
+ _b = _c.sent();
1063
+ return [3 /*break*/, 3];
1064
+ case 2:
1065
+ _b = fn();
1066
+ _c.label = 3;
1067
+ case 3: return [2 /*return*/, _b];
1068
+ }
1069
+ });
1070
+ });
1071
+ };
1072
+ return LocalizeApiService;
1073
+ }()); //class
1074
+ LocalizeApiService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalizeApiService_Factory() { return new LocalizeApiService(i0__namespace.ɵɵinject(LocalizeTokenService)); }, token: LocalizeApiService, providedIn: "root" });
1075
+ LocalizeApiService.decorators = [
1076
+ { type: i0.Injectable, args: [{
1077
+ providedIn: 'root'
1078
+ },] }
1079
+ ];
1080
+ LocalizeApiService.ctorParameters = function () { return [
1081
+ { type: LocalizeTokenService }
1082
+ ]; };
1083
+
1084
+ var LocalizeTokenModule = /** @class */ (function () {
1085
+ function LocalizeTokenModule() {
1086
+ }
1087
+ return LocalizeTokenModule;
1088
+ }());
1089
+ LocalizeTokenModule.decorators = [
1090
+ { type: i0.NgModule, args: [{
1091
+ providers: [
1092
+ LocalizeTokenService,
1093
+ LocalizeApiService
1094
+ ],
1095
+ },] }
1096
+ ];
1097
+
1098
+ /**
1099
+ * Generated bundle index. Do not edit.
1100
+ */
1101
+
1102
+ exports.LocalizeApiService = LocalizeApiService;
1103
+ exports.LocalizeToken = LocalizeToken;
1104
+ exports.LocalizeTokenModule = LocalizeTokenModule;
1105
+ exports.LocalizeTokenService = LocalizeTokenService;
1106
+ exports.LocalizeTokenStorageHelper = LocalizeTokenStorageHelper;
1107
+ exports.waitFor = waitFor;
1108
+ exports.waitUntil = waitUntil;
1109
+
1110
+ Object.defineProperty(exports, '__esModule', { value: true });
1111
+
1112
+ }));
1113
+ //# sourceMappingURL=sambath999-localize-token.umd.js.map