form-aurora-stefanini 0.1.16 → 0.1.19
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/form-aurora-stefanini.umd.js +141 -5
- package/bundles/form-aurora-stefanini.umd.js.map +1 -1
- package/bundles/form-aurora-stefanini.umd.min.js +2 -2
- package/bundles/form-aurora-stefanini.umd.min.js.map +1 -1
- package/esm2015/lib/services/data.service.js +26 -6
- package/esm5/lib/services/data.service.js +26 -6
- package/fesm2015/form-aurora-stefanini.js +140 -5
- package/fesm2015/form-aurora-stefanini.js.map +1 -1
- package/fesm5/form-aurora-stefanini.js +141 -5
- package/fesm5/form-aurora-stefanini.js.map +1 -1
- package/package.json +1 -1
@@ -275,15 +275,142 @@
|
|
275
275
|
}
|
276
276
|
};
|
277
277
|
|
278
|
+
var Offusqued = /** @class */ (function () {
|
279
|
+
function Offusqued() {
|
280
|
+
this.dataMap = new Map();
|
281
|
+
this.dataMap.set('A', '2,');
|
282
|
+
this.dataMap.set('J', '29,');
|
283
|
+
this.dataMap.set('S', '67,');
|
284
|
+
this.dataMap.set('B', '3,');
|
285
|
+
this.dataMap.set('K', '31,');
|
286
|
+
this.dataMap.set('T', '71,');
|
287
|
+
this.dataMap.set('C', '5,');
|
288
|
+
this.dataMap.set('L', '37,');
|
289
|
+
this.dataMap.set('U', '73,');
|
290
|
+
this.dataMap.set('D', '7,');
|
291
|
+
this.dataMap.set('M', '41,');
|
292
|
+
this.dataMap.set('V', '79,');
|
293
|
+
this.dataMap.set('E', '11,');
|
294
|
+
this.dataMap.set('N', '43,');
|
295
|
+
this.dataMap.set('W', '83,');
|
296
|
+
this.dataMap.set('F', '13,');
|
297
|
+
this.dataMap.set('O', '47,');
|
298
|
+
this.dataMap.set('X', '89,');
|
299
|
+
this.dataMap.set('G', '17,');
|
300
|
+
this.dataMap.set('P', '53,');
|
301
|
+
this.dataMap.set('Y', '97,');
|
302
|
+
this.dataMap.set('H', '19,');
|
303
|
+
this.dataMap.set('Q', '59,');
|
304
|
+
this.dataMap.set('Z', '101,');
|
305
|
+
this.dataMap.set('I', '23,');
|
306
|
+
this.dataMap.set('R', '61,');
|
307
|
+
this.dataMap.set('a', '103,');
|
308
|
+
this.dataMap.set('j', '151,');
|
309
|
+
this.dataMap.set('s', '157,');
|
310
|
+
this.dataMap.set('b', '107,');
|
311
|
+
this.dataMap.set('k', '163,');
|
312
|
+
this.dataMap.set('t', '167,');
|
313
|
+
this.dataMap.set('c', '109,');
|
314
|
+
this.dataMap.set('l', '173,');
|
315
|
+
this.dataMap.set('u', '179,');
|
316
|
+
this.dataMap.set('d', '113,');
|
317
|
+
this.dataMap.set('m', '181,');
|
318
|
+
this.dataMap.set('v', '191,');
|
319
|
+
this.dataMap.set('e', '127,');
|
320
|
+
this.dataMap.set('n', '193,');
|
321
|
+
this.dataMap.set('w', '227,');
|
322
|
+
this.dataMap.set('f', '132,');
|
323
|
+
this.dataMap.set('o', '197,');
|
324
|
+
this.dataMap.set('x', '229,');
|
325
|
+
this.dataMap.set('g', '137,');
|
326
|
+
this.dataMap.set('p', '199,');
|
327
|
+
this.dataMap.set('y', '233,');
|
328
|
+
this.dataMap.set('h', '139,');
|
329
|
+
this.dataMap.set('q', '211,');
|
330
|
+
this.dataMap.set('z', '239,');
|
331
|
+
this.dataMap.set('i', '149,');
|
332
|
+
this.dataMap.set('r', '223,');
|
333
|
+
this.dataMap.set('0', 'Z,');
|
334
|
+
this.dataMap.set('1', 'Y,');
|
335
|
+
this.dataMap.set('2', 'X,');
|
336
|
+
this.dataMap.set('3', 'W,');
|
337
|
+
this.dataMap.set('4', 'V,');
|
338
|
+
this.dataMap.set('5', 'U,');
|
339
|
+
this.dataMap.set('6', 'T,');
|
340
|
+
this.dataMap.set('7', 'S,');
|
341
|
+
this.dataMap.set('8', 'R,');
|
342
|
+
this.dataMap.set('9', 'Q,');
|
343
|
+
this.dataMap.set(',', '&');
|
344
|
+
this.dataMap.set('{', '1000,');
|
345
|
+
this.dataMap.set('}', '0000,');
|
346
|
+
}
|
347
|
+
Offusqued.prototype.ofusquedData = function (data) {
|
348
|
+
var responce = '';
|
349
|
+
var ofusquedData = data.toString().split('');
|
350
|
+
// tslint:disable-next-line:prefer-for-of
|
351
|
+
for (var i = 0; i < ofusquedData.length; i++) {
|
352
|
+
var letter = ofusquedData[i].toString();
|
353
|
+
if (this.dataMap.has(letter)) {
|
354
|
+
responce += this.dataMap.get(letter).toString();
|
355
|
+
}
|
356
|
+
else {
|
357
|
+
responce += letter + ',';
|
358
|
+
}
|
359
|
+
}
|
360
|
+
return responce;
|
361
|
+
};
|
362
|
+
Offusqued.prototype.decodeOfusquedData = function (data) {
|
363
|
+
var respoce = '';
|
364
|
+
var arrayData = data.split(',');
|
365
|
+
// tslint:disable-next-line:prefer-for-of
|
366
|
+
for (var i = 0; i < arrayData.length; i++) {
|
367
|
+
respoce += this.readValueInMap(arrayData[i]);
|
368
|
+
}
|
369
|
+
// @ts-ignore
|
370
|
+
return respoce.replaceAll('&', ',');
|
371
|
+
};
|
372
|
+
Offusqued.prototype.readValueInMap = function (data) {
|
373
|
+
var respoce = '';
|
374
|
+
var status = true;
|
375
|
+
this.dataMap.forEach(function (value, key) {
|
376
|
+
if (data + ',' === value) {
|
377
|
+
respoce = key;
|
378
|
+
status = false;
|
379
|
+
}
|
380
|
+
});
|
381
|
+
if (status) {
|
382
|
+
respoce = data;
|
383
|
+
}
|
384
|
+
return respoce;
|
385
|
+
};
|
386
|
+
Offusqued.ngInjectableDef = core.ɵɵdefineInjectable({ factory: function Offusqued_Factory() { return new Offusqued(); }, token: Offusqued, providedIn: "root" });
|
387
|
+
Offusqued = __decorate([
|
388
|
+
core.Injectable({
|
389
|
+
providedIn: 'root',
|
390
|
+
})
|
391
|
+
], Offusqued);
|
392
|
+
return Offusqued;
|
393
|
+
}());
|
394
|
+
|
278
395
|
var CommonDataService = /** @class */ (function () {
|
279
396
|
function CommonDataService() {
|
280
397
|
}
|
281
398
|
CommonDataService_1 = CommonDataService;
|
282
399
|
CommonDataService.prototype.getData = function () {
|
283
|
-
|
400
|
+
var offusqued = new Offusqued();
|
401
|
+
var value = localStorage.getItem('data');
|
284
402
|
if (localStorage.getItem('data') != null) {
|
285
|
-
|
286
|
-
|
403
|
+
if (value.length < 10) {
|
404
|
+
var data = new Map(JSON.parse(localStorage.getItem('data')));
|
405
|
+
return data;
|
406
|
+
}
|
407
|
+
else {
|
408
|
+
value = offusqued.decodeOfusquedData(value);
|
409
|
+
console.log("RETORNA");
|
410
|
+
console.log(value);
|
411
|
+
var data = new Map(JSON.parse(value));
|
412
|
+
return data;
|
413
|
+
}
|
287
414
|
}
|
288
415
|
else {
|
289
416
|
/** Error get cookie */
|
@@ -291,9 +418,18 @@
|
|
291
418
|
}
|
292
419
|
};
|
293
420
|
CommonDataService.prototype.setData = function (data) {
|
421
|
+
var offusqued = new Offusqued();
|
294
422
|
console.log('ENTRO');
|
295
|
-
|
296
|
-
|
423
|
+
var clientInfo = JSON.stringify(Array.from(data.entries()));
|
424
|
+
if (clientInfo.length < 10) {
|
425
|
+
localStorage.setItem('data', clientInfo);
|
426
|
+
}
|
427
|
+
else {
|
428
|
+
console.log('#### LO QUE LLEGA ####');
|
429
|
+
console.log(JSON.stringify(data));
|
430
|
+
console.log('######################');
|
431
|
+
localStorage.setItem('data', offusqued.ofusquedData(clientInfo));
|
432
|
+
}
|
297
433
|
};
|
298
434
|
CommonDataService.prototype.initData = function () {
|
299
435
|
this.setData(new Map());
|