@pepperi-addons/ngx-composite-lib 0.0.16-beta.7 → 0.0.16-beta.8

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.
Files changed (125) hide show
  1. package/bundles/pepperi-addons-ngx-composite-lib-color-settings.umd.js +123 -123
  2. package/bundles/pepperi-addons-ngx-composite-lib-dimx-export.umd.js +835 -835
  3. package/bundles/pepperi-addons-ngx-composite-lib-dimx-export.umd.js.map +1 -1
  4. package/bundles/pepperi-addons-ngx-composite-lib-file-status-panel.umd.js +84 -84
  5. package/bundles/pepperi-addons-ngx-composite-lib-generic-form.umd.js +647 -647
  6. package/bundles/pepperi-addons-ngx-composite-lib-generic-list.umd.js +961 -961
  7. package/bundles/pepperi-addons-ngx-composite-lib-group-buttons-settings.umd.js +176 -176
  8. package/bundles/pepperi-addons-ngx-composite-lib-shadow-settings.umd.js +117 -117
  9. package/bundles/pepperi-addons-ngx-composite-lib.umd.js +538 -538
  10. package/color-settings/color-settings.component.d.ts +22 -22
  11. package/color-settings/color-settings.model.d.ts +5 -5
  12. package/color-settings/color-settings.module.d.ts +12 -12
  13. package/color-settings/pepperi-addons-ngx-composite-lib-color-settings.d.ts +5 -5
  14. package/color-settings/public-api.d.ts +3 -3
  15. package/core/common/directives/index.d.ts +1 -1
  16. package/core/common/directives/public-api.d.ts +1 -1
  17. package/core/common/directives/reset-configuration-field.directive.d.ts +38 -38
  18. package/core/common/index.d.ts +1 -1
  19. package/core/common/public-api.d.ts +2 -2
  20. package/core/common/services/index.d.ts +1 -1
  21. package/core/common/services/public-api.d.ts +1 -1
  22. package/core/common/services/utilities.service.d.ts +6 -6
  23. package/core/index.d.ts +1 -1
  24. package/core/public-api.d.ts +1 -1
  25. package/dimx-export/dimx.component.d.ts +86 -86
  26. package/dimx-export/dimx.model.d.ts +5 -5
  27. package/dimx-export/dimx.module.d.ts +16 -16
  28. package/dimx-export/dimx.service.d.ts +20 -21
  29. package/dimx-export/index.d.ts +1 -1
  30. package/dimx-export/pepperi-addons-ngx-composite-lib-dimx-export.d.ts +5 -5
  31. package/dimx-export/public-api.d.ts +3 -3
  32. package/esm2015/color-settings/color-settings.component.js +81 -81
  33. package/esm2015/color-settings/color-settings.model.js +8 -8
  34. package/esm2015/color-settings/color-settings.module.js +39 -39
  35. package/esm2015/color-settings/pepperi-addons-ngx-composite-lib-color-settings.js +4 -4
  36. package/esm2015/color-settings/public-api.js +6 -6
  37. package/esm2015/core/common/directives/index.js +4 -4
  38. package/esm2015/core/common/directives/public-api.js +4 -4
  39. package/esm2015/core/common/directives/reset-configuration-field.directive.js +135 -135
  40. package/esm2015/core/common/index.js +4 -4
  41. package/esm2015/core/common/public-api.js +5 -5
  42. package/esm2015/core/common/services/index.js +4 -4
  43. package/esm2015/core/common/services/public-api.js +4 -4
  44. package/esm2015/core/common/services/utilities.service.js +18 -18
  45. package/esm2015/core/index.js +4 -4
  46. package/esm2015/core/public-api.js +4 -4
  47. package/esm2015/dimx-export/dimx.component.js +334 -334
  48. package/esm2015/dimx-export/dimx.model.js +7 -7
  49. package/esm2015/dimx-export/dimx.module.js +52 -52
  50. package/esm2015/dimx-export/dimx.service.js +50 -50
  51. package/esm2015/dimx-export/index.js +4 -4
  52. package/esm2015/dimx-export/pepperi-addons-ngx-composite-lib-dimx-export.js +4 -4
  53. package/esm2015/dimx-export/public-api.js +6 -6
  54. package/esm2015/file-status-panel/file-status-panel.component.js +38 -38
  55. package/esm2015/file-status-panel/file-status-panel.model.js +8 -8
  56. package/esm2015/file-status-panel/file-status-panel.module.js +47 -47
  57. package/esm2015/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.js +4 -4
  58. package/esm2015/file-status-panel/public-api.js +6 -6
  59. package/esm2015/generic-form/generic-form.component.js +189 -189
  60. package/esm2015/generic-form/generic-form.model.js +1 -1
  61. package/esm2015/generic-form/generic-form.module.js +73 -73
  62. package/esm2015/generic-form/generic-form.service.js +67 -67
  63. package/esm2015/generic-form/index.js +4 -4
  64. package/esm2015/generic-form/pepperi-addons-ngx-composite-lib-generic-form.js +4 -4
  65. package/esm2015/generic-form/public-api.js +7 -7
  66. package/esm2015/generic-list/generic-list.component.js +416 -416
  67. package/esm2015/generic-list/generic-list.model.js +1 -1
  68. package/esm2015/generic-list/generic-list.module.js +68 -68
  69. package/esm2015/generic-list/generic-list.service.js +113 -113
  70. package/esm2015/generic-list/pepperi-addons-ngx-composite-lib-generic-list.js +4 -4
  71. package/esm2015/generic-list/public-api.js +7 -7
  72. package/esm2015/group-buttons-settings/group-buttons-settings.component.js +134 -134
  73. package/esm2015/group-buttons-settings/group-buttons-settings.model.js +1 -1
  74. package/esm2015/group-buttons-settings/group-buttons-settings.module.js +46 -46
  75. package/esm2015/group-buttons-settings/pepperi-addons-ngx-composite-lib-group-buttons-settings.js +4 -4
  76. package/esm2015/group-buttons-settings/public-api.js +6 -6
  77. package/esm2015/ngx-composite-lib.module.js +44 -44
  78. package/esm2015/pepperi-addons-ngx-composite-lib.js +4 -4
  79. package/esm2015/public-api.js +5 -5
  80. package/esm2015/shadow-settings/pepperi-addons-ngx-composite-lib-shadow-settings.js +4 -4
  81. package/esm2015/shadow-settings/public-api.js +6 -6
  82. package/esm2015/shadow-settings/shadow-settings.component.js +72 -72
  83. package/esm2015/shadow-settings/shadow-settings.model.js +7 -7
  84. package/esm2015/shadow-settings/shadow-settings.module.js +43 -43
  85. package/fesm2015/pepperi-addons-ngx-composite-lib-color-settings.js +113 -113
  86. package/fesm2015/pepperi-addons-ngx-composite-lib-dimx-export.js +415 -415
  87. package/fesm2015/pepperi-addons-ngx-composite-lib-dimx-export.js.map +1 -1
  88. package/fesm2015/pepperi-addons-ngx-composite-lib-file-status-panel.js +77 -77
  89. package/fesm2015/pepperi-addons-ngx-composite-lib-generic-form.js +301 -301
  90. package/fesm2015/pepperi-addons-ngx-composite-lib-generic-list.js +559 -559
  91. package/fesm2015/pepperi-addons-ngx-composite-lib-group-buttons-settings.js +167 -167
  92. package/fesm2015/pepperi-addons-ngx-composite-lib-shadow-settings.js +107 -107
  93. package/fesm2015/pepperi-addons-ngx-composite-lib.js +197 -197
  94. package/file-status-panel/file-status-panel.component.d.ts +14 -14
  95. package/file-status-panel/file-status-panel.model.d.ts +7 -7
  96. package/file-status-panel/file-status-panel.module.d.ts +14 -14
  97. package/file-status-panel/pepperi-addons-ngx-composite-lib-file-status-panel.d.ts +5 -5
  98. package/file-status-panel/public-api.d.ts +3 -3
  99. package/generic-form/generic-form.component.d.ts +49 -49
  100. package/generic-form/generic-form.model.d.ts +39 -39
  101. package/generic-form/generic-form.module.d.ts +13 -13
  102. package/generic-form/generic-form.service.d.ts +16 -16
  103. package/generic-form/index.d.ts +1 -1
  104. package/generic-form/pepperi-addons-ngx-composite-lib-generic-form.d.ts +5 -5
  105. package/generic-form/public-api.d.ts +4 -4
  106. package/generic-list/generic-list.component.d.ts +99 -99
  107. package/generic-list/generic-list.model.d.ts +50 -50
  108. package/generic-list/generic-list.module.d.ts +18 -18
  109. package/generic-list/generic-list.service.d.ts +42 -42
  110. package/generic-list/pepperi-addons-ngx-composite-lib-generic-list.d.ts +5 -5
  111. package/generic-list/public-api.d.ts +4 -4
  112. package/group-buttons-settings/group-buttons-settings.component.d.ts +33 -33
  113. package/group-buttons-settings/group-buttons-settings.model.d.ts +1 -1
  114. package/group-buttons-settings/group-buttons-settings.module.d.ts +14 -14
  115. package/group-buttons-settings/pepperi-addons-ngx-composite-lib-group-buttons-settings.d.ts +5 -5
  116. package/group-buttons-settings/public-api.d.ts +3 -3
  117. package/ngx-composite-lib.module.d.ts +11 -11
  118. package/package.json +1 -1
  119. package/pepperi-addons-ngx-composite-lib.d.ts +5 -5
  120. package/public-api.d.ts +2 -2
  121. package/shadow-settings/pepperi-addons-ngx-composite-lib-shadow-settings.d.ts +5 -5
  122. package/shadow-settings/public-api.d.ts +3 -3
  123. package/shadow-settings/shadow-settings.component.d.ts +23 -23
  124. package/shadow-settings/shadow-settings.model.d.ts +7 -7
  125. package/shadow-settings/shadow-settings.module.d.ts +13 -13
@@ -31,853 +31,853 @@
31
31
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
32
32
  var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
33
33
 
34
- /*! *****************************************************************************
35
- Copyright (c) Microsoft Corporation.
36
-
37
- Permission to use, copy, modify, and/or distribute this software for any
38
- purpose with or without fee is hereby granted.
39
-
40
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
41
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
42
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
43
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
44
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
45
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
46
- PERFORMANCE OF THIS SOFTWARE.
47
- ***************************************************************************** */
48
- /* global Reflect, Promise */
49
- var extendStatics = function (d, b) {
50
- extendStatics = Object.setPrototypeOf ||
51
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
52
- function (d, b) { for (var p in b)
53
- if (Object.prototype.hasOwnProperty.call(b, p))
54
- d[p] = b[p]; };
55
- return extendStatics(d, b);
56
- };
57
- function __extends(d, b) {
58
- if (typeof b !== "function" && b !== null)
59
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
60
- extendStatics(d, b);
61
- function __() { this.constructor = d; }
62
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
63
- }
64
- var __assign = function () {
65
- __assign = Object.assign || function __assign(t) {
66
- for (var s, i = 1, n = arguments.length; i < n; i++) {
67
- s = arguments[i];
68
- for (var p in s)
69
- if (Object.prototype.hasOwnProperty.call(s, p))
70
- t[p] = s[p];
71
- }
72
- return t;
73
- };
74
- return __assign.apply(this, arguments);
75
- };
76
- function __rest(s, e) {
77
- var t = {};
78
- for (var p in s)
79
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
80
- t[p] = s[p];
81
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
82
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
83
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
84
- t[p[i]] = s[p[i]];
85
- }
86
- return t;
87
- }
88
- function __decorate(decorators, target, key, desc) {
89
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
90
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
91
- r = Reflect.decorate(decorators, target, key, desc);
92
- else
93
- for (var i = decorators.length - 1; i >= 0; i--)
94
- if (d = decorators[i])
95
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
96
- return c > 3 && r && Object.defineProperty(target, key, r), r;
97
- }
98
- function __param(paramIndex, decorator) {
99
- return function (target, key) { decorator(target, key, paramIndex); };
100
- }
101
- function __metadata(metadataKey, metadataValue) {
102
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
103
- return Reflect.metadata(metadataKey, metadataValue);
104
- }
105
- function __awaiter(thisArg, _arguments, P, generator) {
106
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
107
- return new (P || (P = Promise))(function (resolve, reject) {
108
- function fulfilled(value) { try {
109
- step(generator.next(value));
110
- }
111
- catch (e) {
112
- reject(e);
113
- } }
114
- function rejected(value) { try {
115
- step(generator["throw"](value));
116
- }
117
- catch (e) {
118
- reject(e);
119
- } }
120
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
121
- step((generator = generator.apply(thisArg, _arguments || [])).next());
122
- });
123
- }
124
- function __generator(thisArg, body) {
125
- var _ = { label: 0, sent: function () { if (t[0] & 1)
126
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
127
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
128
- function verb(n) { return function (v) { return step([n, v]); }; }
129
- function step(op) {
130
- if (f)
131
- throw new TypeError("Generator is already executing.");
132
- while (_)
133
- try {
134
- 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)
135
- return t;
136
- if (y = 0, t)
137
- op = [op[0] & 2, t.value];
138
- switch (op[0]) {
139
- case 0:
140
- case 1:
141
- t = op;
142
- break;
143
- case 4:
144
- _.label++;
145
- return { value: op[1], done: false };
146
- case 5:
147
- _.label++;
148
- y = op[1];
149
- op = [0];
150
- continue;
151
- case 7:
152
- op = _.ops.pop();
153
- _.trys.pop();
154
- continue;
155
- default:
156
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
157
- _ = 0;
158
- continue;
159
- }
160
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
161
- _.label = op[1];
162
- break;
163
- }
164
- if (op[0] === 6 && _.label < t[1]) {
165
- _.label = t[1];
166
- t = op;
167
- break;
168
- }
169
- if (t && _.label < t[2]) {
170
- _.label = t[2];
171
- _.ops.push(op);
172
- break;
173
- }
174
- if (t[2])
175
- _.ops.pop();
176
- _.trys.pop();
177
- continue;
178
- }
179
- op = body.call(thisArg, _);
180
- }
181
- catch (e) {
182
- op = [6, e];
183
- y = 0;
184
- }
185
- finally {
186
- f = t = 0;
187
- }
188
- if (op[0] & 5)
189
- throw op[1];
190
- return { value: op[0] ? op[1] : void 0, done: true };
191
- }
192
- }
193
- var __createBinding = Object.create ? (function (o, m, k, k2) {
194
- if (k2 === undefined)
195
- k2 = k;
196
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
197
- }) : (function (o, m, k, k2) {
198
- if (k2 === undefined)
199
- k2 = k;
200
- o[k2] = m[k];
201
- });
202
- function __exportStar(m, o) {
203
- for (var p in m)
204
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
205
- __createBinding(o, m, p);
206
- }
207
- function __values(o) {
208
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
209
- if (m)
210
- return m.call(o);
211
- if (o && typeof o.length === "number")
212
- return {
213
- next: function () {
214
- if (o && i >= o.length)
215
- o = void 0;
216
- return { value: o && o[i++], done: !o };
217
- }
218
- };
219
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
220
- }
221
- function __read(o, n) {
222
- var m = typeof Symbol === "function" && o[Symbol.iterator];
223
- if (!m)
224
- return o;
225
- var i = m.call(o), r, ar = [], e;
226
- try {
227
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
228
- ar.push(r.value);
229
- }
230
- catch (error) {
231
- e = { error: error };
232
- }
233
- finally {
234
- try {
235
- if (r && !r.done && (m = i["return"]))
236
- m.call(i);
237
- }
238
- finally {
239
- if (e)
240
- throw e.error;
241
- }
242
- }
243
- return ar;
244
- }
245
- /** @deprecated */
246
- function __spread() {
247
- for (var ar = [], i = 0; i < arguments.length; i++)
248
- ar = ar.concat(__read(arguments[i]));
249
- return ar;
250
- }
251
- /** @deprecated */
252
- function __spreadArrays() {
253
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
254
- s += arguments[i].length;
255
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
256
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
257
- r[k] = a[j];
258
- return r;
259
- }
260
- function __spreadArray(to, from, pack) {
261
- if (pack || arguments.length === 2)
262
- for (var i = 0, l = from.length, ar; i < l; i++) {
263
- if (ar || !(i in from)) {
264
- if (!ar)
265
- ar = Array.prototype.slice.call(from, 0, i);
266
- ar[i] = from[i];
267
- }
268
- }
269
- return to.concat(ar || Array.prototype.slice.call(from));
270
- }
271
- function __await(v) {
272
- return this instanceof __await ? (this.v = v, this) : new __await(v);
273
- }
274
- function __asyncGenerator(thisArg, _arguments, generator) {
275
- if (!Symbol.asyncIterator)
276
- throw new TypeError("Symbol.asyncIterator is not defined.");
277
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
278
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
279
- function verb(n) { if (g[n])
280
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
281
- function resume(n, v) { try {
282
- step(g[n](v));
283
- }
284
- catch (e) {
285
- settle(q[0][3], e);
286
- } }
287
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
288
- function fulfill(value) { resume("next", value); }
289
- function reject(value) { resume("throw", value); }
290
- function settle(f, v) { if (f(v), q.shift(), q.length)
291
- resume(q[0][0], q[0][1]); }
292
- }
293
- function __asyncDelegator(o) {
294
- var i, p;
295
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
296
- 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; }
297
- }
298
- function __asyncValues(o) {
299
- if (!Symbol.asyncIterator)
300
- throw new TypeError("Symbol.asyncIterator is not defined.");
301
- var m = o[Symbol.asyncIterator], i;
302
- 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);
303
- 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); }); }; }
304
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
305
- }
306
- function __makeTemplateObject(cooked, raw) {
307
- if (Object.defineProperty) {
308
- Object.defineProperty(cooked, "raw", { value: raw });
309
- }
310
- else {
311
- cooked.raw = raw;
312
- }
313
- return cooked;
314
- }
315
- ;
316
- var __setModuleDefault = Object.create ? (function (o, v) {
317
- Object.defineProperty(o, "default", { enumerable: true, value: v });
318
- }) : function (o, v) {
319
- o["default"] = v;
320
- };
321
- function __importStar(mod) {
322
- if (mod && mod.__esModule)
323
- return mod;
324
- var result = {};
325
- if (mod != null)
326
- for (var k in mod)
327
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
328
- __createBinding(result, mod, k);
329
- __setModuleDefault(result, mod);
330
- return result;
331
- }
332
- function __importDefault(mod) {
333
- return (mod && mod.__esModule) ? mod : { default: mod };
334
- }
335
- function __classPrivateFieldGet(receiver, state, kind, f) {
336
- if (kind === "a" && !f)
337
- throw new TypeError("Private accessor was defined without a getter");
338
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
339
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
340
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
341
- }
342
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
343
- if (kind === "m")
344
- throw new TypeError("Private method is not writable");
345
- if (kind === "a" && !f)
346
- throw new TypeError("Private accessor was defined without a setter");
347
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
348
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
349
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
34
+ /*! *****************************************************************************
35
+ Copyright (c) Microsoft Corporation.
36
+
37
+ Permission to use, copy, modify, and/or distribute this software for any
38
+ purpose with or without fee is hereby granted.
39
+
40
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
41
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
42
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
43
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
44
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
45
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
46
+ PERFORMANCE OF THIS SOFTWARE.
47
+ ***************************************************************************** */
48
+ /* global Reflect, Promise */
49
+ var extendStatics = function (d, b) {
50
+ extendStatics = Object.setPrototypeOf ||
51
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
52
+ function (d, b) { for (var p in b)
53
+ if (Object.prototype.hasOwnProperty.call(b, p))
54
+ d[p] = b[p]; };
55
+ return extendStatics(d, b);
56
+ };
57
+ function __extends(d, b) {
58
+ if (typeof b !== "function" && b !== null)
59
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
60
+ extendStatics(d, b);
61
+ function __() { this.constructor = d; }
62
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
63
+ }
64
+ var __assign = function () {
65
+ __assign = Object.assign || function __assign(t) {
66
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
67
+ s = arguments[i];
68
+ for (var p in s)
69
+ if (Object.prototype.hasOwnProperty.call(s, p))
70
+ t[p] = s[p];
71
+ }
72
+ return t;
73
+ };
74
+ return __assign.apply(this, arguments);
75
+ };
76
+ function __rest(s, e) {
77
+ var t = {};
78
+ for (var p in s)
79
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
80
+ t[p] = s[p];
81
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
82
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
83
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
84
+ t[p[i]] = s[p[i]];
85
+ }
86
+ return t;
87
+ }
88
+ function __decorate(decorators, target, key, desc) {
89
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
90
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
91
+ r = Reflect.decorate(decorators, target, key, desc);
92
+ else
93
+ for (var i = decorators.length - 1; i >= 0; i--)
94
+ if (d = decorators[i])
95
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
96
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
97
+ }
98
+ function __param(paramIndex, decorator) {
99
+ return function (target, key) { decorator(target, key, paramIndex); };
100
+ }
101
+ function __metadata(metadataKey, metadataValue) {
102
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
103
+ return Reflect.metadata(metadataKey, metadataValue);
104
+ }
105
+ function __awaiter(thisArg, _arguments, P, generator) {
106
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
107
+ return new (P || (P = Promise))(function (resolve, reject) {
108
+ function fulfilled(value) { try {
109
+ step(generator.next(value));
110
+ }
111
+ catch (e) {
112
+ reject(e);
113
+ } }
114
+ function rejected(value) { try {
115
+ step(generator["throw"](value));
116
+ }
117
+ catch (e) {
118
+ reject(e);
119
+ } }
120
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
121
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
122
+ });
123
+ }
124
+ function __generator(thisArg, body) {
125
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
126
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
127
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
128
+ function verb(n) { return function (v) { return step([n, v]); }; }
129
+ function step(op) {
130
+ if (f)
131
+ throw new TypeError("Generator is already executing.");
132
+ while (_)
133
+ try {
134
+ 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)
135
+ return t;
136
+ if (y = 0, t)
137
+ op = [op[0] & 2, t.value];
138
+ switch (op[0]) {
139
+ case 0:
140
+ case 1:
141
+ t = op;
142
+ break;
143
+ case 4:
144
+ _.label++;
145
+ return { value: op[1], done: false };
146
+ case 5:
147
+ _.label++;
148
+ y = op[1];
149
+ op = [0];
150
+ continue;
151
+ case 7:
152
+ op = _.ops.pop();
153
+ _.trys.pop();
154
+ continue;
155
+ default:
156
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
157
+ _ = 0;
158
+ continue;
159
+ }
160
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
161
+ _.label = op[1];
162
+ break;
163
+ }
164
+ if (op[0] === 6 && _.label < t[1]) {
165
+ _.label = t[1];
166
+ t = op;
167
+ break;
168
+ }
169
+ if (t && _.label < t[2]) {
170
+ _.label = t[2];
171
+ _.ops.push(op);
172
+ break;
173
+ }
174
+ if (t[2])
175
+ _.ops.pop();
176
+ _.trys.pop();
177
+ continue;
178
+ }
179
+ op = body.call(thisArg, _);
180
+ }
181
+ catch (e) {
182
+ op = [6, e];
183
+ y = 0;
184
+ }
185
+ finally {
186
+ f = t = 0;
187
+ }
188
+ if (op[0] & 5)
189
+ throw op[1];
190
+ return { value: op[0] ? op[1] : void 0, done: true };
191
+ }
192
+ }
193
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
194
+ if (k2 === undefined)
195
+ k2 = k;
196
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
197
+ }) : (function (o, m, k, k2) {
198
+ if (k2 === undefined)
199
+ k2 = k;
200
+ o[k2] = m[k];
201
+ });
202
+ function __exportStar(m, o) {
203
+ for (var p in m)
204
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
205
+ __createBinding(o, m, p);
206
+ }
207
+ function __values(o) {
208
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
209
+ if (m)
210
+ return m.call(o);
211
+ if (o && typeof o.length === "number")
212
+ return {
213
+ next: function () {
214
+ if (o && i >= o.length)
215
+ o = void 0;
216
+ return { value: o && o[i++], done: !o };
217
+ }
218
+ };
219
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
220
+ }
221
+ function __read(o, n) {
222
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
223
+ if (!m)
224
+ return o;
225
+ var i = m.call(o), r, ar = [], e;
226
+ try {
227
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
228
+ ar.push(r.value);
229
+ }
230
+ catch (error) {
231
+ e = { error: error };
232
+ }
233
+ finally {
234
+ try {
235
+ if (r && !r.done && (m = i["return"]))
236
+ m.call(i);
237
+ }
238
+ finally {
239
+ if (e)
240
+ throw e.error;
241
+ }
242
+ }
243
+ return ar;
244
+ }
245
+ /** @deprecated */
246
+ function __spread() {
247
+ for (var ar = [], i = 0; i < arguments.length; i++)
248
+ ar = ar.concat(__read(arguments[i]));
249
+ return ar;
250
+ }
251
+ /** @deprecated */
252
+ function __spreadArrays() {
253
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
254
+ s += arguments[i].length;
255
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
256
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
257
+ r[k] = a[j];
258
+ return r;
259
+ }
260
+ function __spreadArray(to, from, pack) {
261
+ if (pack || arguments.length === 2)
262
+ for (var i = 0, l = from.length, ar; i < l; i++) {
263
+ if (ar || !(i in from)) {
264
+ if (!ar)
265
+ ar = Array.prototype.slice.call(from, 0, i);
266
+ ar[i] = from[i];
267
+ }
268
+ }
269
+ return to.concat(ar || Array.prototype.slice.call(from));
270
+ }
271
+ function __await(v) {
272
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
273
+ }
274
+ function __asyncGenerator(thisArg, _arguments, generator) {
275
+ if (!Symbol.asyncIterator)
276
+ throw new TypeError("Symbol.asyncIterator is not defined.");
277
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
278
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
279
+ function verb(n) { if (g[n])
280
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
281
+ function resume(n, v) { try {
282
+ step(g[n](v));
283
+ }
284
+ catch (e) {
285
+ settle(q[0][3], e);
286
+ } }
287
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
288
+ function fulfill(value) { resume("next", value); }
289
+ function reject(value) { resume("throw", value); }
290
+ function settle(f, v) { if (f(v), q.shift(), q.length)
291
+ resume(q[0][0], q[0][1]); }
292
+ }
293
+ function __asyncDelegator(o) {
294
+ var i, p;
295
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
296
+ 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; }
297
+ }
298
+ function __asyncValues(o) {
299
+ if (!Symbol.asyncIterator)
300
+ throw new TypeError("Symbol.asyncIterator is not defined.");
301
+ var m = o[Symbol.asyncIterator], i;
302
+ 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);
303
+ 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); }); }; }
304
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
305
+ }
306
+ function __makeTemplateObject(cooked, raw) {
307
+ if (Object.defineProperty) {
308
+ Object.defineProperty(cooked, "raw", { value: raw });
309
+ }
310
+ else {
311
+ cooked.raw = raw;
312
+ }
313
+ return cooked;
314
+ }
315
+ ;
316
+ var __setModuleDefault = Object.create ? (function (o, v) {
317
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
318
+ }) : function (o, v) {
319
+ o["default"] = v;
320
+ };
321
+ function __importStar(mod) {
322
+ if (mod && mod.__esModule)
323
+ return mod;
324
+ var result = {};
325
+ if (mod != null)
326
+ for (var k in mod)
327
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
328
+ __createBinding(result, mod, k);
329
+ __setModuleDefault(result, mod);
330
+ return result;
331
+ }
332
+ function __importDefault(mod) {
333
+ return (mod && mod.__esModule) ? mod : { default: mod };
334
+ }
335
+ function __classPrivateFieldGet(receiver, state, kind, f) {
336
+ if (kind === "a" && !f)
337
+ throw new TypeError("Private accessor was defined without a getter");
338
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
339
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
340
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
341
+ }
342
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
343
+ if (kind === "m")
344
+ throw new TypeError("Private method is not writable");
345
+ if (kind === "a" && !f)
346
+ throw new TypeError("Private accessor was defined without a setter");
347
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
348
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
349
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
350
350
  }
351
351
 
352
- var DIMXService = /** @class */ (function () {
353
- function DIMXService(session, pepperiDataConverter, pepHttp) {
354
- this.session = session;
355
- this.pepperiDataConverter = pepperiDataConverter;
356
- this.pepHttp = pepHttp;
357
- this.tempToken = "eyJhbGciOiJSUzI1NiIsImtpZCI6IjRiYTFjNzJmMTI3NThjYzEzMzg3ZWQ3YTBiZjNlODg3IiwidHlwIjoiSldUIn0.eyJuYmYiOjE2NDc3ODY2NDgsImV4cCI6MTY0Nzc5MDI0OCwiaXNzIjoiaHR0cHM6Ly9pZHAuc2FuZGJveC5wZXBwZXJpLmNvbSIsImF1ZCI6WyJodHRwczovL2lkcC5zYW5kYm94LnBlcHBlcmkuY29tL3Jlc291cmNlcyIsInBlcHBlcmkuYXBpbnQiLCJwZXBwZXJpLndhY2QiXSwiY2xpZW50X2lkIjoiaW9zLmNvbS53cm50eS5wZXBwZXJ5Iiwic3ViIjoiOTE1ZWUxODItNTk3Ni00ZjJlLWFhOGQtZDQ1ZjI3N2Y2OTdjIiwiYXV0aF90aW1lIjoxNjQ3Nzg2NjQ4LCJpZHAiOiJsb2NhbCIsInBlcHBlcmkuYXBpbnRiYXNldXJsIjoiaHR0cHM6Ly9yZXN0YXBpLnNhbmRib3gucGVwcGVyaS5jb20iLCJlbWFpbCI6Ik9kZWRAcGVwcGVyaXRlc3QuY29tIiwicGVwcGVyaS5pZCI6MTE0NzcwOTcsInBlcHBlcmkudXNlcnV1aWQiOiI5MTVlZTE4Mi01OTc2LTRmMmUtYWE4ZC1kNDVmMjc3ZjY5N2MiLCJwZXBwZXJpLmRpc3RyaWJ1dG9ydXVpZCI6IjBhM2FmNGU3LTMyZGUtNDExOC04Y2NmLTVkOWRiZDc5YzA0MSIsInBlcHBlcmkuZGlzdHJpYnV0b3JpZCI6MzAwMTUwMzEsInBlcHBlcmkuZGF0YWNlbnRlciI6InNhbmRib3giLCJwZXBwZXJpLmVtcGxveWVldHlwZSI6MSwicGVwcGVyaS5iYXNldXJsIjoiaHR0cHM6Ly9wYXBpLnN0YWdpbmcucGVwcGVyaS5jb20vVjEuMCIsInBlcHBlcmkud2FjZGJhc2V1cmwiOiJodHRwczovL2NwYXBpLnN0YWdpbmcucGVwcGVyaS5jb20iLCJuYW1lIjoiT2RlZCBBbnN3ZXIiLCJzY29wZSI6WyJwZXBwZXJpLmFwaW50IiwicGVwcGVyaS53YWNkIiwib2ZmbGluZV9hY2Nlc3MiXSwiYW1yIjpbInB3ZCJdfQ.XIpG0urTDreOIB3ehAKQqeQoFLiCYnxqYdXo61XaOWuJQe5hvJXNvjdnNuoC79GDiayHXEbrlsExcg5JYnou46bf35D9tEKQSx1ZF5S_vhSZcc5vg7OlS-2_AGJdov0RqC22Ti2nIBoWRkQK_Xv1D9aNWoE23ygD85bHyEI76z35aqpsUY6vy4yR_L-2p9GByslkYByaU9ES4RgLDCefTbo9C40ux0sH62IeJnC9cOC7hSIaCdMzvXVUg1BFh5ZvZGybaqwMRCXmc5XgvgN9e1Q3ej2Mje-Rt4Vqz9OCYHZJ3GZEiyzEatJDXFAwfXhQJypPu9ucNL_r8jy_r5FIGQ";
358
- this.accessToken = '';
359
- this.papiBaseURL = '';
360
- window.sessionStorage.setItem('idp_token', this.tempToken);
361
- var accessToken = this.session.getIdpToken();
362
- this.parsedToken = jwt__default["default"](accessToken);
363
- this.papiBaseURL = this.parsedToken["pepperi.baseurl"];
364
- }
365
- Object.defineProperty(DIMXService.prototype, "papiClient", {
366
- get: function () {
367
- return new papiSdk.PapiClient({
368
- baseURL: this.papiBaseURL,
369
- token: this.session.getIdpToken(),
370
- suppressLogging: true
371
- });
372
- },
373
- enumerable: false,
374
- configurable: true
375
- });
376
- DIMXService.prototype.get = function (endpoint) {
377
- return __awaiter(this, void 0, void 0, function () {
378
- return __generator(this, function (_a) {
379
- switch (_a.label) {
380
- case 0: return [4 /*yield*/, this.papiClient.get(endpoint)];
381
- case 1: return [2 /*return*/, _a.sent()];
382
- }
383
- });
384
- });
385
- };
386
- DIMXService.prototype.post = function (endpoint, body) {
387
- return __awaiter(this, void 0, void 0, function () {
388
- return __generator(this, function (_a) {
389
- switch (_a.label) {
390
- case 0: return [4 /*yield*/, this.papiClient.post(endpoint, body)];
391
- case 1: return [2 /*return*/, _a.sent()];
392
- }
393
- });
394
- });
395
- };
396
- DIMXService.prototype.pepGet = function (endpoint) {
397
- return this.pepHttp.getPapiApiCall(endpoint);
398
- };
399
- DIMXService.prototype.pepPost = function (endpoint, body) {
400
- return this.pepHttp.postPapiApiCall(endpoint, body);
401
- };
402
- return DIMXService;
403
- }());
404
- DIMXService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, deps: [{ token: i1__namespace.PepSessionService }, { token: i1__namespace.PepDataConvertorService }, { token: i1__namespace.PepHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
405
- DIMXService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, providedIn: 'root' });
406
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, decorators: [{
407
- type: i0.Injectable,
408
- args: [{ providedIn: 'root' }]
352
+ var DIMXService = /** @class */ (function () {
353
+ function DIMXService(session, pepperiDataConverter, pepHttp) {
354
+ this.session = session;
355
+ this.pepperiDataConverter = pepperiDataConverter;
356
+ this.pepHttp = pepHttp;
357
+ //tempToken = ""
358
+ this.accessToken = '';
359
+ this.papiBaseURL = '';
360
+ //window.sessionStorage.setItem('idp_token',this.tempToken)
361
+ var accessToken = this.session.getIdpToken();
362
+ this.parsedToken = jwt__default["default"](accessToken);
363
+ this.papiBaseURL = this.parsedToken["pepperi.baseurl"];
364
+ }
365
+ Object.defineProperty(DIMXService.prototype, "papiClient", {
366
+ get: function () {
367
+ return new papiSdk.PapiClient({
368
+ baseURL: this.papiBaseURL,
369
+ token: this.session.getIdpToken(),
370
+ suppressLogging: true
371
+ });
372
+ },
373
+ enumerable: false,
374
+ configurable: true
375
+ });
376
+ DIMXService.prototype.get = function (endpoint) {
377
+ return __awaiter(this, void 0, void 0, function () {
378
+ return __generator(this, function (_a) {
379
+ switch (_a.label) {
380
+ case 0: return [4 /*yield*/, this.papiClient.get(endpoint)];
381
+ case 1: return [2 /*return*/, _a.sent()];
382
+ }
383
+ });
384
+ });
385
+ };
386
+ DIMXService.prototype.post = function (endpoint, body) {
387
+ return __awaiter(this, void 0, void 0, function () {
388
+ return __generator(this, function (_a) {
389
+ switch (_a.label) {
390
+ case 0: return [4 /*yield*/, this.papiClient.post(endpoint, body)];
391
+ case 1: return [2 /*return*/, _a.sent()];
392
+ }
393
+ });
394
+ });
395
+ };
396
+ DIMXService.prototype.pepGet = function (endpoint) {
397
+ return this.pepHttp.getPapiApiCall(endpoint);
398
+ };
399
+ DIMXService.prototype.pepPost = function (endpoint, body) {
400
+ return this.pepHttp.postPapiApiCall(endpoint, body);
401
+ };
402
+ return DIMXService;
403
+ }());
404
+ DIMXService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, deps: [{ token: i1__namespace.PepSessionService }, { token: i1__namespace.PepDataConvertorService }, { token: i1__namespace.PepHttpService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
405
+ DIMXService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, providedIn: 'root' });
406
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXService, decorators: [{
407
+ type: i0.Injectable,
408
+ args: [{ providedIn: 'root' }]
409
409
  }], ctorParameters: function () { return [{ type: i1__namespace.PepSessionService }, { type: i1__namespace.PepDataConvertorService }, { type: i1__namespace.PepHttpService }]; } });
410
410
 
411
- var DIMXComponent = /** @class */ (function () {
412
- function DIMXComponent(translate, addonService, pepSnackBarService) {
413
- this.translate = translate;
414
- this.addonService = addonService;
415
- this.pepSnackBarService = pepSnackBarService;
416
- this.DIMXProcessDone = new i0.EventEmitter();
417
- this.currentSnackBar = null;
418
- this.iFileID = 0;
419
- this.iFileArray = [];
420
- this.toBase64 = function (file) { return new Promise(function (resolve, reject) {
421
- var reader = new FileReader();
422
- reader.readAsDataURL(file);
423
- reader.onload = function () { return resolve(reader.result); };
424
- reader.onerror = function (error) { return reject(error); };
425
- }); };
426
- }
427
- DIMXComponent.prototype.ngOnInit = function () {
428
- // Get the first translation for load all translations.
429
- this.translate.get('SHADOW_SETTINGS.INTENSITY_SOFT').toPromise().then(function (typeSoft) {
430
- console.log("something");
431
- });
432
- };
433
- DIMXComponent.prototype.getDIMXExportPOSTBody = function (value) {
434
- return {
435
- "Format": value.DIMXExportFormat,
436
- "IncludeDeleted": value.DIMXExportIncludeDeleted,
437
- "Where": value.DIMXExportWhere,
438
- "Fields": value.DIMXExportFields,
439
- "Delimiter": value.DIMXExportDelimiter
440
- };
441
- };
442
- DIMXComponent.prototype.pollDIMXResult = function (pollingURL, ifile) {
443
- return __awaiter(this, void 0, void 0, function () {
444
- var delay, seconds, waitingTime, result, _b, ex_1;
445
- return __generator(this, function (_c) {
446
- switch (_c.label) {
447
- case 0:
448
- console.log("polling audit with the executionUUID: " + pollingURL);
449
- delay = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };
450
- seconds = 0;
451
- waitingTime = 1000;
452
- _c.label = 1;
453
- case 1:
454
- _c.trys.push([1, 14, , 16]);
455
- result = void 0;
456
- _c.label = 2;
457
- case 2:
458
- if (!true) return [3 /*break*/, 7];
459
- return [4 /*yield*/, this.addonService.papiClient.get("/audit_logs/" + pollingURL)];
460
- case 3:
461
- result = _c.sent();
462
- console.log("result from auditlog get is: " + result);
463
- if (!(!result || result["Status"]["ID"] === 2 || result["Status"]["ID"] === 4)) return [3 /*break*/, 5];
464
- console.log("waited for " + seconds++ + " seconds");
465
- return [4 /*yield*/, delay(waitingTime)];
466
- case 4:
467
- _c.sent();
468
- return [3 /*break*/, 6];
469
- case 5: return [3 /*break*/, 7];
470
- case 6: return [3 /*break*/, 2];
471
- case 7:
472
- _b = result["Status"]["ID"];
473
- switch (_b) {
474
- case 0: return [3 /*break*/, 8];
475
- case 1: return [3 /*break*/, 10];
476
- }
477
- return [3 /*break*/, 11];
478
- case 8:
479
- ifile.status = "failed";
480
- ifile.returnedObject = { "ErrorMessage": result["AuditInfo"]["ErrorMessage"] };
481
- this.updateSnackbar();
482
- return [4 /*yield*/, this.SendDoneEventIfDone()];
483
- case 9:
484
- _c.sent();
485
- return [2 /*return*/, null];
486
- case 10:
487
- console.log("polling result: " + result["AuditInfo"]["ResultObject"]);
488
- return [2 /*return*/, JSON.parse(result["AuditInfo"]["ResultObject"])];
489
- case 11:
490
- ifile.status = "failed";
491
- ifile.returnedObject = { "ErrorMessage": "unknown audit log type: " + result["Status"] };
492
- this.updateSnackbar();
493
- return [4 /*yield*/, this.SendDoneEventIfDone()];
494
- case 12:
495
- _c.sent();
496
- return [2 /*return*/, null];
497
- case 13: return [3 /*break*/, 16];
498
- case 14:
499
- ex_1 = _c.sent();
500
- console.log("pollDIMXResult: " + ex_1);
501
- ifile.status = "failed";
502
- ifile.returnedObject = { "ErrorMessage": ex_1.message };
503
- this.updateSnackbar();
504
- return [4 /*yield*/, this.SendDoneEventIfDone()];
505
- case 15:
506
- _c.sent();
507
- return [2 /*return*/, null];
508
- case 16: return [2 /*return*/];
509
- }
510
- });
511
- });
512
- };
513
- DIMXComponent.prototype.getNewFileName = function (value) {
514
- var extension;
515
- switch (value.DIMXExportFormat.toLowerCase()) {
516
- case "json":
517
- extension = ".json";
518
- break;
519
- case "csv":
520
- extension = '.csv';
521
- break;
522
- default:
523
- extension = "";
524
- }
525
- var filename = value.DIMXExportFileName;
526
- return filename + extension;
527
- };
528
- DIMXComponent.prototype.createNewIFile = function (fileName, status) {
529
- return {
530
- "key": this.iFileID++,
531
- "name": fileName,
532
- "status": status
533
- };
534
- };
535
- DIMXComponent.prototype.removeIfilesWithDelay = function (iFile, delay) {
536
- if (delay === void 0) { delay = 2000; }
537
- return __awaiter(this, void 0, void 0, function () {
538
- var _this = this;
539
- return __generator(this, function (_b) {
540
- window.setTimeout(function () {
541
- var index = _this.iFileArray.findIndex(function (element) { return element === iFile; });
542
- if (index >= 0) {
543
- _this.iFileArray.splice(index, 1);
544
- _this.updateSnackbar();
545
- }
546
- }, delay);
547
- return [2 /*return*/];
548
- });
549
- });
550
- };
551
- DIMXComponent.prototype.clearIFilesWithDelay = function (delay) {
552
- if (delay === void 0) { delay = 2000; }
553
- return __awaiter(this, void 0, void 0, function () {
554
- var _this = this;
555
- return __generator(this, function (_b) {
556
- window.setTimeout(function () {
557
- _this.iFileArray = [];
558
- //this.currentSnackBar?.instance.closeClick.emit();
559
- _this.updateSnackbar();
560
- }, delay);
561
- return [2 /*return*/];
562
- });
563
- });
564
- };
565
- DIMXComponent.prototype.uploadFile = function (options) {
566
- this.dimxImportOptions = options;
567
- var elem = document.getElementById("fileuploader");
568
- if (elem && document.createEvent) {
569
- var evt = document.createEvent("MouseEvents");
570
- evt.initEvent("click", true, false);
571
- elem.dispatchEvent(evt);
572
- }
573
- // this.fileField?.nativeElement.click();
574
- };
575
- DIMXComponent.prototype.IsFileInProgress = function (iFile) {
576
- return iFile.status == "downloading" || iFile.status == "uploading";
577
- };
578
- DIMXComponent.prototype.AnyFilesInProgress = function () {
579
- if (this.iFileArray.find(this.IsFileInProgress) === undefined) {
580
- return false;
581
- }
582
- return true;
583
- };
584
- DIMXComponent.prototype.GetDoneEventBody = function () {
585
- return this.iFileArray.map(function (iFile) {
586
- return {
587
- "FileName": iFile.name,
588
- "Status": iFile.status,
589
- "ReturnedObject": iFile.returnedObject
590
- };
591
- });
592
- };
593
- DIMXComponent.prototype.SendDoneEventIfDone = function () {
594
- return __awaiter(this, void 0, void 0, function () {
595
- var eventObject;
596
- return __generator(this, function (_b) {
597
- switch (_b.label) {
598
- case 0:
599
- if (this.AnyFilesInProgress()) {
600
- return [2 /*return*/];
601
- }
602
- eventObject = this.GetDoneEventBody();
603
- this.DIMXProcessDone.emit(eventObject);
604
- return [4 /*yield*/, this.clearIFilesWithDelay()];
605
- case 1:
606
- _b.sent();
607
- return [2 /*return*/];
608
- }
609
- });
610
- });
611
- };
612
- DIMXComponent.prototype.updateSnackbar = function () {
613
- var _this = this;
614
- var _a;
615
- if (!((_a = this.currentSnackBar) === null || _a === void 0 ? void 0 : _a.instance)) {
616
- this.currentSnackBar = this.pepSnackBarService.openSnackBarFromComponent(fileStatusPanel.FileStatusPanelComponent, {
617
- title: "DIMX Process",
618
- content: this.iFileArray
619
- });
620
- this.currentSnackBar.instance.closeClick.subscribe(function () {
621
- _this.currentSnackBar = null;
622
- });
623
- }
624
- else {
625
- this.currentSnackBar.instance.data.content = this.iFileArray;
626
- if (this.iFileArray.length === 0) {
627
- this.currentSnackBar.instance.snackBarRef.dismiss();
628
- this.currentSnackBar = null;
629
- }
630
- }
631
- };
632
- DIMXComponent.prototype.dimximportrun = function (e) {
633
- return __awaiter(this, void 0, void 0, function () {
634
- var files, fileListAsArray;
635
- var _this = this;
636
- return __generator(this, function (_b) {
637
- console.log("Enter DIMXImportRun");
638
- files = e.target.files;
639
- fileListAsArray = Array.from(files);
640
- fileListAsArray.forEach(function (file, i) { return __awaiter(_this, void 0, void 0, function () {
641
- var filex, dimx_import_relativeURL, str, ext, value, dimxUploadObject, iFile, header, res, poll_result, ex_2;
642
- return __generator(this, function (_b) {
643
- switch (_b.label) {
644
- case 0:
645
- filex = file;
646
- dimx_import_relativeURL = "/addons/api/44c97115-6d14-4626-91dc-83f176e9a0fc/api/file_import_upload";
647
- return [4 /*yield*/, this.toBase64(filex)];
648
- case 1:
649
- str = (_b.sent());
650
- ext = filex.name.split('.')[1];
651
- value = { fileStr: str, fileExt: ext };
652
- dimxUploadObject = Object.assign(Object.assign(Object.assign({}, this.getPFSUploadObject(value)), this.dimxImportOptions), { Resource: this.DIMXResource, AddonUUID: this.DIMXAddonUUID });
653
- iFile = this.createNewIFile(filex.name, "uploading");
654
- console.log("created new iFile: " + iFile);
655
- this.iFileArray.push(iFile);
656
- this.updateSnackbar();
657
- console.log("added iFile to iFileArray");
658
- _b.label = 2;
659
- case 2:
660
- _b.trys.push([2, 6, , 8]);
661
- console.log("posting to dimx import_upload now");
662
- header = {};
663
- if (dimxUploadObject.ActionID) {
664
- header["X-Pepperi-ActionID"] = dimxUploadObject.ActionID;
665
- }
666
- if (dimxUploadObject.OwnerID) {
667
- header["X-Pepperi-OwnerID"] = dimxUploadObject.OwnerID;
668
- }
669
- return [4 /*yield*/, this.addonService.papiClient.post(dimx_import_relativeURL, dimxUploadObject, header)];
670
- case 3:
671
- res = _b.sent();
672
- console.log("Got reply from dimx, calling poll with the result:");
673
- console.log(JSON.stringify(res));
674
- return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
675
- case 4:
676
- poll_result = _b.sent();
677
- if (poll_result === null) {
678
- return [2 /*return*/];
679
- }
680
- console.log("done polling, got result: " + JSON.stringify(poll_result));
681
- iFile.status = "done";
682
- iFile.returnedObject = poll_result;
683
- this.updateSnackbar();
684
- return [4 /*yield*/, this.SendDoneEventIfDone()];
685
- case 5:
686
- _b.sent();
687
- console.log("Imported the file");
688
- return [3 /*break*/, 8];
689
- case 6:
690
- ex_2 = _b.sent();
691
- console.log("DIMXImportRun: " + ex_2);
692
- iFile.status = "failed";
693
- iFile.returnedObject = { "ErrorMessage": ex_2.message };
694
- this.updateSnackbar();
695
- return [4 /*yield*/, this.SendDoneEventIfDone()];
696
- case 7:
697
- _b.sent();
698
- //await this.removeIfileWithDelay(iFile, 2000);
699
- return [2 /*return*/];
700
- case 8: return [2 /*return*/];
701
- }
702
- });
703
- }); });
704
- return [2 /*return*/];
705
- });
706
- });
707
- };
708
- DIMXComponent.prototype.getNewPFSUploadKey = function (fileExt) {
709
- var uuid = i1.PepGuid.newGuid();
710
- var folder = 'DIMX_import';
711
- var pfsKey = "/" + folder + "/" + uuid + "." + fileExt;
712
- return pfsKey;
713
- };
714
- DIMXComponent.prototype.getPFSUploadObject = function (value) {
715
- var fileStrArr = value.fileStr.split(';');
716
- var mime = fileStrArr[0].split(':')[1];
717
- var pfsKey = this.getNewPFSUploadKey(value.fileExt);
718
- var pfsUploadObject = {
719
- "Key": pfsKey,
720
- "MIME": mime,
721
- "URI": value.fileStr
722
- };
723
- return pfsUploadObject;
724
- };
725
- DIMXComponent.prototype.DIMXExportRun = function (value) {
726
- return __awaiter(this, void 0, void 0, function () {
727
- var bod, fileName, iFile, header, res, result, url, blob, ex_3;
728
- return __generator(this, function (_b) {
729
- switch (_b.label) {
730
- case 0:
731
- if (!value) {
732
- value = {};
733
- }
734
- if (!value.DIMXExportFormat) {
735
- value.DIMXExportFormat = 'json';
736
- }
737
- if (!value.DIMXExportIncludeDeleted) {
738
- value.DIMXExportIncludeDeleted = false;
739
- }
740
- if (!value.DIMXExportFileName) {
741
- value.DIMXExportFileName = 'export';
742
- }
743
- bod = this.getDIMXExportPOSTBody(value ? value : {});
744
- fileName = this.getNewFileName(value);
745
- iFile = this.createNewIFile(fileName, "downloading");
746
- console.log("created new iFile: " + iFile);
747
- this.iFileArray.push(iFile);
748
- this.updateSnackbar();
749
- console.log("added iFile to iFileArray");
750
- _b.label = 1;
751
- case 1:
752
- _b.trys.push([1, 6, , 8]);
753
- console.log("posting to dimx export now");
754
- header = {};
755
- if (value.ActionID) {
756
- header["X-Pepperi-ActionID"] = value.ActionID;
757
- }
758
- return [4 /*yield*/, this.addonService.papiClient.post("/addons/data/export/file/" + this.DIMXAddonUUID + "/" + this.DIMXResource, bod, header)];
759
- case 2:
760
- res = _b.sent();
761
- console.log("Got reply from dimx, calling poll with the result:");
762
- console.log(res);
763
- return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
764
- case 3:
765
- result = _b.sent();
766
- if (result === null) {
767
- return [2 /*return*/];
768
- }
769
- url = result["DownloadURL"];
770
- console.log("attempting to download the file");
771
- console.log("url is: " + url);
772
- return [4 /*yield*/, fetch(url).then(function (r) { return r.blob(); })];
773
- case 4:
774
- blob = _b.sent();
775
- fileSaver.saveAs(blob, fileName);
776
- iFile.status = "done";
777
- iFile.returnedObject = result;
778
- this.updateSnackbar();
779
- return [4 /*yield*/, this.SendDoneEventIfDone()];
780
- case 5:
781
- _b.sent();
782
- console.log("downloaded the file");
783
- return [3 /*break*/, 8];
784
- case 6:
785
- ex_3 = _b.sent();
786
- iFile.status = "failed";
787
- iFile.returnedObject = { "ErrorMessage": ex_3.message };
788
- this.updateSnackbar();
789
- return [4 /*yield*/, this.SendDoneEventIfDone()];
790
- case 7:
791
- _b.sent();
792
- //await this.removeIfileWithDelay(iFile);
793
- console.log("buttonClick: " + ex_3);
794
- return [2 /*return*/];
795
- case 8: return [2 /*return*/];
796
- }
797
- });
798
- });
799
- };
800
- return DIMXComponent;
801
- }());
802
- DIMXComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, deps: [{ token: i1__namespace$1.TranslateService }, { token: DIMXService }, { token: i3__namespace.PepSnackBarService }], target: i0__namespace.ɵɵFactoryTarget.Component });
803
- DIMXComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: DIMXComponent, selector: "pep-dimx", inputs: { DIMXAddonUUID: "DIMXAddonUUID", DIMXResource: "DIMXResource" }, outputs: { DIMXProcessDone: "DIMXProcessDone" }, viewQueries: [{ propertyName: "fileField", first: true, predicate: ["fileField"], descendants: true }], ngImport: i0__namespace, template: "<!-- <pep-file-status-panel [title]=\"'File Imports/Exports'\" *ngIf=\"iFileArray?.length\" [filesList]=\"iFileArray\"></pep-file-status-panel> -->\n<input type=\"file\" multiple=\"multiple\" name=\"avatars\" id=\"fileuploader\" #fileField (change)=\"dimximportrun($event)\">\n<!-- <pep-button\n value=\"export\"\n styleType=\"strong\"\n styleStateType=\"success\"\n sizeType=\"sm\"\n classNames=\"hahah\"\n iconName=\"system_doc\"\n (buttonClick)=\"buttonClick($event)\"\n></pep-button> -->", styles: ["#fileuploader{display:none}:host{width:100%}:host .shadow-size-group,:host .shadow-type-group{display:block;margin-bottom:var(--pep-form-spacing, 1rem)}\n"] });
804
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, decorators: [{
805
- type: i0.Component,
806
- args: [{
807
- selector: 'pep-dimx',
808
- templateUrl: './dimx.component.html',
809
- styleUrls: ['./dimx.component.scss']
810
- }]
811
- }], ctorParameters: function () { return [{ type: i1__namespace$1.TranslateService }, { type: DIMXService }, { type: i3__namespace.PepSnackBarService }]; }, propDecorators: { fileField: [{
812
- type: i0.ViewChild,
813
- args: ['fileField']
814
- }], DIMXAddonUUID: [{
815
- type: i0.Input
816
- }], DIMXResource: [{
817
- type: i0.Input
818
- }], DIMXProcessDone: [{
819
- type: i0.Output
411
+ var DIMXComponent = /** @class */ (function () {
412
+ function DIMXComponent(translate, addonService, pepSnackBarService) {
413
+ this.translate = translate;
414
+ this.addonService = addonService;
415
+ this.pepSnackBarService = pepSnackBarService;
416
+ this.DIMXProcessDone = new i0.EventEmitter();
417
+ this.currentSnackBar = null;
418
+ this.iFileID = 0;
419
+ this.iFileArray = [];
420
+ this.toBase64 = function (file) { return new Promise(function (resolve, reject) {
421
+ var reader = new FileReader();
422
+ reader.readAsDataURL(file);
423
+ reader.onload = function () { return resolve(reader.result); };
424
+ reader.onerror = function (error) { return reject(error); };
425
+ }); };
426
+ }
427
+ DIMXComponent.prototype.ngOnInit = function () {
428
+ // Get the first translation for load all translations.
429
+ this.translate.get('SHADOW_SETTINGS.INTENSITY_SOFT').toPromise().then(function (typeSoft) {
430
+ console.log("something");
431
+ });
432
+ };
433
+ DIMXComponent.prototype.getDIMXExportPOSTBody = function (value) {
434
+ return {
435
+ "Format": value.DIMXExportFormat,
436
+ "IncludeDeleted": value.DIMXExportIncludeDeleted,
437
+ "Where": value.DIMXExportWhere,
438
+ "Fields": value.DIMXExportFields,
439
+ "Delimiter": value.DIMXExportDelimiter
440
+ };
441
+ };
442
+ DIMXComponent.prototype.pollDIMXResult = function (pollingURL, ifile) {
443
+ return __awaiter(this, void 0, void 0, function () {
444
+ var delay, seconds, waitingTime, result, _b, ex_1;
445
+ return __generator(this, function (_c) {
446
+ switch (_c.label) {
447
+ case 0:
448
+ console.log("polling audit with the executionUUID: " + pollingURL);
449
+ delay = function (ms) { return new Promise(function (res) { return setTimeout(res, ms); }); };
450
+ seconds = 0;
451
+ waitingTime = 1000;
452
+ _c.label = 1;
453
+ case 1:
454
+ _c.trys.push([1, 14, , 16]);
455
+ result = void 0;
456
+ _c.label = 2;
457
+ case 2:
458
+ if (!true) return [3 /*break*/, 7];
459
+ return [4 /*yield*/, this.addonService.papiClient.get("/audit_logs/" + pollingURL)];
460
+ case 3:
461
+ result = _c.sent();
462
+ console.log("result from auditlog get is: " + result);
463
+ if (!(!result || result["Status"]["ID"] === 2 || result["Status"]["ID"] === 4)) return [3 /*break*/, 5];
464
+ console.log("waited for " + seconds++ + " seconds");
465
+ return [4 /*yield*/, delay(waitingTime)];
466
+ case 4:
467
+ _c.sent();
468
+ return [3 /*break*/, 6];
469
+ case 5: return [3 /*break*/, 7];
470
+ case 6: return [3 /*break*/, 2];
471
+ case 7:
472
+ _b = result["Status"]["ID"];
473
+ switch (_b) {
474
+ case 0: return [3 /*break*/, 8];
475
+ case 1: return [3 /*break*/, 10];
476
+ }
477
+ return [3 /*break*/, 11];
478
+ case 8:
479
+ ifile.status = "failed";
480
+ ifile.returnedObject = { "ErrorMessage": result["AuditInfo"]["ErrorMessage"] };
481
+ this.updateSnackbar();
482
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
483
+ case 9:
484
+ _c.sent();
485
+ return [2 /*return*/, null];
486
+ case 10:
487
+ console.log("polling result: " + result["AuditInfo"]["ResultObject"]);
488
+ return [2 /*return*/, JSON.parse(result["AuditInfo"]["ResultObject"])];
489
+ case 11:
490
+ ifile.status = "failed";
491
+ ifile.returnedObject = { "ErrorMessage": "unknown audit log type: " + result["Status"] };
492
+ this.updateSnackbar();
493
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
494
+ case 12:
495
+ _c.sent();
496
+ return [2 /*return*/, null];
497
+ case 13: return [3 /*break*/, 16];
498
+ case 14:
499
+ ex_1 = _c.sent();
500
+ console.log("pollDIMXResult: " + ex_1);
501
+ ifile.status = "failed";
502
+ ifile.returnedObject = { "ErrorMessage": ex_1.message };
503
+ this.updateSnackbar();
504
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
505
+ case 15:
506
+ _c.sent();
507
+ return [2 /*return*/, null];
508
+ case 16: return [2 /*return*/];
509
+ }
510
+ });
511
+ });
512
+ };
513
+ DIMXComponent.prototype.getNewFileName = function (value) {
514
+ var extension;
515
+ switch (value.DIMXExportFormat.toLowerCase()) {
516
+ case "json":
517
+ extension = ".json";
518
+ break;
519
+ case "csv":
520
+ extension = '.csv';
521
+ break;
522
+ default:
523
+ extension = "";
524
+ }
525
+ var filename = value.DIMXExportFileName;
526
+ return filename + extension;
527
+ };
528
+ DIMXComponent.prototype.createNewIFile = function (fileName, status) {
529
+ return {
530
+ "key": this.iFileID++,
531
+ "name": fileName,
532
+ "status": status
533
+ };
534
+ };
535
+ DIMXComponent.prototype.removeIfilesWithDelay = function (iFile, delay) {
536
+ if (delay === void 0) { delay = 2000; }
537
+ return __awaiter(this, void 0, void 0, function () {
538
+ var _this = this;
539
+ return __generator(this, function (_b) {
540
+ window.setTimeout(function () {
541
+ var index = _this.iFileArray.findIndex(function (element) { return element === iFile; });
542
+ if (index >= 0) {
543
+ _this.iFileArray.splice(index, 1);
544
+ _this.updateSnackbar();
545
+ }
546
+ }, delay);
547
+ return [2 /*return*/];
548
+ });
549
+ });
550
+ };
551
+ DIMXComponent.prototype.clearIFilesWithDelay = function (delay) {
552
+ if (delay === void 0) { delay = 2000; }
553
+ return __awaiter(this, void 0, void 0, function () {
554
+ var _this = this;
555
+ return __generator(this, function (_b) {
556
+ window.setTimeout(function () {
557
+ _this.iFileArray = [];
558
+ //this.currentSnackBar?.instance.closeClick.emit();
559
+ _this.updateSnackbar();
560
+ }, delay);
561
+ return [2 /*return*/];
562
+ });
563
+ });
564
+ };
565
+ DIMXComponent.prototype.uploadFile = function (options) {
566
+ this.dimxImportOptions = options;
567
+ var elem = document.getElementById("fileuploader");
568
+ if (elem && document.createEvent) {
569
+ var evt = document.createEvent("MouseEvents");
570
+ evt.initEvent("click", true, false);
571
+ elem.dispatchEvent(evt);
572
+ }
573
+ // this.fileField?.nativeElement.click();
574
+ };
575
+ DIMXComponent.prototype.IsFileInProgress = function (iFile) {
576
+ return iFile.status == "downloading" || iFile.status == "uploading";
577
+ };
578
+ DIMXComponent.prototype.AnyFilesInProgress = function () {
579
+ if (this.iFileArray.find(this.IsFileInProgress) === undefined) {
580
+ return false;
581
+ }
582
+ return true;
583
+ };
584
+ DIMXComponent.prototype.GetDoneEventBody = function () {
585
+ return this.iFileArray.map(function (iFile) {
586
+ return {
587
+ "FileName": iFile.name,
588
+ "Status": iFile.status,
589
+ "ReturnedObject": iFile.returnedObject
590
+ };
591
+ });
592
+ };
593
+ DIMXComponent.prototype.SendDoneEventIfDone = function () {
594
+ return __awaiter(this, void 0, void 0, function () {
595
+ var eventObject;
596
+ return __generator(this, function (_b) {
597
+ switch (_b.label) {
598
+ case 0:
599
+ if (this.AnyFilesInProgress()) {
600
+ return [2 /*return*/];
601
+ }
602
+ eventObject = this.GetDoneEventBody();
603
+ this.DIMXProcessDone.emit(eventObject);
604
+ return [4 /*yield*/, this.clearIFilesWithDelay()];
605
+ case 1:
606
+ _b.sent();
607
+ return [2 /*return*/];
608
+ }
609
+ });
610
+ });
611
+ };
612
+ DIMXComponent.prototype.updateSnackbar = function () {
613
+ var _this = this;
614
+ var _a;
615
+ if (!((_a = this.currentSnackBar) === null || _a === void 0 ? void 0 : _a.instance)) {
616
+ this.currentSnackBar = this.pepSnackBarService.openSnackBarFromComponent(fileStatusPanel.FileStatusPanelComponent, {
617
+ title: "DIMX Process",
618
+ content: this.iFileArray
619
+ });
620
+ this.currentSnackBar.instance.closeClick.subscribe(function () {
621
+ _this.currentSnackBar = null;
622
+ });
623
+ }
624
+ else {
625
+ this.currentSnackBar.instance.data.content = this.iFileArray;
626
+ if (this.iFileArray.length === 0) {
627
+ this.currentSnackBar.instance.snackBarRef.dismiss();
628
+ this.currentSnackBar = null;
629
+ }
630
+ }
631
+ };
632
+ DIMXComponent.prototype.dimximportrun = function (e) {
633
+ return __awaiter(this, void 0, void 0, function () {
634
+ var files, fileListAsArray;
635
+ var _this = this;
636
+ return __generator(this, function (_b) {
637
+ console.log("Enter DIMXImportRun");
638
+ files = e.target.files;
639
+ fileListAsArray = Array.from(files);
640
+ fileListAsArray.forEach(function (file, i) { return __awaiter(_this, void 0, void 0, function () {
641
+ var filex, dimx_import_relativeURL, str, ext, value, dimxUploadObject, iFile, header, res, poll_result, ex_2;
642
+ return __generator(this, function (_b) {
643
+ switch (_b.label) {
644
+ case 0:
645
+ filex = file;
646
+ dimx_import_relativeURL = "/addons/api/44c97115-6d14-4626-91dc-83f176e9a0fc/api/file_import_upload";
647
+ return [4 /*yield*/, this.toBase64(filex)];
648
+ case 1:
649
+ str = (_b.sent());
650
+ ext = filex.name.split('.')[1];
651
+ value = { fileStr: str, fileExt: ext };
652
+ dimxUploadObject = Object.assign(Object.assign(Object.assign({}, this.getPFSUploadObject(value)), this.dimxImportOptions), { Resource: this.DIMXResource, AddonUUID: this.DIMXAddonUUID });
653
+ iFile = this.createNewIFile(filex.name, "uploading");
654
+ console.log("created new iFile: " + iFile);
655
+ this.iFileArray.push(iFile);
656
+ this.updateSnackbar();
657
+ console.log("added iFile to iFileArray");
658
+ _b.label = 2;
659
+ case 2:
660
+ _b.trys.push([2, 6, , 8]);
661
+ console.log("posting to dimx import_upload now");
662
+ header = {};
663
+ if (dimxUploadObject.ActionID) {
664
+ header["X-Pepperi-ActionID"] = dimxUploadObject.ActionID;
665
+ }
666
+ if (dimxUploadObject.OwnerID) {
667
+ header["X-Pepperi-OwnerID"] = dimxUploadObject.OwnerID;
668
+ }
669
+ return [4 /*yield*/, this.addonService.papiClient.post(dimx_import_relativeURL, dimxUploadObject, header)];
670
+ case 3:
671
+ res = _b.sent();
672
+ console.log("Got reply from dimx, calling poll with the result:");
673
+ console.log(JSON.stringify(res));
674
+ return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
675
+ case 4:
676
+ poll_result = _b.sent();
677
+ if (poll_result === null) {
678
+ return [2 /*return*/];
679
+ }
680
+ console.log("done polling, got result: " + JSON.stringify(poll_result));
681
+ iFile.status = "done";
682
+ iFile.returnedObject = poll_result;
683
+ this.updateSnackbar();
684
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
685
+ case 5:
686
+ _b.sent();
687
+ console.log("Imported the file");
688
+ return [3 /*break*/, 8];
689
+ case 6:
690
+ ex_2 = _b.sent();
691
+ console.log("DIMXImportRun: " + ex_2);
692
+ iFile.status = "failed";
693
+ iFile.returnedObject = { "ErrorMessage": ex_2.message };
694
+ this.updateSnackbar();
695
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
696
+ case 7:
697
+ _b.sent();
698
+ //await this.removeIfileWithDelay(iFile, 2000);
699
+ return [2 /*return*/];
700
+ case 8: return [2 /*return*/];
701
+ }
702
+ });
703
+ }); });
704
+ return [2 /*return*/];
705
+ });
706
+ });
707
+ };
708
+ DIMXComponent.prototype.getNewPFSUploadKey = function (fileExt) {
709
+ var uuid = i1.PepGuid.newGuid();
710
+ var folder = 'DIMX_import';
711
+ var pfsKey = "/" + folder + "/" + uuid + "." + fileExt;
712
+ return pfsKey;
713
+ };
714
+ DIMXComponent.prototype.getPFSUploadObject = function (value) {
715
+ var fileStrArr = value.fileStr.split(';');
716
+ var mime = fileStrArr[0].split(':')[1];
717
+ var pfsKey = this.getNewPFSUploadKey(value.fileExt);
718
+ var pfsUploadObject = {
719
+ "Key": pfsKey,
720
+ "MIME": mime,
721
+ "URI": value.fileStr
722
+ };
723
+ return pfsUploadObject;
724
+ };
725
+ DIMXComponent.prototype.DIMXExportRun = function (value) {
726
+ return __awaiter(this, void 0, void 0, function () {
727
+ var bod, fileName, iFile, header, res, result, url, blob, ex_3;
728
+ return __generator(this, function (_b) {
729
+ switch (_b.label) {
730
+ case 0:
731
+ if (!value) {
732
+ value = {};
733
+ }
734
+ if (!value.DIMXExportFormat) {
735
+ value.DIMXExportFormat = 'json';
736
+ }
737
+ if (!value.DIMXExportIncludeDeleted) {
738
+ value.DIMXExportIncludeDeleted = false;
739
+ }
740
+ if (!value.DIMXExportFileName) {
741
+ value.DIMXExportFileName = 'export';
742
+ }
743
+ bod = this.getDIMXExportPOSTBody(value ? value : {});
744
+ fileName = this.getNewFileName(value);
745
+ iFile = this.createNewIFile(fileName, "downloading");
746
+ console.log("created new iFile: " + iFile);
747
+ this.iFileArray.push(iFile);
748
+ this.updateSnackbar();
749
+ console.log("added iFile to iFileArray");
750
+ _b.label = 1;
751
+ case 1:
752
+ _b.trys.push([1, 6, , 8]);
753
+ console.log("posting to dimx export now");
754
+ header = {};
755
+ if (value.ActionID) {
756
+ header["X-Pepperi-ActionID"] = value.ActionID;
757
+ }
758
+ return [4 /*yield*/, this.addonService.papiClient.post("/addons/data/export/file/" + this.DIMXAddonUUID + "/" + this.DIMXResource, bod, header)];
759
+ case 2:
760
+ res = _b.sent();
761
+ console.log("Got reply from dimx, calling poll with the result:");
762
+ console.log(res);
763
+ return [4 /*yield*/, this.pollDIMXResult(res['ExecutionUUID'], iFile)];
764
+ case 3:
765
+ result = _b.sent();
766
+ if (result === null) {
767
+ return [2 /*return*/];
768
+ }
769
+ url = result["DownloadURL"];
770
+ console.log("attempting to download the file");
771
+ console.log("url is: " + url);
772
+ return [4 /*yield*/, fetch(url).then(function (r) { return r.blob(); })];
773
+ case 4:
774
+ blob = _b.sent();
775
+ fileSaver.saveAs(blob, fileName);
776
+ iFile.status = "done";
777
+ iFile.returnedObject = result;
778
+ this.updateSnackbar();
779
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
780
+ case 5:
781
+ _b.sent();
782
+ console.log("downloaded the file");
783
+ return [3 /*break*/, 8];
784
+ case 6:
785
+ ex_3 = _b.sent();
786
+ iFile.status = "failed";
787
+ iFile.returnedObject = { "ErrorMessage": ex_3.message };
788
+ this.updateSnackbar();
789
+ return [4 /*yield*/, this.SendDoneEventIfDone()];
790
+ case 7:
791
+ _b.sent();
792
+ //await this.removeIfileWithDelay(iFile);
793
+ console.log("buttonClick: " + ex_3);
794
+ return [2 /*return*/];
795
+ case 8: return [2 /*return*/];
796
+ }
797
+ });
798
+ });
799
+ };
800
+ return DIMXComponent;
801
+ }());
802
+ DIMXComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, deps: [{ token: i1__namespace$1.TranslateService }, { token: DIMXService }, { token: i3__namespace.PepSnackBarService }], target: i0__namespace.ɵɵFactoryTarget.Component });
803
+ DIMXComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.0.5", type: DIMXComponent, selector: "pep-dimx", inputs: { DIMXAddonUUID: "DIMXAddonUUID", DIMXResource: "DIMXResource" }, outputs: { DIMXProcessDone: "DIMXProcessDone" }, viewQueries: [{ propertyName: "fileField", first: true, predicate: ["fileField"], descendants: true }], ngImport: i0__namespace, template: "<!-- <pep-file-status-panel [title]=\"'File Imports/Exports'\" *ngIf=\"iFileArray?.length\" [filesList]=\"iFileArray\"></pep-file-status-panel> -->\n<input type=\"file\" multiple=\"multiple\" name=\"avatars\" id=\"fileuploader\" #fileField (change)=\"dimximportrun($event)\">\n<!-- <pep-button\n value=\"export\"\n styleType=\"strong\"\n styleStateType=\"success\"\n sizeType=\"sm\"\n classNames=\"hahah\"\n iconName=\"system_doc\"\n (buttonClick)=\"buttonClick($event)\"\n></pep-button> -->", styles: ["#fileuploader{display:none}:host{width:100%}:host .shadow-size-group,:host .shadow-type-group{display:block;margin-bottom:var(--pep-form-spacing, 1rem)}\n"] });
804
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: DIMXComponent, decorators: [{
805
+ type: i0.Component,
806
+ args: [{
807
+ selector: 'pep-dimx',
808
+ templateUrl: './dimx.component.html',
809
+ styleUrls: ['./dimx.component.scss']
810
+ }]
811
+ }], ctorParameters: function () { return [{ type: i1__namespace$1.TranslateService }, { type: DIMXService }, { type: i3__namespace.PepSnackBarService }]; }, propDecorators: { fileField: [{
812
+ type: i0.ViewChild,
813
+ args: ['fileField']
814
+ }], DIMXAddonUUID: [{
815
+ type: i0.Input
816
+ }], DIMXResource: [{
817
+ type: i0.Input
818
+ }], DIMXProcessDone: [{
819
+ type: i0.Output
820
820
  }] } });
821
821
 
822
- var pepIcons = [
823
- i1$2.pepIconSystemDoc,
824
- ];
825
- var PepDIMXModule = /** @class */ (function () {
826
- function PepDIMXModule(pepIconRegistry) {
827
- this.pepIconRegistry = pepIconRegistry;
828
- this.pepIconRegistry.registerIcons(pepIcons);
829
- }
830
- return PepDIMXModule;
831
- }());
832
- PepDIMXModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, deps: [{ token: i1__namespace$2.PepIconRegistry }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
833
- PepDIMXModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, declarations: [DIMXComponent], imports: [common.CommonModule,
834
- i1.PepNgxLibModule,
835
- button.PepButtonModule,
836
- i1$2.PepIconModule,
837
- fileStatusPanel.PepFileStatusPanelModule,
838
- i3.PepSnackBarModule], exports: [DIMXComponent] });
839
- PepDIMXModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, imports: [[
840
- common.CommonModule,
841
- i1.PepNgxLibModule,
842
- button.PepButtonModule,
843
- i1$2.PepIconModule,
844
- fileStatusPanel.PepFileStatusPanelModule,
845
- i3.PepSnackBarModule,
846
- ]] });
847
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, decorators: [{
848
- type: i0.NgModule,
849
- args: [{
850
- declarations: [
851
- DIMXComponent
852
- ],
853
- imports: [
854
- common.CommonModule,
855
- i1.PepNgxLibModule,
856
- button.PepButtonModule,
857
- i1$2.PepIconModule,
858
- fileStatusPanel.PepFileStatusPanelModule,
859
- i3.PepSnackBarModule,
860
- ],
861
- exports: [DIMXComponent]
862
- }]
822
+ var pepIcons = [
823
+ i1$2.pepIconSystemDoc,
824
+ ];
825
+ var PepDIMXModule = /** @class */ (function () {
826
+ function PepDIMXModule(pepIconRegistry) {
827
+ this.pepIconRegistry = pepIconRegistry;
828
+ this.pepIconRegistry.registerIcons(pepIcons);
829
+ }
830
+ return PepDIMXModule;
831
+ }());
832
+ PepDIMXModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, deps: [{ token: i1__namespace$2.PepIconRegistry }], target: i0__namespace.ɵɵFactoryTarget.NgModule });
833
+ PepDIMXModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, declarations: [DIMXComponent], imports: [common.CommonModule,
834
+ i1.PepNgxLibModule,
835
+ button.PepButtonModule,
836
+ i1$2.PepIconModule,
837
+ fileStatusPanel.PepFileStatusPanelModule,
838
+ i3.PepSnackBarModule], exports: [DIMXComponent] });
839
+ PepDIMXModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, imports: [[
840
+ common.CommonModule,
841
+ i1.PepNgxLibModule,
842
+ button.PepButtonModule,
843
+ i1$2.PepIconModule,
844
+ fileStatusPanel.PepFileStatusPanelModule,
845
+ i3.PepSnackBarModule,
846
+ ]] });
847
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0__namespace, type: PepDIMXModule, decorators: [{
848
+ type: i0.NgModule,
849
+ args: [{
850
+ declarations: [
851
+ DIMXComponent
852
+ ],
853
+ imports: [
854
+ common.CommonModule,
855
+ i1.PepNgxLibModule,
856
+ button.PepButtonModule,
857
+ i1$2.PepIconModule,
858
+ fileStatusPanel.PepFileStatusPanelModule,
859
+ i3.PepSnackBarModule,
860
+ ],
861
+ exports: [DIMXComponent]
862
+ }]
863
863
  }], ctorParameters: function () { return [{ type: i1__namespace$2.PepIconRegistry }]; } });
864
864
 
865
- var IFileExt = /** @class */ (function (_super) {
866
- __extends(IFileExt, _super);
867
- function IFileExt() {
868
- var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
869
- _this.status = 'downloading';
870
- return _this;
871
- }
872
- return IFileExt;
865
+ var IFileExt = /** @class */ (function (_super) {
866
+ __extends(IFileExt, _super);
867
+ function IFileExt() {
868
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
869
+ _this.status = 'downloading';
870
+ return _this;
871
+ }
872
+ return IFileExt;
873
873
  }(fileStatusPanel.FileStatus));
874
874
 
875
- /*
876
- * Public API Surface of ngx-composite-lib/dimx-export
875
+ /*
876
+ * Public API Surface of ngx-composite-lib/dimx-export
877
877
  */
878
878
 
879
- /**
880
- * Generated bundle index. Do not edit.
879
+ /**
880
+ * Generated bundle index. Do not edit.
881
881
  */
882
882
 
883
883
  exports.DIMXComponent = DIMXComponent;