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